From dec11f0c01af1ab2e1c2c89e6d7f7ee0cdeada47 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 13 Apr 2026 21:08:51 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20hero=20carousel=20=E2=80=94=20horizontal?= =?UTF-8?q?=20book=20spine=20stack=20instead=20of=20vertical=20overlap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/routes/+page.svelte | 88 +++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/ui/src/routes/+page.svelte b/ui/src/routes/+page.svelte index a618b69..71ff11a 100644 --- a/ui/src/routes/+page.svelte +++ b/ui/src/routes/+page.svelte @@ -136,40 +136,18 @@ {#if heroBook} -{@const stackBook1 = heroBooks[(heroIndex + 1) % heroBooks.length]} -{@const stackBook2 = heroBooks[(heroIndex + 2) % heroBooks.length]} +{@const stackBooks = heroBooks.length > 1 + ? Array.from({ length: Math.min(heroBooks.length - 1, 3) }, (_, i) => + heroBooks[(heroIndex + 1 + i) % heroBooks.length]) + : []}
-
- - {#if heroBooks.length >= 3} - - {/if} - - - {#if heroBooks.length >= 2} - - {/if} + +
@@ -226,23 +204,43 @@
- - {#if heroBooks.length > 1} -
- {#each heroBooks as _, i} - - {/each} -
- {/if} + + {#each stackBooks as stackBook, i} + {@const opacity = i === 0 ? 'opacity-70' : 'opacity-40'} + {@const width = i === 0 ? 'sm:w-10' : 'sm:w-7'} + + {/each} +
+ + + {#if heroBooks.length > 1} +
+ {#each heroBooks as _, i} + + {/each} +
+ {/if}
{/if}