Skip to content

Commit d75e6f0

Browse files
fix: improve Leaderboard visibility and layout for light theme
1 parent f96615f commit d75e6f0

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

components/Leaderboard.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function Leaderboard({ contributors }: LeaderboardProps) {
2626
const rank3 = top3[2];
2727

2828
return (
29-
<div className="w-full mx-auto font-sans relative overflow-hidden bg-white/[0.02] border border-white/[0.08] backdrop-blur-xl p-8 sm:p-12 rounded-[2rem] text-white">
29+
<div className="w-full mx-auto font-sans relative overflow-hidden bg-black/[0.02] dark:bg-white/[0.02] border border-black/10 dark:border-white/[0.08] backdrop-blur-xl p-8 sm:p-12 rounded-[2rem] text-black dark:text-white">
3030
{/* ── Ambient Background Glows ── */}
3131
<div className="absolute inset-0 pointer-events-none overflow-hidden rounded-[2rem]">
3232
<div className="absolute top-[5%] left-1/2 -translate-x-1/2 h-[400px] w-[400px] rounded-full bg-[#eab308]/10 blur-[120px]" />
@@ -38,7 +38,7 @@ export default function Leaderboard({ contributors }: LeaderboardProps) {
3838
{/* ── Podium Section ── */}
3939
<div className="flex items-end justify-center h-[300px] sm:h-[360px] mb-16 gap-3 sm:gap-6 relative mt-8">
4040
{/* Subtle grid bg */}
41-
<div className="absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.015)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.015)_1px,transparent_1px)] bg-[size:2rem_2rem] pointer-events-none [mask-image:radial-gradient(ellipse_at_center,#000_30%,transparent_70%)]" />
41+
<div className="absolute inset-0 bg-[linear-gradient(rgba(0,0,0,0.05)_1px,transparent_1px),linear-gradient(90deg,rgba(0,0,0,0.05)_1px,transparent_1px)] dark:bg-[linear-gradient(rgba(255,255,255,0.015)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.015)_1px,transparent_1px)] bg-[size:2rem_2rem] pointer-events-none [mask-image:radial-gradient(ellipse_at_center,#000_30%,transparent_70%)]" />
4242

4343
{/* Rank 2 (Left) */}
4444
{rank2 && (
@@ -87,20 +87,20 @@ export default function Leaderboard({ contributors }: LeaderboardProps) {
8787
viewport={{ once: true }}
8888
transition={{ delay: 0.1 + i * 0.1, duration: 0.6, type: 'spring', stiffness: 80 }}
8989
whileHover={{ x: 6, scale: 1.01 }}
90-
className="flex items-center justify-between p-4 rounded-xl bg-white/[0.03] border border-white/[0.05] hover:bg-white/[0.06] hover:border-white/10 transition-all duration-300 cursor-pointer group"
90+
className="flex items-center justify-between p-4 rounded-xl bg-black/[0.03] dark:bg-white/[0.03] border border-black/5 dark:border-white/[0.05] hover:bg-black/[0.06] dark:hover:bg-white/[0.06] hover:border-black/10 dark:hover:border-white/10 transition-all duration-300 cursor-pointer group"
9191
onClick={() => {
9292
const el = document.getElementById('contributors');
9393
el?.scrollIntoView({ behavior: 'smooth' });
9494
}}
9595
>
9696
<div className="flex items-center gap-4">
9797
{/* Rank */}
98-
<div className="flex items-center justify-center w-9 h-9 rounded-lg bg-white/[0.05] text-sm font-bold text-zinc-500 group-hover:text-cyan-400 group-hover:bg-cyan-400/10 transition-colors font-mono">
98+
<div className="flex items-center justify-center w-9 h-9 rounded-lg bg-black/5 dark:bg-white/[0.05] text-sm font-bold text-zinc-500 group-hover:text-cyan-600 dark:group-hover:text-cyan-400 group-hover:bg-cyan-400/10 transition-colors font-mono">
9999
#{i + 4}
100100
</div>
101101

102102
{/* Avatar */}
103-
<div className="relative w-10 h-10 rounded-full overflow-hidden border border-white/10 group-hover:border-cyan-400/40 transition-colors">
103+
<div className="relative w-10 h-10 rounded-full overflow-hidden border border-black/10 dark:border-white/10 group-hover:border-cyan-400/40 transition-colors">
104104
<Image
105105
src={contributor.avatar_url}
106106
alt={contributor.login}
@@ -110,16 +110,18 @@ export default function Leaderboard({ contributors }: LeaderboardProps) {
110110
</div>
111111

112112
{/* Name */}
113-
<span className="font-semibold text-white group-hover:text-cyan-300 transition-colors">
113+
<span className="font-semibold text-black dark:text-white group-hover:text-cyan-600 dark:group-hover:text-cyan-300 transition-colors">
114114
{contributor.login}
115115
</span>
116116
</div>
117117

118118
{/* Metrics */}
119119
<div className="flex items-center gap-3 text-sm">
120-
<TrendingUp className="h-4 w-4 text-zinc-600 group-hover:text-cyan-400 transition-colors" />
121-
<span className="font-mono font-bold text-white">{contributor.contributions}</span>
122-
<span className="text-zinc-600 hidden sm:inline">commits</span>
120+
<TrendingUp className="h-4 w-4 text-zinc-500 dark:text-zinc-600 group-hover:text-cyan-600 dark:group-hover:text-cyan-400 transition-colors" />
121+
<span className="font-mono font-bold text-black dark:text-white">
122+
{contributor.contributions}
123+
</span>
124+
<span className="text-zinc-500 dark:text-zinc-600 hidden sm:inline">commits</span>
123125
</div>
124126
</motion.div>
125127
))}
@@ -220,7 +222,7 @@ function PodiumItem({ contributor, height, variant, delay, isFirst }: PodiumItem
220222
</div>
221223

222224
{/* Info Box */}
223-
<div className="relative z-20 flex flex-col items-center w-full px-3 py-3 rounded-xl bg-white/[0.06] border border-white/[0.08] backdrop-blur-md transition-all duration-300 group-hover:bg-white/[0.1] group-hover:border-white/15">
225+
<div className="relative z-20 flex flex-col items-center w-full px-3 py-3 rounded-xl bg-black/[0.04] dark:bg-white/[0.06] border border-black/10 dark:border-white/[0.08] backdrop-blur-md transition-all duration-300 group-hover:bg-black/[0.08] dark:group-hover:bg-white/[0.1] group-hover:border-black/15 dark:group-hover:border-white/15">
224226
<div className={`font-bold truncate w-full text-center ${theme.name} text-sm`}>
225227
{contributor.login}
226228
</div>
@@ -236,7 +238,7 @@ function PodiumItem({ contributor, height, variant, delay, isFirst }: PodiumItem
236238
whileInView={{ height, opacity: 1 }}
237239
viewport={{ once: true }}
238240
transition={{ delay: delay + 0.3, duration: 1, type: 'spring', bounce: 0.15 }}
239-
className={`w-24 sm:w-32 rounded-t-xl bg-gradient-to-b ${theme.pillarGradient} border-t border-x border-white/[0.06] -mt-5 relative z-10 overflow-hidden`}
241+
className={`w-24 sm:w-32 rounded-t-xl bg-gradient-to-b ${theme.pillarGradient} border-t border-x border-black/10 dark:border-white/[0.06] -mt-5 relative z-10 overflow-hidden`}
240242
>
241243
{/* Pillar inner glow */}
242244
<div className={`absolute inset-x-0 top-0 h-12 ${theme.glowBg} blur-lg rounded-t-xl`} />

0 commit comments

Comments
 (0)