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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user