From ad214a24ddcccaf64b3c72575e71f5f0684bd665 Mon Sep 17 00:00:00 2001 From: Nazim Kri Date: Sat, 31 Oct 2026 11:58:21 -0400 Subject: [PATCH] Landing redesign: animated hero, draw cards, how-it-works, footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- app/globals.css | 64 +++++++++++- app/layout.tsx | 6 +- app/page.tsx | 77 +++++++++------ components/count-up.tsx | 41 ++++++++ components/hero.tsx | 140 ++++++++++++++++++++------- components/how-it-works.tsx | 39 ++++++++ components/lottery-card.tsx | 127 ++++++++++++++++++++++++ components/lottery-mobile-card.tsx | 81 ---------------- components/lottery-results-panel.tsx | 52 ---------- components/lottery-row.tsx | 92 ------------------ components/lottery-strip.tsx | 4 + components/site-footer.tsx | 92 ++++++++++++++++++ lib/countries.ts | 24 ----- lib/lokilab-feed.ts | 2 + public/flags/dz.svg | 1 - public/flags/it.svg | 1 - public/flags/ma.svg | 1 - 17 files changed, 524 insertions(+), 320 deletions(-) create mode 100644 components/count-up.tsx create mode 100644 components/how-it-works.tsx create mode 100644 components/lottery-card.tsx delete mode 100644 components/lottery-mobile-card.tsx delete mode 100644 components/lottery-results-panel.tsx delete mode 100644 components/lottery-row.tsx create mode 100644 components/site-footer.tsx delete mode 100644 public/flags/dz.svg delete mode 100644 public/flags/it.svg delete mode 100644 public/flags/ma.svg diff --git a/app/globals.css b/app/globals.css index 98e2c3c..20833db 100644 --- a/app/globals.css +++ b/app/globals.css @@ -146,4 +146,66 @@ html { @apply font-sans; } -} \ No newline at end of file +} +/* ---- 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; + } +} diff --git a/app/layout.tsx b/app/layout.tsx index cfc1896..a1a7395 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -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 ( - {children} + + {children} + + ); } diff --git a/app/page.tsx b/app/page.tsx index 59669e4..9054f52 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -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 ( <> + +
-
- - -
-
- -

Derniers tirages — {theme.name}

- - {totalTracked > 0 ? `Loki : ${totalWins}/${totalTracked} grilles gagnantes` : `${lotteries.length} loteries`} - +
+
+
+

+ + Derniers tirages — {theme.name} +

+

Changez de pays en haut à droite

+ {lotteries.length > 0 ? ( - +
+ {lotteries.map((entry, i) => ( + + ))} +
) : ( -

- Les loteries de {theme.name} arrivent bientôt dans l'univers de Loki. +

+ Aucune loterie pour {theme.name} pour le moment.

)} -
+ -

- Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain. -

+
}> @@ -84,12 +97,12 @@ async function HomeContent() { function HomeSkeleton() { return ( -
-
- - +
+ +
+ +
-
) } diff --git a/components/count-up.tsx b/components/count-up.tsx new file mode 100644 index 0000000..d9da5ed --- /dev/null +++ b/components/count-up.tsx @@ -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(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 ( + + {shown.toLocaleString("fr-CA")} + + ) +} diff --git a/components/hero.tsx b/components/hero.tsx index 518bdbb..eab3d86 100644 --- a/components/hero.tsx +++ b/components/hero.tsx @@ -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 ( -
- +
+ + + +
- -
-
-

L'armée de Loki

-

- Loki lit les tirages. Suivez ses choix. -

-

- Suivez ses pronostics, grimpez au classement — gratuit. -

- -
- + {STARS.map((s, i) => ( + + ))} + +
+
+

+ L'armée de Loki +

+

+ Loki lit les tirages. +
+ + Vous suivez ses choix. + +

+

+ Résultats officiels, statistiques et pronostics de loterie au Québec, en France, aux + États-Unis, en Espagne et au Portugal. +

+ +
+ + {isAuthenticated ? "Voir le classement" : "Rejoindre l'armée — gratuit"} + + + + Derniers tirages + +
+ +
+ + + +
+
+ +
+
+ Loki salue de la main +
) } + +function HeroStat({ value, label }: { value: number; label: string }) { + return ( +
+
{label}
+
+ +
+

{label}

+
+ ) +} diff --git a/components/how-it-works.tsx b/components/how-it-works.tsx new file mode 100644 index 0000000..8891dc0 --- /dev/null +++ b/components/how-it-works.tsx @@ -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 ( +
+

+ Comment ça marche +

+
    + {STEPS.map((s, i) => ( +
  1. + {i + 1} + +

    {s.title}

    +

    {s.text}

    +
  2. + ))} +
+
+ ) +} diff --git a/components/lottery-card.tsx b/components/lottery-card.tsx new file mode 100644 index 0000000..8528e51 --- /dev/null +++ b/components/lottery-card.tsx @@ -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 ( +
+
+ + + +
+

{entry.name}

+ {lastDraw &&

{formatDate(lastDraw.date)}

} +
+ {lastDraw && ( + + )} +
+ +
+ {lastDraw ? ( +
+ {lastDraw.result.map((n, i) => ( + + ))} + {lastDraw.bonus?.map((n, i) => ( + + ))} +
+ ) : ( +

Aucun tirage disponible.

+ )} + + {lastDraw?.pick ? ( +
+

+ Choix de Loki · {lastDraw.matched}/{lastDraw.result.length} +

+
+ {lastDraw.pick.map((n, i) => ( + + {n} + + ))} +
+
+ ) : null} +
+ +
+ + {lifetime.picksTracked > 0 ? ( + <> + Loki : {(lifetime.winRate * 100).toFixed(0)}% sur{" "} + {lifetime.picksTracked} + + ) : ( + "Archives officielles" + )} + + + Statistiques + +
+
+ ) +} + +function Ball({ n, bonus, delay, title }: { n: number; bonus?: boolean; delay: number; title?: string }) { + return ( + + {n} + + ) +} + +function formatDate(iso: string): string { + return new Date(iso + "T00:00:00").toLocaleDateString("fr-CA", { weekday: "long", day: "numeric", month: "long" }) +} diff --git a/components/lottery-mobile-card.tsx b/components/lottery-mobile-card.tsx deleted file mode 100644 index c8ce73b..0000000 --- a/components/lottery-mobile-card.tsx +++ /dev/null @@ -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 ( -
-
-

- {lastDraw && ( - - )} - - {entry.name} - -

- {lifetime.picksTracked > 0 ? ( -

- - {(lifetime.winRate * 100).toFixed(0)}% - {" "} - sur {lifetime.picksTracked} -

- ) : ( -

Nouveau

- )} -
- - {lastDraw ? ( - <> -
-

- Résultat du {formatDate(lastDraw.date)} -

- -
- {lastDraw.pick ? ( -
-

- Choix pour ce tirage —{" "} - - {lastDraw.matched} / {lastDraw.result.length} - -

- -
- ) : ( -

Aucun choix pour ce tirage.

- )} - - ) : ( -

Aucun tirage disponible.

- )} -
- ) -} - -function formatDate(iso: string): string { - const d = new Date(iso + "T00:00:00") - return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" }) -} diff --git a/components/lottery-results-panel.tsx b/components/lottery-results-panel.tsx deleted file mode 100644 index 5883a31..0000000 --- a/components/lottery-results-panel.tsx +++ /dev/null @@ -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 - isAuthenticated: boolean -}) { - return ( -
-
- - Loterie - Résultat officiel - Choix de Loki - Score - Historique -
- -
- {lotteries.map((entry) => ( - - ))} -
- -
- {lotteries.map((entry) => ( - - ))} -
-
- ) -} diff --git a/components/lottery-row.tsx b/components/lottery-row.tsx deleted file mode 100644 index 786137f..0000000 --- a/components/lottery-row.tsx +++ /dev/null @@ -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 ( -
-
- {lastDraw && ( - - )} -
- -
- - {entry.name} - - {lastDraw && ( -

{formatDate(lastDraw.date)}

- )} -
- -
{lastDraw ? : }
- -
- {lastDraw?.pick ? ( - - ) : ( - Aucun choix pour ce tirage - )} -
- -
- {lastDraw?.pick ? ( - - {lastDraw.matched} / {lastDraw.result.length} - - ) : ( - - )} -
- -
- {lifetime.picksTracked > 0 ? ( - <> - - {(lifetime.winRate * 100).toFixed(0)}% - - - sur {lifetime.picksTracked} grilles - - - ) : ( - Nouveau - )} -
-
- ) -} - -function Dash() { - return — -} - -function formatDate(iso: string): string { - const d = new Date(iso + "T00:00:00") - return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" }) -} diff --git a/components/lottery-strip.tsx b/components/lottery-strip.tsx index 9945cb8..487ed14 100644 --- a/components/lottery-strip.tsx +++ b/components/lottery-strip.tsx @@ -13,6 +13,10 @@ const ICONS: Record = { 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 ( diff --git a/components/site-footer.tsx b/components/site-footer.tsx new file mode 100644 index 0000000..1c649d9 --- /dev/null +++ b/components/site-footer.tsx @@ -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 ( +
+
+
+
+ + + + LokiLoto + + +

+ Résultats officiels, statistiques et pronostics de loterie. Propulsé par LokiLab. +

+
+ + + Derniers tirages + Classement de l'armée + Rejoindre l'armée + Mon profil + + + + {COUNTRIES.map((c) => ( +
  • + {c.name} +
  • + ))} +
    + + +
  • + LokiLoto ne vend aucun billet et ne prend aucune mise. Les statistiques décrivent le passé + et ne prédisent pas les tirages. +
  • +
  • + + Jeu : aide et référence ↗ + +
  • +
    +
    + + + +
    +

    © 2026 LokiLoto · un projet LokiLab

    +

    + 18+ + Réservé aux personnes majeures +

    +
    +
    +
    + ) +} + +function FooterCol({ title, children }: { title: string; children: React.ReactNode }) { + return ( +
    +

    {title}

    +
      {children}
    +
    + ) +} + +function FooterLink({ href, children }: { href: string; children: React.ReactNode }) { + return ( +
  • + + {children} + +
  • + ) +} diff --git a/lib/countries.ts b/lib/countries.ts index 54d7abd..32dc246 100644 --- a/lib/countries.ts +++ b/lib/countries.ts @@ -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 { diff --git a/lib/lokilab-feed.ts b/lib/lokilab-feed.ts index f753f5e..49173eb 100644 --- a/lib/lokilab-feed.ts +++ b/lib/lokilab-feed.ts @@ -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 }[] } diff --git a/public/flags/dz.svg b/public/flags/dz.svg deleted file mode 100644 index fe8bb71..0000000 --- a/public/flags/dz.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/flags/it.svg b/public/flags/it.svg deleted file mode 100644 index 2eb1289..0000000 --- a/public/flags/it.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/flags/ma.svg b/public/flags/ma.svg deleted file mode 100644 index c2f0600..0000000 --- a/public/flags/ma.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file