Files
lokiloto/lib/lokilab-feed.ts
T
Nazim KriandClaude Opus 5.5 ad214a24dd 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>
2026-10-31 11:58:21 -04:00

50 lines
1.5 KiB
TypeScript

import 'server-only'
/**
* The one contract between LokiLab and LokiLoto: results, Loki's picks,
* lifetime win record, and army size. LokiLoto never talks to LokiLab's
* database or stats engine directly — only this feed.
*/
export interface ArmyFeed {
army: {
total: number
byCountry: Record<string, number>
}
lotteries: LotteryFeedEntry[]
}
export interface LotteryFeedEntry {
id: string
name: string
country: string
lifetime: {
picksTracked: number
wins: number
winRate: number
}
/** Name of the extra ball(s), e.g. "Powerball", "Étoiles" — international games only. */
bonusLabel?: string
lastDraw: {
date: string
result: number[]
bonus?: number[]
pick: number[] | null
matched: number | null
won: boolean | null
} | 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 }[]
}
const LOKILAB_FEED_URL = process.env.LOKILAB_FEED_URL ?? 'https://goldd.devyouz.net/api/public/army-feed'
export async function getArmyFeed(): Promise<ArmyFeed> {
const res = await fetch(LOKILAB_FEED_URL, { next: { revalidate: 300 } })
if (!res.ok) throw new Error(`LokiLab feed returned ${res.status}`)
return res.json()
}