Commit graph

17 commits

Author SHA1 Message Date
AyoubBenziza
723d91943e feat(web): WarioWare-style transition between rounds
- RoundTransition overlay: fullscreen colored wipe-in, spinning sunburst,
  big bouncing "QUESTION N" + "PRÊT ?!", then wipe-out (Framer Motion)
- store: roundKey counter incremented on round:start
- rendered at RoomPage, keyed by roundKey so it plays once per round

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 11:15:36 +02:00
AyoubBenziza
0c2534f3a4 feat(web): podium on the end screen + larger avatars
- GameEndView: top-3 podium — 2nd left, champion center (taller), 3rd right,
  with gold/silver/bronze pedestals, staggered rise-in (climax on the champion),
  crown + pulsing gold glow kept on #1; ranks 4+ listed below
- bigger avatars where they read too small: lobby (size-7→11) and in-game
  player cards (size-9→14, slightly wider cards)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 11:05:54 +02:00
AyoubBenziza
c3e00ab9d9 refactor(web): generate DiceBear avatars locally instead of via HTTP API
Self-hosted over the HTTP API: no runtime dependency on api.dicebear.com,
works offline/LAN, and no player pseudo leaks to a third party.

- @dicebear/core@10 + @dicebear/styles@10 (lorelei.json), CC0 1.0
- Avatar builds a data URI locally (new Style/Avatar), memoized per seed
- same component API (seed/className) → no call-site changes
- enable resolveJsonModule for the style import

Cost: ~64 kB gzip added to the bundle — acceptable for a self-hosted game.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 10:58:23 +02:00
AyoubBenziza
4f10d86fb0 feat(web): DiceBear lorelei avatars for players
- Avatar component using DiceBear 9.x lorelei, seeded by the player name
  (stable, recognizable across screens)
- shown in the lobby list, the in-game player cards (gold ring on leader),
  and the final leaderboard (large on the winner, small on runners-up)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 10:50:17 +02:00
AyoubBenziza
2fce63530b feat(quiz): show per-player answer status during the round
- voteAck now carries `voted` (playerIds who validated) — never their answer,
  so no leak; the count/total stay for the progress text
- PlayerCards show a green "Prêt" check for players who answered and a
  pulsing "en attente" dot for those who haven't, during in_round only
- score stays visible on the cards alongside the status
- engine test updated for the new voteAck shape

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 10:30:03 +02:00
AyoubBenziza
0c9eaca312 feat(web): glorify the winner on the final leaderboard
- dedicated winner card: gold border, gold gradient, pulsing gold glow,
  spring scale-in, and a Crown that drops & bounces in (Framer Motion)
- champion label + big gold score; runners-up listed below from rank 2
- drop the generic Scoreboard component (now unused)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 10:25:28 +02:00
AyoubBenziza
c9f3197300 feat(web): real explosion at 0 — fullscreen flash + giant 💥
- store: boomKey counter + boom() action
- Countdown fires boom() once when it reaches 0 (timer expiry only)
- Boom component (portal to body) plays a fullscreen white flash + giant 💥
- rendered at RoomPage level, keyed by boomKey so it plays fully (independent
  of the countdown unmounting on reveal) and replays each round

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 16:05:42 +02:00
AyoubBenziza
f82c7d9700 feat(web): bomb countdown, copyable room code, persistent score cards
- Countdown: under 10s it ramps into a "bomb" — white→red color and an
  escalating scale/wiggle pulse (faster & wider as it nears 0) via Framer Motion
- RoomCode: click-to-copy the room code with visual feedback
- PlayerCards: always-on score HUD during the game (cards per player,
  animated reorder, crown on the leader) so scores are tracked continuously
  instead of only appearing at reveal
