WIP Animations all over site
- Run a transition In for each page - Involve a "loader" panel on page change - TODO: tweak the animations and finish the concept
This commit is contained in:
25
src/animations/page.js
Normal file
25
src/animations/page.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import anime from 'animejs'
|
||||
import ScrollOut from 'scroll-out'
|
||||
import { animDuration, animDurationLong } from '../utils/store'
|
||||
|
||||
|
||||
/*
|
||||
** Transition In
|
||||
*/
|
||||
export const animateIn = () => {
|
||||
// Simple fade
|
||||
const page = ScrollOut({
|
||||
once: true,
|
||||
targets: '.page',
|
||||
onShown (el) {
|
||||
anime({
|
||||
targets: '.page__part',
|
||||
opacity: [0, 1],
|
||||
translateY: [8, 0],
|
||||
duration: 1800,
|
||||
delay: anime.stagger(220, { start: animDurationLong * 0.3 }),
|
||||
easing: 'easeOutQuart'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user