Use ZenScroll for smooth scroll on anchors

This commit is contained in:
2020-03-03 20:38:49 +01:00
parent b294800f34
commit e98452673e
2 changed files with 2 additions and 14 deletions

View File

@@ -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>

View File

@@ -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
*/