diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/+layout.svelte | 6 | ||||
| -rw-r--r-- | src/styles/normalise.css | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e1677b44..4aaf2159 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -98,9 +98,11 @@ const handleScroll = () => { onMount(async () => { if (browser) { - lenis = new Lenis({ autoRaf: true }); + if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) { + lenis = new Lenis({ autoRaf: true }); - lenisStore.set(lenis); + lenisStore.set(lenis); + } if (await localforage.getItem("redirect")) { window.location.href = (await localforage.getItem("redirect")) ?? "/"; diff --git a/src/styles/normalise.css b/src/styles/normalise.css index a3e623f0..f38ff649 100644 --- a/src/styles/normalise.css +++ b/src/styles/normalise.css @@ -35,3 +35,14 @@ h5:before, h6:before { content: "" !important; } + +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } +} |