From 9b254d50ea3dcdba84ca8c733fbfafd4b9021da7 Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Thu, 26 Feb 2026 18:22:19 -0500 Subject: [PATCH] ui: apply Gruvbox Dark theme to dashboard and charts --- static/css/dashboard.css | 764 ++++++++------------------------------- static/js/charts.js | 63 ++-- 2 files changed, 187 insertions(+), 640 deletions(-) diff --git a/static/css/dashboard.css b/static/css/dashboard.css index 15094479..c1cefb00 100644 --- a/static/css/dashboard.css +++ b/static/css/dashboard.css @@ -6,33 +6,61 @@ } :root { - /* Color Palette - Modern SaaS Darkish Theme */ - --primary: #6366f1; - --primary-dark: #4f46e5; - --primary-light: #818cf8; - --secondary: #64748b; - --success: #10b981; - --warning: #f59e0b; - --danger: #ef4444; - --info: #06b6d4; + /* Gruvbox Dark Color Palette */ + --bg0: #282828; + --bg1: #3c3836; + --bg2: #504945; + --bg3: #665c54; + --bg4: #7c6f64; + + --fg0: #fbf1c7; + --fg1: #ebdbb2; + --fg2: #d5c4a1; + --fg3: #bdae93; + --fg4: #a89984; + + --red: #cc241d; + --red-light: #fb4934; + --green: #98971a; + --green-light: #b8bb26; + --yellow: #d79921; + --yellow-light: #fabd2f; + --blue: #458588; + --blue-light: #83a598; + --purple: #b16286; + --purple-light: #d3869b; + --aqua: #689d6a; + --aqua-light: #8ec07c; + --orange: #d65d0e; + --orange-light: #fe8019; + + /* Theme Mapping */ + --primary: var(--orange); + --primary-dark: var(--orange); + --primary-light: var(--orange-light); + --secondary: var(--bg4); + --success: var(--green); + --warning: var(--yellow); + --danger: var(--red); + --info: var(--blue); /* Background Colors */ - --bg-primary: #ffffff; - --bg-secondary: #f8fafc; - --bg-sidebar: #0f172a; - --bg-card: #ffffff; - --bg-hover: #f1f5f9; + --bg-primary: var(--bg0); + --bg-secondary: var(--bg1); + --bg-sidebar: #1d2021; + --bg-card: var(--bg1); + --bg-hover: var(--bg2); /* Text Colors */ - --text-primary: #0f172a; - --text-secondary: #475569; - --text-light: #94a3b8; - --text-white: #ffffff; + --text-primary: var(--fg1); + --text-secondary: var(--fg3); + --text-light: var(--fg4); + --text-white: var(--fg0); /* Borders */ - --border-color: #e2e8f0; - --border-radius: 12px; - --border-radius-sm: 6px; + --border-color: var(--bg2); + --border-radius: 8px; + --border-radius-sm: 4px; /* Spacing System */ --spacing-xs: 0.25rem; @@ -42,15 +70,15 @@ --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); - --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); - --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2); + --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3); + --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4); + --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5); } body { font-family: 'Inter', -apple-system, sans-serif; - background-color: var(--bg-secondary); + background-color: var(--bg-primary); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; @@ -59,7 +87,7 @@ body { /* Utils */ .text-center { text-align: center; } .whitespace-nowrap { white-space: nowrap; } -.code-sm { font-family: monospace; font-size: 0.8rem; background: var(--bg-secondary); padding: 2px 4px; border-radius: 4px; } +.code-sm { font-family: monospace; font-size: 0.8rem; background: var(--bg-secondary); color: var(--aqua-light); padding: 2px 4px; border-radius: 4px; } /* Dashboard Layout */ .dashboard-container { @@ -91,27 +119,27 @@ body { align-items: center; justify-content: space-between; height: 70px; - border-bottom: 1px solid rgba(255, 255, 255, 0.05); + border-bottom: 1px solid var(--bg2); } .sidebar-toggle { - background: rgba(255, 255, 255, 0.05); + background: var(--bg2); border: none; - color: var(--text-white); + color: var(--fg1); width: 32px; height: 32px; - border-radius: 6px; + border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; - opacity: 0.7; - flex-shrink: 0; + opacity: 0.8; } .sidebar-toggle:hover { - background: rgba(255, 255, 255, 0.1); + background: var(--bg3); + color: var(--fg0); opacity: 1; } @@ -124,23 +152,20 @@ body { display: none; } -.sidebar.collapsed .sidebar-toggle { - opacity: 1; -} - .logo { display: flex; align-items: center; gap: 0.75rem; font-size: 1.25rem; font-weight: 800; + color: var(--orange-light); letter-spacing: -0.025em; overflow: hidden; white-space: nowrap; } .logo i { - color: var(--primary-light); + color: var(--orange); font-size: 1.5rem; min-width: 24px; } @@ -159,10 +184,10 @@ body { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; - color: var(--text-light); + color: var(--fg4); padding: 0 var(--spacing-lg) var(--spacing-sm); letter-spacing: 0.1em; - opacity: 0.5; + opacity: 0.6; } .sidebar.collapsed .menu-title { @@ -174,22 +199,27 @@ body { align-items: center; gap: 1rem; padding: 0.75rem var(--spacing-lg); - color: #94a3b8; + color: var(--fg3); text-decoration: none; font-weight: 500; transition: all 0.2s; border-left: 3px solid transparent; } +.menu-item i { + width: 20px; + text-align: center; +} + .menu-item:hover { - color: var(--text-white); - background: rgba(255, 255, 255, 0.03); + color: var(--fg0); + background: var(--bg1); } .menu-item.active { - color: var(--text-white); - background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent); - border-left-color: var(--primary); + color: var(--fg0); + background: var(--bg2); + border-left-color: var(--orange); } .sidebar.collapsed .menu-item { @@ -206,39 +236,22 @@ body { font-size: 1.25rem; } -/* Sidebar Tooltips (for collapsed state) */ -.sidebar.collapsed .menu-item { - position: relative; -} - +/* Sidebar Tooltips */ .sidebar.collapsed .menu-item::after { - content: attr(data-tooltip); - position: absolute; - left: 100%; - margin-left: 10px; - background: #1e293b; - color: white; - padding: 4px 8px; - border-radius: 4px; - font-size: 0.75rem; - opacity: 0; - pointer-events: none; - transition: opacity 0.2s; - white-space: nowrap; - z-index: 1001; -} - -.sidebar.collapsed .menu-item:hover::after { - opacity: 1; + background: var(--bg0); + color: var(--fg1); + border: 1px solid var(--bg2); } +/* Sidebar Footer */ .sidebar-footer { padding: var(--spacing-lg); - border-top: 1px solid rgba(255, 255, 255, 0.05); + border-top: 1px solid var(--bg2); display: flex; align-items: center; justify-content: space-between; min-height: 70px; + background: #1d2021; } .sidebar.collapsed .sidebar-footer { @@ -246,69 +259,23 @@ body { padding: var(--spacing-lg) 0; } -.sidebar.collapsed .user-details, -.sidebar.collapsed .logout-btn { - display: none; -} - -.user-info { - display: flex; - align-items: center; - gap: 0.75rem; - overflow: hidden; -} - .user-avatar { - width: 32px; - height: 32px; - border-radius: 50%; - background: rgba(255, 255, 255, 0.1); - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; -} - -.user-details { - display: flex; - flex-direction: column; - overflow: hidden; -} - -.user-name { - font-size: 0.875rem; - font-weight: 600; - white-space: nowrap; - text-overflow: ellipsis; -} - -.user-role { - font-size: 0.75rem; - color: var(--text-light); - opacity: 0.7; + background: var(--bg2); + color: var(--fg1); } .logout-btn { - background: none; - border: none; - color: #94a3b8; - cursor: pointer; - font-size: 1.125rem; - transition: color 0.2s; + color: var(--fg4); } .logout-btn:hover { - color: var(--danger); + color: var(--red-light); } /* Main Content Area */ .main-content { margin-left: 260px; - flex: 1; - min-height: 100vh; - transition: all 0.3s; - display: flex; - flex-direction: column; + background-color: var(--bg-primary); } .sidebar.collapsed ~ .main-content { @@ -316,550 +283,127 @@ body { } .top-nav { - height: 70px; - background: rgba(255, 255, 255, 0.8); - backdrop-filter: blur(8px); - border-bottom: 1px solid var(--border-color); - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 var(--spacing-xl); - position: sticky; - top: 0; - z-index: 100; + background: var(--bg0); + border-bottom: 1px solid var(--bg2); } .nav-left .page-title { - font-size: 1.25rem; - font-weight: 700; - color: var(--text-primary); -} - -.nav-right { - display: flex; - align-items: center; - gap: var(--spacing-lg); + color: var(--fg0); } .nav-item { - display: flex; - align-items: center; - gap: var(--spacing-sm); - color: var(--text-secondary); - font-size: 0.875rem; - cursor: pointer; - transition: color 0.2s; + color: var(--fg3); } .nav-item:hover { - color: var(--primary); + color: var(--orange-light); } -/* Page Content */ -.page-content { - padding: var(--spacing-xl); - flex: 1; - animation: fadeIn 0.3s ease-out; -} - -@keyframes fadeIn { - from { opacity: 0; transform: translateY(5px); } - to { opacity: 1; transform: translateY(0); } -} - -/* Grids */ -.grid-2, .grid-3 { - display: grid; - gap: 1.5rem; - margin-bottom: 1.5rem; -} - -.grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); } -.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } - -/* Stat Cards */ -.stats-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); - gap: 1.5rem; - margin-bottom: 1.5rem; -} - -.stat-card { - background: var(--bg-card); - 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: center; - transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); +/* Cards */ +.card, .stat-card, .chart-container { + background: var(--bg1); + border: 1px solid var(--bg2); } .stat-card:hover { - border-color: var(--primary-light); - transform: translateY(-2px); - box-shadow: var(--shadow-md); + border-color: var(--orange); } -.stat-icon { - width: 48px; - height: 48px; - border-radius: 10px; - display: flex; - align-items: center; - justify-content: center; - font-size: 1.25rem; - flex-shrink: 0; -} +.stat-icon.primary { background: rgba(214, 93, 14, 0.1); color: var(--orange); } +.stat-icon.success { background: rgba(152, 151, 26, 0.1); color: var(--green-light); } +.stat-icon.warning { background: rgba(215, 153, 33, 0.1); color: var(--yellow-light); } +.stat-icon.danger { background: rgba(204, 36, 29, 0.1); color: var(--red-light); } -.stat-icon.primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); } -.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); } -.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); } -.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); } - -.stat-content { - flex: 1; - display: flex; - flex-direction: column; -} - -.stat-value { - font-size: 1.5rem; - font-weight: 800; - letter-spacing: -0.025em; - line-height: 1.2; -} - -.stat-label { - color: var(--text-secondary); - font-size: 0.875rem; - font-weight: 500; - margin-bottom: 2px; -} - -.stat-change { - font-size: 0.75rem; - font-weight: 600; - margin-top: 4px; -} - -.stat-change.positive { color: var(--success); } -.stat-change.negative { color: var(--danger); } - -/* Generic Cards */ -.card { - background: var(--bg-card); - border-radius: var(--border-radius); - border: 1px solid var(--border-color); - box-shadow: var(--shadow-sm); - margin-bottom: 1.5rem; - display: flex; - flex-direction: column; -} - -.card-header { - padding: 1.25rem var(--spacing-lg); - border-bottom: 1px solid var(--border-color); - display: flex; - justify-content: space-between; - align-items: center; -} - -.card-title { - font-size: 1rem; - font-weight: 700; - color: var(--text-primary); - display: flex; - align-items: center; - gap: 0.5rem; -} - -.card-body { - padding: var(--spacing-lg); -} - -.card-action-btn { - background: none; - border: none; - color: var(--text-secondary); - cursor: pointer; - font-size: 1rem; - transition: color 0.2s; -} - -.card-action-btn:hover { - color: var(--primary); -} +.stat-value { color: var(--fg0); } +.stat-label { color: var(--fg3); } /* Tables */ -.table-container { - overflow-x: auto; -} - -.table { - width: 100%; - border-collapse: collapse; -} - .table th { - background: #f8fafc; - text-align: left; - padding: 0.75rem 1rem; - font-size: 0.75rem; - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.05em; - color: #64748b; - border-bottom: 1px solid var(--border-color); + background: var(--bg2); + color: var(--fg2); + border-bottom: 1px solid var(--bg3); } .table td { - padding: 1rem; - border-bottom: 1px solid #f1f5f9; - font-size: 0.875rem; + color: var(--fg1); + border-bottom: 1px solid var(--bg2); } .table tr:hover td { - background-color: var(--bg-hover); -} - -.table tr:last-child td { - border-bottom: none; + background-color: var(--bg2); } /* Badges */ -.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; -} - -.status-badge.online, .status-badge.success { background: #dcfce7; color: #166534; } -.status-badge.offline, .status-badge.danger { background: #fee2e2; color: #991b1b; } -.status-badge.warning { background: #fef9c3; color: #854d0e; } +.status-badge.online, .status-badge.success { background: rgba(184, 187, 38, 0.2); color: var(--green-light); } +.status-badge.offline, .status-badge.danger { background: rgba(251, 73, 52, 0.2); color: var(--red-light); } +.status-badge.warning { background: rgba(250, 189, 47, 0.2); color: var(--yellow-light); } .badge-client { - background: #f1f5f9; - color: #475569; - padding: 2px 8px; - border-radius: 6px; - font-family: monospace; - font-size: 0.85rem; - border: 1px solid #e2e8f0; -} - -/* Charts */ -.chart-container { - background: white; - border: 1px solid var(--border-color); - border-radius: var(--border-radius); - padding: 1.5rem; + background: var(--bg2); + color: var(--blue-light); + border: 1px solid var(--bg3); } /* Forms */ -.form-control { - margin-bottom: 1.25rem; -} - -.form-control label { - display: block; - font-weight: 600; - margin-bottom: 0.5rem; - font-size: 0.875rem; - color: var(--text-secondary); -} - +.form-control label { color: var(--fg2); } .form-control input, .form-control textarea, .form-control select { - width: 100%; - border: 1px solid #cbd5e1; - border-radius: 8px; - padding: 0.75rem; - font-family: inherit; - font-size: 0.875rem; - transition: all 0.2s; + background: var(--bg0); + border-color: var(--bg3); + color: var(--fg1); } -.form-control input:focus, .form-control textarea:focus, .form-control select:focus { - outline: none; - border-color: var(--primary); - box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); +.form-control input:focus { + border-color: var(--orange); + box-shadow: 0 0 0 2px rgba(214, 93, 14, 0.2); } -.btn { - display: inline-flex; - align-items: center; - gap: 0.5rem; - padding: 0.625rem 1.25rem; - border-radius: 8px; - font-weight: 600; - font-size: 0.875rem; - cursor: pointer; - transition: all 0.2s; - border: 1px solid transparent; -} +.btn-primary { background: var(--orange); color: var(--bg0); } +.btn-primary:hover { background: var(--orange-light); } -.btn-primary { background: var(--primary); color: white; } -.btn-primary:hover { background: var(--primary-dark); } - -.btn-secondary { background: white; border-color: var(--border-color); color: var(--text-secondary); } -.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); } - -.btn-danger { background: var(--danger); color: white; } -.btn-danger:hover { background: #dc2626; } +.btn-secondary { background: var(--bg2); border-color: var(--bg3); color: var(--fg1); } +.btn-secondary:hover { background: var(--bg3); color: var(--fg0); } /* Modals */ -.modal { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(15, 23, 42, 0.6); - backdrop-filter: blur(4px); - display: flex; - align-items: center; - justify-content: center; - z-index: 2000; - opacity: 0; - visibility: hidden; - transition: all 0.2s; -} - -.modal.active { - opacity: 1; - visibility: visible; -} - .modal-content { - background: white; - border-radius: 16px; - width: 90%; - max-width: 500px; - box-shadow: var(--shadow-lg); - transform: translateY(20px); - transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + background: var(--bg1); + border: 1px solid var(--bg3); + color: var(--fg1); } -.modal.active .modal-content { - transform: translateY(0); +.modal-header { border-bottom-color: var(--bg2); } +.modal-footer { border-top-color: var(--bg2); } + +/* WebSocket Dot */ +.ws-dot.connected { + background: var(--green-light); + box-shadow: 0 0 8px var(--green-light); } -.modal-header { - padding: 1.25rem 1.5rem; - border-bottom: 1px solid var(--border-color); - display: flex; - justify-content: space-between; - align-items: center; +/* Toasts */ +.toast { + background: var(--bg2); + color: var(--fg1); + border-left-color: var(--orange); } -.modal-title { - font-size: 1.125rem; - font-weight: 700; -} +.toast.success { border-left-color: var(--green); } +.toast.error { border-left-color: var(--red); } -.modal-close { - background: none; - border: none; - color: var(--text-secondary); - cursor: pointer; - font-size: 1.25rem; -} - -.modal-body { - padding: 1.5rem; -} - -.modal-footer { - padding: 1.25rem 1.5rem; - border-top: 1px solid var(--border-color); - display: flex; - justify-content: flex-end; - gap: 0.75rem; -} - -/* 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); } -} - -.ws-dot { +/* Scrollbars for Gruvbox */ +::-webkit-scrollbar { width: 8px; height: 8px; - border-radius: 50%; - background: var(--text-light); } -.ws-dot.connected { - background: var(--success); - animation: ws-pulse 2s infinite; +::-webkit-scrollbar-track { + background: var(--bg0); } -.ws-dot.disconnected { background: var(--danger); } -.ws-dot.error { background: var(--warning); } - -/* Loading Spinner */ -.spinner-container { - display: none; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 2000; +::-webkit-scrollbar-thumb { + background: var(--bg3); + border-radius: 4px; } -.loading .spinner-container { - display: block; +::-webkit-scrollbar-thumb:hover { + background: var(--bg4); } - -.spinner { - width: 40px; - height: 40px; - border: 3px solid rgba(99, 102, 241, 0.1); - border-radius: 50%; - border-top-color: var(--primary); - animation: spin 0.8s linear infinite; -} - -@keyframes spin { - to { transform: rotate(360deg); } -} - -/* Login Screen */ -.login-container { - min-height: 100vh; - 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; -} - -.login-header { - text-align: center; - margin-bottom: 2rem; -} - -.login-icon { - font-size: 3rem; - color: var(--primary); - margin-bottom: 1rem; -} - -.login-subtitle { - color: var(--text-secondary); - font-size: 0.875rem; -} - -.login-btn { - width: 100%; - padding: 0.75rem; - margin-top: 1rem; -} - -.error-message { - background: #fef2f2; - color: var(--danger); - padding: 0.75rem; - border-radius: 8px; - margin-bottom: 1.5rem; - font-size: 0.875rem; - display: none; - align-items: center; - gap: 0.5rem; -} - -/* Provider Grid Details */ -.provider-card-header .provider-info { - display: flex; - flex-direction: column; -} - -.provider-id { - font-size: 0.75rem; - color: var(--text-light); - font-weight: 600; -} - -.provider-meta { - display: flex; - flex-direction: column; - gap: 0.5rem; - margin-bottom: 1rem; -} - -.meta-item { - display: flex; - align-items: center; - gap: 0.5rem; - font-size: 0.875rem; - color: var(--text-secondary); -} - -.provider-card-footer { - padding: 1rem 1.25rem; - background: #f8fafc; - border-top: 1px solid var(--border-color); - display: flex; - gap: 0.75rem; -} - -.btn-sm { - padding: 0.4rem 0.75rem; - font-size: 0.75rem; -} - -/* Toast Container */ -.toast-container { - position: fixed; - bottom: 1.5rem; - right: 1.5rem; - z-index: 3000; - display: flex; - flex-direction: column; - gap: 0.75rem; -} - -.toast { - background: white; - border-radius: 12px; - padding: 1rem; - box-shadow: var(--shadow-lg); - display: flex; - align-items: center; - gap: 1rem; - min-width: 300px; - border-left: 4px solid var(--primary); - animation: slideIn 0.3s ease-out forwards; -} - -@keyframes slideIn { - from { transform: translateX(100%); opacity: 0; } - to { transform: translateX(0); opacity: 1; } -} - -.toast.success { border-left-color: var(--success); } -.toast.error { border-left-color: var(--danger); } -.toast.warning { border-left-color: var(--warning); } - -.toast-content { flex: 1; } -.toast-title { font-weight: 700; font-size: 0.875rem; } -.toast-message { font-size: 0.8rem; color: var(--text-secondary); } -.toast-close { background: none; border: none; color: var(--text-light); cursor: pointer; } diff --git a/static/js/charts.js b/static/js/charts.js index 65089c16..72777b37 100644 --- a/static/js/charts.js +++ b/static/js/charts.js @@ -4,22 +4,24 @@ class ChartManager { constructor() { this.charts = new Map(); this.defaultColors = [ - '#3b82f6', // Blue - '#10b981', // Green - '#f59e0b', // Yellow - '#ef4444', // Red - '#8b5cf6', // Purple - '#ec4899', // Pink - '#06b6d4', // Cyan - '#84cc16', // Lime - '#f97316', // Orange - '#6366f1', // Indigo + '#fe8019', // Orange + '#b8bb26', // Green + '#fabd2f', // Yellow + '#fb4934', // Red + '#83a598', // Blue + '#d3869b', // Purple + '#8ec07c', // Aqua + '#d65d0e', // Dark Orange + '#98971a', // Dark Green + '#d79921', // Dark Yellow ]; this.init(); } init() { - // Register Chart.js plugins if needed + // Set Chart.js defaults for Gruvbox + Chart.defaults.color = '#bdae93'; // fg3 + Chart.defaults.borderColor = '#504945'; // bg2 this.registerPlugins(); } @@ -41,7 +43,7 @@ class ChartManager { ctx.moveTo(x, topY); ctx.lineTo(x, bottomY); ctx.lineWidth = 1; - ctx.strokeStyle = 'rgba(0, 0, 0, 0.1)'; + ctx.strokeStyle = '#665c54'; // bg3 ctx.stroke(); ctx.restore(); } @@ -74,18 +76,19 @@ class ChartManager { labels: { padding: 20, usePointStyle: true, - pointStyle: 'circle' + pointStyle: 'circle', + color: '#ebdbb2' // fg1 } }, tooltip: { mode: 'index', intersect: false, - backgroundColor: 'rgba(255, 255, 255, 0.95)', - titleColor: '#1e293b', - bodyColor: '#1e293b', - borderColor: '#e2e8f0', + backgroundColor: '#3c3836', // bg1 + titleColor: '#fbf1c7', // fg0 + bodyColor: '#ebdbb2', // fg1 + borderColor: '#504945', // bg2 borderWidth: 1, - cornerRadius: 6, + cornerRadius: 4, padding: 12, boxPadding: 6, callbacks: { @@ -110,20 +113,20 @@ class ChartManager { x: { grid: { display: true, - color: 'rgba(0, 0, 0, 0.05)' + color: '#3c3836' // bg1 }, ticks: { - color: '#64748b' + color: '#a89984' // fg4 } }, y: { beginAtZero: true, grid: { display: true, - color: 'rgba(0, 0, 0, 0.05)' + color: '#3c3836' // bg1 }, ticks: { - color: '#64748b', + color: '#a89984', // fg4 callback: function(value) { return value.toLocaleString(); } @@ -164,12 +167,12 @@ class ChartManager { label: dataset.label, data: dataset.data, borderColor: dataset.color || this.defaultColors[index % this.defaultColors.length], - backgroundColor: dataset.fill ? this.hexToRgba(dataset.color || this.defaultColors[index % this.defaultColors.length], 0.1) : 'transparent', + backgroundColor: dataset.fill ? this.hexToRgba(dataset.color || this.defaultColors[index % this.defaultColors.length], 0.15) : 'transparent', borderWidth: 2, pointRadius: 3, pointHoverRadius: 6, pointBackgroundColor: dataset.color || this.defaultColors[index % this.defaultColors.length], - pointBorderColor: '#ffffff', + pointBorderColor: '#282828', // bg0 pointBorderWidth: 2, fill: dataset.fill || false, tension: 0.4, @@ -248,7 +251,7 @@ class ChartManager { datasets: [{ data: data.data || [], backgroundColor: data.colors || this.defaultColors.slice(0, data.data.length), - borderColor: '#ffffff', + borderColor: '#282828', // bg0 borderWidth: 2, hoverOffset: 15 }] @@ -290,7 +293,7 @@ class ChartManager { datasets: [{ data: data.data || [], backgroundColor: data.colors || this.defaultColors.slice(0, data.data.length), - borderColor: '#ffffff', + borderColor: '#282828', // bg0 borderWidth: 2, hoverOffset: 15 }] @@ -334,7 +337,7 @@ class ChartManager { label: dataset.label, data: dataset.data, backgroundColor: dataset.color || this.defaultColors[index % this.defaultColors.length], - borderColor: dataset.borderColor || '#ffffff', + borderColor: '#282828', // bg0 borderWidth: 1, borderRadius: 4, ...dataset @@ -366,10 +369,10 @@ class ChartManager { beginAtZero: true, grid: { display: true, - color: 'rgba(0, 0, 0, 0.05)' + color: '#3c3836' // bg1 }, ticks: { - color: '#64748b', + color: '#a89984', // fg4 callback: function(value) { return value.toLocaleString(); } @@ -380,7 +383,7 @@ class ChartManager { display: false }, ticks: { - color: '#64748b' + color: '#a89984' // fg4 } } },