Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/pastel-dream. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
package main
|
|
|
|
// affirmationPaletteVar maps a palette name to a token reference. All four
|
|
// names resolve to a theme token so the strip never fails to colorize.
|
|
func affirmationPaletteVar(palette string) string {
|
|
switch palette {
|
|
case "mint":
|
|
return "hsl(var(--secondary) / 0.55)"
|
|
case "butter":
|
|
return "hsl(var(--accent) / 0.55)"
|
|
case "sky":
|
|
return "hsl(var(--secondary) / 0.40)"
|
|
default:
|
|
return "hsl(var(--primary) / 0.35)"
|
|
}
|
|
}
|
|
|
|
// affirmationComponent renders the shimmering affirmation strip.
|
|
templ affirmationComponent(data AffirmationData) {
|
|
<section
|
|
class="relative py-16 overflow-hidden animate-pastel-shimmer"
|
|
style={ "background-image: linear-gradient(90deg, hsl(var(--background)) 0%, " + affirmationPaletteVar(data.Palette) + " 50%, hsl(var(--background)) 100%);" }
|
|
data-block="pastel-dream:affirmation"
|
|
data-palette={ data.Palette }
|
|
>
|
|
<div class="relative z-10 max-w-3xl mx-auto px-6 text-center">
|
|
<p class="font-display text-3xl md:text-4xl leading-snug" style="color: hsl(var(--foreground));">
|
|
“{ data.Quote }”
|
|
</p>
|
|
if data.Author != "" {
|
|
<p class="font-body mt-4 text-sm uppercase tracking-[0.2em]" style="color: hsl(var(--muted-foreground));">
|
|
{ data.Author }
|
|
</p>
|
|
}
|
|
</div>
|
|
</section>
|
|
}
|