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:
Nazim Kri
2026-10-29 21:57:03 -04:00
co-authored by Claude Sonnet 5
parent 3017d612e3
commit 8621284cab
20 changed files with 5722 additions and 112 deletions
+121 -16
View File
@@ -1,26 +1,131 @@
@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
:root {
--background: #ffffff;
--foreground: #171717;
}
@custom-variant dark (&:is(.dark *));
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-sans: var(--font-sans);
--font-mono: var(--font-geist-mono);
--font-heading: var(--font-sans);
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar);
--color-chart-5: var(--chart-5);
--color-chart-4: var(--chart-4);
--color-chart-3: var(--chart-3);
--color-chart-2: var(--chart-2);
--color-chart-1: var(--chart-1);
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
--color-destructive: var(--destructive);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-accent-soft: var(--accent-soft);
--color-muted-foreground: var(--muted-foreground);
--color-muted: var(--muted);
--color-secondary-foreground: var(--secondary-foreground);
--color-secondary: var(--secondary);
--color-primary-foreground: var(--primary-foreground);
--color-primary: var(--primary);
--color-popover-foreground: var(--popover-foreground);
--color-popover: var(--popover);
--color-card-foreground: var(--card-foreground);
--color-card: var(--card);
--radius-sm: calc(var(--radius) * 0.6);
--radius-md: calc(var(--radius) * 0.8);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) * 1.4);
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
}
@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.75 0.15 85);
--accent-soft: oklch(0.75 0.15 85 / 12%);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0.002 264);
--foreground: oklch(0.96 0 0);
--card: oklch(0.195 0.004 264);
--card-foreground: oklch(0.96 0 0);
--popover: oklch(0.195 0.004 264);
--popover-foreground: oklch(0.96 0 0);
--primary: var(--accent);
--primary-foreground: oklch(0.145 0 0);
--secondary: oklch(0.255 0.004 264);
--secondary-foreground: oklch(0.96 0 0);
--muted: oklch(0.225 0.004 264);
--muted-foreground: oklch(0.63 0.01 264);
--accent-foreground: oklch(0.96 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 8%);
--input: oklch(1 0 0 / 12%);
--ring: var(--accent);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
}
body {
background: var(--background);
color: var(--foreground);
font-family: Arial, Helvetica, sans-serif;
}
body {
@apply bg-background text-foreground;
}
html {
@apply font-sans;
}
}
+3 -3
View File
@@ -3,7 +3,7 @@ import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
variable: "--font-sans",
subsets: ["latin"],
});
@@ -21,9 +21,9 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
return (
<html
lang="fr"
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
className={`dark ${geistSans.variable} ${geistMono.variable} h-full antialiased`}
>
<body className="min-h-full flex flex-col bg-zinc-50 text-zinc-900">{children}</body>
<body className="min-h-full flex flex-col">{children}</body>
</html>
);
}
+121 -61
View File
@@ -1,69 +1,129 @@
import { countryTheme } from '@/lib/countries'
import { getArmyFeed } from '@/lib/lokilab-feed'
import { Suspense } from "react"
import { Users, Dices, Trophy } from "lucide-react"
import { COUNTRIES, countryTheme } from "@/lib/countries"
import { getArmyFeed } from "@/lib/lokilab-feed"
import { CountrySelector } from "@/components/country-selector"
import { LotteryCard } from "@/components/lottery-card"
import { ArmyStat } from "@/components/army-stat"
import { LokiMark } from "@/components/loki-mark"
import { Skeleton } from "@/components/ui/skeleton"
export const instant = false
export default async function Home() {
const feed = await getArmyFeed()
const theme = countryTheme('CA-QC')
export default async function Home({
searchParams,
}: {
searchParams: Promise<{ country?: string }>
}) {
const sp = await searchParams
const activeCode = sp.country && COUNTRIES.some((c) => c.code === sp.country) ? sp.country : "CA-QC"
return (
<main className="flex flex-1 flex-col items-center px-6 py-16">
<div className="w-full max-w-3xl space-y-8">
<header className="text-center">
<h1 className="text-4xl font-bold tracking-tight" style={{ color: theme.primary }}>
LokiLoto
</h1>
<p className="mt-2 text-zinc-600">
{feed.army.total.toLocaleString('fr-CA')} membres dans l'armée · stats et pronostics de Loki, pays par pays
</p>
</header>
<section
className="rounded-2xl border p-6"
style={{ borderColor: theme.secondary + '30', background: theme.primary + '08' }}
>
<div className="mb-4 flex items-center gap-2">
<span className="text-2xl">{theme.flagEmoji}</span>
<h2 className="text-xl font-semibold" style={{ color: theme.secondary }}>
{theme.name}
</h2>
<span className="ml-auto text-sm text-zinc-500">
{(feed.army.byCountry[theme.code] ?? 0).toLocaleString('fr-CA')} membres
</span>
</div>
<div className="grid gap-3 sm:grid-cols-2">
{feed.lotteries
.filter((l) => l.country === theme.code)
.map((l) => (
<div key={l.id} className="rounded-xl border border-zinc-200 bg-white p-4">
<div className="flex items-center justify-between">
<span className="font-medium">{l.name}</span>
<span className="text-xs text-zinc-500">
{l.lifetime.wins}/{l.lifetime.picksTracked} gains
</span>
</div>
{l.lastDraw && (
<div className="mt-2 text-sm text-zinc-600">
<div>Dernier tirage {l.lastDraw.date} : {l.lastDraw.result.join(' - ')}</div>
{l.lastDraw.pick && (
<div style={{ color: l.lastDraw.won ? '#188653' : theme.secondary }}>
Choix de Loki : {l.lastDraw.pick.join(' - ')}
{l.lastDraw.won ? ' — gagnant' : ` — ${l.lastDraw.matched} correspondance(s)`}
</div>
)}
</div>
)}
</div>
))}
</div>
</section>
<p className="text-center text-xs text-zinc-400">
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
</p>
</div>
<main className="flex flex-1 flex-col">
<BrandBar />
<Suspense fallback={<HomeSkeleton />}>
<HomeContent activeCode={activeCode} />
</Suspense>
</main>
)
}
function BrandBar() {
return (
<div className="border-b border-border/60 bg-background/95 backdrop-blur">
<div className="mx-auto flex max-w-6xl items-center gap-2 px-4 py-3 sm:px-6">
<LokiMark className="h-7 w-7 text-accent" />
<span className="text-lg font-extrabold tracking-tight">LokiLoto</span>
<span className="ml-1 hidden text-sm text-muted-foreground sm:inline">
pronostics et statistiques de loterie, pays par pays
</span>
</div>
</div>
)
}
async function HomeContent({ activeCode }: { activeCode: string }) {
const feed = await getArmyFeed()
const theme = countryTheme(activeCode)
const lotteries = feed.lotteries.filter((l) => l.country === activeCode)
const totalWins = lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
const totalTracked = lotteries.reduce((sum, l) => sum + l.lifetime.picksTracked, 0)
return (
<div style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}>
<header className="relative overflow-hidden border-b border-border/60">
<div
className="absolute inset-0 -z-10"
style={{
background:
"radial-gradient(ellipse 90% 60% at 15% 0%, var(--accent-soft), transparent 70%)",
}}
/>
<div className="mx-auto max-w-6xl px-4 pt-6 pb-5 sm:px-6">
<CountrySelector active={activeCode} />
<div className="mt-4 flex items-center gap-3">
<LokiMark className="h-10 w-10 shrink-0 text-accent" />
<div>
<h2 className="text-xl font-bold tracking-tight">{theme.name}</h2>
<p className="text-sm text-muted-foreground">
Statistiques et pronostics de Loki pour les loteries suivies.
</p>
</div>
</div>
<div className="mt-4 grid grid-cols-1 gap-3 sm:grid-cols-3">
<ArmyStat
icon={Users}
label="Membres dans l'armée"
value={feed.army.total.toLocaleString("fr-CA")}
/>
<ArmyStat
icon={Dices}
label={`Loteries suivies — ${theme.name}`}
value={lotteries.length.toString()}
/>
<ArmyStat
icon={Trophy}
label="Gains de Loki"
value={totalTracked > 0 ? `${totalWins} / ${totalTracked}` : "—"}
/>
</div>
</div>
</header>
<section className="mx-auto w-full max-w-6xl flex-1 px-4 py-6 sm:px-6">
{lotteries.length > 0 ? (
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{lotteries.map((entry) => (
<LotteryCard key={entry.id} entry={entry} />
))}
</div>
) : (
<div className="rounded-xl border border-dashed border-border py-16 text-center text-sm text-muted-foreground">
Aucune loterie suivie pour {theme.name} pour le moment.
</div>
)}
</section>
<footer className="border-t border-border/60 px-4 py-4 text-center text-xs text-muted-foreground sm:px-6">
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de
gain.
</footer>
</div>
)
}
function HomeSkeleton() {
return (
<div className="mx-auto w-full max-w-6xl px-4 py-8 sm:px-6">
<Skeleton className="h-10 w-full" />
<Skeleton className="mt-4 h-10 w-64" />
<div className="mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{Array.from({ length: 6 }).map((_, i) => (
<Skeleton key={i} className="h-48 w-full" />
))}
</div>
</div>
)
}