From 50d329f645430b33790b2d959d6837459efa7f13 Mon Sep 17 00:00:00 2001 From: Mayur Shinde Date: Thu, 18 Jun 2026 15:24:26 +0530 Subject: [PATCH] leaderboard column colours changed --- src/pages/LeaderboardPage.jsx | 78 +++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/src/pages/LeaderboardPage.jsx b/src/pages/LeaderboardPage.jsx index 3352f38..650b771 100644 --- a/src/pages/LeaderboardPage.jsx +++ b/src/pages/LeaderboardPage.jsx @@ -16,47 +16,85 @@ const rankBadge = (i) => i === 2 ? 'bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-300' : 'text-zinc-500'; -// ── Podium (shared) ────────────────────────────────────────────────────────── -const TopPodium = ({ data, metricKey, numberFormat = {}, accentColor = 'border-yellow-400' }) => { - if (data.length < 3) return null; - const [first, second, third] = data; - // Bars grow from a shared baseline at a constant speed, so the shortest (bronze) - // finishes first, then silver, and the tallest (gold) lands last. - const Step = ({ agent, rank, heightPx, color, glow }) => ( +// ── Podium tier styling (gold / silver / bronze) ─────────────────────────────── +// Solid metal bars with dark, clearly-legible rank numerals. Height encodes rank: +// 1st is tallest, then 2nd, then 3rd. +const PODIUM_TIERS = { + 1: { + heightPx: 200, + border: 'border-yellow-400', + avatarRing: 'border-yellow-400', + bar: 'bg-gradient-to-b from-yellow-300 to-yellow-500', + numeral: 'text-yellow-900/80', + text: 'text-yellow-600 dark:text-yellow-400', + glow: 'bg-yellow-500', + }, + 2: { + heightPx: 144, + border: 'border-zinc-300', + avatarRing: 'border-zinc-300', + bar: 'bg-gradient-to-b from-zinc-200 to-zinc-400', + numeral: 'text-zinc-700/80', + text: 'text-zinc-500 dark:text-zinc-300', + glow: 'bg-zinc-400', + }, + 3: { + heightPx: 100, + border: 'border-orange-400', + avatarRing: 'border-orange-400', + bar: 'bg-gradient-to-b from-orange-300 to-orange-500', + numeral: 'text-orange-900/80', + text: 'text-orange-600 dark:text-orange-400', + glow: 'bg-orange-500', + }, +}; + +// ── Podium step (single column) ─────────────────────────────────────────────── +// Bars grow from a shared baseline at a constant speed, so the shortest (bronze) +// finishes first, then silver, and the tallest (gold) lands last. +const PodiumStep = ({ agent, rank, metricKey, numberFormat = {} }) => { + const tier = PODIUM_TIERS[rank]; + return (
-
+
{agent.name.split(' ').map(n => n[0]).join('')}
{rank === 1 && } -
+

{agent.name}

-

+

-
-
{rank}
+
+
{rank}
); +}; + +// ── Podium (shared) ────────────────────────────────────────────────────────── +const TopPodium = ({ data, metricKey, numberFormat = {} }) => { + if (data.length < 3) return null; + const [first, second, third] = data; return ( // Fixed min-height reserves the full podium space so the shared baseline // never shifts while the bars animate — they grow upward from the floor. -
- - - +
+ + +
); }; @@ -262,7 +300,6 @@ const LeaderboardPage = () => { volume: { suffix: ' Deals' }, winRate: { suffix: '%', decimals: 1 }, }[metric]} - accentColor="border-yellow-400" />
@@ -357,7 +394,6 @@ const LeaderboardPage = () => { total: {}, convRate: { suffix: '%', decimals: 1 }, }[cvMetric]} - accentColor="border-emerald-400" />