diff --git a/apps/mana/apps/web/src/lib/modules/zitare/ListView.svelte b/apps/mana/apps/web/src/lib/modules/zitare/ListView.svelte index b95815d16..a563caa30 100644 --- a/apps/mana/apps/web/src/lib/modules/zitare/ListView.svelte +++ b/apps/mana/apps/web/src/lib/modules/zitare/ListView.svelte @@ -22,6 +22,7 @@ let favorites = $state([]); let quote = $state(null); + let transitioning = $state(false); // Initialize once on mount (writes to store state — keep out of $effect // to avoid the read/write loop where reading currentQuote retriggers @@ -59,8 +60,14 @@ let currentTags = $derived(getTagsByIds(allTags, currentTagIds)); function nextQuote() { - quotesStore.loadRandomQuote(); - quote = quotesStore.currentQuote; + if (transitioning) return; + transitioning = true; + // After fade-out completes, swap quote and fade back in + setTimeout(() => { + quotesStore.loadRandomQuote(); + quote = quotesStore.currentQuote; + transitioning = false; + }, 200); } async function toggleFav(e: Event) { @@ -102,42 +109,60 @@ }} > {#if quote} -
- «{quotesStore.getText(quote)}» -
-

— {quote.author}

+
+
+ «{quotesStore.getText(quote)}» +
+

— {quote.author}

- - {#if currentTags.length > 0} -
- {#each currentTags as tag (tag.id)} - - - {tag.name} - - {/each} -
- {/if} + + {#if currentTags.length > 0} +
+ {#each currentTags as tag (tag.id)} + + + {tag.name} + + {/each} +
+ {/if} - + +
{/if}