Put wait cursor globally when page is loading
don't use a div over everything as it interacts with the current hover state of elements instead force a cursor on every element in body when the body has a loading class
This commit is contained in:
@@ -43,6 +43,9 @@
|
|||||||
$previousPage = from.url.pathname
|
$previousPage = from.url.pathname
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Define page loading
|
||||||
|
$: browser && document.body.classList.toggle('is-loading', $pageLoading)
|
||||||
|
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
// Avoid FOUC
|
// Avoid FOUC
|
||||||
@@ -69,10 +72,6 @@
|
|||||||
<Footer />
|
<Footer />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $pageLoading}
|
|
||||||
<div class="page-loading" />
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<SVGSprite />
|
<SVGSprite />
|
||||||
<SmoothScroll />
|
<SmoothScroll />
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ html {
|
|||||||
&.block-scroll {
|
&.block-scroll {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
&.is-loading * {
|
||||||
|
cursor: wait !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
@include font-smooth;
|
@include font-smooth;
|
||||||
|
|||||||
Reference in New Issue
Block a user