diff --git a/app/globals.css b/app/globals.css index 6c91d9e..c2b447d 100644 --- a/app/globals.css +++ b/app/globals.css @@ -30,6 +30,10 @@ --color-accent-foreground: var(--accent-foreground); --color-accent: var(--accent); --color-accent-soft: var(--accent-soft); + --color-success: var(--success); + --color-success-foreground: var(--success-foreground); + --color-panel: var(--panel); + --color-panel-hover: var(--panel-hover); --color-muted-foreground: var(--muted-foreground); --color-muted: var(--muted); --color-secondary-foreground: var(--secondary-foreground); @@ -86,22 +90,31 @@ } .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); + --background: oklch(0.183 0.031 263.4); + --foreground: oklch(0.969 0.007 260.7); + --card: oklch(0.229 0.037 257.2); + --card-foreground: oklch(0.969 0.007 260.7); + --popover: oklch(0.266 0.043 255.9); + --popover-foreground: oklch(0.969 0.007 260.7); + /* --primary stays neutral — never tied to the country accent, so generic + shadcn controls (menu hover, focus states) don't inherit a country's + color as if it meant something semantically. */ + --primary: oklch(0.969 0.007 260.7); + --primary-foreground: oklch(0.183 0.031 263.4); + --secondary: oklch(0.317 0.050 254.8); + --secondary-foreground: oklch(0.969 0.007 260.7); + --muted: oklch(0.266 0.043 255.9); + --muted-foreground: oklch(0.774 0.033 255.6); + --accent-foreground: oklch(0.969 0.007 260.7); + /* --success is the one stable "won/matched" color across every country — + never derived from --accent, so a win doesn't change color by country. */ + --success: oklch(0.723 0.192 149.6); + --success-foreground: oklch(0.1 0.02 149.6); + --panel: oklch(0.229 0.037 257.2); + --panel-hover: oklch(0.317 0.050 254.8); --destructive: oklch(0.704 0.191 22.216); - --border: oklch(1 0 0 / 8%); - --input: oklch(1 0 0 / 12%); + --border: oklch(0.366 0.051 253.4 / 50%); + --input: oklch(0.366 0.051 253.4 / 60%); --ring: var(--accent); --chart-1: oklch(0.87 0 0); --chart-2: oklch(0.556 0 0); diff --git a/app/page.tsx b/app/page.tsx index 767a8ce..d4e9e34 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,10 +1,8 @@ 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 { CountryNav, CountryNavMobile } from "@/components/country-nav" +import { LotteryResultsPanel } from "@/components/lottery-results-panel" import { LokiMark } from "@/components/loki-mark" import { Skeleton } from "@/components/ui/skeleton" @@ -20,7 +18,7 @@ export default async function Home({ return (
- + }> @@ -28,15 +26,12 @@ export default async function Home({ ) } -function BrandBar() { +function AppHeader() { return ( -
-
- - LokiLoto - - pronostics et statistiques de loterie, pays par pays - +
+
+ + LokiLoto
) @@ -48,81 +43,77 @@ async function HomeContent({ activeCode }: { activeCode: string }) { 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) + const countryMembers = feed.army.byCountry[activeCode] ?? 0 return ( -
-
-
-
- +
+
+ +
-
- -
-

{theme.name}

-

- Statistiques et pronostics de Loki pour les loteries suivies. -

-
+
+ + +
+
+

{theme.name}

+

+ {lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie + {lotteries.length === 1 ? "" : "s"} +

-
- - - + + + 0 ? `${totalWins} / ${totalTracked}` : "—"} + label="Grilles gagnantes" />
+ + {lotteries.length > 0 ? ( + + ) : ( +
+ Aucune loterie suivie pour {theme.name} pour le moment. +
+ )} + +

+ Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie + de gain. +

-
+
+
+ ) +} -
- {lotteries.length > 0 ? ( -
- {lotteries.map((entry) => ( - - ))} -
- ) : ( -
- Aucune loterie suivie pour {theme.name} pour le moment. -
- )} -
- -
- Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de - gain. -
+function Stat({ value, label }: { value: string; label: string }) { + return ( +
+ {value} + {label}
) } function HomeSkeleton() { return ( -
- - -
- {Array.from({ length: 6 }).map((_, i) => ( - - ))} +
+
+ +
+ + + +
) diff --git a/components/army-stat.tsx b/components/army-stat.tsx deleted file mode 100644 index 4f57f92..0000000 --- a/components/army-stat.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import type { LucideIcon } from "lucide-react" - -export function ArmyStat({ - icon: Icon, - label, - value, -}: { - icon: LucideIcon - label: string - value: string -}) { - return ( -
-
- -
-
-

{value}

-

{label}

-
-
- ) -} diff --git a/components/country-nav.tsx b/components/country-nav.tsx new file mode 100644 index 0000000..36b7a7c --- /dev/null +++ b/components/country-nav.tsx @@ -0,0 +1,79 @@ +"use client" + +import Link from "next/link" +import { usePathname, useSearchParams } from "next/navigation" +import { COUNTRIES } from "@/lib/countries" +import { cn } from "@/lib/utils" + +export function CountryNav({ active }: { active: string }) { + const pathname = usePathname() + const searchParams = useSearchParams() + + function hrefFor(code: string) { + const params = new URLSearchParams(searchParams.toString()) + params.set("country", code) + return `${pathname}?${params.toString()}` + } + + return ( + + ) +} + +export function CountryNavMobile({ active }: { active: string }) { + const pathname = usePathname() + const searchParams = useSearchParams() + + function hrefFor(code: string) { + const params = new URLSearchParams(searchParams.toString()) + params.set("country", code) + return `${pathname}?${params.toString()}` + } + + return ( + + ) +} diff --git a/components/country-selector.tsx b/components/country-selector.tsx deleted file mode 100644 index 1ae3653..0000000 --- a/components/country-selector.tsx +++ /dev/null @@ -1,50 +0,0 @@ -"use client" - -import Link from "next/link" -import { usePathname, useSearchParams } from "next/navigation" -import { COUNTRIES } from "@/lib/countries" -import { cn } from "@/lib/utils" -import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area" - -export function CountrySelector({ active }: { active: string }) { - const pathname = usePathname() - const searchParams = useSearchParams() - - function hrefFor(code: string) { - const params = new URLSearchParams(searchParams.toString()) - params.set("country", code) - return `${pathname}?${params.toString()}` - } - - return ( - - - - - ) -} diff --git a/components/loki-mark.tsx b/components/loki-mark.tsx index f631352..75f2929 100644 --- a/components/loki-mark.tsx +++ b/components/loki-mark.tsx @@ -1,21 +1,18 @@ /** - * The one shared mascot mark: a geometric fox/trickster silhouette. - * Palette-swapped per country via currentColor — never hardcode a fill here. + * The one shared mascot mark: a simplified fox head. Two ears, a tapered + * muzzle, two eyes — designed to stay legible at 20-24px, not just at hero + * size. Palette-swapped per country via currentColor — never hardcode a + * fill here. */ export function LokiMark({ className }: { className?: string }) { return ( - - {value} - - ) -} - -export function LotteryCard({ entry }: { entry: LotteryFeedEntry }) { - const { lifetime, lastDraw } = entry - const resultSet = new Set(lastDraw?.result ?? []) - - return ( - - - - {entry.name} - - - - - - {lastDraw ? ( - <> -
-

- Tirage du {formatDate(lastDraw.date)} -

-
- {lastDraw.result.map((n, i) => ( - - ))} -
-
- - {lastDraw.pick ? ( -
-
- - Choix de Loki -
-
- {lastDraw.pick.map((n, i) => ( - - ))} - - {lastDraw.matched} correspondance{lastDraw.matched === 1 ? "" : "s"} - - {lastDraw.won && ( - - - Gagnant - - )} -
-
- ) : ( -

- Aucun choix de Loki pour ce tirage. -

- )} - - ) : ( -

Aucun tirage disponible.

- )} -
-
- ) -} - -function WinRateBadge({ winRate, tracked }: { winRate: number; tracked: number }) { - if (tracked === 0) { - return ( - - Nouveau - - ) - } - return ( - - - {(winRate * 100).toFixed(0)}% sur {tracked} - - ) -} - -function formatDate(iso: string): string { - const d = new Date(iso + "T00:00:00") - return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short", year: "numeric" }) -} diff --git a/components/lottery-mobile-card.tsx b/components/lottery-mobile-card.tsx new file mode 100644 index 0000000..f349b7a --- /dev/null +++ b/components/lottery-mobile-card.tsx @@ -0,0 +1,56 @@ +import { NumberSequence } from "@/components/number-sequence" +import type { LotteryFeedEntry } from "@/lib/lokilab-feed" + +export function LotteryMobileCard({ entry }: { entry: LotteryFeedEntry }) { + const { lifetime, lastDraw } = entry + const resultSet = new Set(lastDraw?.result ?? []) + + return ( +
+
+

{entry.name}

+ {lifetime.picksTracked > 0 ? ( +

+ + {(lifetime.winRate * 100).toFixed(0)}% + {" "} + sur {lifetime.picksTracked} +

+ ) : ( +

Nouveau

+ )} +
+ + {lastDraw ? ( + <> +
+

+ Résultat du {formatDate(lastDraw.date)} +

+ +
+ {lastDraw.pick ? ( +
+

+ Choix pour ce tirage —{" "} + + {lastDraw.matched} / {lastDraw.result.length} + +

+ +
+ ) : ( +

Aucun choix pour ce tirage.

+ )} + + ) : ( +

Aucun tirage disponible.

+ )} +
+ ) +} + +function formatDate(iso: string): string { + const d = new Date(iso + "T00:00:00") + return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" }) +} diff --git a/components/lottery-results-panel.tsx b/components/lottery-results-panel.tsx new file mode 100644 index 0000000..922b8c0 --- /dev/null +++ b/components/lottery-results-panel.tsx @@ -0,0 +1,29 @@ +import { LotteryRow } from "@/components/lottery-row" +import { LotteryMobileCard } from "@/components/lottery-mobile-card" +import type { LotteryFeedEntry } from "@/lib/lokilab-feed" + +export function LotteryResultsPanel({ lotteries }: { lotteries: LotteryFeedEntry[] }) { + return ( +
+
+ Loterie + Résultat officiel + Choix de Loki + Score + Historique +
+ +
+ {lotteries.map((entry) => ( + + ))} +
+ +
+ {lotteries.map((entry) => ( + + ))} +
+
+ ) +} diff --git a/components/lottery-row.tsx b/components/lottery-row.tsx new file mode 100644 index 0000000..ad93665 --- /dev/null +++ b/components/lottery-row.tsx @@ -0,0 +1,64 @@ +import { NumberSequence } from "@/components/number-sequence" +import type { LotteryFeedEntry } from "@/lib/lokilab-feed" + +export function LotteryRow({ entry }: { entry: LotteryFeedEntry }) { + const { lifetime, lastDraw } = entry + const resultSet = new Set(lastDraw?.result ?? []) + + return ( +
+
+

+ {entry.name} +

+ {lastDraw && ( +

{formatDate(lastDraw.date)}

+ )} +
+ +
{lastDraw ? : }
+ +
+ {lastDraw?.pick ? ( + + ) : ( + Aucun choix pour ce tirage + )} +
+ +
+ {lastDraw?.pick ? ( + + {lastDraw.matched} / {lastDraw.result.length} + + ) : ( + + )} +
+ +
+ {lifetime.picksTracked > 0 ? ( + <> + + {(lifetime.winRate * 100).toFixed(0)}% + + + sur {lifetime.picksTracked} grilles + + + ) : ( + Nouveau + )} +
+
+ ) +} + +function Dash() { + return — +} + +function formatDate(iso: string): string { + const d = new Date(iso + "T00:00:00") + return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" }) +} diff --git a/components/number-sequence.tsx b/components/number-sequence.tsx new file mode 100644 index 0000000..49ce722 --- /dev/null +++ b/components/number-sequence.tsx @@ -0,0 +1,25 @@ +export function NumberSequence({ + numbers, + hitSet, +}: { + numbers: number[] + hitSet?: Set +}) { + return ( +
+ {numbers.map((n, i) => ( + + {n} + + ))} +
+ ) +}