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>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
3017d612e3
commit
8621284cab
+95
-20
@@ -1,34 +1,109 @@
|
||||
/**
|
||||
* One mascot, palette-swapped per country/region. Colors are derived from
|
||||
* each flag's dominant hues (primary = most saturated non-neutral color,
|
||||
* secondary = next), with manual overrides where the algorithmic pick would
|
||||
* clash as a 2-color UI (e.g. flags that are only red/white or green/white).
|
||||
* 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
|
||||
primary: string
|
||||
secondary: string
|
||||
flagPrimary: string
|
||||
flagSecondary: string
|
||||
accent: string // oklch(), CSS custom property value
|
||||
accentSoft: string // oklch() with alpha, for subtle backgrounds
|
||||
}
|
||||
|
||||
const FALLBACK: Pick<CountryTheme, 'primary' | 'secondary'> = {
|
||||
primary: '#D7AE54', // LokiLab gold — used when a flag has no usable non-neutral color
|
||||
secondary: '#242B36',
|
||||
}
|
||||
const FALLBACK_ACCENT = 'oklch(0.77 0.118 84.8)' // LokiLab gold
|
||||
|
||||
export const COUNTRIES: CountryTheme[] = [
|
||||
{ code: 'CA-QC', name: 'Québec', flagEmoji: '⚜️', primary: '#1768C4', secondary: '#183653' },
|
||||
{ code: 'CA', name: 'Canada', flagEmoji: '🇨🇦', primary: '#D52B1E', secondary: '#FFFFFF' },
|
||||
{ code: 'FR', name: 'France', flagEmoji: '🇫🇷', primary: '#0055A4', secondary: '#EF4135' },
|
||||
{ code: 'US', name: 'United States', flagEmoji: '🇺🇸', primary: '#B22234', secondary: '#3C3B6E' },
|
||||
{ code: 'ES', name: 'España', flagEmoji: '🇪🇸', primary: '#AA151B', secondary: '#F1BF00' },
|
||||
{ code: 'IT', name: 'Italia', flagEmoji: '🇮🇹', primary: '#009246', secondary: '#CE2B37' },
|
||||
{ code: 'PT', name: 'Portugal', flagEmoji: '🇵🇹', primary: '#046A38', secondary: '#DA020E' },
|
||||
{ code: 'DZ', name: 'Algérie', flagEmoji: '🇩🇿', primary: '#006233', secondary: '#D21034' },
|
||||
{ code: 'MA', name: 'Maroc', flagEmoji: '🇲🇦', primary: '#C1272D', secondary: '#006233' },
|
||||
{
|
||||
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: '🏳️', ...FALLBACK }
|
||||
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%)',
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export { cn } from "cn"
|
||||
Reference in New Issue
Block a user