Restructure navigation after 1xbet: utility bar, lottery strip, right rail

User feedback: still ugly, the 1xbet navigation was never actually
reproduced. Now follows its structure:
- thin utility bar on top (country picker, Connexion + Inscription)
  above the main bar (logo, nav)
- horizontal icon strip of the country's lotteries under the header,
  with the active one underlined in gold
- compact promo banner instead of a full-height hero, so results stay
  above the fold
- right rail in the bet-slip position: top-5 leaderboard and army stats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nazim Kri
2026-10-30 15:41:16 -04:00
co-authored by Claude Opus 5.5
parent e97b2e54ad
commit 9996f7b823
11 changed files with 233 additions and 158 deletions
+23 -14
View File
@@ -9,13 +9,31 @@ import { resolveCountry } from "@/lib/country-pref"
async function CountrySlot() {
const member = await getCurrentMember()
return <CountrySwitcher active={await resolveCountry(member)} />
return <CountrySwitcher active={await resolveCountry(member)} compact />
}
/** Two stacked bars, 1xbet-style: a thin utility bar (country, auth), then the main bar (logo, nav). */
export function AppHeader() {
return (
<div className="sticky top-0 z-30 h-14 border-b border-border bg-background/85 backdrop-blur">
<div className="mx-auto flex h-full max-w-6xl items-center gap-6 px-4 sm:px-6">
<header className="sticky top-0 z-30 border-b border-border bg-background/95 backdrop-blur">
<div className="border-b border-border/60 bg-[#0b111d]">
<div className="mx-auto flex h-9 max-w-6xl items-center px-4 text-xs sm:px-6">
<p className="hidden text-muted-foreground md:block">
Pronostics &amp; statistiques de loterie — l&apos;univers de Loki
</p>
<div className="ml-auto flex items-center gap-2.5">
<Suspense fallback={<Skeleton className="h-7 w-24 rounded" />}>
<CountrySlot />
</Suspense>
<span aria-hidden className="h-4 w-px bg-border" />
<Suspense fallback={<Skeleton className="h-7 w-32 rounded" />}>
<UserMenu />
</Suspense>
</div>
</div>
</div>
<div className="mx-auto flex h-14 max-w-6xl items-center gap-7 px-4 sm:px-6">
<Link href="/" className="flex shrink-0 items-center gap-2.5">
<Image src="/lokilab/ui/loki-mark.svg" alt="" aria-hidden="true" width={30} height={30} />
<span className="font-display text-xl text-foreground">
@@ -23,7 +41,7 @@ export function AppHeader() {
</span>
</Link>
<nav className="hidden items-center gap-5 text-sm text-muted-foreground sm:flex">
<nav className="flex items-center gap-5 text-sm font-medium text-muted-foreground">
<Link href="/" className="transition-colors hover:text-gold">
Résultats
</Link>
@@ -31,16 +49,7 @@ export function AppHeader() {
Classement
</Link>
</nav>
<div className="ml-auto flex items-center gap-3">
<Suspense fallback={<Skeleton className="h-9 w-28 rounded-md" />}>
<CountrySlot />
</Suspense>
<Suspense fallback={<Skeleton className="h-8 w-8 rounded-full" />}>
<UserMenu />
</Suspense>
</div>
</div>
</div>
</header>
)
}
+5 -2
View File
@@ -16,7 +16,7 @@ import {
import { cn } from "@/lib/utils"
import { Flag } from "@/components/flag"
export function CountrySwitcher({ active }: { active: string }) {
export function CountrySwitcher({ active, compact }: { active: string; compact?: boolean }) {
const router = useRouter()
const [pending, startTransition] = useTransition()
const current = countryTheme(active)
@@ -34,7 +34,10 @@ export function CountrySwitcher({ active }: { active: string }) {
<DropdownMenuTrigger
aria-label={`Pays : ${current.name}. Changer de pays`}
className={cn(
"flex h-9 items-center gap-2 rounded-md border border-gold/30 bg-card/70 px-3 text-sm font-medium outline-none transition-colors hover:border-gold/60 focus-visible:ring-2 focus-visible:ring-ring",
"flex items-center gap-2 rounded border font-medium outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
compact
? "h-7 border-transparent px-2 text-xs hover:bg-panel-hover"
: "h-9 border-gold/30 bg-card/70 px-3 text-sm hover:border-gold/60",
pending && "opacity-60"
)}
>
+32 -80
View File
@@ -1,92 +1,44 @@
import Image from "next/image"
import Link from "next/link"
import { Users, Trophy, Globe } from "lucide-react"
import { Button } from "@/components/ui/button"
export function Hero({
armyTotal,
countryCount,
totalWins,
isAuthenticated,
}: {
armyTotal: number
countryCount: number
totalWins: number
isAuthenticated: boolean
}) {
/** Compact promo banner, 1xbet-style: short, wide, one message and one CTA — data stays above the fold. */
export function Hero({ isAuthenticated }: { isAuthenticated: boolean }) {
return (
<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"
<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%]"
/>
<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"
className="h-full w-full object-cover"
width={320}
height={480}
priority
className="hidden h-[176px] w-auto self-end object-cover object-top sm:block sm:mr-6"
/>
</picture>
<div className="absolute inset-0 -z-10 bg-gradient-to-r from-background via-background/80 to-background/10" />
<div className="absolute inset-x-0 bottom-0 -z-10 h-40 bg-gradient-to-t from-background to-transparent" />
<div className="mx-auto grid min-h-[600px] max-w-6xl grid-cols-1 items-end gap-4 px-4 pt-10 sm:px-6 md:grid-cols-[1.1fr_0.9fr] md:items-center md:pt-0">
<div className="pb-4 md:py-16">
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-mint">L&apos;armée de Loki</p>
<h1 className="mt-3 font-display text-4xl leading-[1.08] text-foreground sm:text-5xl lg:text-6xl">
Loki lit les tirages.
<br />
<span className="text-gold">Vous décidez de le suivre.</span>
</h1>
<p className="mt-5 max-w-md text-base leading-relaxed text-muted-foreground">
Résultats, statistiques et pronostics de loterie, pays par pays. Rejoignez l&apos;armée,
suivez les choix de Loki et grimpez au classement.
</p>
<div className="mt-7 flex flex-wrap items-center gap-3">
{!isAuthenticated && (
<Button asChild size="lg" className="h-11 px-6 font-semibold shadow-[0_0_24px_rgba(244,199,107,0.35)]">
<Link href="/connexion">Rejoindre l&apos;armée</Link>
</Button>
)}
<Button
asChild
variant="outline"
size="lg"
className="h-11 border-gold/40 bg-background/40 px-6 backdrop-blur hover:bg-gold/10"
>
<Link href="/classement">Voir le classement</Link>
</Button>
</div>
<div className="mt-10 grid max-w-lg grid-cols-3 gap-3">
<HeroStat icon={Users} value={armyTotal.toLocaleString("fr-CA")} label="Membres" />
<HeroStat icon={Globe} value={countryCount.toString()} label="Pays" />
<HeroStat icon={Trophy} value={totalWins.toString()} label="Grilles gagnées" />
</div>
</div>
<div className="relative flex justify-center md:justify-end">
<div className="absolute bottom-10 h-64 w-64 rounded-full bg-gold/20 blur-3xl" />
<Image
src="/lokilab/mascots/loki-welcome.webp"
alt="Loki, la mascotte de LokiLoto, salue de la main"
width={640}
height={960}
priority
sizes="(max-width: 767px) 260px, 420px"
className="relative h-[340px] w-auto drop-shadow-[0_20px_40px_rgba(0,0,0,0.6)] md:h-[560px]"
/>
</div>
</div>
</section>
)
}
function HeroStat({ icon: Icon, value, label }: { icon: typeof Users; value: string; label: string }) {
return (
<div className="rounded-lg border border-gold/20 bg-card/60 px-3 py-3 backdrop-blur">
<Icon className="h-4 w-4 text-gold" />
<p className="mt-2 font-display text-2xl leading-none text-foreground tabular-nums">{value}</p>
<p className="mt-1 text-[11px] text-muted-foreground">{label}</p>
</div>
)
}
+2 -2
View File
@@ -14,8 +14,8 @@ export function LotteryResultsPanel({
isAuthenticated: boolean
}) {
return (
<div className="overflow-hidden rounded-md border border-border/60 bg-panel">
<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-xs font-medium uppercase tracking-wide text-muted-foreground">
<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>
+62
View File
@@ -0,0 +1,62 @@
import Link from "next/link"
import { Clover, Crown, Dices, Gem, LayoutGrid, type LucideIcon } from "lucide-react"
import { cn } from "@/lib/utils"
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
const ICONS: Record<string, LucideIcon> = {
"lotto-max": Crown,
"lotto-649": Clover,
"daily-grand": Gem,
}
/** 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 (
<div className="border-b border-border bg-card/70">
<div className="mx-auto flex max-w-6xl items-stretch overflow-x-auto px-2 sm:px-4 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
<StripItem href="/" icon={LayoutGrid} label="Tous" active={!activeId} />
{lotteries.map((l) => (
<StripItem
key={l.id}
href={`/loterie/${l.id}`}
icon={ICONS[l.id] ?? Dices}
label={shortName(l.name)}
active={activeId === l.id}
/>
))}
</div>
</div>
)
}
function StripItem({
href,
icon: Icon,
label,
active,
}: {
href: string
icon: LucideIcon
label: string
active?: boolean
}) {
return (
<Link
href={href}
aria-current={active ? "page" : undefined}
className={cn(
"flex w-[86px] shrink-0 flex-col items-center gap-1.5 border-b-2 px-2 pb-2.5 pt-3 text-center transition-colors",
active
? "border-gold bg-gold/5 text-gold"
: "border-transparent text-muted-foreground hover:bg-panel-hover/50 hover:text-foreground"
)}
>
<Icon className="h-5 w-5" />
<span className="w-full truncate text-[11px] leading-tight">{label}</span>
</Link>
)
}
function shortName(name: string) {
return name.replace(" (Daily Grand)", "").replace("Quotidienne ", "Quot. ")
}
+2 -2
View File
@@ -9,8 +9,8 @@ import { cn } from "@/lib/utils"
const INITIAL: MemberAuthState = { ok: false, message: "" }
export function MemberAuthForm({ next }: { next: string }) {
const [mode, setMode] = useState<"login" | "signup">("login")
export function MemberAuthForm({ next, initialMode = "login" }: { next: string; initialMode?: "login" | "signup" }) {
const [mode, setMode] = useState<"login" | "signup">(initialMode)
const [loginState, loginAction, loginPending] = useActionState(loginWithPassword, INITIAL)
const [signupState, signupActionFn, signupPending] = useActionState(signupWithPassword, INITIAL)
+52
View File
@@ -0,0 +1,52 @@
import Link from "next/link"
import { Trophy, Users } from "lucide-react"
import { leaderboard } from "@/lib/follows"
/** Right rail, 1xbet "bet slip" position — here the live leaderboard and army stats. */
export async function SideRail({ armyTotal, globalWins }: { armyTotal: number; globalWins: number }) {
const top = await leaderboard(5)
return (
<aside className="space-y-3">
<div className="overflow-hidden rounded-lg border border-border bg-card">
<div className="flex items-center gap-2 border-b border-border bg-gold/10 px-4 py-2.5">
<Trophy className="h-4 w-4 text-gold" />
<h2 className="text-sm font-semibold">Classement</h2>
</div>
{top.length === 0 ? (
<p className="px-4 py-5 text-xs leading-relaxed text-muted-foreground">
Personne au classement pour l&apos;instant. Suivez un choix de Loki (★) pour y entrer.
</p>
) : (
<ol className="divide-y divide-border/60">
{top.map((s, i) => (
<li key={s.userId} className="flex items-center gap-3 px-4 py-2 text-sm">
<span className="w-4 text-xs text-muted-foreground tabular-nums">{i + 1}</span>
<span className="flex-1 truncate">{s.displayName}</span>
<span className="font-semibold tabular-nums text-gold">{(s.winRate * 100).toFixed(0)}%</span>
</li>
))}
</ol>
)}
<Link href="/classement" className="block border-t border-border px-4 py-2 text-center text-xs text-gold hover:bg-gold/5">
Voir tout le classement
</Link>
</div>
<div className="grid grid-cols-2 gap-3">
<RailStat icon={Users} value={armyTotal.toLocaleString("fr-CA")} label="Membres" />
<RailStat icon={Trophy} value={globalWins.toString()} label="Grilles gagnées" />
</div>
</aside>
)
}
function RailStat({ icon: Icon, value, label }: { icon: typeof Users; value: string; label: string }) {
return (
<div className="rounded-lg border border-border bg-card px-3 py-3">
<Icon className="h-4 w-4 text-gold" />
<p className="mt-1.5 font-display text-xl leading-none tabular-nums">{value}</p>
<p className="mt-1 text-[11px] text-muted-foreground">{label}</p>
</div>
)
}
+11 -5
View File
@@ -15,9 +15,14 @@ export async function UserMenu() {
if (!member) {
return (
<Button asChild size="sm">
<Link href="/connexion">Connexion</Link>
</Button>
<div className="flex items-center gap-1.5">
<Button asChild size="sm" variant="ghost" className="h-7 px-3 text-xs">
<Link href="/connexion">Connexion</Link>
</Button>
<Button asChild size="sm" className="h-7 px-3 text-xs font-semibold">
<Link href="/connexion?mode=inscription">Inscription</Link>
</Button>
</div>
)
}
@@ -26,8 +31,9 @@ export async function UserMenu() {
return (
<DropdownMenu>
<DropdownMenuTrigger className="flex items-center gap-2 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring">
<Avatar className="h-8 w-8">
<DropdownMenuTrigger className="flex items-center gap-2 rounded-full text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring">
<span className="hidden text-muted-foreground sm:inline">{displayName}</span>
<Avatar className="h-6 w-6">
<AvatarImage src={member.avatarUrl ?? undefined} alt="" />
<AvatarFallback>{initial}</AvatarFallback>
</Avatar>