From 3f942ebf87419ce60823cd39906589c4707dacac Mon Sep 17 00:00:00 2001 From: Mike Rockwell Date: Sat, 26 Jul 2025 15:58:33 -0400 Subject: [PATCH] add IDs and classes to crypto link list, add JS to prevent default clicking behavior --- app.js | 41 +++++++++++++++++++++++++++++++++++++++++ index.html | 6 +++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 64e1e37..35c7dfb 100644 --- a/app.js +++ b/app.js @@ -47,3 +47,44 @@ document.getElementById("dogewall").addEventListener("click", function(){ // Display alert to confirm the address was added 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 + +}); diff --git a/index.html b/index.html index 49465ec..a869b56 100644 --- a/index.html +++ b/index.html @@ -74,9 +74,9 @@ PayPal