- quiz view: drop the reveal-only scoreboard (now covered by PlayerCards)
- add framer-motion dependency

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 15:56:57 +02:00
AyoubBenziza
5cc9113b8c feat(quiz): quiz game mode end-to-end (server mode + playable client UI)
Server:
- quiz mode (GameRound): in-memory FR question bank (mcq + truefalse),
  per-room anti-repeat, first-vote lock, score = base + speed bonus ∝ time
  left; registered via registerRound, loaded at startup
- shared: typed quiz payloads (QuizQuestionPayload / reveal truth / result)
- tests: quiz scoring, vote lock, bounds, reveal (bun test)

Client:
- room store handles round:start / voteAck / reveal / game:end
- RoomPage dispatches by status: lobby (host start controls) → quiz view
  (question, countdown, vote, reveal + scoreboard) → game-end view
- replaces standalone lobby page

Roadmap V1 step 4. Verified end-to-end over the wire (start→vote→reveal→
score→next round→game:end, no answer leaked, anti-repeat works).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 15:43:17 +02:00
eb7e9a20d1 Merge pull request 'feat(server): generic game engine — GameRound interface + orchestration loop' (#3) from feature/game-engine into dev
Reviewed-on: #3
2026-06-08 13:30:48 +00:00
AyoubBenziza
9ed3b8a4cb feat(server): generic game engine — GameRound interface + orchestration loop
- game/round.ts: GameRound contract (start/submitAnswer/reveal/score) +
  RoundContext + RoomGameController (decouples room from engine)
- game/registry.ts: register/createRound — adding a mode = one registerRound
- game/engine.ts: server-authoritative orchestration. Per round:
  start → broadcast round:start → wait (timer OR all eligible voted) →
  reveal → apply score deltas → score:update; then game:end. DJ counts as
  eligible voter; round ends on first condition met.
- handlers: game:start (host-only, validates rounds/modes) + round:vote
  wired to the engine
- shared: add game:start client event
- engine.test.ts: covers both end conditions + voteAck (bun test)
- turbo/root: add test task

Roadmap V1 step 3. No UI yet — concrete quiz mode + client come in step 4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 15:29:49 +02:00
7dca1a5da7 Merge pull request 'feat(server,web): first real-time cycle — room create/join + lobby' (#2) from feature/realtime-room-cycle into dev
Reviewed-on: #2
2026-06-08 13:21:48 +00:00
AyoubBenziza
29faa18731 feat(server,web): first real-time cycle — room create/join + lobby
Server (@nerdware/server):
- RoomManager: in-memory rooms (Map), code generation, create/join,
  disconnect handling, public snapshot projection (no secrets)
- Socket.IO handlers: room:create / room:join with typed acks,
  room:state broadcast on every change, lobby:updateSettings (host-only),
  player:left on disconnect

Web (web):
- typed Socket.IO client + Zustand store mirroring room:state
- wouter routing: home (create/join) + minimal lobby (live player list)
- @nerdware/shared wired into the client

Roadmap V1 step 2. Verified end-to-end (create/join/broadcast/disconnect).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 15:16:26 +02:00
2139696f3f Merge pull request 'feat(shared,server): scaffold @nerdware/shared types + Fastify/Socket.IO server' (#1) from feature/shared-and-server into dev
Reviewed-on: #1
2026-06-08 12:59:53 +00:00
AyoubBenziza
56115b5a9f feat(shared,server): scaffold @nerdware/shared types + Fastify/Socket.IO server
- packages/shared (@nerdware/shared): domain model (Room, Player, Settings,
  Round, votes, scores) + fully typed Socket.IO events, consumed as source
- apps/server (@nerdware/server): Fastify boot + /health, typed Socket.IO
  attached to the HTTP server, env config, graceful shutdown
- gitignore: allow .env.example to be committed

Roadmap V1 step 1. Room logic (room:create/join) comes next.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 14:55:52 +02:00
AyoubBenziza
ad13eb4e68 chore: initial scaffold (Turborepo + Vite/React + shadcn) 2026-06-08 14:24:04 +02:00
AyoubBenziza
e7b2f46e81 feat: initial commit 2026-06-07 18:45:52 +02:00