HTML Template
95 lines
7.4 KB
Dashboard Template
Live Preview
Source Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard Template</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #0a0a0f; color: #e4e4e7; }
.sidebar { position: fixed; left: 0; top: 0; width: 240px; height: 100vh; background: #111113; border-right: 1px solid #1e1e22; padding: 1.5rem 1rem; overflow-y: auto; }
.sidebar .logo { font-size: 1.25rem; font-weight: 800; color: #6366f1; margin-bottom: 2rem; padding: 0 0.5rem; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.75rem; border-radius: 8px; color: #71717a; text-decoration: none; font-size: 0.9rem; margin-bottom: 0.25rem; transition: all 0.2s; }
.nav-item:hover { background: #18181b; color: #e4e4e7; }
.nav-item.active { background: #6366f122; color: #818cf8; }
.nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.main { margin-left: 240px; padding: 1.5rem 2rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.topbar h1 { font-size: 1.5rem; font-weight: 700; }
.topbar .actions { display: flex; gap: 0.75rem; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #6366f1; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.search-box { padding: 0.5rem 1rem; background: #18181b; border: 1px solid #27272a; border-radius: 8px; color: #71717a; font-size: 0.85rem; outline: none; width: 240px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 1.25rem; }
.stat-card .label { font-size: 0.75rem; color: #71717a; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; }
.stat-card .change { font-size: 0.8rem; margin-top: 0.25rem; }
.change.up { color: #22c55e; } .change.down { color: #ef4444; }
.panels { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.panel { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 1.5rem; }
.panel h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.75rem; color: #71717a; text-transform: uppercase; padding: 0.5rem 0; border-bottom: 1px solid #27272a; }
td { padding: 0.75rem 0; font-size: 0.85rem; border-bottom: 1px solid #18181b; }
.status-badge { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.status-active { background: #22c55e22; color: #22c55e; }
.status-pending { background: #f59e0b22; color: #f59e0b; }
.activity-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid #18181b; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.activity-text { font-size: 0.85rem; color: #a1a1aa; }
.activity-time { font-size: 0.75rem; color: #52525b; }
@media (max-width: 900px) { .sidebar { display: none; } .main { margin-left: 0; } .stats-grid { grid-template-columns: repeat(2, 1fr); } .panels { grid-template-columns: 1fr; } }
</style>
</head>
<body>
<div class="sidebar">
<div class="logo">CDNSnippet</div>
<a href="#" class="nav-item active"><span class="nav-icon">🏠</span> Dashboard</a>
<a href="#" class="nav-item"><span class="nav-icon">📋</span> Snippets</a>
<a href="#" class="nav-item"><span class="nav-icon">📂</span> Categories</a>
<a href="#" class="nav-item"><span class="nav-icon">🎯</span> Analytics</a>
<a href="#" class="nav-item"><span class="nav-icon">📝</span> White Pages</a>
<a href="#" class="nav-item"><span class="nav-icon">⚙</span> Settings</a>
<a href="#" class="nav-item"><span class="nav-icon">💬</span> Support</a>
</div>
<div class="main">
<div class="topbar">
<h1>Dashboard</h1>
<div class="actions">
<input type="text" class="search-box" placeholder="Search...">
<div class="avatar">JD</div>
</div>
</div>
<div class="stats-grid">
<div class="stat-card"><div class="label">Total Snippets</div><div class="value">101</div><div class="change up">↑ 12% this week</div></div>
<div class="stat-card"><div class="label">Total Views</div><div class="value">24.5K</div><div class="change up">↑ 8% this week</div></div>
<div class="stat-card"><div class="label">Downloads</div><div class="value">1,832</div><div class="change up">↑ 23% this week</div></div>
<div class="stat-card"><div class="label">Bounce Rate</div><div class="value">32%</div><div class="change down">↓ 5% this week</div></div>
</div>
<div class="panels">
<div class="panel">
<h3>Recent Snippets</h3>
<table>
<thead><tr><th>Title</th><th>Category</th><th>Status</th><th>Views</th></tr></thead>
<tbody>
<tr><td>Contact Form PHP</td><td>Forms</td><td><span class="status-badge status-active">Published</span></td><td>1,450</td></tr>
<tr><td>Meta Pixel Purchase</td><td>Tracking</td><td><span class="status-badge status-active">Published</span></td><td>890</td></tr>
<tr><td>Dark Mode Toggle</td><td>UI</td><td><span class="status-badge status-active">Published</span></td><td>670</td></tr>
<tr><td>OTP Verification</td><td>Validation</td><td><span class="status-badge status-pending">Draft</span></td><td>0</td></tr>
<tr><td>PDO Singleton</td><td>Database</td><td><span class="status-badge status-active">Published</span></td><td>320</td></tr>
</tbody>
</table>
</div>
<div class="panel">
<h3>Recent Activity</h3>
<div class="activity-item"><div class="activity-dot" style="background:#22c55e"></div><div><div class="activity-text">New snippet "Cron Job Setup" published</div><div class="activity-time">2 hours ago</div></div></div>
<div class="activity-item"><div class="activity-dot" style="background:#6366f1"></div><div><div class="activity-text">Snippet "Login Form" updated</div><div class="activity-time">5 hours ago</div></div></div>
<div class="activity-item"><div class="activity-dot" style="background:#f59e0b"></div><div><div class="activity-text">New comment on "Dark Mode Toggle"</div><div class="activity-time">1 day ago</div></div></div>
<div class="activity-item"><div class="activity-dot" style="background:#22c55e"></div><div><div class="activity-text">3 new snippets added to Forms</div><div class="activity-time">2 days ago</div></div></div>
</div>
</div>
</div>
</body>
</html>