aboutsummaryrefslogtreecommitdiff
path: root/src/lib/LandingHero.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/LandingHero.svelte')
-rw-r--r--src/lib/LandingHero.svelte4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/LandingHero.svelte b/src/lib/LandingHero.svelte
index b57aec85..9f5d0368 100644
--- a/src/lib/LandingHero.svelte
+++ b/src/lib/LandingHero.svelte
@@ -1,6 +1,7 @@
<script lang="ts">
import { env } from "$env/dynamic/public";
import localforage from "localforage";
+import lenis from "$stores/lenis";
let heroSection = $state<HTMLElement>();
@@ -10,7 +11,8 @@ const scrollPastHero = () => {
const heroBottom =
heroSection.getBoundingClientRect().bottom + window.scrollY;
- window.scrollTo({ top: heroBottom, behavior: "smooth" });
+ if ($lenis) $lenis.scrollTo(heroBottom);
+ else window.scrollTo({ top: heroBottom, behavior: "smooth" });
};
</script>