Code clean,
This commit is contained in:
@@ -7,21 +7,20 @@ import { animDelay } from 'utils/store'
|
||||
** Transition In
|
||||
*/
|
||||
export const animateIn = (scope, init) => {
|
||||
const tl = anime.timeline({
|
||||
easing: 'easeOutQuart',
|
||||
duration: 1000
|
||||
})
|
||||
// Stagger each letters and words
|
||||
tl.add({
|
||||
const letters = anime({
|
||||
targets: scope.querySelectorAll('span, em span'),
|
||||
translateY: ['100%', 0],
|
||||
easing: 'easeOutQuart',
|
||||
duration: 1000,
|
||||
delay: anime.stagger(40, { start: init ? 0 : animDelay }),
|
||||
autoplay: false
|
||||
})
|
||||
|
||||
// On scroll animation
|
||||
const title = ScrollOut({
|
||||
once: true,
|
||||
targets: scope,
|
||||
onShown: () => tl.restart()
|
||||
onShown: () => letters.restart()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ export const animateIn = () => {
|
||||
duration: animDuration,
|
||||
autoplay: false
|
||||
})
|
||||
window.addEventListener('scroll', throttle(() => parallaxAnime(document.getElementById('title-houses'), translate), 10))
|
||||
requestAnimationFrame(() => parallaxAnime(document.getElementById('title-houses'), translate), 50)
|
||||
window.addEventListener('scroll', throttle(() => parallaxAnime(document.getElementById('title-houses'), translate), 5))
|
||||
requestAnimationFrame(() => parallaxAnime(document.getElementById('title-houses'), translate))
|
||||
|
||||
// Intro: Description
|
||||
const introDescription = anime({
|
||||
|
||||
Reference in New Issue
Block a user