+ {topUsers.map((user, idx) => {
+ const rankColor =
+ idx === 0
+ ? "text-yellow-400 drop-shadow-[0_0_8px_rgba(250,204,21,0.4)]"
+ : idx === 1
+ ? "text-gray-300 drop-shadow-[0_0_8px_rgba(209,213,219,0.4)]"
+ : "text-amber-600 drop-shadow-[0_0_8px_rgba(217,119,6,0.4)]";
+
+ const badgeInfo = getBadgeInfo(user.rank, user.hours);
+ const initial = (user.email?.[0] || "?").toUpperCase();
-
-
-
-
- {topLanguage}
-
-
+ return (
+
+ {/* Minimal Background Glow based on rank */}
+
-
+
+
+
+ {initial}
+
+
+
+ {user.email.split("@")[0]}
+
+
+ {badgeInfo.icon && (
+
+ )}
+ {badgeInfo.label}
+
+
+
+
+
+
+ {idx === 0 ? "01" : idx === 1 ? "02" : "03"}
+
+
+
-
-
-
-
-
+ {/* Stats Row */}
+
+
+
+ Hours
+
+
+ {user.hours}
+
+
+
+
+ Language
+
+
+ {user.languages?.[0] || "N/A"}
+
+
+
+
+ Editor
+
+
+ {user.editor || "N/A"}
+
+
+
-
- OS
-
-
-
- {topOS}
-
-
+ );
+ })}
);
}
-const getBadgeInfo = (rank: number, hours: number) => {
- if (rank === 1)
- return { label: "GOD LEVEL", class: "badge-god", icon: faBolt };
- if (rank === 2) return { label: "ELITE", class: "badge-elite", icon: faFire };
- if (rank === 3) return { label: "PRO", class: "badge-pro", icon: faStar };
- if (hours > 100)
- return { label: "MASTER", class: "badge-master", icon: faRocket };
- if (hours > 20)
- return { label: "HUSTLER", class: "badge-hustler", icon: null };
- return { label: "NOVICE", class: "badge-novice", icon: null };
-};
-
export default function LeaderboardTable({
members,
ownerId,
@@ -208,29 +187,45 @@ export default function LeaderboardTable({
gap: 0.25rem;
line-height: normal;
}
+ .badge-impossible {
+ background: linear-gradient(90deg, rgba(255,0,102,0.15) 0%, rgba(255,51,153,0.8) 50%, rgba(255,0,102,0.15) 100%);
+ background-size: 200% auto;
+ animation: pulse-glow 1.5s infinite, shimmer-bg 1.5s linear infinite;
+ border: 1px solid rgba(255,0,102,0.8);
+ color: #ff99cc;
+ box-shadow: 0 0 15px rgba(255,0,102,0.6);
+ }
.badge-god {
- background: linear-gradient(90deg, rgba(234,179,8,0.15) 0%, rgba(253,224,71,0.6) 50%, rgba(234,179,8,0.15) 100%);
+ background: linear-gradient(90deg, rgba(217,70,239,0.15) 0%, rgba(232,121,249,0.6) 50%, rgba(217,70,239,0.15) 100%);
background-size: 200% auto;
- animation: shimmer-bg 2s linear infinite;
- border: 1px solid rgba(250,204,21,0.6);
- color: #fef08a;
- box-shadow: 0 0 10px rgba(250,204,21,0.3);
+ animation: shimmer-bg 2s linear infinite, glow-pulse 2s alternate infinite;
+ border: 1px solid rgba(217,70,239,0.6);
+ color: #f0abfc;
+ box-shadow: 0 0 10px rgba(217,70,239,0.4);
}
- .badge-elite {
- background: linear-gradient(90deg, rgba(148,163,184,0.15) 0%, rgba(241,245,249,0.5) 50%, rgba(148,163,184,0.15) 100%);
+ .badge-starlight {
+ background: linear-gradient(90deg, rgba(56,189,248,0.15) 0%, rgba(125,211,252,0.6) 50%, rgba(56,189,248,0.15) 100%);
background-size: 200% auto;
animation: shimmer-bg 2.5s linear infinite;
- border: 1px solid rgba(203,213,225,0.5);
- color: #ffffff;
- box-shadow: 0 0 10px rgba(203,213,225,0.2);
+ border: 1px solid rgba(56,189,248,0.5);
+ color: #bae6fd;
+ box-shadow: 0 0 10px rgba(56,189,248,0.3);
}
- .badge-pro {
- background: linear-gradient(90deg, rgba(217,119,6,0.15) 0%, rgba(252,211,77,0.5) 50%, rgba(217,119,6,0.15) 100%);
+ .badge-elite {
+ background: linear-gradient(90deg, rgba(239,68,68,0.15) 0%, rgba(248,113,113,0.6) 50%, rgba(239,68,68,0.15) 100%);
background-size: 200% auto;
animation: shimmer-bg 3s linear infinite;
- border: 1px solid rgba(217,119,6,0.5);
- color: #fce68a;
- box-shadow: 0 0 10px rgba(217,119,6,0.2);
+ border: 1px solid rgba(239,68,68,0.5);
+ color: #fca5a5;
+ box-shadow: 0 0 10px rgba(239,68,68,0.3);
+ }
+ .badge-pro {
+ background: linear-gradient(90deg, rgba(234,179,8,0.15) 0%, rgba(253,224,71,0.5) 50%, rgba(234,179,8,0.15) 100%);
+ background-size: 200% auto;
+ animation: shimmer-bg 4s linear infinite;
+ border: 1px solid rgba(234,179,8,0.5);
+ color: #fef08a;
+ box-shadow: 0 0 10px rgba(234,179,8,0.2);
}
.badge-master {
background: rgba(99,102,241,0.15);
@@ -243,14 +238,30 @@ export default function LeaderboardTable({
color: #93c5fd;
}
.badge-novice {
+ background: linear-gradient(90deg, rgba(16,185,129,0.1) 0%, rgba(52,211,153,0.3) 50%, rgba(16,185,129,0.1) 100%);
+ background-size: 200% auto;
+ animation: shimmer-bg 5s linear infinite;
+ border: 1px solid rgba(16,185,129,0.4);
+ color: #6ee7b7;
+ }
+ .badge-newbie {
background: rgba(107,114,128,0.15);
border: 1px solid rgba(107,114,128,0.4);
color: #d1d5db;
}
+ @keyframes pulse-glow {
+ 0%, 100% { box-shadow: 0 0 15px rgba(255,0,102,0.6); }
+ 50% { box-shadow: 0 0 25px rgba(255,0,102,1); }
+ }
+ @keyframes glow-pulse {
+ 0% { box-shadow: 0 0 5px rgba(217,70,239,0.4); }
+ 100% { box-shadow: 0 0 15px rgba(217,70,239,0.8); }
+ }
`,
}}
/>
-
+
+
{ranked.length === 0 ? (
@@ -264,14 +275,14 @@ export default function LeaderboardTable({
Rank
Developer
-
Tech Stack
-
Environment
-
Score
+
Language
+
Editor
+
Hours
{/* List Body */}
- {ranked.map((user) => {
+ {ranked.slice(3).map((user) => {
const isCurrentUser = user.user_id === ownerId;
const pct = Math.max(2, (user.hours / maxHours) * 100);
const badgeInfo = getBadgeInfo(user.rank, user.hours);
@@ -346,7 +357,7 @@ export default function LeaderboardTable({
{/* MOBILE BOTTOM STACK / DESKTOP RIGHT ROW */}
- {/* Tech Stack */}
+ {/* Language */}
{user.languages.length > 0 ? (
user.languages.map((lang, i) => (
@@ -364,7 +375,7 @@ export default function LeaderboardTable({
)}
- {/* Environment */}
+ {/* Editor */}
{user.editor !== "N/A" && (
diff --git a/app/components/landing-page/TopLeaderbord.tsx b/app/components/landing-page/TopLeaderbord.tsx
index 52db441..af33bbd 100644
--- a/app/components/landing-page/TopLeaderbord.tsx
+++ b/app/components/landing-page/TopLeaderbord.tsx
@@ -1,18 +1,7 @@
-export interface Category {
- name: string;
- text: string;
- hours: number;
- decimal: string;
- digital: string;
- minutes: number;
- percent: number;
- total_seconds: number;
-}
-
export interface TopMember {
email: string;
total_seconds: number;
- categories?: Category[];
+ categories?: { name: string; total_seconds: number }[];
}
export default function TopLeaderboard({
diff --git a/app/components/leaderboard/BackButton.tsx b/app/components/leaderboard/BackButton.tsx
index 9029387..cff840a 100644
--- a/app/components/leaderboard/BackButton.tsx
+++ b/app/components/leaderboard/BackButton.tsx
@@ -4,12 +4,12 @@ import { useRouter } from "next/navigation";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons";
-export default function BackButton() {
+export default function BackButton({ href = "/dashboard/leaderboards" }: { href?: string }) {
const router = useRouter();
return (