From 70c3eb1285cba199a09cdc278a36dc8a909cf2c0 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 20:47:00 +0100 Subject: [PATCH] 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 ""; };