⚠️ Rework completely how transitions works

- Use Svelte/Sapper native if and transitions to show either the page content or the loader, then load each page animationIn
- Code is safe on SSR side, using process.browser on this if
- The <main> element is on position absolute to fade nicely the different pages
- Code cleaning
This commit is contained in:
2020-04-03 22:53:43 +02:00
parent 76e2f8242e
commit 7e0d1e33fb
21 changed files with 300 additions and 315 deletions

View File

@@ -1,4 +1,3 @@
// Svelte
import { writable } from 'svelte/store'
// Define environment
@@ -25,17 +24,14 @@ export let currentLocation = writable()
export let currentPhotos = writable()
// State
export let pageReady = writable(false)
export const pageTransition = {
onAnimationEnd () {}
}
export let pageReady = writable(false, () => {})
export let firstLoad = writable(true)
export let fullscreen = writable()
/* ==========================================================================
Animation related
========================================================================== */
export const transitionDelay = 1400
export const transitionNormal = 1400
export const transitionLong = 1800
export const transitionPanelIn = 700
export const animDelay = 800
export const animDuration = 1400
export const animDurationLong = 1800