From 396e6b5f00a95833641b3923c88af9d36f789821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Thu, 2 Jan 2020 14:15:48 +0100 Subject: [PATCH] WIP animations --- src/animations.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/animations.js diff --git a/src/animations.js b/src/animations.js new file mode 100644 index 0000000..00d9aba --- /dev/null +++ b/src/animations.js @@ -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) + }) + } + } +}