From b81346dbb25925a12c616fbd73ab89cc5ffaca11 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Tue, 26 May 2026 19:11:17 +0300 Subject: [PATCH] refactor(quieter): tone down AdminPanel + AdminDashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per /impeccable audit findings: admin overview pages concentrated AI-aesthetic tells. Apply the 'quieter' refinement — strip the loudness, keep the structure, preserve state-conveying motion. AdminPanel.tsx • Hero h1 — drop bg-clip-text + 3-stop gradient. Solid text-dark-50 (the absolute ban applied; type weight + size carry hierarchy now). • 'Online' dot — drop the 10px-radius glow shadow; the dot + pulse animation alone signal liveness. • GlassCard — drop the 3D perspective-tilt mouse-tracking (decorative motion that didn't convey state), drop the staggered enter animation (no orchestrated page-load), drop the top hairline-glow gradient, drop the inner shine overlay + drop-shadow-sm on the count badge. Keep backdrop-blur on the card body itself — the component is literally named GlassCard, the glass identity is the point. Hover state stays. • Stats-bar pills (2 places) — drop backdrop-blur. Tiny data cells don't need glass. • Search empty-state icon container — drop backdrop-blur. Decorative on a non-interactive surface. AdminDashboard.tsx • Strip backdrop-blur from all 9 stat / node / panel cards. They were using it as ambient noise; solid bg-dark-800/{30,50} reads better and renders faster. • Daily-sales progress bar — drop the from-accent-600 to-accent-400 gradient (and hover gradient swap). Solid bg-accent-500, hover bg-accent-400. Width still animates (functional state change). • Animate-pulse on the connected-node status dot kept — it conveys 'live' state, which is exactly what motion is for in product UI. --- src/pages/AdminDashboard.tsx | 18 +++++----- src/pages/AdminPanel.tsx | 68 ++++++++---------------------------- 2 files changed, 23 insertions(+), 63 deletions(-) diff --git a/src/pages/AdminDashboard.tsx b/src/pages/AdminDashboard.tsx index a53c212..c0fd632 100644 --- a/src/pages/AdminDashboard.tsx +++ b/src/pages/AdminDashboard.tsx @@ -178,7 +178,7 @@ function StatCard({ title, value, subtitle, icon, color, trend }: StatCardProps) }; return ( -
+
{icon}
{trend && ( @@ -230,7 +230,7 @@ function NodeCard({ node, onRestart, onToggle, isLoading }: NodeCardProps) { return (
@@ -499,7 +499,7 @@ export default function AdminDashboard() {
{/* Nodes Section */} -
+
@@ -568,7 +568,7 @@ export default function AdminDashboard() { {/* Revenue and Subscriptions */}
{/* Revenue Chart */} -
+
@@ -602,7 +602,7 @@ export default function AdminDashboard() {
{/* Subscription Stats */} -
+
@@ -701,7 +701,7 @@ export default function AdminDashboard() { {/* Tariff Stats */} {stats?.tariff_stats && stats.tariff_stats.tariffs.length > 0 && ( -
+
@@ -778,7 +778,7 @@ export default function AdminDashboard() {
{/* Top Referrers */} {referrers && (referrers.by_earnings.length > 0 || referrers.by_invited.length > 0) && ( -
+
@@ -918,7 +918,7 @@ export default function AdminDashboard() { {/* Top Campaigns */} {campaigns && campaigns.campaigns.length > 0 && ( -
+
@@ -981,7 +981,7 @@ export default function AdminDashboard() { {/* Recent Payments */} {payments && payments.payments.length > 0 && ( -
+
diff --git a/src/pages/AdminPanel.tsx b/src/pages/AdminPanel.tsx index 088869c..44121da 100644 --- a/src/pages/AdminPanel.tsx +++ b/src/pages/AdminPanel.tsx @@ -690,7 +690,7 @@ const StatsBar = memo(function StatsBar({ systemInfo, dashboardStats, loading }:
state.hasPermission); const [hoveredItem, setHoveredItem] = useState(null); - const cardRef = useRef(null); - const [tilt, setTilt] = useState({ x: 0, y: 0 }); - const tiltRef = useRef({ x: 0, y: 0 }); - const rafRef = useRef(0); - - useEffect(() => () => cancelAnimationFrame(rafRef.current), []); - - const onMouseMove = useCallback((e: React.MouseEvent) => { - if (!cardRef.current) return; - const rect = cardRef.current.getBoundingClientRect(); - tiltRef.current = { - x: ((e.clientY - rect.top) / rect.height - 0.5) * -2.5, - y: ((e.clientX - rect.left) / rect.width - 0.5) * 2.5, - }; - cancelAnimationFrame(rafRef.current); - rafRef.current = requestAnimationFrame(() => { - setTilt({ ...tiltRef.current }); - }); - }, []); - - const onMouseLeave = useCallback(() => { - cancelAnimationFrame(rafRef.current); - setTilt({ x: 0, y: 0 }); - }, []); + // 3D mouse-tracking tilt removed: decorative motion that didn't convey state. + // Hover styling alone signals interactivity. + void index; const visibleItems = useMemo( () => @@ -796,31 +775,14 @@ const GlassCard = memo(function GlassCard({ section, index, searchTerm }: GlassC if (visibleItems.length === 0) return null; return ( -
- {/* Top glow line */} -
- +
{/* Header */}
- {/* Shine overlay */} -
-
@@ -836,16 +798,13 @@ const GlassCard = memo(function GlassCard({ section, index, searchTerm }: GlassC key={item.to} to={item.to} className={cn( - 'group/item flex items-center gap-2.5 rounded-xl border border-transparent px-2 py-1.5 transition-all duration-150', + 'group/item flex items-center gap-2.5 rounded-xl border border-transparent px-2 py-1.5 transition-colors duration-150', hoveredItem === i ? 'border-dark-600/50 bg-dark-700/30 light:border-champagne-400/40 light:bg-champagne-200/50' : 'hover:border-dark-600/50 hover:bg-dark-700/30 light:hover:border-champagne-400/40 light:hover:bg-champagne-200/50', )} onMouseEnter={() => setHoveredItem(i)} onMouseLeave={() => setHoveredItem(null)} - style={{ - animation: `adminItemEnter 0.35s cubic-bezier(0.22, 1, 0.36, 1) ${index * 60 + i * 20}ms both`, - }} > {/* Icon */}
-

+

{t('admin.panel.title')}

-