WIP animations

This commit is contained in:
2020-01-02 14:15:48 +01:00
parent 6b221c2172
commit 396e6b5f00

31
src/animations.js Normal file
View File

@@ -0,0 +1,31 @@
import anime from 'animejs/lib/anime.es.js'
// Appear/Disappear
export const zoomFadeIn = (node, { targets, duration }) => {
return {
css: t => {
anime({
targets,
duration,
easing: 'easeInOutCirc',
opacity: [0, 1],
scale: [.9, 1],
delay: anime.stagger(100)
})
}
}
}
export const zoomFadeOut = (node, { targets, duration }) => {
return {
css: t => {
anime({
targets,
duration,
easing: 'easeInOutCirc',
opacity: [1, 0],
scale: [1, .9],
delay: anime.stagger(100)
})
}
}
}