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}