From dd6b26c5245724ac159c700555b285462769af49 Mon Sep 17 00:00:00 2001 From: Michilis Date: Mon, 8 Dec 2025 15:51:13 +0000 Subject: [PATCH] feat: Mobile optimization and UI improvements - Add mobile hamburger menu in TopBar with slide-in panel - Optimize all components for mobile (responsive fonts, spacing, touch targets) - Add proper viewport meta tags and safe area padding - Fix /jackpot/next API to return active cycles regardless of scheduled time - Remove BTC display from jackpot pot (show sats only) - Add setup/ folder to .gitignore - Improve mobile UX: 16px inputs (no iOS zoom), 44px touch targets - Add active states for touch feedback on buttons --- .gitignore | 2 + back_end/src/controllers/public.ts | 20 +- front_end/src/app/buy/page.tsx | 10 +- front_end/src/app/globals.css | 109 +++++++++- front_end/src/app/layout.tsx | 18 +- front_end/src/app/page.tsx | 68 +++--- front_end/src/app/tickets/[id]/page.tsx | 68 +++--- front_end/src/components/DrawAnimation.tsx | 46 ++-- front_end/src/components/Footer.tsx | 10 +- front_end/src/components/JackpotCountdown.tsx | 22 +- .../src/components/JackpotPotDisplay.tsx | 9 +- .../src/components/LightningInvoiceCard.tsx | 15 +- front_end/src/components/TopBar.tsx | 205 +++++++++++++++--- 13 files changed, 432 insertions(+), 170 deletions(-) diff --git a/.gitignore b/.gitignore index 7b9ad50..60cd4da 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,5 @@ ehthumbs.db *.key secrets/ +# Setup/deployment configs (contains server-specific settings) +setup/ diff --git a/back_end/src/controllers/public.ts b/back_end/src/controllers/public.ts index aabcb6f..e50f213 100644 --- a/back_end/src/controllers/public.ts +++ b/back_end/src/controllers/public.ts @@ -65,17 +65,29 @@ export async function getNextJackpot(req: Request, res: Response) { const lottery = lotteryResult.rows[0]; - // Get next cycle - const cycleResult = await db.query( + // Get next cycle - first try to find one that hasn't drawn yet + let cycleResult = await db.query( `SELECT * FROM jackpot_cycles WHERE lottery_id = $1 - AND status IN ('scheduled', 'sales_open') - AND scheduled_at > NOW() + AND status IN ('scheduled', 'sales_open', 'drawing') ORDER BY scheduled_at ASC LIMIT 1`, [lottery.id] ); + // If no active cycles, get the next upcoming one + if (cycleResult.rows.length === 0) { + cycleResult = await db.query( + `SELECT * FROM jackpot_cycles + WHERE lottery_id = $1 + AND status = 'scheduled' + AND scheduled_at > NOW() + ORDER BY scheduled_at ASC + LIMIT 1`, + [lottery.id] + ); + } + if (cycleResult.rows.length === 0) { return res.status(503).json({ version: '1.0', diff --git a/front_end/src/app/buy/page.tsx b/front_end/src/app/buy/page.tsx index 2465096..bb3cfa0 100644 --- a/front_end/src/app/buy/page.tsx +++ b/front_end/src/app/buy/page.tsx @@ -222,15 +222,15 @@ export default function BuyPage() { const totalCost = ticketPriceSats * tickets; return ( -
-

+
+

{STRINGS.buy.title}

{!invoice ? ( /* Purchase Form */ -
-
+
+ {/* Lightning Address */}