From: Ardis Lu Date: Tue, 19 Mar 2024 04:52:09 +0000 (-0700) Subject: Directly inject button in RAF loop X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=e15d9308c75894ce31885da3498eb9eec83d9004;p=ard.is Directly inject button in RAF loop Fixes issue where the button will not appear if the tab is inactive --- diff --git a/index.html b/index.html index eadad86..3be59ad 100644 --- a/index.html +++ b/index.html @@ -143,6 +143,7 @@ const currentFrame = Math.floor((timestamp - start) / msPerFrame); if (currentFrame >= frames.length) { asciiContainer.textContent = ascii; + asciiContainer.insertAdjacentElement('beforeend', button) return; } asciiContainer.textContent = frames[currentFrame]; @@ -178,9 +179,6 @@ }); } }); - setTimeout(() => { - asciiContainer.insertAdjacentElement('beforeend', button); - }, msPerFrame * totalFrames + 500); // Inject obfuscated email. To block low-effort scraping. const addr = document.querySelector('address > a');