aboutsummaryrefslogtreecommitdiff
path: root/src/stores
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-05-08 07:47:47 +0000
committerFuwn <[email protected]>2026-05-08 07:47:47 +0000
commita69b12642237844e60bef7cb8abac7cbd074b53b (patch)
treeaf03b84a664d054add03d988ef48ee8ab75fc0e9 /src/stores
parentfeat(scroll): add global smooth scrolling via Lenis (diff)
downloaddue.moe-a69b12642237844e60bef7cb8abac7cbd074b53b.tar.xz
due.moe-a69b12642237844e60bef7cb8abac7cbd074b53b.zip
fix(scroll): route LandingHero scroll-down through Lenis
Lenis disables native CSS smooth scroll, so window.scrollTo({behavior:"smooth"}) jumps instantly. Expose the Lenis instance via a store and scroll through it, falling back to native when unavailable.
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/lenis.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stores/lenis.ts b/src/stores/lenis.ts
new file mode 100644
index 00000000..a0f028b5
--- /dev/null
+++ b/src/stores/lenis.ts
@@ -0,0 +1,6 @@
+import type Lenis from "lenis";
+import { writable } from "svelte/store";
+
+const lenis = writable<Lenis | undefined>(undefined);
+
+export default lenis;