From b7accde2c3fbb25742e1437f952e9827187b6ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Wed, 8 Apr 2020 19:33:57 +0200 Subject: [PATCH] Viewer: Fix reveal animation --- src/animations/viewer.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/animations/viewer.js b/src/animations/viewer.js index 5a207a4..7955e4e 100644 --- a/src/animations/viewer.js +++ b/src/animations/viewer.js @@ -15,10 +15,9 @@ export const animateIn = () => { // Carousel tl.add({ - targets: viewer.querySelector('.carousel'), + targets: viewer.querySelector('.carousel .wrap'), opacity: [0, 1], - translateY: window.innerWidth >= 768 ? [32, 0] : ['-33%', '-37%'], - complete: event => event.animatables[0].target.removeAttribute('style') + translateY: ['-4%', 0] }) // Carousel: Number @@ -28,6 +27,13 @@ export const animateIn = () => { translateY: [window.innerWidth >= 768 ? -24 : 24, 0] }, 0) + // Dots + tl.add({ + targets: viewer.querySelectorAll('.carousel__dots'), + translateY: [16, 0], + opacity: [0, 1] + }, 150) + // Buttons tl.add({ targets: viewer.querySelectorAll('.tip, .viewer__buttons a'), @@ -35,4 +41,5 @@ export const animateIn = () => { opacity: [0, 1], delay: anime.stagger(120), }, 400) + }