From 1316ef57f33879d18ad036ec5e25008548d5a916 Mon Sep 17 00:00:00 2001 From: Till JS Date: Thu, 26 Mar 2026 20:48:33 +0100 Subject: [PATCH] feat(zitare): show author bio on quote cards Add a small info icon next to the author name that toggles a short biography when clicked. Bio text is displayed in the current quote language with German as fallback. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../web/src/lib/components/QuoteCard.svelte | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/apps/zitare/apps/web/src/lib/components/QuoteCard.svelte b/apps/zitare/apps/web/src/lib/components/QuoteCard.svelte index ec88a8170..051dcd1b3 100644 --- a/apps/zitare/apps/web/src/lib/components/QuoteCard.svelte +++ b/apps/zitare/apps/web/src/lib/components/QuoteCard.svelte @@ -19,6 +19,14 @@ let isFavorite = $derived(favoritesStore.isFavorite(quote.id)); let quoteText = $derived(quotesStore.getText(quote)); + let showBio = $state(false); + + // Get author bio in current language + let authorBioText = $derived(() => { + if (!quote.authorBio) return ''; + const lang = quotesStore.language === 'original' ? 'de' : quotesStore.language; + return quote.authorBio[lang] || quote.authorBio.de || ''; + }); // Category gradient classes const categoryGradients: Record = { @@ -107,7 +115,28 @@
-

— {quote.author}

+

+ — {quote.author} + {#if authorBioText} + + {/if} +

+ {#if showBio && authorBioText} +

{authorBioText}

+ {/if} {#if showSource && (quote.source || quote.year)}

{#if quote.source}