let timeout = 200 if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) { timeout = 500; } document.addEventListener("DOMContentLoaded", async () => { // Transition in document.documentElement.style.display = "initial"; document.getElementById("swipe-out").classList.add("swipe-out-animate"); await new Promise(r => setTimeout(r, timeout)); }) function redirect(href) { document.getElementById("swipe").classList.add("swipe-animate"); setTimeout(() => { window.location.href = href; }, timeout); }