TitleSite: Fix longer delay after first transition
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import anime from 'animejs'
|
||||
import ScrollOut from 'scroll-out'
|
||||
import { animDelay } from 'utils/store'
|
||||
import { firstLoad, animDurationLong, animDelay } from 'utils/store'
|
||||
|
||||
let firstLoadValue
|
||||
firstLoad.subscribe(store => firstLoadValue = store)
|
||||
|
||||
/*
|
||||
** Transition In
|
||||
@@ -14,7 +16,7 @@ export const animateIn = (scope, init) => {
|
||||
translateZ: [0, 0],
|
||||
easing: 'easeOutQuart',
|
||||
duration: 1000,
|
||||
delay: anime.stagger(40, { start: init ? 0 : animDelay }),
|
||||
delay: anime.stagger(40, { start: init ? 0 : (firstLoadValue) ? animDurationLong : animDelay }),
|
||||
autoplay: false
|
||||
})
|
||||
|
||||
@@ -22,6 +24,9 @@ export const animateIn = (scope, init) => {
|
||||
const title = ScrollOut({
|
||||
once: true,
|
||||
targets: scope,
|
||||
onShown: () => letters.restart()
|
||||
onShown: () => {
|
||||
console.log('TitleSite show')
|
||||
letters.restart()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user