From 0c9eaca31295e3ada3a085d1170194d9275b4d13 Mon Sep 17 00:00:00 2001 From: AyoubBenziza Date: Tue, 9 Jun 2026 10:25:28 +0200 Subject: [PATCH] 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) --- apps/web/src/components/game-end-view.tsx | 86 +++++++++++++++++++++-- apps/web/src/components/scoreboard.tsx | 37 ---------- 2 files changed, 80 insertions(+), 43 deletions(-) delete mode 100644 apps/web/src/components/scoreboard.tsx diff --git a/apps/web/src/components/game-end-view.tsx b/apps/web/src/components/game-end-view.tsx index 0d8c8fe..fb85092 100644 --- a/apps/web/src/components/game-end-view.tsx +++ b/apps/web/src/components/game-end-view.tsx @@ -1,8 +1,9 @@ import { Link } from "wouter" +import { motion } from "framer-motion" +import { Crown } from "lucide-react" import type { PlayerScore, RoomSnapshot } from "@nerdware/shared" import { Button } from "@workspace/ui/components/button" import { useRoomStore } from "@/store/room" -import { Scoreboard } from "@/components/scoreboard" export function GameEndView({ snapshot }: { snapshot: RoomSnapshot }) { const playerId = useRoomStore((s) => s.playerId) @@ -10,9 +11,13 @@ export function GameEndView({ snapshot }: { snapshot: RoomSnapshot }) { const reset = useRoomStore((s) => s.reset) const scores: PlayerScore[] = finalScores ?? snapshot.scores - const winner = [...scores].sort((a, b) => b.score - a.score)[0] - const winnerName = - snapshot.players.find((p) => p.id === winner?.playerId)?.name ?? "?" + const ranked = [...scores].sort((a, b) => b.score - a.score) + const nameOf = (id: string) => + snapshot.players.find((p) => p.id === id)?.name ?? "?" + + const winner = ranked[0] + const rest = ranked.slice(1) + const isMe = (id: string) => id === playerId return (
@@ -21,11 +26,80 @@ export function GameEndView({ snapshot }: { snapshot: RoomSnapshot }) { Partie terminée

- 🏆 {winnerName} l'emporte ! + 🏆 {winner ? nameOf(winner.playerId) : "?"} l'emporte !

- + {winner && ( + + + + + + + {nameOf(winner.playerId)} + {isMe(winner.playerId) && ( + (toi) + )} + + + {winner.score} + + + Champion·ne + + + )} + + {rest.length > 0 && ( +
    + {rest.map((s, i) => ( +
  1. + + + {i + 2} + + + {nameOf(s.playerId)} + {isMe(s.playerId) && ( + (toi) + )} + + + + {s.score} + +
  2. + ))} +
+ )}