diff --git a/src/utils/Transition.svelte b/src/utils/Transition.svelte index c1776fb..eca845b 100644 --- a/src/utils/Transition.svelte +++ b/src/utils/Transition.svelte @@ -29,6 +29,9 @@ if (!firstLoad && process.browser) { animateIn(scope) } + + // TODO: Figure out how to delay the page rendering a little bit before the end of the transition panel ending + // Set pageReady to false (?) pageReady.set(false) }) @@ -36,20 +39,22 @@ // 2. Watch when loaded changes pageReady.subscribe(loaded => { if (loaded) { + // 3. Hide the loader setTimeout(() => { - // Scroll back to top of page - window.scrollTo(0,0) - // 3. Hide the loader // Also sets firstLoad to false in order to show the second icon afterwards animateOut(scope, () => firstLoad = false) }, 400) // This duration allows to not come over the transition In // [OU ALORS] les pages changent la valeur de loaded plus tard // Scroll back to top of page + setTimeout(() => { + window.scrollTo(0,0) + }, animDurationLong * 0.75 + 400) + // 4. Run the page's transition in, but a little bit before the end of the loader setTimeout(() => { pageTransition.onAnimationEnd() - }, animDurationLong * 0.666 + 200) + }, animDurationLong * 0.75 + 400) // + 200 } }) @@ -58,6 +63,7 @@