WIP attempt to fix page transitions, Several edits
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-02 16:07:16 +02:00
parent 6f409c5331
commit 730eb75457
34 changed files with 386 additions and 401 deletions

View File

@@ -1,12 +1,12 @@
import anime from 'animejs'
import ScrollOut from 'scroll-out'
import { animDuration } from 'utils/store'
import { transitionDelay } from 'utils/store'
/*
** Transition In
*/
export const animateIn = scope => {
export const animateIn = (scope, init) => {
// On scroll animation
const title = ScrollOut({
once: true,
@@ -16,16 +16,16 @@ export const animateIn = scope => {
anime({
targets: el.querySelectorAll('span'),
translateY: ['100%', 0],
delay: anime.stagger(40),
duration: 1000,
easing: 'easeOutQuart'
easing: 'easeOutQuart',
delay: anime.stagger(40, { start: init ? 0 : transitionDelay }),
duration: 1000
})
// Word in between
anime({
targets: el.querySelectorAll('em span'),
opacity: [0, 1],
delay: anime.stagger(80, { start: 400 }),
delay: anime.stagger(80, { start: (init ? 0 : transitionDelay) + 400 }),
duration: 1000,
easing: 'easeOutQuart'
})