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
+41
View File
@@ -0,0 +1,41 @@
"use client"
import { useEffect, useRef, useState } from "react"
/** Counts from 0 to `value` once it scrolls into view. */
export function CountUp({ value, duration = 1400 }: { value: number; duration?: number }) {
const [shown, setShown] = useState(0)
const ref = useRef<HTMLSpanElement>(null)
useEffect(() => {
const el = ref.current
if (!el) return
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
setShown(value)
return
}
let frame = 0
const observer = new IntersectionObserver(([entry]) => {
if (!entry.isIntersecting) return
observer.disconnect()
const start = performance.now()
const tick = (now: number) => {
const t = Math.min(1, (now - start) / duration)
setShown(Math.round(value * (1 - Math.pow(1 - t, 3))))
if (t < 1) frame = requestAnimationFrame(tick)
}
frame = requestAnimationFrame(tick)
})
observer.observe(el)
return () => {
observer.disconnect()
cancelAnimationFrame(frame)
}
}, [value, duration])
return (
<span ref={ref} className="tabular-nums">
{shown.toLocaleString("fr-CA")}
</span>
)
}
+106 -34
View File
@@ -1,44 +1,116 @@
import Image from "next/image"
import Link from "next/link"
import { Button } from "@/components/ui/button"
import { ArrowRight, Sparkles } from "lucide-react"
import { CountUp } from "@/components/count-up"
/** Compact promo banner, 1xbet-style: short, wide, one message and one CTA — data stays above the fold. */
export function Hero({ isAuthenticated }: { isAuthenticated: boolean }) {
const STARS = [
{ top: "12%", left: "48%", delay: "0s" },
{ top: "22%", left: "62%", delay: "1.1s" },
{ top: "8%", left: "72%", delay: "0.5s" },
{ top: "30%", left: "54%", delay: "1.8s" },
{ top: "16%", left: "88%", delay: "0.8s" },
{ top: "40%", left: "92%", delay: "2.2s" },
]
export function Hero({
isAuthenticated,
draws,
lotteries,
countries,
}: {
isAuthenticated: boolean
draws: number
lotteries: number
countries: number
}) {
return (
<section className="relative isolate overflow-hidden rounded-lg border border-gold/25">
<img
src="/lokilab/backgrounds/observatory-desktop.webp"
alt=""
aria-hidden="true"
className="absolute inset-0 -z-20 h-full w-full object-cover object-[center_35%]"
/>
<section className="relative isolate overflow-hidden border-b border-border">
<picture className="absolute inset-0 -z-20">
<source media="(max-width: 767px)" srcSet="/lokilab/backgrounds/observatory-mobile.webp" />
<img src="/lokilab/backgrounds/observatory-desktop.webp" alt="" aria-hidden="true" className="h-full w-full object-cover" />
</picture>
<div className="absolute inset-0 -z-10 bg-gradient-to-r from-background via-background/85 to-background/20" />
<div className="flex min-h-[176px] items-center justify-between gap-4 pl-5 sm:pl-8">
<div className="py-5">
<p className="text-[11px] font-semibold uppercase tracking-[0.2em] text-mint">L&apos;armée de Loki</p>
<h1 className="mt-1.5 font-display text-2xl leading-tight sm:text-3xl">
Loki lit les tirages. <span className="text-gold">Suivez ses choix.</span>
</h1>
<p className="mt-1.5 max-w-md text-sm text-muted-foreground">
Suivez ses pronostics, grimpez au classement — gratuit.
</p>
<Button asChild size="sm" className="mt-3.5 h-9 px-5 font-semibold">
<Link href={isAuthenticated ? "/classement" : "/connexion?mode=inscription"}>
{isAuthenticated ? "Voir le classement" : "Rejoindre l'armée"}
</Link>
</Button>
</div>
<Image
src="/lokilab/mascots/loki-welcome-320.webp"
alt=""
aria-hidden="true"
width={320}
height={480}
priority
className="hidden h-[176px] w-auto self-end object-cover object-top sm:block sm:mr-6"
<div className="absolute inset-x-0 bottom-0 -z-10 h-24 bg-gradient-to-t from-background to-transparent" />
{STARS.map((s, i) => (
<span
key={i}
aria-hidden
className="animate-twinkle absolute -z-10 h-1 w-1 rounded-full bg-gold-light shadow-[0_0_8px_2px_rgba(255,227,163,0.7)]"
style={{ top: s.top, left: s.left, animationDelay: s.delay }}
/>
))}
<div className="mx-auto grid max-w-6xl grid-cols-1 items-center gap-4 px-4 sm:px-6 md:grid-cols-[1.15fr_0.85fr]">
<div className="py-10 md:py-14">
<p className="animate-fade-up inline-flex items-center gap-1.5 rounded-full border border-mint/30 bg-mint/10 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.18em] text-mint">
<Sparkles className="h-3 w-3" /> L&apos;armée de Loki
</p>
<h1
className="animate-fade-up mt-4 font-display text-4xl leading-[1.08] sm:text-5xl"
style={{ animationDelay: "120ms" }}
>
Loki lit les tirages.
<br />
<span className="bg-gradient-to-r from-gold-light via-gold to-gold-light bg-clip-text text-transparent">
Vous suivez ses choix.
</span>
</h1>
<p
className="animate-fade-up mt-4 max-w-md text-[15px] leading-relaxed text-muted-foreground"
style={{ animationDelay: "240ms" }}
>
Résultats officiels, statistiques et pronostics de loterie au Québec, en France, aux
États-Unis, en Espagne et au Portugal.
</p>
<div className="animate-fade-up mt-6 flex flex-wrap items-center gap-3" style={{ animationDelay: "360ms" }}>
<Link
href={isAuthenticated ? "/classement" : "/connexion?mode=inscription"}
className="shimmer relative inline-flex h-11 items-center gap-2 overflow-hidden rounded-md bg-gold px-6 text-sm font-semibold text-primary-foreground shadow-[0_0_28px_rgba(244,199,107,0.35)] transition-transform hover:-translate-y-0.5"
>
{isAuthenticated ? "Voir le classement" : "Rejoindre l'armée — gratuit"}
<ArrowRight className="h-4 w-4" />
</Link>
<a
href="#tirages"
className="inline-flex h-11 items-center rounded-md border border-gold/30 bg-background/40 px-5 text-sm font-medium backdrop-blur transition-colors hover:bg-gold/10"
>
Derniers tirages
</a>
</div>
<dl className="animate-fade-up mt-8 flex gap-8" style={{ animationDelay: "480ms" }}>
<HeroStat value={draws} label="tirages archivés" />
<HeroStat value={lotteries} label="loteries" />
<HeroStat value={countries} label="pays" />
</dl>
</div>
<div className="relative hidden h-full items-end justify-center md:flex">
<div className="animate-glow absolute bottom-16 h-72 w-72 rounded-full bg-gold/25 blur-3xl" />
<Image
src="/lokilab/mascots/loki-welcome.webp"
alt="Loki salue de la main"
width={640}
height={960}
priority
sizes="400px"
className="animate-float relative h-[420px] w-auto drop-shadow-[0_24px_40px_rgba(0,0,0,0.6)]"
/>
</div>
</div>
</section>
)
}
function HeroStat({ value, label }: { value: number; label: string }) {
return (
<div>
<dt className="sr-only">{label}</dt>
<dd className="font-display text-3xl leading-none text-gold">
<CountUp value={value} />
</dd>
<p className="mt-1 text-xs text-muted-foreground">{label}</p>
</div>
)
}
+39
View File
@@ -0,0 +1,39 @@
import { BarChart3, Star, Trophy } from "lucide-react"
const STEPS = [
{
icon: BarChart3,
title: "Loki analyse",
text: "Chaque tirage officiel est archivé et passé au crible : fréquences, retards, séries.",
},
{
icon: Star,
title: "Vous suivez",
text: "Marquez d'une étoile les choix de Loki qui vous inspirent, gratuitement.",
},
{
icon: Trophy,
title: "L'armée grimpe",
text: "Chaque tirage résolu fait bouger le classement des membres qui suivent Loki.",
},
]
export function HowItWorks() {
return (
<section aria-labelledby="how" className="rounded-xl border border-border bg-card/60 p-5 sm:p-6">
<h2 id="how" className="font-display text-xl">
Comment ça marche
</h2>
<ol className="mt-4 grid gap-4 sm:grid-cols-3">
{STEPS.map((s, i) => (
<li key={s.title} className="relative rounded-lg border border-border/60 bg-background/40 p-4">
<span className="absolute -top-2.5 right-3 font-display text-3xl text-gold/20">{i + 1}</span>
<s.icon className="h-5 w-5 text-gold" />
<h3 className="mt-2 text-sm font-semibold">{s.title}</h3>
<p className="mt-1 text-xs leading-relaxed text-muted-foreground">{s.text}</p>
</li>
))}
</ol>
</section>
)
}
+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" })
}
-81
View File
@@ -1,81 +0,0 @@
import Link from "next/link"
import { NumberSequence } from "@/components/number-sequence"
import { FollowButton } from "@/components/follow-button"
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
export function LotteryMobileCard({
entry,
country,
isFollowing,
isAuthenticated,
}: {
entry: LotteryFeedEntry
country: string
isFollowing: boolean
isAuthenticated: boolean
}) {
const { lifetime, lastDraw } = entry
const resultSet = new Set(lastDraw?.result ?? [])
return (
<div className="space-y-2.5 border-b border-border/60 p-3 last:border-b-0">
<div className="flex items-center justify-between">
<p className="flex items-center gap-1.5 font-semibold">
{lastDraw && (
<FollowButton
lotteryId={entry.id}
country={country}
targetDrawDate={lastDraw.date}
initialFollowing={isFollowing}
isAuthenticated={isAuthenticated}
/>
)}
<Link href={`/loterie/${entry.id}`} className="hover:text-accent hover:underline">
{entry.name}
</Link>
</p>
{lifetime.picksTracked > 0 ? (
<p className="text-xs text-muted-foreground">
<span className="font-semibold text-foreground tabular-nums">
{(lifetime.winRate * 100).toFixed(0)}%
</span>{" "}
sur {lifetime.picksTracked}
</p>
) : (
<p className="text-xs text-muted-foreground">Nouveau</p>
)}
</div>
{lastDraw ? (
<>
<div>
<p className="mb-1 text-xs text-muted-foreground">
Résultat du {formatDate(lastDraw.date)}
</p>
<NumberSequence numbers={lastDraw.result} bonus={lastDraw.bonus} bonusLabel={entry.bonusLabel} />
</div>
{lastDraw.pick ? (
<div>
<p className="mb-1 text-xs text-muted-foreground">
Choix pour ce tirage —{" "}
<span className={lastDraw.won ? "font-semibold text-success" : ""}>
{lastDraw.matched} / {lastDraw.result.length}
</span>
</p>
<NumberSequence numbers={lastDraw.pick} hitSet={resultSet} />
</div>
) : (
<p className="text-xs text-muted-foreground">Aucun choix pour ce tirage.</p>
)}
</>
) : (
<p className="text-xs text-muted-foreground">Aucun tirage disponible.</p>
)}
</div>
)
}
function formatDate(iso: string): string {
const d = new Date(iso + "T00:00:00")
return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" })
}
-52
View File
@@ -1,52 +0,0 @@
import { LotteryRow } from "@/components/lottery-row"
import { LotteryMobileCard } from "@/components/lottery-mobile-card"
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
export function LotteryResultsPanel({
lotteries,
country,
followedKeys,
isAuthenticated,
}: {
lotteries: LotteryFeedEntry[]
country: string
followedKeys: Set<string>
isAuthenticated: boolean
}) {
return (
<div>
<div className="hidden sm:grid grid-cols-[28px_160px_1fr_1fr_72px_120px] gap-3 border-b border-border/60 px-3 py-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
<span />
<span>Loterie</span>
<span>Résultat officiel</span>
<span>Choix de Loki</span>
<span className="text-right">Score</span>
<span className="text-right">Historique</span>
</div>
<div className="hidden sm:block">
{lotteries.map((entry) => (
<LotteryRow
key={entry.id}
entry={entry}
country={country}
isFollowing={entry.lastDraw ? followedKeys.has(`${entry.id}:${entry.lastDraw.date}`) : false}
isAuthenticated={isAuthenticated}
/>
))}
</div>
<div className="sm:hidden">
{lotteries.map((entry) => (
<LotteryMobileCard
key={entry.id}
entry={entry}
country={country}
isFollowing={entry.lastDraw ? followedKeys.has(`${entry.id}:${entry.lastDraw.date}`) : false}
isAuthenticated={isAuthenticated}
/>
))}
</div>
</div>
)
}
-92
View File
@@ -1,92 +0,0 @@
import Link from "next/link"
import { NumberSequence } from "@/components/number-sequence"
import { FollowButton } from "@/components/follow-button"
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
export function LotteryRow({
entry,
country,
isFollowing,
isAuthenticated,
}: {
entry: LotteryFeedEntry
country: string
isFollowing: boolean
isAuthenticated: boolean
}) {
const { lifetime, lastDraw } = entry
const resultSet = new Set(lastDraw?.result ?? [])
return (
<div className="grid grid-cols-[28px_160px_1fr_1fr_72px_120px] items-center gap-3 border-b border-border/60 px-3 py-3 text-sm last:border-b-0 hover:bg-panel-hover/40">
<div>
{lastDraw && (
<FollowButton
lotteryId={entry.id}
country={country}
targetDrawDate={lastDraw.date}
initialFollowing={isFollowing}
isAuthenticated={isAuthenticated}
/>
)}
</div>
<div className="min-w-0">
<Link
href={`/loterie/${entry.id}`}
className="block truncate font-semibold leading-tight hover:text-accent hover:underline"
title={entry.name}
>
{entry.name}
</Link>
{lastDraw && (
<p className="text-xs text-muted-foreground">{formatDate(lastDraw.date)}</p>
)}
</div>
<div>{lastDraw ? <NumberSequence numbers={lastDraw.result} bonus={lastDraw.bonus} bonusLabel={entry.bonusLabel} /> : <Dash />}</div>
<div>
{lastDraw?.pick ? (
<NumberSequence numbers={lastDraw.pick} hitSet={resultSet} />
) : (
<span className="text-xs text-muted-foreground">Aucun choix pour ce tirage</span>
)}
</div>
<div className="text-right tabular-nums">
{lastDraw?.pick ? (
<span className={lastDraw.won ? "font-semibold text-success" : "text-foreground"}>
{lastDraw.matched} / {lastDraw.result.length}
</span>
) : (
<Dash />
)}
</div>
<div className="text-right">
{lifetime.picksTracked > 0 ? (
<>
<span className="font-semibold tabular-nums">
{(lifetime.winRate * 100).toFixed(0)}%
</span>
<span className="ml-1 text-xs text-muted-foreground">
sur {lifetime.picksTracked} grilles
</span>
</>
) : (
<span className="text-xs text-muted-foreground">Nouveau</span>
)}
</div>
</div>
)
}
function Dash() {
return <span className="text-muted-foreground">—</span>
}
function formatDate(iso: string): string {
const d = new Date(iso + "T00:00:00")
return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" })
}
+4
View File
@@ -13,6 +13,10 @@ const ICONS: Record<string, LucideIcon> = {
euromillions: Sparkles,
}
export function lotteryIcon(id: string): LucideIcon {
return ICONS[id] ?? Dices
}
/** Horizontal icon strip under the header — the 1xbet sports-strip pattern, one tile per lottery. */
export function LotteryStrip({ lotteries, activeId }: { lotteries: LotteryFeedEntry[]; activeId?: string }) {
return (
+92
View File
@@ -0,0 +1,92 @@
import Image from "next/image"
import Link from "next/link"
import { COUNTRIES } from "@/lib/countries"
import { Flag } from "@/components/flag"
export function SiteFooter() {
return (
<footer className="mt-auto border-t border-border bg-[#0b111d]">
<div className="mx-auto max-w-6xl px-4 pt-10 pb-6 sm:px-6">
<div className="grid gap-8 sm:grid-cols-2 lg:grid-cols-4">
<div className="lg:col-span-1">
<Link href="/" className="inline-flex items-center gap-2.5">
<Image src="/lokilab/ui/loki-mark.svg" alt="" aria-hidden="true" width={34} height={34} />
<span className="font-display text-xl">
Loki<span className="text-gold">Loto</span>
</span>
</Link>
<p className="mt-3 text-sm leading-relaxed text-muted-foreground">
Résultats officiels, statistiques et pronostics de loterie. Propulsé par LokiLab.
</p>
</div>
<FooterCol title="Explorer">
<FooterLink href="/">Derniers tirages</FooterLink>
<FooterLink href="/classement">Classement de l&apos;armée</FooterLink>
<FooterLink href="/connexion?mode=inscription">Rejoindre l&apos;armée</FooterLink>
<FooterLink href="/profil">Mon profil</FooterLink>
</FooterCol>
<FooterCol title="Pays couverts">
{COUNTRIES.map((c) => (
<li key={c.code} className="flex items-center gap-2 text-sm text-muted-foreground">
<Flag code={c.code} /> {c.name}
</li>
))}
</FooterCol>
<FooterCol title="Jouer responsable">
<li className="text-sm leading-relaxed text-muted-foreground">
LokiLoto ne vend aucun billet et ne prend aucune mise. Les statistiques décrivent le passé
et ne prédisent pas les tirages.
</li>
<li>
<a
href="https://www.jeu-aidereference.qc.ca"
target="_blank"
rel="noopener noreferrer"
className="text-sm text-gold hover:text-gold-light"
>
Jeu : aide et référence ↗
</a>
</li>
</FooterCol>
</div>
<img
src="/lokilab/ui/rune-divider.svg"
alt=""
aria-hidden="true"
className="mx-auto my-8 h-4 w-full max-w-md opacity-60"
/>
<div className="flex flex-col items-center justify-between gap-3 text-xs text-muted-foreground sm:flex-row">
<p>© 2026 LokiLoto · un projet LokiLab</p>
<p className="flex items-center gap-2">
<span className="rounded border border-destructive/60 px-1.5 py-0.5 font-semibold text-destructive">18+</span>
Réservé aux personnes majeures
</p>
</div>
</div>
</footer>
)
}
function FooterCol({ title, children }: { title: string; children: React.ReactNode }) {
return (
<div>
<h2 className="mb-3 text-xs font-semibold uppercase tracking-[0.15em] text-gold">{title}</h2>
<ul className="space-y-2">{children}</ul>
</div>
)
}
function FooterLink({ href, children }: { href: string; children: React.ReactNode }) {
return (
<li>
<Link href={href} className="text-sm text-muted-foreground transition-colors hover:text-foreground">
{children}
</Link>
</li>
)
}