All checks were successful
continuous-integration/drone/push Build is passing
28 lines
557 B
JavaScript
28 lines
557 B
JavaScript
import anime from 'animejs'
|
|
import ScrollOut from 'scroll-out'
|
|
|
|
|
|
/*
|
|
** Transition In
|
|
*/
|
|
export const animateIn = (scope, init) => {
|
|
const tl = anime.timeline({
|
|
easing: 'easeOutQuart',
|
|
duration: 1000
|
|
})
|
|
|
|
// Stagger each letters and words
|
|
tl.add({
|
|
targets: scope.querySelectorAll('span, em span'),
|
|
translateY: ['100%', 0],
|
|
delay: anime.stagger(40),
|
|
})
|
|
|
|
// On scroll animation
|
|
const title = ScrollOut({
|
|
once: true,
|
|
targets: scope,
|
|
onShown: () => tl.restart()
|
|
})
|
|
}
|