diff --git a/spock-website/src/main.ts b/spock-website/src/main.ts index 498c26e..5dd0179 100644 --- a/spock-website/src/main.ts +++ b/spock-website/src/main.ts @@ -2,9 +2,12 @@ import './style.css' import './icons' import AOS from 'aos' +const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; +const disableAosByQuery = new URLSearchParams(window.location.search).get('disableaos') !== null; + AOS.init({ duration: 800, // Animation duration once: true, // Whether animation should happen only once - while scrolling down offset: 50, // Offset (in px) from the original trigger point - disable: new URLSearchParams(window.location.search).get('disableaos') !== null, + disable: prefersReducedMotion || disableAosByQuery, });