]> git.ardis.lu - ard.is/commitdiff
Respect prefers-reduced-motion
authorArdis Lu <ardisglu@gmail.com>
Sat, 9 Sep 2023 20:29:36 +0000 (13:29 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sat, 9 Sep 2023 20:29:36 +0000 (13:29 -0700)
index.html

index f20e8cd8d39f87065b165ce55a901ee3c1774292..ad6cc5169e0541d9cd53e21dba48430a08a36657 100644 (file)
       asciiContainer.textContent = frames[currentFrame];
       requestAnimationFrame(step);
     }
-    requestAnimationFrame(step);
+    if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
+      asciiContainer.textContent = ascii;
+    }
+    else {
+      requestAnimationFrame(step);
+    }
 
     // Inject obfuscated email. To block low-effort scraping.
     const addr = document.querySelector('address > a');
This page took 0.038843 seconds and 4 git commands to generate.