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:
co-authored by
Claude Opus 5.5
parent
302915d888
commit
ad214a24dd
+63
-1
@@ -146,4 +146,66 @@
|
||||
html {
|
||||
@apply font-sans;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* ---- Motion ---------------------------------------------------------- */
|
||||
@keyframes loki-fade-up {
|
||||
from { opacity: 0; transform: translateY(14px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
@keyframes loki-float {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-10px); }
|
||||
}
|
||||
@keyframes loki-ball-drop {
|
||||
0% { opacity: 0; transform: translateY(-18px) scale(0.6); }
|
||||
60% { opacity: 1; transform: translateY(3px) scale(1.06); }
|
||||
100% { transform: translateY(0) scale(1); }
|
||||
}
|
||||
@keyframes loki-shimmer {
|
||||
from { transform: translateX(-120%) skewX(-20deg); }
|
||||
to { transform: translateX(220%) skewX(-20deg); }
|
||||
}
|
||||
@keyframes loki-glow {
|
||||
0%, 100% { opacity: 0.35; transform: scale(1); }
|
||||
50% { opacity: 0.6; transform: scale(1.08); }
|
||||
}
|
||||
@keyframes loki-twinkle {
|
||||
0%, 100% { opacity: 0.15; }
|
||||
50% { opacity: 0.9; }
|
||||
}
|
||||
|
||||
@utility animate-fade-up {
|
||||
animation: loki-fade-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
|
||||
}
|
||||
@utility animate-float {
|
||||
animation: loki-float 5s ease-in-out infinite;
|
||||
}
|
||||
@utility animate-ball-drop {
|
||||
animation: loki-ball-drop 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both;
|
||||
}
|
||||
@utility animate-glow {
|
||||
animation: loki-glow 4s ease-in-out infinite;
|
||||
}
|
||||
@utility animate-twinkle {
|
||||
animation: loki-twinkle 3s ease-in-out infinite;
|
||||
}
|
||||
/* Gold sweep across a button; the element needs relative + overflow-hidden. */
|
||||
@utility shimmer {
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 40%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
|
||||
animation: loki-shimmer 2.8s ease-in-out infinite;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -1,6 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Inter, Fraunces } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { SiteFooter } from "@/components/site-footer";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"], variable: "--font-sans", display: "swap" });
|
||||
const fraunces = Fraunces({
|
||||
@@ -18,7 +19,10 @@ export const metadata: Metadata = {
|
||||
export default function RootLayout({ children }: LayoutProps<"/">) {
|
||||
return (
|
||||
<html lang="fr" className={`dark ${inter.variable} ${fraunces.variable} h-full antialiased`}>
|
||||
<body className="min-h-full flex flex-col">{children}</body>
|
||||
<body className="min-h-full flex flex-col">
|
||||
{children}
|
||||
<SiteFooter />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
+45
-32
@@ -1,13 +1,14 @@
|
||||
import { Suspense } from "react"
|
||||
import { countryTheme } from "@/lib/countries"
|
||||
import { COUNTRIES, countryTheme } from "@/lib/countries"
|
||||
import { getArmyFeed } from "@/lib/lokilab-feed"
|
||||
import { getCurrentMember } from "@/lib/member-auth"
|
||||
import { listFollowedPicks } from "@/lib/follows"
|
||||
import { resolveCountry } from "@/lib/country-pref"
|
||||
import { LotteryResultsPanel } from "@/components/lottery-results-panel"
|
||||
import { AppHeader } from "@/components/app-header"
|
||||
import { LotteryStrip } from "@/components/lottery-strip"
|
||||
import { Hero } from "@/components/hero"
|
||||
import { LotteryCard } from "@/components/lottery-card"
|
||||
import { HowItWorks } from "@/components/how-it-works"
|
||||
import { SideRail } from "@/components/side-rail"
|
||||
import { Flag } from "@/components/flag"
|
||||
import { Skeleton } from "@/components/ui/skeleton"
|
||||
@@ -30,48 +31,60 @@ async function HomeContent() {
|
||||
const activeCode = await resolveCountry(member)
|
||||
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)
|
||||
const globalWins = feed.lotteries.reduce((sum, l) => sum + l.lifetime.wins, 0)
|
||||
|
||||
// EuroMillions is listed once per country; count each game's archive once.
|
||||
const uniqueGames = new Map(feed.lotteries.map((l) => [l.id, l]))
|
||||
const archived = [...uniqueGames.values()].reduce((sum, l) => sum + (l.totalDraws ?? l.recentDraws.length), 0)
|
||||
|
||||
const follows = member ? await listFollowedPicks(member.id) : []
|
||||
const followedKeys = new Set(follows.map((f) => `${f.lotteryId}:${f.targetDrawDate}`))
|
||||
|
||||
return (
|
||||
<>
|
||||
<LotteryStrip lotteries={lotteries} />
|
||||
<Hero
|
||||
isAuthenticated={!!member}
|
||||
draws={archived}
|
||||
lotteries={uniqueGames.size}
|
||||
countries={COUNTRIES.length}
|
||||
/>
|
||||
|
||||
<div
|
||||
style={{ "--accent": theme.accent, "--accent-soft": theme.accentSoft } as React.CSSProperties}
|
||||
className="mx-auto grid w-full max-w-6xl flex-1 grid-cols-1 gap-4 px-4 py-4 sm:px-6 lg:grid-cols-[1fr_300px]"
|
||||
className="mx-auto grid w-full max-w-6xl flex-1 grid-cols-1 gap-6 px-4 py-8 sm:px-6 lg:grid-cols-[1fr_300px]"
|
||||
>
|
||||
<div className="min-w-0 space-y-4">
|
||||
<Hero isAuthenticated={!!member} />
|
||||
|
||||
<div className="overflow-hidden rounded-lg border border-border bg-card">
|
||||
<div className="flex items-center gap-2.5 border-b border-border bg-[#0b111d] px-4 py-2.5">
|
||||
<Flag code={theme.code} />
|
||||
<h2 className="text-sm font-semibold">Derniers tirages — {theme.name}</h2>
|
||||
<span className="ml-auto text-xs text-muted-foreground">
|
||||
{totalTracked > 0 ? `Loki : ${totalWins}/${totalTracked} grilles gagnantes` : `${lotteries.length} loteries`}
|
||||
</span>
|
||||
<div className="min-w-0 space-y-6">
|
||||
<section id="tirages" aria-labelledby="tirages-title" className="scroll-mt-28">
|
||||
<div className="mb-4 flex flex-wrap items-end justify-between gap-2">
|
||||
<h2 id="tirages-title" className="flex items-center gap-2.5 font-display text-2xl">
|
||||
<Flag code={theme.code} className="h-[18px] w-[27px]" />
|
||||
Derniers tirages — {theme.name}
|
||||
</h2>
|
||||
<p className="text-xs text-muted-foreground">Changez de pays en haut à droite</p>
|
||||
</div>
|
||||
|
||||
{lotteries.length > 0 ? (
|
||||
<LotteryResultsPanel
|
||||
lotteries={lotteries}
|
||||
country={activeCode}
|
||||
followedKeys={followedKeys}
|
||||
isAuthenticated={!!member}
|
||||
/>
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
{lotteries.map((entry, i) => (
|
||||
<LotteryCard
|
||||
key={entry.id}
|
||||
entry={entry}
|
||||
index={i}
|
||||
country={activeCode}
|
||||
isAuthenticated={!!member}
|
||||
isFollowing={entry.lastDraw ? followedKeys.has(`${entry.id}:${entry.lastDraw.date}`) : false}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p className="py-14 text-center text-sm text-muted-foreground">
|
||||
Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki.
|
||||
<p className="rounded-xl border border-dashed border-border py-14 text-center text-sm text-muted-foreground">
|
||||
Aucune loterie pour {theme.name} pour le moment.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<p className="text-[11px] text-muted-foreground">
|
||||
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
|
||||
</p>
|
||||
<HowItWorks />
|
||||
</div>
|
||||
|
||||
<Suspense fallback={<Skeleton className="h-72 w-full" />}>
|
||||
@@ -84,12 +97,12 @@ async function HomeContent() {
|
||||
|
||||
function HomeSkeleton() {
|
||||
return (
|
||||
<div className="mx-auto grid w-full max-w-6xl grid-cols-1 gap-4 px-4 py-4 sm:px-6 lg:grid-cols-[1fr_300px]">
|
||||
<div className="space-y-4">
|
||||
<Skeleton className="h-44 w-full" />
|
||||
<Skeleton className="h-80 w-full" />
|
||||
<div className="mx-auto w-full max-w-6xl space-y-4 px-4 py-6 sm:px-6">
|
||||
<Skeleton className="h-[420px] w-full" />
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Skeleton className="h-52" />
|
||||
<Skeleton className="h-52" />
|
||||
</div>
|
||||
<Skeleton className="h-72 w-full" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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
@@ -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'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'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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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" })
|
||||
}
|
||||
@@ -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" })
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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" })
|
||||
}
|
||||
@@ -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 (
|
||||
|
||||
@@ -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'armée</FooterLink>
|
||||
<FooterLink href="/connexion?mode=inscription">Rejoindre l'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>
|
||||
)
|
||||
}
|
||||
@@ -51,14 +51,6 @@ export const COUNTRIES: CountryTheme[] = [
|
||||
accent: 'oklch(0.76 0.16 89.6)',
|
||||
accentSoft: 'oklch(0.76 0.16 89.6 / 14%)',
|
||||
},
|
||||
{
|
||||
code: 'IT',
|
||||
name: 'Italie',
|
||||
flagPrimary: '#009246',
|
||||
flagSecondary: '#CE2B37',
|
||||
accent: 'oklch(0.65 0.15 151.1)',
|
||||
accentSoft: 'oklch(0.65 0.15 151.1 / 14%)',
|
||||
},
|
||||
{
|
||||
code: 'PT',
|
||||
name: 'Portugal',
|
||||
@@ -67,22 +59,6 @@ export const COUNTRIES: CountryTheme[] = [
|
||||
accent: 'oklch(0.63 0.14 153.6)',
|
||||
accentSoft: 'oklch(0.63 0.14 153.6 / 14%)',
|
||||
},
|
||||
{
|
||||
code: 'DZ',
|
||||
name: 'Algérie',
|
||||
flagPrimary: '#006233',
|
||||
flagSecondary: '#D21034',
|
||||
accent: 'oklch(0.6 0.13 153.7)',
|
||||
accentSoft: 'oklch(0.6 0.13 153.7 / 14%)',
|
||||
},
|
||||
{
|
||||
code: 'MA',
|
||||
name: 'Maroc',
|
||||
flagPrimary: '#C1272D',
|
||||
flagSecondary: '#006233',
|
||||
accent: 'oklch(0.58 0.19 25)',
|
||||
accentSoft: 'oklch(0.58 0.19 25 / 14%)',
|
||||
},
|
||||
]
|
||||
|
||||
export function countryTheme(code: string): CountryTheme {
|
||||
|
||||
@@ -34,6 +34,8 @@ export interface LotteryFeedEntry {
|
||||
} | null
|
||||
/** Last ~30 official draws (date + result only), newest first. */
|
||||
recentDraws: { date: string; result: number[]; bonus?: number[]; pick: number[] | null }[]
|
||||
/** Full archive size in LokiLab (recentDraws is capped at 30). */
|
||||
totalDraws?: number
|
||||
/** Loki's resolved picks over time (date + won), oldest first. */
|
||||
pickHistory: { date: string; won: boolean }[]
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#41662E" d="M0 0h513v342H0z"/><path fill="#FFF" d="M256.5 0H513v342H256.5z"/><g fill="#D80027"><path d="m341.5 105.3-29.4 40.4-47.5-15.4 29.4 40.4-29.4 40.4 47.5-15.4 29.4 40.4v-50l47.5-15.5-47.5-15.4z"/><path d="M309.9 276.7c-58.5 0-106-47.5-106-106s47.5-106 106-106c18.3 0 35.4 4.6 50.4 12.7-23.5-23-55.7-37.2-91.2-37.2-72 0-130.4 58.4-130.4 130.4S197.1 301 269.1 301c35.5 0 67.7-14.2 91.2-37.2-14.9 8.2-32.1 12.9-50.4 12.9z"/></g></svg>
|
||||
|
Before Width: | Height: | Size: 513 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#F4F5F0" d="M342 0H0v341.3h512V0z"/><path fill="#008C45" d="M0 0h171v342H0z"/><path fill="#CD212A" d="M342 0h171v342H342z"/></svg>
|
||||
|
Before Width: | Height: | Size: 204 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 513 342"><path fill="#d12a46" d="M0 .3V342h513V.3z"/><path fill="#316525" d="M359.8 148.9h-73.3l-22.7-69.7-22.7 69.7h-73.3l59.3 43.1-22.7 69.7 59.3-43.1 59.3 43.1-22.5-69.7 59.3-43.1zm-116.1 37.7 7.7-23.6h24.8l7.7 23.6-20.1 14.6-20.1-14.6zm27.9-37.7H256l7.8-24 7.8 24zm24.3 29-4.8-14.9h25.3l-20.5 14.9zM236.6 163l-4.8 14.9-20.5-14.9h25.3zm-5.3 61.8 7.8-24 12.6 9.2-20.4 14.8zm44.5-14.9 12.6-9.2 7.8 24-20.4-14.8z"/></svg>
|
||||
|
Before Width: | Height: | Size: 474 B |
Reference in New Issue
Block a user