Scaffold LokiLoto: country theme engine, LokiLab feed client, Québec home page
International lottery stats layer, fed by LokiLab's army-feed API (results, Loki's picks, lifetime win record, army size). One mascot reskinned per country via flag-derived colors; Québec is the first locale, same pattern every future country will follow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b6a4c94e93
commit
b2915d06cd
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* 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).
|
||||
*/
|
||||
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
|
||||
}
|
||||
|
||||
const FALLBACK: Pick<CountryTheme, 'primary' | 'secondary'> = {
|
||||
primary: '#D7AE54', // LokiLab gold — used when a flag has no usable non-neutral color
|
||||
secondary: '#242B36',
|
||||
}
|
||||
|
||||
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' },
|
||||
]
|
||||
|
||||
export function countryTheme(code: string): CountryTheme {
|
||||
return COUNTRIES.find((c) => c.code === code) ?? { code, name: code, flagEmoji: '🏳️', ...FALLBACK }
|
||||
}
|
||||
Reference in New Issue
Block a user