Commit Graph
15 Commits
Author SHA1 Message Date
tiennm99 254a6dc39a refactor: move shared modules out of app/
`app/` should hold route segments only. Game logic and the player-card
component are imported by both routes, so they belong outside:

  app/loto-game-logic.ts   -> lib/game-logic.ts
  app/loto-player-board.tsx -> components/player-board.tsx

Imports use the existing @/* alias. Drops the redundant `loto-` prefix.
Also fixes the package name from the scaffold default.
2026-04-26 19:34:37 +07:00
tiennm99 dd64aa6ed3 docs: initialize project documentation
Adds the standard ./docs/ structure (overview, codebase summary,
architecture, code standards, design guidelines, deployment guide,
roadmap) and the code-review report under ./plans/reports/.
README now points at the docs and covers the codeserver dev profile.
2026-04-26 19:27:18 +07:00
tiennm99 fd2d144428 refactor: harden loto game per code review
- Validate localStorage shape on load (typed parse, guarded set)
- Fix isRowComplete to require at least one number per row
- Split row-scan effect into bingo + waiting passes so updates to
  later rows are not skipped by an early return
- Memoize per-row completeness; was recomputing 81 times per render
- Replace clickable divs with real <button>s; aria-label, aria-pressed,
  focus ring, dialog role + escape on the bingo modal
- Freeze the master tracking board to make module-scope state safer
- Allow NEXT_BASE_PATH to override the prod default for forks /
  custom-domain deploys
2026-04-26 19:27:11 +07:00
tiennm99 400c55bef8 feat: add codeserver dev profile
NEXT_DEV_PROFILE=codeserver wires basePath, assetPrefix, and
allowedDevOrigins from CODESERVER_HOST/PORT in .env.local. Use
/absproxy/{port} so code-server preserves the path prefix and Next's
basePath matches the incoming request.

Run with `npm run dev:codeserver` and access via
https://<host>/absproxy/<port>/.
2026-04-26 19:16:46 +07:00
tiennm99 9d52b5b02a feat: add player board for game master
Master page now embeds a separate playing card so the host can play along
while drawing numbers. Extracted shared grid logic into a reusable
PlayerBoard component with a configurable storage prefix.
2026-04-26 19:16:38 +07:00
tiennm99 dfea4d9403 feat: add "Kinh!" congrats popup and "Chờ X" waiting toast
Show animated congrats when all 5 numbers in a row are crossed.
Show "Chờ [number]" toast overlay when 4/5 crossed. Auto-fades
after 5s or dismissible by tap.
2026-04-04 22:44:12 +07:00
tiennm99 4cf11bfcfc fix: make master board view-only and enlarge control buttons 2026-04-04 22:34:00 +07:00
tiennm99 fca823a9de feat: add game master page with number generator and tracking board
9x10 master board to track called numbers, random draw button,
call history, and manual toggle. Conditional basePath for local dev.
2026-04-04 22:28:05 +07:00
tiennm99 3bf9cd9c60 feat: add GitHub Pages deployment workflow
Configure static export and GitHub Actions workflow
to auto-deploy to GitHub Pages on push to master.
2026-04-04 22:17:18 +07:00
tiennm99 b399e54a47 fix: equal cell sizing with CSS grid and improved UI design
Use CSS grid for uniform cell sizes, gradient accents,
cleaner color palette, and footer with heart emoji link.
2026-04-04 22:03:40 +07:00
tiennm99 7f25a8e462 feat: convert to Next.js with TypeScript and Tailwind CSS
Replace vanilla HTML/JS/CSS with Next.js App Router, TypeScript,
and Tailwind CSS. Responsive design with dark mode support.
All original game logic preserved: grid generation, click-to-cross,
localStorage persistence.
2026-04-04 21:51:07 +07:00
tiennm99 761744cdc6 Create loto.js 2025-12-21 09:55:19 +07:00
tiennm99 77b70442ea [Change] random number algorithm 2021-02-08 20:30:54 +07:00
tiennm99 2abc1a0068 Init 2021-02-08 18:47:14 +07:00
miti99 e3a44836cb Initial commit 2021-02-08 11:10:48 +00:00