Add skeleton, updates to client email formatting

This commit is contained in:
2026-05-04 16:30:05 +12:00
parent d1dd103a6e
commit bf9331bb5b
10 changed files with 875 additions and 20 deletions
+51 -1
View File
@@ -1,7 +1,9 @@
<script lang="ts">
import { onMount } from 'svelte';
import { navigating, page } from '$app/stores';
import { afterNavigate, disableScrollHandling } from '$app/navigation';
import { initClickTracking, trackPageView } from '$lib/analytics';
import RouteSkeleton from '$lib/components/RouteSkeleton.svelte';
import '$lib/styles/variables.css';
import '$lib/styles/base.css';
import '$lib/styles/layout.css';
@@ -13,6 +15,26 @@
onMount(() => initClickTracking());
function shouldShowSkeleton() {
const navigation = $navigating;
if (!navigation?.to?.url) {
return false;
}
const fromPath = navigation.from?.url.pathname ?? $page.url.pathname;
const toPath = navigation.to.url.pathname;
if (navigation.to.url.hash && toPath === fromPath) {
return false;
}
return toPath !== fromPath;
}
$: loadingPath = $navigating?.to?.url.pathname ?? $page.url.pathname;
$: showRouteSkeleton = shouldShowSkeleton();
afterNavigate(({ from, to }) => {
if (!from || !to || to.url.hash) {
return;
@@ -38,4 +60,32 @@
});
</script>
<slot />
<div class="layout-shell">
<div class:layout-content-loading={showRouteSkeleton} class="layout-content" aria-hidden={showRouteSkeleton}>
<slot />
</div>
{#if showRouteSkeleton}
<div class="layout-skeleton-layer" role="status" aria-label="Loading page" aria-live="polite">
<RouteSkeleton pathname={loadingPath} />
</div>
{/if}
</div>
<style>
.layout-shell {
position: relative;
}
.layout-content-loading {
visibility: hidden;
}
.layout-skeleton-layer {
position: fixed;
inset: 0;
z-index: 30;
overflow-y: auto;
background: rgba(251, 251, 251, 0.98);
}
</style>