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:
2022-11-13 23:16:54 +01:00
parent e3f36d1810
commit 225cd6fe00
2 changed files with 6 additions and 4 deletions

View File

@@ -43,6 +43,9 @@
$previousPage = from.url.pathname
})
// Define page loading
$: browser && document.body.classList.toggle('is-loading', $pageLoading)
onMount(() => {
// Avoid FOUC
@@ -69,10 +72,6 @@
<Footer />
{/if}
{#if $pageLoading}
<div class="page-loading" />
{/if}
<SVGSprite />
<SmoothScroll />