From 18b9ece009ece5d113025335d3e983b878a2e1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sun, 29 Mar 2020 18:16:05 +0200 Subject: [PATCH] Fullscreen fixes - Due to the Homepage carousel animation, fullscreen was constraint to the top of the parent block. Resetting the style on transition complete fixes it - Check if scope exists before emptying its image content --- src/animations/index.js | 3 ++- src/organisms/Fullscreen.svelte | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/animations/index.js b/src/animations/index.js index 4e9c1c8..9f1c852 100644 --- a/src/animations/index.js +++ b/src/animations/index.js @@ -65,7 +65,8 @@ export const animateIn = () => { translateY: [24, 0], duration: animDuration, delay: 650, - easing: 'easeOutQuart' + easing: 'easeOutQuart', + complete: () => el.removeAttribute('style') }) } }) diff --git a/src/organisms/Fullscreen.svelte b/src/organisms/Fullscreen.svelte index c607d75..dba9bb0 100644 --- a/src/organisms/Fullscreen.svelte +++ b/src/organisms/Fullscreen.svelte @@ -57,10 +57,12 @@ closed = true // Clear image and reset fullscreen store value - setTimeout(() => { - scope.querySelector('.fullscreen__image').innerHTML = '' - fullscreen.set() - }, 800) // Transition duration + if (scope) { + setTimeout(() => { + scope.querySelector('.fullscreen__image').innerHTML = '' + fullscreen.set() + }, 800) // Transition duration + } }, 800)