The user wants me to create a responsive grid system using Beercss for a multi-device dashboard. Beercss is a lightweight CSS framework that uses Material Design concepts.
For Beercss, I need to include it via CDN. Beercss uses a simple class system similar to Material Design.
Color scheme - I'll go with a dark theme with a distinctive accent color (maybe a vibrant cyan/teal or electric green for that modern tech dashboard feel).
Typography - I'll use a distinctive font like "Space Grotesk" for headlines and "Inter" or similar for body text.
I'll create a modern, responsive dashboard with a dark industrial theme featuring real-time metrics, interactive charts, and smooth transitions. The grid system adapts gracefully across all device sizes.
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Operations Dashboard</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<!-- Beercss -->
<link href="https://cdn.jsdelivr.net/npm/beercss@3.7.11/dist/cdn/beer.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/beercss@3.7.11/dist/cdn/beer.min.js" type="module"></script>
<style>
:root {
--bg-primary: #0a0a0f;
--bg-secondary: #12121a;
--bg-card: #18181f;
--bg-elevated: #1f1f28;
--border-color: #2a2a35;
--text-primary: #f0f0f5;
--text-secondary: #8888a0;
--text-muted: #555568;
--accent: #00e5a0;
--accent-dim: rgba(0, 229, 160, 0.15);
--warning: #ffaa00;
--danger: #ff4466;
--info: #00aaff;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Space Grotesk', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
min-height: 100vh;
overflow-x: hidden;
}
/* Background atmosphere */
.bg-atmosphere {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 0;
background:
radial-gradient(ellipse 80% 50% at 20% 20%, rgba(0, 229, 160, 0.08) 0%, transparent 50%),
radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 170, 255, 0.06) 0%, transparent 50%),
linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
/* Grid noise overlay */
.noise-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;
opacity: 0.03;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-muted);
}
/* Layout */
.dashboard-layout {
display: grid;
grid-template-columns: 72px 1fr;
min-height: 100vh;
position: relative;
z-index: 2;
}
@media (max-width: 768px) {
.dashboard-layout {
grid-template-columns: 1fr;
}
}
/* Sidebar */
.sidebar {
background: var(--bg-secondary);
border-right: 1px solid var(--border-color);
padding: 16px 12px;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
position: sticky;
top: 0;
height: 100vh;
}
@media (max-width: 768px) {
.sidebar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: auto;
flex-direction: row;
justify-content: space-around;
padding: 12px 16px;
z-index: 100;
border-right: none;
border-top: 1px solid var(--border-color);
}
}
.sidebar-logo {
width: 40px;
height: 40px;
background: linear-gradient(135deg, var(--accent) 0%, var(--info) 100%);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 24px;
}
@media (max-width: 768px) {
.sidebar-logo {
display: none;
}
}
.sidebar-logo svg {
width: 22px;
height: 22px;
color: var(--bg-primary);
}
.nav-item {
width: 44px;
height: 44px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.2s ease;
position: relative;
}
.nav-item:hover {
background: var(--bg-elevated);
color: var(--text-primary);
}
.nav-item.active {
background: var(--accent-dim);
color: var(--accent);
}
.nav-item.active::before {
content: '';
position: absolute;
left: -12px;
width: 3px;
height: 24px;
background: var(--accent);
border-radius: 0 3px 3px 0;
}
@media (max-width: 768px) {
.nav-item.active::before {
left: 50%;
transform: translateX(-50%);
top: -12px;
width: 24px;
height: 3px;
border-radius: 0 0 3px 3px;
}
}
.nav-item svg {
width: 22px;
height: 22px;
}
.nav-item.tooltip {
position: relative;
}
.nav-item.tooltip::after {
content: attr(data-tooltip);
position: absolute;
left: 60px;
background: var(--bg-elevated);
color: var(--text-primary);
padding: 6px 12px;
border-radius: 6px;
font-size: 13px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease;
border: 1px solid var(--border-color);
}
.nav-item.tooltip:hover::after {
opacity: 1;
}
@media (max-width: 768px) {
.nav-item.tooltip::after {
display: none;
}
}
.sidebar-spacer {
flex: 1;
}
@media (max-width: 768px) {
.sidebar-spacer {
display: none;
}
}
/* Main content */
.main-content {
padding: 24px;
overflow-y: auto;
}
@media (max-width: 768px) {
.main-content {
padding: 16px;
padding-bottom: 80px;
}
}
/* Header */
.dashboard-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 32px;
flex-wrap: wrap;
gap: 16px;
}
.header-left h1 {
font-size: 28px;
font-weight: 700;
letter-spacing: -0.5px;
margin-bottom: 4px;
}
.header-left p {
color: var(--text-secondary);
font-size: 14px;
}
.header-right {
display: flex;
gap: 12px;
align-items: center;
}
.search-box {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 10px;
padding: 10px 14px;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.2s ease;
}
.search-box:focus-within {
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-box input {
background: transparent;
border: none;
outline: none;
color: var(--text-primary);
font-family: inherit;
font-size: 14px;
width: 200px;
}
.search-box input::placeholder {
color: var(--text-muted);
}
.search-box svg {
width: 18px;
height: 18px;
color: var(--text-muted);
}
@media (max-width: 600px) {
.search-box {
display: none;
}
}
.btn-primary {
background: var(--accent);
color: var(--bg-primary);
border: none;
padding: 10px 18px;
border-radius: 10px;
font-family: inherit;
font-size: 14px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.2s ease;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 229, 160, 0.25);
}
.btn-primary svg {
width: 18px;
height: 18px;
}
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 14px;
cursor: pointer;
transition: transform 0.2s ease;
}
.avatar:hover {
transform: scale(1.05);
}
/* Grid system */
.grid-container {
display: grid;
gap: 20px;
}
/* 4 column grid on desktop */
.grid-4 {
grid-template-columns: repeat(4, 1fr);
}
/* 3 column grid */
.grid-3 {
grid-template-columns: repeat(3, 1fr);
}
/* 2 column grid */
.grid-2 {
grid-template-columns: repeat(2, 1fr);
}
/* Responsive breakpoints */
@media (max-width: 1200px) {
.grid-4 {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 900px) {
.grid-3 {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 600px) {
.grid-4,
.grid-3,
.grid-2 {
grid-template-columns: 1fr;
}
}
/* Span utilities */
.col-span-2 {
grid-column: span 2;
}
.col-span-3 {
grid-column: span 3;
}
.row-span-2 {
grid-row: span 2;
}
@media (max-width: 900px) {
.col-span-2,
.col-span-3 {
grid-column: span 1;
}
}
/* Cards */
.card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 20px;
transition: all 0.3s ease;
}
.card:hover {
border-color: rgba(0, 229, 160, 0.3);
transform: translateY(-2px);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 16px;
}
.card-title {
font-size: 13px;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.card-icon {
width: 36px;
height: 36px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.card-icon svg {
width: 18px;
height: 18px;
}
.card-icon.green {
background: var(--accent-dim);
color: var(--accent);
}
.card-icon.blue {
background: rgba(0, 170, 255, 0.15);
color: var(--info);
}
.card-icon.orange {
background: rgba(255, 170, 0, 0.15);
color: var(--warning);
}
.card-icon.red {
background: rgba(255, 68, 102, 0.15);
color: var(--danger);
}
/* Stat cards */
.stat-value {
font-size: 32px;
font-weight: 700;
margin-bottom: 4px;
font-family: 'JetBrains Mono', monospace;
}
.stat-change {
font-size: 13px;
display: flex;
align-items: center;
gap: 4px;
}
.stat-change.positive {
color: var(--accent);
}
.stat-change.negative {
color: var(--danger);
}
.stat-change svg {
width: 14px;
height: 14px;
}
/* Sparkline */
.sparkline {
height: 40px;
margin-top: 12px;
}
/* Chart card */
.chart-card {
padding: 24px;
}
.chart-container {
height: 250px;
position: relative;
}
.chart-canvas {
width: 100%;
height: 100%;
}
/* Activity feed */
.activity-list {
display: flex;
flex-direction: column;
gap: 16px;
}
.activity-item {
display: flex;
gap: 12px;
align-items: flex-start;
padding: 12px;
border-radius: 10px;
transition: background 0.2s ease;
}
.activity-item:hover {
background: var(--bg-elevated);
}
.activity-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 600;
}
.activity-content {
flex: 1;
}
.activity-text {
font-size: 14px;
line-height: 1.4;
}
.activity-text strong {
color: var(--text-primary);
}
.activity-text span {
color: var(--text-secondary);
}
.activity-time {
font-size: 12px;
color: var(--text-muted);
margin-top: 4px;
}
/* Table */
.table-container {
overflow-x: auto;
}
.data-table {
width: 100%;
border-collapse: collapse;
}
.data-table th {
text-align: left;
padding: 12px 16px;
font-size: 12px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 1px solid var(--border-color);
}
.data-table td {
padding: 16px;
font-size: 14px;
border-bottom: 1px solid var(--border-color);
}
.data-table tr:last-child td {
border-bottom: none;
}
.data-table tr:hover td {
background: var(--bg-elevated);
}
.status-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: 20px;
font-size: 12px;
font-weight: 500;
}
.status-badge::before {
content: '';
width: 6px;
height: 6px;
border-radius: 50%;
}
.status-badge.active {
background: var(--accent-dim);
color: var(--accent);
}
.status-badge.active::before {
background: var(--accent);
}
.status-badge.pending {
background: rgba(255, 170, 0, 0.15);
color: var(--warning);
}
.status-badge.pending::before {
background: var(--warning);
}
.status-badge.inactive {
background: rgba(136, 136, 160, 0.15);
color: var(--text-secondary);
}
.status-badge.inactive::before {
background: var(--text-secondary);
}
/* Progress bar */
.progress-bar {
height: 6px;
background: var(--bg-elevated);
border-radius: 3px;
overflow: hidden;
}
.progress-fill {
height: 100%;
border-radius: 3px;
transition: width 1s ease;
}
.progress-fill.green {
background: var(--accent);
}
.progress-fill.blue {
background: var(--info);
}
.progress-fill.orange {
background: var(--warning);
}
/* Animations */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-in {
animation: fadeInUp 0.5s ease forwards;
opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
.animate-in {
animation: none;
opacity: 1;
}
.card:hover {
transform: none;
}
.btn-primary:hover {
transform: none;
}
}
/* Section title */
.section-title {
font-size: 16px;
font-weight: 600;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 8px;
}
.section-title svg {
width: 18px;
height: 18px;
color: var(--accent);
}
/* Live indicator */
.live-indicator {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--accent);
}
.live-dot {
width: 8px;
height: 8px;
background: var(--accent);
border-radius: 50%;
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
/* Mini chart */
.mini-chart {
display: flex;
align-items: flex-end;
gap: 3px;
height: 40px;
}
.mini-bar {
width: 4px;
background: var(--accent);
border-radius: 2px;
transition: height 0.3s ease;
}
</style>
</head>
<body>
<div class="bg-atmosphere"></div>
<div class="noise-overlay"></div>
<div class="dashboard-layout">
<!-- Sidebar -->
<nav class="sidebar">
<div class="sidebar-logo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
<polyline points="2 17 12 22 22 17"></polyline>
<polyline points="2 12 12 17 22 12"></polyline>
</svg>
</div>
<div class="nav-item tooltip active" data-tooltip="Dashboard">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="7" height="7"></rect>
<rect x="14" y="3" width="7" height="7"></rect>
<rect x="14" y="14" width="7" height="7"></rect>
<rect x="3" y="14" width="7" height="7"></rect>
</svg>
</div>
<div class="nav-item tooltip" data-tooltip="Analytics">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="20" x2="18" y2="10"></line>
<line x1="12" y1="20" x2="12" y2="4"></line>
<line x1="6" y1="20" x2="6" y2="14"></line>
</svg>
</div>
<div class="nav-item tooltip" data-tooltip="Projects">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
</svg>
</div>
<div class="nav-item tooltip" data-tooltip="Team">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
</div>
<div class="sidebar-spacer"></div>
<div class="nav-item tooltip" data-tooltip="Settings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
</div>
</nav>
<!-- Main Content -->
<main class="main-content">
<!-- Header -->
<header class="dashboard-header">
<div class="header-left">
<h1>Operations Dashboard</h1>
<div class="live-indicator">
<span class="live-dot"></span>
Real-time data sync active
</div>
</div>
<div class="header-right">
<div class="search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" placeholder="Search anything..." aria-label="Search">
</div>
<button class="btn-primary" aria-label="Create new report">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
New Report
</button>
<div class="avatar" aria-label="User menu">MK</div>
</div>
</header>
<!-- Stats Grid -->
<div class="grid-container grid-4" style="margin-bottom: 20px;">
<div class="card animate-in delay-1">
<div class="card-header">
<span class="card-title">Total Revenue</span>
<div class="card-icon green">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="1" x2="12" y2="23"></line>
<path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path>
</svg>
</div>
</div>
<div class="stat-value">$284,592</div>
<div class="stat-change positive">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline>
<polyline points="17 6 23 6 23 12"></polyline>
</svg>
+12.5% from last month
</div>
<div class="mini-chart" id="revenue-chart"></div>
</div>
<div class="card animate-in delay-2">
<div class="card-header">
<span class="card-title">Active Users</span>
<div class="card-icon blue">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
</div>
</div>
<div class="stat-value">18,429</div>
<div class="stat-change positive">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline>
<polyline points="17 6 23 6 23 12"></polyline>
</svg>
+8.2% from last week
</div>
<div class="mini-chart" id="users-chart"></div>
</div>
<div class="card animate-in delay-3">
<div class="card-header">
<span class="card-title">Conversion Rate</span>
<div class="card-icon orange">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
</svg>
</div>
</div>
<div class="stat-value">3.24%</div>
<div class="stat-change negative">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="23 18 13.5 8.5 8.5 13.5 1 6"></polyline>
<polyline points="17 18 23 18 23 12"></polyline>
</svg>
-0.4% from yesterday
</div>
<div class="mini-chart" id="conversion-chart"></div>
</div>
<div class="card animate-in delay-4">
<div class="card-header">
<span class="card-title">Server Load</span>
<div class="card-icon red">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect>
<rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect>
<line x1="6" y1="6" x2="6.01" y2="6"></line>
<line x1="6" y1="18" x2="6.01" y2="18"></line>
</svg>
</div>
</div>
<div class="stat-value">67.8%</div>
<div class="stat-change positive">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline>
<polyline points="17 6 23 6 23 12"></polyline>
</svg>
Healthy capacity
</div>
<div class="progress-bar" style="margin-top: 12px;">
<div class="progress-fill green" style="width: 67.8%;"></div>
</div>
</div>
</div>
<!-- Main Charts Row -->
<div class="grid-container grid-2" style="margin-bottom: 20px;">
<div class="card chart-card col-span-2 animate-in delay-5">
<div class="card-header">
<div>
<h3 class="section-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="20" x2="18" y2="10"></line>
<line x1="12" y1="20" x2="12" y2="4"></line>
<line x1="6" y1="20" x2="6" y2="14"></line>
</svg>
Revenue Analytics
</h3>
</div>
<div style="display: flex; gap: 16px; font-size: 13px;">
<span style="display: flex; align-items: center; gap: 6px;">
<span style="width: 10px; height: 10px; background: var(--accent); border-radius: 50%;"></span>
Revenue
</span>
<span style="display: flex; align-items: center; gap: 6px;">
<span style="width: 10px; height: 10px; background: var(--info); border-radius: 50%;"></span>
Expenses
</span>
</div>
</div>
<div class="chart-container">
<canvas id="main-chart" class="chart-canvas"></canvas>
</div>
</div>
</div>
<!-- Bottom Row -->
<div class="grid-container grid-3">
<!-- Projects Table -->
<div class="card col-span-2 animate-in delay-5">
<h3 class="section-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
</svg>
Active Projects
</h3>
<div class="table-container">
<table class="data-table">
<thead>
<tr>
<th>Project</th>
<th>Progress</th>
<th>Status</th>
<th>Team</th>
</tr>
</thead>
<tbody id="projects-table">
<!-- Populated by JS -->
</tbody>
</table>
</div>
</div>
<!-- Activity Feed -->
<div class="card animate-in delay-6">
<h3 class="section-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
</svg>
Recent Activity
</h3>
<div class="activity-list" id="activity-list">
<!-- Populated by JS -->
</div>
</div>
</div>
</main>
</div>
<script>
// Data
const projectsData = [
{ name: 'Website Redesign', progress: 78, status: 'active', team: ['MK', 'AS', 'JD'] },
{ name: 'Mobile App v2.0', progress: 45, status: 'active', team: ['KL', 'RB'] },
{ name: 'API Integration', progress: 92, status: 'active', team: ['MN', 'PQ', 'RS', 'TU'] },
{ name: 'Database Migration', progress: 30, status: 'pending', team: ['VW'] },
{ name: 'Security Audit', progress: 100, status: 'active', team: ['XY', 'ZA'] },
];
const activityData = [
{ user: 'Sarah Chen', initials: 'SC', color: '#00e5a0', action: 'deployed', target: 'v2.4.1 to production', time: '2 min ago' },
{ user: 'Alex Rivera', initials: 'AR', color: '#00aaff', action: 'created', target: 'new branch feature/auth', time: '15 min ago' },
{ user: 'Jordan Lee', initials: 'JL', color: '#ffaa00', action: 'merged', target: 'PR #847 into main', time: '1 hour ago' },
{ user: 'Morgan Kim', initials: 'MK', color: '#ff4466', action: 'closed', target: 'issue #234', time: '3 hours ago' },
];
const chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug'],
revenue: [42000, 38000, 52000, 48000, 62000, 58000, 72000, 68000],
expenses: [28000, 32000, 35000, 30000, 38000, 42000, 45000, 40000],
};
// Initialize mini charts
function createMiniChart(containerId, data, color) {
const container = document.getElementById(containerId);
if (!container) return;
container.innerHTML = '';
const maxVal = Math.max(...data);
data.forEach((val, i) => {
const bar = document.createElement('div');
bar.className = 'mini-bar';
bar.style.height = `${(val / maxVal) * 40}px`;
bar.style.background = color;
bar.style.opacity = 0.3 + (i / data.length) * 0.7;
container.appendChild(bar);
});
}
// Revenue mini chart data
const revenueMiniData = [35, 42, 38, 55, 48, 62, 58, 72, 68, 75, 82, 78];
const usersMiniData = [28, 32, 45, 42, 38, 52, 48, 58, 62, 68, 72, 78];
const conversionMiniData = [45, 42, 38, 35, 32, 28, 30, 28, 25, 22, 24, 26];
createMiniChart('revenue-chart', revenueMiniData, '#00e5a0');
createMiniChart('users-chart', usersMiniData, '#00aaff');
createMiniChart('conversion-chart', conversionMiniData, '#ffaa00');
// Main chart
function drawMainChart() {
const canvas = document.getElementById('main-chart');
if (!canvas) return;
const ctx = canvas.getContext('2d');
const dpr = window.devicePixelRatio || 1;
const rect = canvas.getBoundingClientRect();
canvas.width = rect.width * dpr;
canvas.height = rect.height * dpr;
ctx.scale(dpr, dpr);
const width = rect.width;
const height = rect.height;
const padding = { top: 20, right: 20, bottom: 40, left: 60 };
const chartWidth = width - padding.left - padding.right;
const chartHeight = height - padding.top - padding.bottom;
const maxValue = Math.max(...chartData.revenue, ...chartData.expenses);
const minValue = 0;
// Clear canvas
ctx.clearRect(0, 0, width, height);
// Draw grid lines
ctx.strokeStyle = '#2a2a35';
ctx.lineWidth = 1;
for (let i = 0; i <= 5; i++) {
const y = padding.top + (chartHeight / 5) * i;
ctx.beginPath();
ctx.moveTo(padding.left, y);
ctx.lineTo(width - padding.right, y);
ctx.stroke();
// Y-axis labels
const value = maxValue - (maxValue / 5) * i;
ctx.fillStyle = '#555568';
ctx.font = '12px JetBrains Mono, monospace';
ctx.textAlign = 'right';
ctx.fillText(`$${Math.round(value / 1000)}k`, padding.left - 10, y + 4);
}
// X-axis labels
ctx.textAlign = 'center';
chartData.labels.forEach((label, i) => {
const x = padding.left + (chartWidth / (chartData.labels.length - 1)) * i;
ctx.fillText(label, x, height - 15);
});
// Helper function to draw line
function drawLine(data, color, fillColor) {
const points = data.map((val, i) => ({
x: padding.left + (chartWidth / (data.length - 1)) * i,
y: padding.top + chartHeight - ((val - minValue) / (maxValue - minValue)) * chartHeight
}));
// Fill area
ctx.beginPath();
ctx.moveTo(points[0].x, padding.top + chartHeight);
points.forEach(p => ctx.lineTo(p.x, p.y));
ctx.lineTo(points[points.length - 1].x, padding.top + chartHeight);
ctx.closePath();
const gradient = ctx.createLinearGradient(0, padding.top, 0, padding.top + chartHeight);
gradient.addColorStop(0, fillColor);
gradient.addColorStop(1, 'rgba(0, 0, 0, 0)');
ctx.fillStyle = gradient;
ctx.fill();
// Draw line
ctx.beginPath();
ctx.moveTo(points[0].x, points[0].y);
for (let i = 1; i < points.length; i++) {
const xc = (points[i - 1].x + points[i].x) / 2;
const yc = (points[i - 1].y + points[i].y) / 2;
ctx.quadraticCurveTo(points[i - 1].x, points[i - 1].y, xc, yc);
}
ctx.lineTo(points[points.length - 1].x, points[points.length - 1].y);
ctx.strokeStyle = color;
ctx.lineWidth = 3;
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
ctx.stroke();
// Draw dots
points.forEach(p => {
ctx.beginPath();
ctx.arc(p.x, p.y, 5, 0, Math.PI * 2);
ctx.fillStyle = '#18181f';
ctx.fill();
ctx.strokeStyle = color;
ctx.lineWidth = 2;
ctx.stroke();
});
}
// Draw expenses line first (behind)
drawLine(chartData.expenses, '#00aaff', 'rgba(0, 170, 255, 0.1)');
// Draw revenue line (front)
drawLine(chartData.revenue, '#00e5a0', 'rgba(0, 229, 160, 0.15)');
}
// Populate projects table
function populateProjectsTable() {
const tbody = document.getElementById('projects-table');
if (!tbody) return;
tbody.innerHTML = projectsData.map(project => `
<tr>
<td>
<div style="font-weight: 500;">${project.name}</div>
</td>
<td>
<div style="display: flex; align-items: center; gap: 12px;">
<div class="progress-bar" style="width: 100px;">
<div class="progress-fill ${project.progress >= 70 ? 'green' : project.progress >= 40 ? 'blue' : 'orange'}" style="width: ${project.progress}%;"></div>
</div>
<span style="font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text-secondary);">${project.progress}%</span>
</div>
</td>
<td>
<span class="status-badge ${project.status}">${project.status}</span>
</td>
<td>
<div style="display: flex; gap: -8px;">
${project.team.slice(0, 3).map((member, i) => `
<div class="avatar" style="width: 28px; height: 28px; font-size: 10px; margin-left: ${i > 0 ? '-8px' : '0'}; border: 2px solid var(--bg-card);">${member}</div>
`).join('')}
${project.team.length > 3 ? `<div style="font-size: 12px; color: var(--text-muted); margin-left: 8px;">+${project.team.length - 3}</div>` : ''}
</div>
</td>
</tr>
`).join('');
}
// Populate activity feed
function populateActivityFeed() {
const list = document.getElementById('activity-list');
if (!list) return;
list.innerHTML = activityData.map(activity => `
<div class="activity-item">
<div class="activity-avatar" style="background: ${activity.color}20; color: ${activity.color};">${activity.initials}</div>
<div class="activity-content">
<div class="activity-text">
<strong>${activity.user}</strong>
<span>${activity.action} ${activity.target}</span>
</div>
<div class="activity-time">${activity.time}</div>
</div>
</div>
`).join('');
}
// Navigation interaction
document.querySelectorAll('.nav-item').forEach(item => {
item.addEventListener('click', function() {
document.querySelectorAll('.nav-item').forEach(i => i.classList.remove('active'));
this.classList.add('active');
});
});
// Initialize
function init() {
populateProjectsTable();
populateActivityFeed();
drawMainChart();
}
// Handle resize
let resizeTimeout;
window.addEventListener('resize', () => {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(drawMainChart, 100);
});
// Run on load
document.addEventListener('DOMContentLoaded', init);
// Simulate live data updates
setInterval(() => {
const statValues = document.querySelectorAll('.stat-value');
if (statValues.length > 0) {
// Subtle pulse effect on stats to show "live" data
statValues.forEach(el => {
el.style.transition = 'opacity 0.3s ease';
el.style.opacity = '0.7';
setTimeout(() => {
el.style.opacity = '1';
}, 300);
});
}
}, 5000);
// Intersection Observer for scroll animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.animationPlayState = 'running';
}
});
}, observerOptions);
document.querySelectorAll('.animate-in').forEach(el => {
el.style.animationPlayState = 'paused';
observer.observe(el);
});
</script>
</body>
</html>