// The opening curtain. It used to hold for 1400ms on arrival and 1250ms on // every move between pages, whether or not anything was still loading — long // enough to feel like the site was thinking. Shorter now, and skipped entirely // for anyone who has asked for less motion, since it is pure animation. function Loader({ onDone, minMs = 900 }) { const [exiting, setExiting] = React.useState(false); const [gone, setGone] = React.useState(false); React.useEffect(() => { const still = window.matchMedia("(prefers-reduced-motion: reduce)").matches; const hold = still ? 0 : minMs; const fade = still ? 0 : 700; const t1 = setTimeout(() => setExiting(true), hold); const t2 = setTimeout(() => { setGone(true); if (onDone) onDone(); }, hold + fade); return () => { clearTimeout(t1); clearTimeout(t2); }; }, [minMs, onDone]); if (gone) return null; return (
Bert Verheye
); } window.Loader = Loader;