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