From a3755d88c951476fc58152539577333482f0230a Mon Sep 17 00:00:00 2001 From: gator Date: Wed, 29 Jul 2026 23:09:16 +0000 Subject: [PATCH] Reveal animation is progressive enhancement, not a visibility dependency --- index.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 50cebd3..ce4466f 100644 --- a/index.html +++ b/index.html @@ -129,10 +129,11 @@ .foot .sp{margin-left:auto} /* ── reveal ── */ - .rev{opacity:0; transform:translateY(18px); transition:opacity .7s ease, transform .7s ease} - .rev.in{opacity:1; transform:none} + .rev{opacity:1} + html.js .rev{opacity:0; transform:translateY(18px); transition:opacity .7s ease, transform .7s ease} + html.js .rev.in{opacity:1; transform:none} @media (prefers-reduced-motion:reduce){ - .rev{opacity:1; transform:none; transition:none} + html.js .rev{opacity:1; transform:none; transition:none} html{scroll-behavior:auto} } @media (max-width:720px){ @@ -321,6 +322,9 @@ (function(){ "use strict"; var reduce = matchMedia("(prefers-reduced-motion: reduce)").matches; + // Arm the reveal animation only now that JS is definitely running — without + // this, a script failure would leave the page's content invisible. + if (!reduce) document.documentElement.classList.add("js"); /* ── scroll reveal ─────────────────────────────────────────────── */ var revs = document.querySelectorAll(".rev"); @@ -331,6 +335,10 @@ }); },{threshold:.14, rootMargin:"0px 0px -40px 0px"}); revs.forEach(function(el){ io.observe(el); }); + // Safety net: anything the observer somehow misses still becomes visible. + setTimeout(function(){ revs.forEach(function(el){ + if (el.getBoundingClientRect().top < innerHeight*2) el.classList.add("in"); + }); }, 2500); } else { revs.forEach(function(el){ el.classList.add("in"); }); } /* ── LED world map ─────────────────────────────────────────────────