Files
lokiloto/lib/countries.ts
T
Nazim KriandClaude Sonnet 5 8621284cab Real design pass: shadcn/ui, dark sportsbook-style UI, per-country accent
Replaces the plain proof-of-concept page with a proper design: shadcn/ui
component foundation, dark theme by default, a brand bar + country
selector pill nav, lottery cards with real number chips and win-state
highlighting, and a shared Loki mark reskinned per country via a single
--accent CSS variable (set from lib/countries.ts's flag-derived OKLCH
palette) — one mascot, one layout, color is the only thing that changes
per country, as specified.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-29 21:57:03 -04:00

110 lines
2.9 KiB
TypeScript

/**
* One mascot, palette-swapped per country. `flagPrimary`/`flagSecondary` are
* the true flag hex values (used for the small flag swatch / badges).
* `accent`/`accentSoft` are OKLCH values tuned for legibility as a UI accent
* on a dark background — several flag colors (navy, dark green, deep red)
* are too dark/desaturated to use directly as an accent on dark UI, so they
* are lightened here rather than algorithmically derived, same as the
* manual-override policy described for the mascot palette.
*/
export interface CountryTheme {
code: string // ISO 3166-1 alpha-2, or a region code like 'CA-QC'
name: string
flagEmoji: string
flagPrimary: string
flagSecondary: string
accent: string // oklch(), CSS custom property value
accentSoft: string // oklch() with alpha, for subtle backgrounds
}
const FALLBACK_ACCENT = 'oklch(0.77 0.118 84.8)' // LokiLab gold
export const COUNTRIES: CountryTheme[] = [
{
code: 'CA-QC',
name: 'Québec',
flagEmoji: '⚜️',
flagPrimary: '#1768C4',
flagSecondary: '#183653',
accent: 'oklch(0.62 0.16 255.5)',
accentSoft: 'oklch(0.62 0.16 255.5 / 14%)',
},
{
code: 'FR',
name: 'France',
flagEmoji: '🇫🇷',
flagPrimary: '#0055A4',
flagSecondary: '#EF4135',
accent: 'oklch(0.63 0.19 28.6)',
accentSoft: 'oklch(0.63 0.19 28.6 / 14%)',
},
{
code: 'US',
name: 'United States',
flagEmoji: '🇺🇸',
flagPrimary: '#B22234',
flagSecondary: '#3C3B6E',
accent: 'oklch(0.6 0.17 20.7)',
accentSoft: 'oklch(0.6 0.17 20.7 / 14%)',
},
{
code: 'ES',
name: 'España',
flagEmoji: '🇪🇸',
flagPrimary: '#AA151B',
flagSecondary: '#F1BF00',
accent: 'oklch(0.76 0.16 89.6)',
accentSoft: 'oklch(0.76 0.16 89.6 / 14%)',
},
{
code: 'IT',
name: 'Italia',
flagEmoji: '🇮🇹',
flagPrimary: '#009246',
flagSecondary: '#CE2B37',
accent: 'oklch(0.65 0.15 151.1)',
accentSoft: 'oklch(0.65 0.15 151.1 / 14%)',
},
{
code: 'PT',
name: 'Portugal',
flagEmoji: '🇵🇹',
flagPrimary: '#046A38',
flagSecondary: '#DA020E',
accent: 'oklch(0.63 0.14 153.6)',
accentSoft: 'oklch(0.63 0.14 153.6 / 14%)',
},
{
code: 'DZ',
name: 'Algérie',
flagEmoji: '🇩🇿',
flagPrimary: '#006233',
flagSecondary: '#D21034',
accent: 'oklch(0.6 0.13 153.7)',
accentSoft: 'oklch(0.6 0.13 153.7 / 14%)',
},
{
code: 'MA',
name: 'Maroc',
flagEmoji: '🇲🇦',
flagPrimary: '#C1272D',
flagSecondary: '#006233',
accent: 'oklch(0.58 0.19 25)',
accentSoft: 'oklch(0.58 0.19 25 / 14%)',
},
]
export function countryTheme(code: string): CountryTheme {
return (
COUNTRIES.find((c) => c.code === code) ?? {
code,
name: code,
flagEmoji: '🏳️',
flagPrimary: '#D7AE54',
flagSecondary: '#242B36',
accent: FALLBACK_ACCENT,
accentSoft: 'oklch(0.77 0.118 84.8 / 14%)',
}
)
}