add IDs and classes to crypto link list, add JS to prevent default clicking behavior

This commit is contained in:
2025-07-26 15:58:33 -04:00
parent cc4ba5c3ea
commit 3f942ebf87
2 changed files with 44 additions and 3 deletions

41
app.js
View File

@@ -47,3 +47,44 @@ document.getElementById("dogewall").addEventListener("click", function(){
// Display alert to confirm the address was added to clipboard // Display alert to confirm the address was added to clipboard
alert("DOGE address copied to clipboard"); alert("DOGE address copied to clipboard");
}); });
//
// Display crypto QR code when link is clicked
//
// Prevent clicks on QR codes from functioning
document.querySelector("#btc-qr-link a").addEventListener("click", function(event){
event.preventDefault()
});
document.querySelector("#eth-qr-link a").addEventListener("click", function(event){
event.preventDefault()
});
document.querySelector("#doge-qr-link a").addEventListener("click", function(event){
event.preventDefault()
});
// Watch for click on BTC QR code link
document.querySelector("#btc-qr-link a").addEventListener("click", function(){
console.log('BTC QR Clicked');
// Hide all other QR codes
// Display BTC QR code
});
// Watch for click on ETH QR code link
document.querySelector("#eth-qr-link a").addEventListener("click", function(){
console.log('ETH QR Clicked');
// Hide all other QR codes
// Display ETH QR code
});
// Watch for click on DOGE QR code link
document.querySelector("#doge-qr-link a").addEventListener("click", function(){
console.log('DOGE QR Clicked');
// Hide all other QR codes
// Display DOGE QR code
});

View File

@@ -74,9 +74,9 @@
<a class="button button-paypal" href="https://www.paypal.com/donate/?business=LXMQTRPCCLAEG&no_recurring=0&item_name=Support+Initial+Charge%2C+%23OpenWeb%2C+and+my+other+projects+with+value+for+value.&currency_code=USD" rel="noopener" role="button"><img class="icon" aria-hidden="true" src="images/icons/paypal.svg" alt="PayPal Logo">PayPal</a> <a class="button button-paypal" href="https://www.paypal.com/donate/?business=LXMQTRPCCLAEG&no_recurring=0&item_name=Support+Initial+Charge%2C+%23OpenWeb%2C+and+my+other+projects+with+value+for+value.&currency_code=USD" rel="noopener" role="button"><img class="icon" aria-hidden="true" src="images/icons/paypal.svg" alt="PayPal Logo">PayPal</a>
<ul> <ul>
<li><strong>Bitcoin</strong> &#8226; <a href="images/crypto/btc-qr.png">QR Code</a><br><code id="btcwall">bc1qxj26ssa24a7x8mp0rykn80d6v088p996mt0kcc</code><br>&nbsp;</li> <li id="btc-qr-link"><strong>Bitcoin</strong> &#8226; <a href="images/crypto/btc-qr.png" class="qr-code-link">QR Code</a><br><code id="btcwall">bc1qxj26ssa24a7x8mp0rykn80d6v088p996mt0kcc</code><br>&nbsp;</li>
<li><strong>Ethereum</strong> &#8226; <a href="images/crypto/eth-qr.png">QR Code</a><br><code id="ethwall">0x41C1689FF03a11205aB22dd0d97889065E971D7f</code><br>&nbsp;</li> <li id="eth-qr-link"><strong>Ethereum</strong> &#8226; <a href="images/crypto/eth-qr.png" class="qr-code-link">QR Code</a><br><code id="ethwall">0x41C1689FF03a11205aB22dd0d97889065E971D7f</code><br>&nbsp;</li>
<li><strong>Dogecoin</strong> &#8226; <a href="images/crypto/doge-qr.png">QR Code</a><br><code id="dogewall">DC27kzyjxVgSjuPj6NJkadKibbf4S9UgGd</code></li> <li id="doge-qr-link"><strong>Dogecoin</strong> &#8226; <a href="images/crypto/doge-qr.png" class="qr-code-link">QR Code</a><br><code id="dogewall">DC27kzyjxVgSjuPj6NJkadKibbf4S9UgGd</code></li>
</ul> </ul>
</details> </details>
</div> </div>