From adeb60c5cb1c0158dd3d2ee95c8448b22fe891c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 6 Apr 2020 18:51:51 +0200 Subject: [PATCH] TitleSite: Fix delay? --- src/animations/TitleSite.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/animations/TitleSite.js b/src/animations/TitleSite.js index 31ca3be..61fa221 100644 --- a/src/animations/TitleSite.js +++ b/src/animations/TitleSite.js @@ -13,7 +13,7 @@ export const animateIn = (scope, init) => { translateY: ['100%', 0], easing: 'easeOutQuart', duration: 1000, - delay: anime.stagger(40, { start: !!init ? animDelay : 0 }), + delay: anime.stagger(40), autoplay: false }) @@ -21,6 +21,12 @@ export const animateIn = (scope, init) => { const title = ScrollOut({ once: true, targets: scope, - onShown: () => letters.restart() + onShown: () => { + if (init) { + letters.restart() + } else { + setTimeout(() => letters.restart(), animDelay) + } + } }) }