🚧 Use PageTransition as a div and switch
- use a page classed div for PageTransition which avoids to make global style for the page - fix the loading spinner that was too short and would come and go before arriving on the page, now fades out when changing page as pageLoading is defined on the PageTransition afterUpdate
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
import type { PageData } from './$types'
|
||||
import { onMount, setContext } from 'svelte'
|
||||
import { pageLoading, previousPage } from '$utils/stores'
|
||||
import { DURATION } from '$utils/contants'
|
||||
import '$utils/polyfills'
|
||||
import { PUBLIC_ANALYTICS_KEY, PUBLIC_ANALYTICS_URL } from '$env/static/public'
|
||||
// Components
|
||||
@@ -46,14 +45,7 @@
|
||||
|
||||
// Define page loading from navigating store
|
||||
navigating.subscribe((store: any) => {
|
||||
if (store) {
|
||||
$pageLoading = true
|
||||
|
||||
// Turn page loading when changing page
|
||||
setTimeout(() => {
|
||||
$pageLoading = false
|
||||
}, DURATION.PAGE_IN * 1.25)
|
||||
}
|
||||
store && ($pageLoading = true)
|
||||
})
|
||||
|
||||
onMount(() => {
|
||||
|
||||
Reference in New Issue
Block a user