TitleSite: Fix longer delay after first transition
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-21 15:05:33 +02:00
parent 5b4fe1c6d6
commit ecc69e3206
3 changed files with 21 additions and 11 deletions

View File

@@ -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()
}
})
}