From 6767a01700d1242efba9c0ec71f225adf69b94ca Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 20:25:39 +0100 Subject: [PATCH 1/4] More seamless problems UI --- src/app/problems/page.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/app/problems/page.tsx b/src/app/problems/page.tsx index 4eacb13..2abc43d 100644 --- a/src/app/problems/page.tsx +++ b/src/app/problems/page.tsx @@ -32,24 +32,13 @@ export default function Problems() { {/* Filters */} -
+
{/* Search */}
- {/* Category Filter */} -
- - {["Arrays", "Trees", "Graphs", "DP", "Strings"].map((f) => ( - - {f} - - ))} - -
- {/* Difficulty Filter */}
@@ -63,7 +52,9 @@ export default function Problems() { {/* View Toggle */} v && setViewMode(v as "grid" | "list")} > From 70c3eb1285cba199a09cdc278a36dc8a909cf2c0 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 20:47:00 +0100 Subject: [PATCH 2/4] Improved UI and css stuff and problems shadcnified --- src/app/globals.css | 60 +---------- src/app/problems/components/ProblemCard.tsx | 107 +++++++++++--------- src/components/app/Rank.tsx | 18 ++-- 3 files changed, 74 insertions(+), 111 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index afc34f5..c3dd94a 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -163,33 +163,6 @@ } @layer components { - - /* ===== Glow effects ===== */ - .glow-purple { - box-shadow: - 0 0 20px color-mix(in oklch, var(--primary) 30%, transparent), - 0 0 40px color-mix(in oklch, var(--primary) 10%, transparent); - } - - .glow-purple-intense { - box-shadow: - 0 0 30px color-mix(in oklch, var(--primary) 50%, transparent), - 0 0 60px color-mix(in oklch, var(--primary) 20%, transparent); - } - - .glow-gold { - box-shadow: 0 0 20px color-mix(in oklch, oklch(82.8% 0.189 84.429) 70%, transparent); - /* box-shadow: 0 0 20px color-mix(in oklch, var(--chart-4) 40%, transparent); */ - } - - .glow-silver { - box-shadow: 0 0 20px color-mix(in oklch, var(--foreground) 60%, transparent); - } - - .glow-bronze { - box-shadow: 0 0 20px color-mix(in oklch, oklch(55.5% 0.163 48.998) 60%, transparent); - } - /* ===== Text glow ===== */ .text-glow { text-shadow: 0 0 20px color-mix(in oklch, var(--primary) 50%, transparent); @@ -218,44 +191,13 @@ box-shadow: 0 10px 40px color-mix(in oklch, var(--primary) 15%, transparent); } - /* ===== Timer / mono UI ===== */ + /* ===== Timer ===== */ .timer-display { font-family: var(--font-geist-mono); @apply text-6xl font-bold tracking-wider; text-shadow: 0 0 30px color-mix(in oklch, var(--primary) 60%, transparent); } - .split-time { - font-family: var(--font-geist-mono); - @apply text-sm tracking-wide; - } - - /* ===== Rank badges ===== */ - .rank-gold { - @apply bg-linear-to-r from-yellow-500 to-amber-400 text-black; - } - - .rank-silver { - @apply bg-linear-to-r from-gray-300 to-gray-400 text-black; - } - - .rank-bronze { - @apply bg-linear-to-r from-orange-600 to-amber-700 text-white; - } - - /* ===== Difficulty badges ===== */ - .diff-easy { - @apply bg-emerald-500/20 text-emerald-400 border border-emerald-500/30; - } - - .diff-medium { - @apply bg-amber-500/20 text-amber-400 border border-amber-500/30; - } - - .diff-hard { - @apply bg-red-500/20 text-red-400 border border-red-500/30; - } - /* ===== Animations ===== */ .pulse-live { animation: pulse-glow 2s ease-in-out infinite; diff --git a/src/app/problems/components/ProblemCard.tsx b/src/app/problems/components/ProblemCard.tsx index 2a9f5b8..3ea94e4 100644 --- a/src/app/problems/components/ProblemCard.tsx +++ b/src/app/problems/components/ProblemCard.tsx @@ -1,4 +1,13 @@ import { Button } from "@/components/ui/button"; +import { + Card, + CardHeader, + CardContent, + CardFooter, + CardDescription, + CardTitle, +} from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; import { Problem } from "@/modules/problems/types"; import { Clock, Zap, Users, Code } from "lucide-react"; @@ -15,9 +24,9 @@ const ProblemCard = ({ attempts?: number; }) => { const difficultyStyles = { - easy: "diff-easy", - medium: "diff-medium", - hard: "diff-hard", + easy: "bg-emerald-500/10 text-emerald-400 border border-emerald-500/30", + medium: "bg-amber-500/10 text-amber-400 border border-amber-500/30", + hard: "bg-red-500/10 text-red-400 border border-red-500/30", }; const difficultyLabels = { @@ -27,66 +36,72 @@ const ProblemCard = ({ }; return ( -
- {/* Glow effect on hover */} -
+ {/* Glow */} +
- {/* Content */} -
- {/* Header */} -
-

- {problem.title} -

- + + {problem.title} + {difficultyLabels[problem.difficulty]} - -
+ + - {/* Tags / Meta */} -
-
- {bestTime && ( -
- - {bestTime} -
- )} + + {problem.description} + + + + {/* Content */} + + {/* Meta */} +
+ {bestTime && (
- - {attempts} runs + + {bestTime}
+ )} + +
+ + {attempts} runs
{problem.language && ( - - {problem.language} - + + + {problem.language} + )}
+
- {/* Description */} -

- {problem.description} -

- -
- -
-
-
+ {/* Footer */} + + + + ); }; diff --git a/src/components/app/Rank.tsx b/src/components/app/Rank.tsx index 0727cad..b916269 100644 --- a/src/components/app/Rank.tsx +++ b/src/components/app/Rank.tsx @@ -2,16 +2,22 @@ import { Trophy } from "lucide-react"; export default function Rank({ rank }: { rank: number }) { const getRankStyle = (rank: number) => { - if (rank === 1) return "rank-gold"; - if (rank === 2) return "rank-silver"; - if (rank === 3) return "rank-bronze"; + if (rank === 1) + return "bg-linear-to-r from-yellow-500 to-amber-400 text-black"; + if (rank === 2) + return "bg-linear-to-r from-gray-300 to-gray-400 text-black"; + if (rank === 3) + return "bg-linear-to-r from-orange-600 to-amber-700 text-white"; return "bg-secondary text-muted-foreground"; }; const getRankGlow = (rank: number) => { - if (rank === 1) return "glow-gold"; - if (rank === 2) return "glow-silver"; - if (rank === 3) return "glow-bronze"; + if (rank === 1) + return "shadow-[0_0_20px_color-mix(in_oklch,oklch(82.8%_0.189_84.429)_70%,transparent)]"; + if (rank === 2) + return "shadow-[0_0_20px_color-mix(in_oklch,var(--foreground)_60%,transparent)]"; + if (rank === 3) + return "shadow-[0_0_20px_color-mix(in_oklch,oklch(55.5%_0.163_48.998)_60%,transparent)]"; return ""; }; From 9afd6e4fd95e23f4928a64cdd3b808e68baa2949 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 21:01:24 +0100 Subject: [PATCH 3/4] Leaderboard UI improvement --- .../components/LeaderboardRow.tsx | 0 .../{leaderboards => leaderboard}/page.tsx | 41 +++---------------- src/app/page.tsx | 4 +- src/components/app/Footer.tsx | 2 +- src/components/app/Navbar.tsx | 4 +- 5 files changed, 11 insertions(+), 40 deletions(-) rename src/app/{leaderboards => leaderboard}/components/LeaderboardRow.tsx (100%) rename src/app/{leaderboards => leaderboard}/page.tsx (76%) diff --git a/src/app/leaderboards/components/LeaderboardRow.tsx b/src/app/leaderboard/components/LeaderboardRow.tsx similarity index 100% rename from src/app/leaderboards/components/LeaderboardRow.tsx rename to src/app/leaderboard/components/LeaderboardRow.tsx diff --git a/src/app/leaderboards/page.tsx b/src/app/leaderboard/page.tsx similarity index 76% rename from src/app/leaderboards/page.tsx rename to src/app/leaderboard/page.tsx index 51e704a..a59e046 100644 --- a/src/app/leaderboards/page.tsx +++ b/src/app/leaderboard/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { Trophy, Calendar, Globe, TrendingUp } from "lucide-react"; +import { Calendar, Globe } from "lucide-react"; import { useState } from "react"; import { Card } from "@/components/ui/card"; @@ -21,15 +21,14 @@ import { PaginationPrevious, } from "@/components/ui/pagination"; -import LeaderboardRow from "@/app/leaderboards/components/LeaderboardRow"; -import StatCard from "@/components/app/StatCard"; +import LeaderboardRow from "@/app/leaderboard/components/LeaderboardRow"; import useAction from "@/hook/use-action"; import { getGlobalLeaderboard, getWeeklyLeaderboard, } from "@/modules/leaderboard/actions"; -export default function Leaderboards() { +export default function Leaderboard() { const [global] = useAction(getGlobalLeaderboard); const [weekly] = useAction(getWeeklyLeaderboard); @@ -41,40 +40,12 @@ export default function Leaderboards() {
{/* Header */}
-

Leaderboards

-

- The fastest runners in the game. Will you claim a spot? +

Leaderboard

+

+ 1,284 runners ยท Ranked by performance

- {/* Stats */} -
- - - - -
- {/* Tabs + Filters */}
- +
diff --git a/src/components/app/Footer.tsx b/src/components/app/Footer.tsx index b483c8e..af5195c 100644 --- a/src/components/app/Footer.tsx +++ b/src/components/app/Footer.tsx @@ -34,7 +34,7 @@ const Footer = () => { - {/* Tabs + Filters */} + {/* Filters */}