Landing redesign: animated hero, draw cards, how-it-works, footer

Keeps only countries with archived results (Québec, France, US, Spain,
Portugal). The landing gets motion and a real structure: staggered
fade-in hero with a floating Loki, twinkling stars, a shimmering gold CTA
and counters that tick up (draws archived, lotteries, countries); draw
cards in place of the table, with lottery balls dropping in and a
lift-on-hover; a three-step "Comment ça marche"; and a site-wide footer
with links, covered countries, responsible-play note and 18+ notice.
All motion is disabled under prefers-reduced-motion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nazim Kri
2026-10-31 11:58:21 -04:00
co-authored by Claude Opus 5.5
parent 302915d888
commit ad214a24dd
17 changed files with 524 additions and 320 deletions
+127
View File
@@ -0,0 +1,127 @@
import Link from "next/link"
import { BarChart3, Target } from "lucide-react"
import { FollowButton } from "@/components/follow-button"
import { lotteryIcon } from "@/components/lottery-strip"
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
import { cn } from "@/lib/utils"
export function LotteryCard({
entry,
country,
isFollowing,
isAuthenticated,
index,
}: {
entry: LotteryFeedEntry
country: string
isFollowing: boolean
isAuthenticated: boolean
index: number
}) {
const { lastDraw, lifetime } = entry
const Icon = lotteryIcon(entry.id)
const hits = new Set(lastDraw?.result ?? [])
const base = index * 90
return (
<article
className="animate-fade-up group relative overflow-hidden rounded-xl border border-border bg-card transition-all duration-300 hover:-translate-y-1 hover:border-gold/40 hover:shadow-[0_12px_40px_-12px_rgba(244,199,107,0.25)]"
style={{ animationDelay: `${base}ms` }}
>
<div className="flex items-center gap-2.5 border-b border-border bg-[#0b111d] px-4 py-2.5">
<span className="flex h-7 w-7 items-center justify-center rounded-md bg-gold/10 text-gold">
<Icon className="h-4 w-4" />
</span>
<div className="min-w-0 flex-1">
<h3 className="truncate text-sm font-semibold">{entry.name}</h3>
{lastDraw && <p className="text-[11px] text-muted-foreground">{formatDate(lastDraw.date)}</p>}
</div>
{lastDraw && (
<FollowButton
lotteryId={entry.id}
country={country}
targetDrawDate={lastDraw.date}
initialFollowing={isFollowing}
isAuthenticated={isAuthenticated}
/>
)}
</div>
<div className="space-y-3 px-4 py-4">
{lastDraw ? (
<div className="flex flex-wrap items-center gap-1.5">
{lastDraw.result.map((n, i) => (
<Ball key={i} n={n} delay={base + 200 + i * 70} />
))}
{lastDraw.bonus?.map((n, i) => (
<Ball key={`b${i}`} n={n} bonus delay={base + 200 + (lastDraw.result.length + i) * 70} title={entry.bonusLabel} />
))}
</div>
) : (
<p className="text-sm text-muted-foreground">Aucun tirage disponible.</p>
)}
{lastDraw?.pick ? (
<div className="rounded-lg border border-mint/20 bg-mint/5 px-3 py-2">
<p className="mb-1.5 flex items-center gap-1.5 text-[11px] font-medium uppercase tracking-wide text-mint">
<Target className="h-3 w-3" /> Choix de Loki · {lastDraw.matched}/{lastDraw.result.length}
</p>
<div className="flex flex-wrap gap-1">
{lastDraw.pick.map((n, i) => (
<span
key={i}
className={cn(
"flex h-6 w-6 items-center justify-center rounded-full text-[11px] font-semibold tabular-nums",
hits.has(n) ? "bg-mint text-[#0b1a14]" : "bg-muted text-muted-foreground"
)}
>
{n}
</span>
))}
</div>
</div>
) : null}
</div>
<div className="flex items-center justify-between border-t border-border/60 px-4 py-2.5 text-xs">
<span className="text-muted-foreground">
{lifetime.picksTracked > 0 ? (
<>
Loki : <span className="font-semibold text-gold">{(lifetime.winRate * 100).toFixed(0)}%</span> sur{" "}
{lifetime.picksTracked}
</>
) : (
"Archives officielles"
)}
</span>
<Link
href={`/loterie/${entry.id}`}
className="inline-flex items-center gap-1 font-medium text-gold transition-colors hover:text-gold-light"
>
<BarChart3 className="h-3.5 w-3.5" /> Statistiques
</Link>
</div>
</article>
)
}
function Ball({ n, bonus, delay, title }: { n: number; bonus?: boolean; delay: number; title?: string }) {
return (
<span
title={title}
className={cn(
"animate-ball-drop flex h-9 w-9 items-center justify-center rounded-full text-sm font-bold tabular-nums shadow-[inset_0_-3px_6px_rgba(0,0,0,0.25),inset_0_2px_4px_rgba(255,255,255,0.35)]",
bonus
? "bg-gradient-to-b from-gold-light to-gold text-primary-foreground"
: "bg-gradient-to-b from-[#fbf8f0] to-[#d9d3c3] text-[#101827]"
)}
style={{ animationDelay: `${delay}ms` }}
>
{n}
</span>
)
}
function formatDate(iso: string): string {
return new Date(iso + "T00:00:00").toLocaleDateString("fr-CA", { weekday: "long", day: "numeric", month: "long" })
}