diff --git a/src/app/donate/page.tsx b/src/app/donate/page.tsx index de15eed..8c60e01 100644 --- a/src/app/donate/page.tsx +++ b/src/app/donate/page.tsx @@ -16,7 +16,7 @@ import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { TIERS, tierForAmount, upgradePrice } from "@/lib/donations"; import { TopBar } from "@/components/top-bar"; -import { DonateGlow, type GlowTheme } from "@/components/donate-glow"; +import { DonateGlow, glowAccentStyle, type GlowTheme } from "@/components/donate-glow"; const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ?? ""); @@ -604,7 +604,7 @@ function DonateFlow() { if (!started) { return ( -
+
@@ -620,7 +620,7 @@ function DonateFlow() { } return ( -
+
diff --git a/src/components/donate-glow.tsx b/src/components/donate-glow.tsx index c713b35..4b461dc 100644 --- a/src/components/donate-glow.tsx +++ b/src/components/donate-glow.tsx @@ -30,6 +30,30 @@ export const GLOW_THEMES = { export type GlowTheme = keyof typeof GLOW_THEMES; +// UI accent that goes with each glow. `green` is the site default, so it sets +// nothing and the stylesheet's own --primary applies. +const GLOW_ACCENTS: Record = { + green: null, + lime: { primary: "#a6ff3c", foreground: "#14210a" }, + teal: { primary: "#2dd4bf", foreground: "#042f2b" }, + purple: { primary: "#8b6cf6", foreground: "#ffffff" }, + blue: { primary: "#4a90f7", foreground: "#ffffff" }, + iron: { primary: "#cbd5e1", foreground: "#1e293b" }, + gold: { primary: "#fbbf24", foreground: "#2b1d02" }, + diamond: { primary: "#22d3ee", foreground: "#052e38" }, +}; + +// Inline style that retints the accent variables for the glow's theme. +export function glowAccentStyle(theme: GlowTheme): React.CSSProperties | undefined { + const accent = GLOW_ACCENTS[theme]; + if (!accent) return undefined; + return { + "--primary": accent.primary, + "--primary-foreground": accent.foreground, + "--ring": accent.primary, + } as React.CSSProperties; +} + const VERTEX_SHADER = `#version 300 es in vec2 position; void main() {