Add a real hero landing section with large mascot, slogan, CTA

The homepage went straight into a dense dashboard with no brand
identity up front — user feedback was blunt: "c'est quoi ça, j'ai
demandé une belle landing page et interface." Adds a proper hero above
the existing dashboard: a large, more detailed mascot illustration
(LokiHeroMark, distinct from the small LokiMark used in the header),
a real headline + tagline, "Rejoindre l'armée" / "Voir le classement"
CTAs, and big-number stats (army size, country count, total wins).
Brand-neutral gold accent, not tied to the selected country's color —
the hero is identity, not data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Nazim Kri
2026-10-30 09:17:25 -04:00
co-authored by Claude Sonnet 5
parent c36b621d39
commit 8a45c331c3
3 changed files with 192 additions and 45 deletions
+55 -45
View File
@@ -6,6 +6,7 @@ import { listFollowedPicks } from "@/lib/follows"
import { CountryNav, CountryNavMobile } from "@/components/country-nav" import { CountryNav, CountryNavMobile } from "@/components/country-nav"
import { LotteryResultsPanel } from "@/components/lottery-results-panel" import { LotteryResultsPanel } from "@/components/lottery-results-panel"
import { AppHeader } from "@/components/app-header" import { AppHeader } from "@/components/app-header"
import { Hero } from "@/components/hero"
import { Skeleton } from "@/components/ui/skeleton" import { Skeleton } from "@/components/ui/skeleton"
export const instant = false export const instant = false
@@ -35,62 +36,71 @@ async function HomeContent({ activeCode }: { activeCode: string }) {
const totalWins = lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0) const totalWins = lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
const totalTracked = lotteries.reduce((sum, l) => sum + l.lifetime.picksTracked, 0) const totalTracked = lotteries.reduce((sum, l) => sum + l.lifetime.picksTracked, 0)
const countryMembers = feed.army.byCountry[activeCode] ?? 0 const countryMembers = feed.army.byCountry[activeCode] ?? 0
const globalWins = feed.lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
const follows = member ? await listFollowedPicks(member.id) : [] const follows = member ? await listFollowedPicks(member.id) : []
const followedKeys = new Set(follows.map((f) => `${f.lotteryId}:${f.targetDrawDate}`)) const followedKeys = new Set(follows.map((f) => `${f.lotteryId}:${f.targetDrawDate}`))
return ( return (
<div <>
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties} <Hero
className="mx-auto w-full max-w-6xl flex-1 px-4 py-4 sm:px-6" armyTotal={feed.army.total}
> countryCount={COUNTRIES.length}
<div className="sm:hidden mb-3"> totalWins={globalWins}
<CountryNavMobile active={activeCode} /> isAuthenticated={!!member}
</div> />
<div
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
className="mx-auto w-full max-w-6xl flex-1 px-4 py-4 sm:px-6"
>
<div className="sm:hidden mb-3">
<CountryNavMobile active={activeCode} />
</div>
<div className="flex gap-5"> <div className="flex gap-5">
<aside className="hidden w-[200px] shrink-0 sm:block"> <aside className="hidden w-[200px] shrink-0 sm:block">
<CountryNav active={activeCode} /> <CountryNav active={activeCode} />
</aside> </aside>
<div className="min-w-0 flex-1 space-y-3"> <div className="min-w-0 flex-1 space-y-3">
<div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1"> <div className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1">
<h1 className="text-[22px] font-bold tracking-tight">{theme.name}</h1> <h2 className="text-[22px] font-bold tracking-tight">{theme.name}</h2>
<p className="text-xs text-muted-foreground"> <p className="text-xs text-muted-foreground">
{lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie {lotteries.length} loterie{lotteries.length === 1 ? "" : "s"} suivie
{lotteries.length === 1 ? "" : "s"} {lotteries.length === 1 ? "" : "s"}
</p>
</div>
<div className="flex h-11 items-center divide-x divide-border rounded-md border border-border/60 bg-panel px-4 text-sm">
<Stat value={feed.army.total.toLocaleString("fr-CA")} label="Armée (global)" />
<Stat value={countryMembers.toLocaleString("fr-CA")} label={`Membres — ${theme.name}`} />
<Stat
value={totalTracked > 0 ? `${totalWins} / ${totalTracked}` : "—"}
label="Grilles gagnantes"
/>
</div>
{lotteries.length > 0 ? (
<LotteryResultsPanel
lotteries={lotteries}
country={activeCode}
followedKeys={followedKeys}
isAuthenticated={!!member}
/>
) : (
<div className="rounded-md border border-dashed border-border py-16 text-center text-sm text-muted-foreground">
Aucune loterie suivie pour {theme.name} pour le moment.
</div>
)}
<p className="text-[11px] text-muted-foreground">
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie
de gain.
</p> </p>
</div> </div>
<div className="flex h-11 items-center divide-x divide-border rounded-md border border-border/60 bg-panel px-4 text-sm">
<Stat value={feed.army.total.toLocaleString("fr-CA")} label="Armée (global)" />
<Stat value={countryMembers.toLocaleString("fr-CA")} label={`Membres — ${theme.name}`} />
<Stat
value={totalTracked > 0 ? `${totalWins} / ${totalTracked}` : "—"}
label="Grilles gagnantes"
/>
</div>
{lotteries.length > 0 ? (
<LotteryResultsPanel
lotteries={lotteries}
country={activeCode}
followedKeys={followedKeys}
isAuthenticated={!!member}
/>
) : (
<div className="rounded-md border border-dashed border-border py-16 text-center text-sm text-muted-foreground">
Aucune loterie suivie pour {theme.name} pour le moment.
</div>
)}
<p className="text-[11px] text-muted-foreground">
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie
de gain.
</p>
</div> </div>
</div> </div>
</div> </>
) )
} }
+85
View File
@@ -0,0 +1,85 @@
import Link from "next/link"
import { LokiHeroMark } from "@/components/loki-hero-mark"
import { Button } from "@/components/ui/button"
import { Users, Trophy, Globe } from "lucide-react"
export function Hero({
armyTotal,
countryCount,
totalWins,
isAuthenticated,
}: {
armyTotal: number
countryCount: number
totalWins: number
isAuthenticated: boolean
}) {
return (
<section className="relative overflow-hidden border-b border-border/60">
<div
className="pointer-events-none absolute inset-0 -z-10"
style={{
background:
"radial-gradient(ellipse 80% 55% at 50% -10%, oklch(0.77 0.118 84.8 / 18%), transparent 65%)",
}}
/>
<div className="mx-auto grid max-w-6xl grid-cols-1 items-center gap-6 px-4 py-10 sm:px-6 md:grid-cols-[1fr_auto] md:py-16">
<div className="order-2 md:order-1">
<p className="text-sm font-semibold uppercase tracking-wide text-accent">
Le tricheur des loteries
</p>
<h1 className="mt-2 text-4xl font-extrabold leading-[1.05] tracking-tight sm:text-5xl">
Loki lit les tirages.
<br />
Vous décidez si vous le suivez.
</h1>
<p className="mt-4 max-w-md text-sm text-muted-foreground sm:text-base">
Statistiques, pronostics et historique de loterie, pays par pays. Rejoignez
l&apos;armée, suivez les choix de Loki, grimpez au classement.
</p>
<div className="mt-6 flex flex-wrap items-center gap-3">
{!isAuthenticated && (
<Button asChild size="lg" className="font-semibold">
<Link href="/connexion">Rejoindre l&apos;armée</Link>
</Button>
)}
<Button asChild variant="outline" size="lg">
<Link href="/classement">Voir le classement</Link>
</Button>
</div>
<div className="mt-8 flex flex-wrap gap-x-8 gap-y-4">
<HeroStat icon={Users} value={armyTotal.toLocaleString("fr-CA")} label="Membres de l'armée" />
<HeroStat icon={Globe} value={countryCount.toString()} label="Pays couverts" />
<HeroStat icon={Trophy} value={totalWins.toString()} label="Grilles gagnées par Loki" />
</div>
</div>
<div className="order-1 flex justify-center md:order-2">
<LokiHeroMark className="h-48 w-48 text-accent sm:h-64 sm:w-64 md:h-72 md:w-72" />
</div>
</div>
</section>
)
}
function HeroStat({
icon: Icon,
value,
label,
}: {
icon: typeof Users
value: string
label: string
}) {
return (
<div className="flex items-center gap-2">
<Icon className="h-5 w-5 shrink-0 text-accent" />
<div>
<p className="text-xl font-bold leading-none tabular-nums">{value}</p>
<p className="mt-0.5 text-xs text-muted-foreground">{label}</p>
</div>
</div>
)
}
+52
View File
@@ -0,0 +1,52 @@
/**
* Large-format hero illustration of the mascot — more detail than LokiMark
* (which is tuned for 20-24px). Same palette-swap contract: every fill is
* currentColor or a var(), never a hardcoded country color.
*/
export function LokiHeroMark({ className }: { className?: string }) {
return (
<svg viewBox="0 0 400 400" fill="none" className={className} aria-hidden="true">
{/* Back glow */}
<circle cx="200" cy="210" r="170" fill="var(--accent-soft)" />
{/* Ears */}
<path d="M100 60 L170 150 L120 170 Z" fill="currentColor" />
<path d="M300 60 L230 150 L280 170 Z" fill="currentColor" />
<path d="M118 90 L160 148 L132 158 Z" fill="var(--background)" opacity="0.35" />
<path d="M282 90 L240 148 L268 158 Z" fill="var(--background)" opacity="0.35" />
{/* Head */}
<path
d="M200 110
C 270 110 310 165 310 225
C 310 300 260 340 200 340
C 140 340 90 300 90 225
C 90 165 130 110 200 110 Z"
fill="currentColor"
/>
{/* Cheek markings */}
<path d="M90 225 C 90 270 115 305 150 325 L 140 260 Z" fill="var(--background)" opacity="0.18" />
<path d="M310 225 C 310 270 285 305 250 325 L 260 260 Z" fill="var(--background)" opacity="0.18" />
{/* Muzzle */}
<path
d="M160 255 C 160 290 178 312 200 312 C 222 312 240 290 240 255 C 240 235 222 222 200 222 C 178 222 160 235 160 255 Z"
fill="var(--background)"
/>
<ellipse cx="200" cy="258" rx="14" ry="10" fill="currentColor" />
{/* Eyes */}
<ellipse cx="160" cy="210" rx="16" ry="20" fill="var(--background)" />
<ellipse cx="240" cy="210" rx="16" ry="20" fill="var(--background)" />
<circle cx="162" cy="214" r="8" fill="currentColor" />
<circle cx="238" cy="214" r="8" fill="currentColor" />
<circle cx="165" cy="210" r="2.5" fill="var(--background)" />
<circle cx="241" cy="210" r="2.5" fill="var(--background)" />
{/* Eyebrows — trickster tilt */}
<path d="M140 182 Q 160 170 180 180" stroke="currentColor" strokeWidth="6" strokeLinecap="round" />
<path d="M260 182 Q 240 170 220 180" stroke="currentColor" strokeWidth="6" strokeLinecap="round" />
</svg>
)
}