Optimize animations and transitions
will-change is apparently not enough to run GPU-enabled animations, use translateZ on top of it
This commit is contained in:
@@ -8,13 +8,24 @@ import { animDuration, animDelay } from 'utils/store'
|
||||
export const animateIn = () => {
|
||||
const tl = anime.timeline({
|
||||
easing: 'easeOutQuart',
|
||||
duration: animDuration
|
||||
duration: animDuration,
|
||||
delay: animDelay
|
||||
})
|
||||
|
||||
// Simple slide and fade on each part of the page
|
||||
tl.add({
|
||||
targets: document.querySelectorAll('.page__part'),
|
||||
opacity: [0, 1],
|
||||
translateY: [8, 0],
|
||||
delay: anime.stagger(160, { start: animDelay })
|
||||
translateZ: [0, 0],
|
||||
delay: anime.stagger(160)
|
||||
})
|
||||
|
||||
// Globe
|
||||
tl.add({
|
||||
targets: document.querySelector('.globe'),
|
||||
opacity: [0, 1],
|
||||
translateY: ['5%', 0],
|
||||
translateZ: [0, 0]
|
||||
}, 200)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user