Use ZenScroll for smooth scroll on anchors
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
// Dependencies
|
||||
import * as basicScroll from 'basicscroll'
|
||||
import AOS from 'aos'
|
||||
import zenscroll from 'zenscroll'
|
||||
|
||||
// Components
|
||||
import Button from '../atoms/Button'
|
||||
@@ -110,7 +111,7 @@
|
||||
<div class="intro__description style-description">
|
||||
<p>{$site.description}</p>
|
||||
|
||||
<Button type="a" href="#choose" class="button" text="Explore locations" on:click={e => fn.smoothScroll(e, '#choose')}>
|
||||
<Button type="a" href="#choose" class="button" text="Explore locations">
|
||||
<IconGlobeSmall width="22" color="#666" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -57,19 +57,6 @@ export const isInViewport = element => {
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** Smooth Scroll
|
||||
*/
|
||||
export const smoothScroll = (event, element = null) => {
|
||||
document.querySelector(element).scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
})
|
||||
event.preventDefault()
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** Random String Generator
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user