diff --git a/frontend/src/lib/components/ArticleCard.svelte b/frontend/src/lib/components/ArticleCard.svelte index 4809952..c729bb6 100644 --- a/frontend/src/lib/components/ArticleCard.svelte +++ b/frontend/src/lib/components/ArticleCard.svelte @@ -8,6 +8,20 @@ (article.tags?.length ? article.tags : article.topic ? [article.topic] : []).slice(0, 3) ); + // The accent line is color-coded by primary topic — a quiet bit of variety + // across the grid. Muted tones in the sand/sea/sun family; calm, not loud. + const TOPIC_COLOR = { + science: '#0083ad', // azure (sea) + technology: '#5f72a8', // muted indigo + environment: '#3f9070', // soft green + health: '#3aa6a0', // calm teal + community: '#c79a3a', // warm gold + culture: '#c4795a', // terracotta + animals: '#9a8246', // earthy tan + learning: '#8a6da3', // soft violet + }; + let accentColor = $derived(TOPIC_COLOR[article.topic] ?? 'var(--accent)'); + // Reset image-failure when the article changes (cards swap in place). let failed = $state(false); $effect(() => { @@ -41,7 +55,7 @@