Use Lenis to use smooth scroll to anchors
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
import { navigating } from '$app/stores'
|
||||
import { getContext, onMount } from 'svelte'
|
||||
import { stagger, timeline } from 'motion'
|
||||
import { smoothScroll } from '$utils/stores'
|
||||
import { cartOpen } from '$utils/stores/shop'
|
||||
import { smoothScroll } from '$utils/functions'
|
||||
import { DELAY } from '$utils/contants'
|
||||
import { quartOut } from '$animations/easings'
|
||||
// Components
|
||||
@@ -117,7 +117,7 @@
|
||||
<ul data-sveltekit-noscroll data-sveltekit-prefetch>
|
||||
{#each shopLocations as { name, slug }}
|
||||
<li class:is-active={product && slug === product.location.slug}>
|
||||
<a href="/shop/poster-{slug}" on:click={() => smoothScroll({ hash: 'poster' })}>
|
||||
<a href="/shop/poster-{slug}" on:click={() => $smoothScroll.scrollTo('#poster', { duration: 2 })}>
|
||||
{name}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user