From d3d6af33cc907418ca880b12303bd928b999a9a1 Mon Sep 17 00:00:00 2001 From: Satyam <95536056+Satyam-Rastogi@users.noreply.github.com> Date: Fri, 13 Mar 2026 00:29:32 +0530 Subject: [PATCH] feat(procanvas): full light/dark mode redesign with distinct visual identities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Light mode — Energetic & Clean (Duolingo/fitness app aesthetic): - GlassPanel rebuilt as function component using useTheme; light mode gets solid colored header banners per panel (gold=Showdown, fire=Hot Streak, cyan=Weekly, blue=Stats/Leaderboard, purple=Rewards/Badges) with white text on color; dark mode keeps existing glass panel + accent glow line - Page background: zinc-100/80 so white cards float visually - Event cards (Showdown, Hot Streak, 12 Appointments) promoted to use GlassPanel title+icon props — each gets its own colored identity banner - OperatorCard: soft shadow + amber ring in light mode; stays dark (sports card aesthetic intentional); harsh rgba(0,0,0,0.6) shadow removed - Live Event Banner: vibrant emerald-600→green-700 gradient in light mode replacing the always-dark green-900; softer shadow and border - Log Action buttons: clean bg-white with shadow-sm, removed dark inset shadow that made them look dirty in light mode - Neon/cyan on white fixed: #AAFF00→green-600, #00E5FF→sky-500/sky-600 - EnergyBar tracks: bg-zinc-200 in light, bg-black/60 in dark - Leaderboard, badge cards, reward nodes: all adapted with dark: variants - XP badge in header: bg-zinc-100/border-zinc-200 in light mode - Import useTheme added to support GlassPanel and OperatorCard hooks Dark mode — unchanged; all existing glass panel aesthetics preserved. --- src/pages/ProCanvas.jsx | 343 +++++++++++++++++++++------------------- 1 file changed, 182 insertions(+), 161 deletions(-) diff --git a/src/pages/ProCanvas.jsx b/src/pages/ProCanvas.jsx index fae1a1e..498c91f 100644 --- a/src/pages/ProCanvas.jsx +++ b/src/pages/ProCanvas.jsx @@ -5,6 +5,7 @@ import { useAuth } from '../context/AuthContext'; import { useMockStore } from '../data/mockStore'; import { GamificationProvider, useGamification } from '../context/GamificationContext'; import { useGamification as useOldGamification } from '../hooks/useGamification'; +import { useTheme } from '../context/ThemeContext'; import FloatingXPManager from '../components/ProCanvas/gamification/FloatingXPManager'; import LevelUpModal from '../components/ProCanvas/gamification/LevelUpModal'; import profilePic from '../assets/images/Profile_Pic_1_Agent.png'; @@ -104,14 +105,23 @@ const HexLevelBadge = ({ level, color = C.gold, size = 100, mobileSize = 85 }) = // Fut-style Player Card const OperatorCard = ({ user, gamestate }) => { + const { theme } = useTheme(); + const isDark = theme === 'dark'; return ( {/* Card Background (Elite Gold Theme) */} -
+
{/* Glossy overlay */}
@@ -194,33 +204,52 @@ const OperatorCard = ({ user, gamestate }) => { }; // Sleek Glass Panel (base container for UI) -const GlassPanel = ({ children, className = '', accentColor = 'transparent', title, icon: Icon, extra }) => ( -
+function GlassPanel({ children, className = '', accentColor = 'transparent', title, icon: Icon, extra }) { + const { theme } = useTheme(); + const isDark = theme === 'dark'; + const hasAccent = accentColor !== 'transparent'; - {/* Subtle accent glow at the top */} - {accentColor !== 'transparent' && ( -
- )} + return ( +
- {/* Header if provided */} - {(title || Icon || extra) && ( -
-
- {Icon && } -

- {title} -

-
- {extra &&
{extra}
} + {/* Dark mode: subtle accent glow line at top */} + {isDark && hasAccent && ( +
+ )} + + {/* Header */} + {(title || Icon || extra) && ( + isDark ? ( +
+
+ {Icon && } +

{title}

+
+ {extra &&
{extra}
} +
+ ) : ( +
+
+ {Icon && } +

{title}

+
+ {extra &&
{extra}
} +
+ ) + )} + +
+ {children}
- )} - -
- {children}
-
-); + ); +} // Progress Bar (Sleek, bright energy bar) const EnergyBar = ({ current, max, color = C.neon, label }) => { @@ -229,11 +258,11 @@ const EnergyBar = ({ current, max, color = C.neon, label }) => {
{label && (
- {label} - / {max} + {label} + / {max}
)} -
+
{ {actionKey === 'knock' && ( <>
- - + +
- - + +
- - + +
- - setXpReward(e.target.value === 'Pitched' ? 15 : 10)} className="w-full bg-zinc-100 dark:bg-black/50 border border-zinc-300 dark:border-white/10 rounded-lg p-3 text-zinc-900 dark:text-white focus:outline-none focus:border-[#AAFF00] transition-colors">
- +