From 88f21e268cc17dcc184cf4b1c70c104d1442feb3 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 22 Mar 2026 04:01:25 +0000 Subject: perf: lazy-load landing demo sections --- src/lib/Landing.svelte | 96 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 81 insertions(+), 15 deletions(-) (limited to 'src/lib/Landing.svelte') diff --git a/src/lib/Landing.svelte b/src/lib/Landing.svelte index dd493be4..604becee 100644 --- a/src/lib/Landing.svelte +++ b/src/lib/Landing.svelte @@ -1,8 +1,6 @@
-
- -
+ {#if MangaDemoComponent} + + {:else} + + {/if}
-
- -
+ {#if AnimeDemoComponent} + + {:else} + + {/if}
@@ -257,6 +290,25 @@ onMount(() => { min-width: 0; } + .demo-placeholder { + min-height: 28rem; + border-radius: inherit; + background: + linear-gradient( + 110deg, + color-mix(in srgb, var(--base01) 85%, transparent) 8%, + color-mix(in srgb, var(--base02) 70%, transparent) 18%, + color-mix(in srgb, var(--base01) 85%, transparent) 33% + ), + linear-gradient( + 180deg, + color-mix(in srgb, var(--base01) 88%, transparent), + color-mix(in srgb, var(--base00) 96%, transparent) + ); + background-size: 220% 100%, 100% 100%; + animation: demoPlaceholderShift 1.8s ease-in-out infinite; + } + .section-info { flex: 1 1 40%; display: flex; @@ -441,6 +493,16 @@ onMount(() => { } } + @keyframes demoPlaceholderShift { + 0% { + background-position: 100% 0, 0 0; + } + + 100% { + background-position: -100% 0, 0 0; + } + } + @media (max-width: 1000px) { .tools-and-demo { grid-template-columns: 1fr 1fr; @@ -463,6 +525,10 @@ onMount(() => { flex: 1 1 100%; } + .demo-placeholder { + min-height: 20rem; + } + .section-info { order: -1; } -- cgit v1.2.3