From e8bcfcf8aba3bff04cb7a54e1efcc3aa1ae01dee Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Thu, 26 Feb 2026 15:51:01 -0500 Subject: [PATCH] ui: fix alignment issues and improve responsive layout --- static/css/dashboard.css | 179 ++++++++++++++++++++++++--------------- static/js/dashboard.js | 4 +- 2 files changed, 111 insertions(+), 72 deletions(-) diff --git a/static/css/dashboard.css b/static/css/dashboard.css index 2e5da3e6..fdb9a123 100644 --- a/static/css/dashboard.css +++ b/static/css/dashboard.css @@ -6,7 +6,7 @@ } :root { - /* Color Palette - Modern SaaS Darkish Theme */ + /* ... existing colors ... */ --primary: #6366f1; --primary-dark: #4f46e5; --primary-light: #818cf8; @@ -34,6 +34,13 @@ --border-radius: 12px; --border-radius-sm: 6px; + /* Spacing System */ + --spacing-xs: 0.25rem; + --spacing-sm: 0.5rem; + --spacing-md: 1rem; + --spacing-lg: 1.5rem; + --spacing-xl: 2rem; + /* Shadows */ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); @@ -54,23 +61,10 @@ body { .whitespace-nowrap { white-space: nowrap; } .code-sm { font-family: monospace; font-size: 0.8rem; background: var(--bg-secondary); padding: 2px 4px; border-radius: 4px; } -/* Login Screen */ -.login-container { - min-height: 100vh; +/* Dashboard Layout */ +.dashboard-container { display: flex; - align-items: center; - justify-content: center; - background: radial-gradient(circle at top left, #1e293b, #0f172a); - padding: 1.5rem; -} - -.login-card { - background: var(--bg-primary); - border-radius: var(--border-radius); - box-shadow: var(--shadow-lg); - padding: 3rem; - width: 100%; - max-width: 450px; + min-height: 100vh; } /* Sidebar */ @@ -83,33 +77,40 @@ body { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1000; box-shadow: var(--shadow-lg); + display: flex; + flex-direction: column; } -.sidebar.collapsed .logo span, -.sidebar.collapsed .menu-title, -.sidebar.collapsed .menu-item span, -.sidebar.collapsed .user-details { - display: none; -} - -.sidebar.collapsed .menu-item { - justify-content: center; - padding: 0.75rem 0; -} - -.sidebar.collapsed .menu-item i { - margin: 0; - font-size: 1.25rem; +.sidebar.collapsed { + width: 80px; } .sidebar-header { - padding: 1.5rem; + padding: var(--spacing-lg); display: flex; align-items: center; justify-content: space-between; + height: 70px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); } +.sidebar.collapsed .sidebar-header { + justify-content: center; + padding: var(--spacing-sm); +} + +.sidebar.collapsed .logo span { + display: none; +} + +.sidebar.collapsed .sidebar-toggle { + display: none; /* Hide toggle when collapsed to simplify, or center it */ +} + +.sidebar.collapsed .logo { + justify-content: center; +} + .logo { display: flex; align-items: center; @@ -117,15 +118,23 @@ body { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.025em; + overflow: hidden; } .logo i { color: var(--primary-light); font-size: 1.5rem; + min-width: 24px; +} + +.sidebar-menu { + flex: 1; + overflow-y: auto; + padding: var(--spacing-md) 0; } .menu-section { - padding: 1.5rem 0; + padding-bottom: var(--spacing-md); } .menu-title { @@ -133,20 +142,25 @@ body { font-weight: 700; text-transform: uppercase; color: var(--text-light); - padding: 0 1.5rem 0.75rem; + padding: 0 var(--spacing-lg) var(--spacing-sm); letter-spacing: 0.1em; + opacity: 0.5; +} + +.sidebar.collapsed .menu-title { + display: none; } .menu-item { display: flex; align-items: center; gap: 1rem; - padding: 0.75rem 1.5rem; + padding: 0.75rem var(--spacing-lg); color: #94a3b8; text-decoration: none; font-weight: 500; transition: all 0.2s; - border-right: 3px solid transparent; + border-left: 3px solid transparent; } .menu-item:hover { @@ -157,14 +171,31 @@ body { .menu-item.active { color: var(--text-white); background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent); - border-right-color: var(--primary); + border-left-color: var(--primary); +} + +.sidebar.collapsed .menu-item { + justify-content: center; + padding: 0.75rem 0; + border-left: none; +} + +.sidebar.collapsed .menu-item span { + display: none; +} + +.sidebar.collapsed .menu-item i { + font-size: 1.25rem; } /* Main Content Area */ .main-content { margin-left: 260px; + flex: 1; min-height: 100vh; transition: all 0.3s; + display: flex; + flex-direction: column; } .sidebar.collapsed ~ .main-content { @@ -179,26 +210,36 @@ body { display: flex; align-items: center; justify-content: space-between; - padding: 0 2rem; + padding: 0 var(--spacing-xl); position: sticky; top: 0; z-index: 100; } -.page-content { - padding: 2rem; +.nav-right { + display: flex; + align-items: center; + gap: var(--spacing-lg); } -/* Dashboard Cards */ +.nav-item { + display: flex; + align-items: center; + gap: var(--spacing-sm); + color: var(--text-secondary); + font-size: 0.875rem; +} + +/* Stat Cards */ .stat-card { background: var(--bg-card); - padding: 1.5rem; + padding: var(--spacing-lg); border-radius: var(--border-radius); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); display: flex; gap: 1.25rem; - align-items: flex-start; + align-items: center; /* Center horizontally/vertically */ } .stat-icon { @@ -209,42 +250,40 @@ body { align-items: center; justify-content: center; font-size: 1.25rem; + flex-shrink: 0; } -.stat-value { - font-size: 1.75rem; - font-weight: 800; - letter-spacing: -0.025em; +.stat-content { + flex: 1; } -.stat-label { - color: var(--text-secondary); - font-size: 0.875rem; - font-weight: 500; -} - -/* Badges */ -.grid-2 { +/* Grids */ +.grid-2, .grid-3 { display: grid; - grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; + margin-bottom: 1.5rem; } -.grid-3 { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); - gap: 1.5rem; +.grid-2 { grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); } +.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } + +/* WebSocket Dot Pulse */ +@keyframes ws-pulse { + 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); } + 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } + 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } } -.status-badge { - padding: 0.25rem 0.75rem; - border-radius: 9999px; - font-size: 0.7rem; - font-weight: 700; - text-transform: uppercase; - display: inline-flex; - align-items: center; - gap: 0.375rem; +.ws-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--text-light); +} + +.ws-dot.connected { + background: var(--success); + animation: ws-pulse 2s infinite; } .status-badge.online, .status-badge.success { background: #dcfce7; color: #166534; } diff --git a/static/js/dashboard.js b/static/js/dashboard.js index 487e76bb..dcbe2786 100644 --- a/static/js/dashboard.js +++ b/static/js/dashboard.js @@ -180,7 +180,7 @@ class Dashboard { getOverviewTemplate() { return `
-
+

Request Volume (Last 24h)

@@ -190,7 +190,7 @@ class Dashboard {
-
+

System Health