From b30d2ad6820b76a7b847e1330d63f8a4df3f4e65 Mon Sep 17 00:00:00 2001 From: Mike Rockwell Date: Sat, 26 Jul 2025 16:48:57 -0400 Subject: [PATCH] Add smooth scrolling when opening and closing QR code images --- app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.js b/app.js index 0786f70..44683d0 100644 --- a/app.js +++ b/app.js @@ -74,8 +74,10 @@ document.querySelector("#btc-qr-link a").addEventListener("click", function(){ // Display BTC QR code if (document.contains(document.querySelector("#btc-js-qr"))) { document.querySelector("#btc-js-qr").remove(); + valueBlock.scrollIntoView({ behavior: "smooth" }); } else { document.querySelector("#btcwall").insertAdjacentHTML("afterend", ""); + document.querySelector("#btc-qr-link").scrollIntoView({ behavior: "smooth" }); } }); @@ -91,8 +93,10 @@ document.querySelector("#eth-qr-link a").addEventListener("click", function(){ // Display ETH QR code if (document.contains(document.querySelector("#eth-js-qr"))) { document.querySelector("#eth-js-qr").remove(); + valueBlock.scrollIntoView({ behavior: "smooth" }); } else { document.querySelector("#ethwall").insertAdjacentHTML("afterend", ""); + document.querySelector("#eth-qr-link").scrollIntoView({ behavior: "smooth" }); } }); @@ -108,7 +112,9 @@ document.querySelector("#doge-qr-link a").addEventListener("click", function(){ // Display DOGE QR code if (document.contains(document.querySelector("#doge-js-qr"))) { document.querySelector("#doge-js-qr").remove(); + valueBlock.scrollIntoView({ behavior: "smooth" }); } else { document.querySelector("#dogewall").insertAdjacentHTML("afterend", ""); + document.querySelector("#doge-qr-link").scrollIntoView({ behavior: "smooth" }); } });