index.html
Copy Code
<!--
SYNTAXIS_CHALLENGE
slug: admin-commerce
title: Ecommerce Administration Dashboard
difficulty: ADVANCED
technologies: HTML, CSS, JavaScript
suggested_tier: PRO
description: Create a high-density ecommerce management console with live revenue metrics, SVG sales trend charts, order status filtering, search, and inventory analytics.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>Vanguard Commerce | Merchant Admin Console</title>
<link href="css/styles.css" rel="stylesheet"/></head>
<body>
<!-- Left Sidebar Navigation -->
<aside aria-label="Commerce Sidebar" class="admin-sidebar">
<div class="brand-header">
<div class="brand-logo-mark">V</div>
<div class="brand-title">
<h1>Vanguard</h1>
<span>Commerce Admin</span>
</div>
</div>
<div class="sidebar-menu">
<div>
<div class="menu-group-label">Manage Store</div>
<ul class="menu-list">
<li class="menu-link active">
<div class="menu-link-inner">
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16">
<rect height="7" width="7" x="3" y="3"></rect>
<rect height="7" width="7" x="14" y="3"></rect>
<rect height="7" width="7" x="14" y="14"></rect>
<rect height="7" width="7" x="3" y="14"></rect>
</svg>
<span>Overview</span>
</div>
</li>
<li class="menu-link">
<div class="menu-link-inner">
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16">
<circle cx="9" cy="21" r="1"></circle>
<circle cx="20" cy="21" r="1"></circle>
<path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
</svg>
<span>Orders</span>
</div>
<span class="pill-count">128</span>
</li>
<li class="menu-link">
<div class="menu-link-inner">
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16">
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
<line x1="7" x2="7.01" y1="7" y2="7"></line>
</svg>
<span>Products</span>
</div>
</li>
<li class="menu-link">
<div class="menu-link-inner">
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16">
<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>
<span>Customers</span>
</div>
</li>
<li class="menu-link">
<div class="menu-link-inner">
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16">
<line x1="16.5" x2="7.5" y1="9.4" y2="4.21"></line>
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
<polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
<line x1="12" x2="12" y1="22.08" y2="12"></line>
</svg>
<span>Inventory</span>
</div>
</li>
</ul>
</div>
<div>
<div class="menu-group-label">Intelligence</div>
<ul class="menu-list">
<li class="menu-link">
<div class="menu-link-inner">
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16">
<line x1="18" x2="18" y1="20" y2="10"></line>
<line x1="12" x2="12" y1="20" y2="4"></line>
<line x1="6" x2="6" y1="20" y2="14"></line>
</svg>
<span>Analytics</span>
</div>
</li>
<li class="menu-link">
<div class="menu-link-inner">
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16">
<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>
<span>Store Settings</span>
</div>
</li>
</ul>
</div>
</div>
<div class="admin-footer-profile">
<div class="merchant-avatar">OA</div>
<div>
<div>Oliver Archer</div>
<div>Store Administrator</div>
</div>
</div>
</aside>
<!-- Main Content Console -->
<main class="admin-main">
<!-- Topbar -->
<header class="top-navbar">
<div class="nav-search">
<svg fill="none" height="15" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="15">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" x2="16.65" y1="21" y2="16.65"></line>
</svg>
<input placeholder="Search orders, customers, or SKUs..." type="text"/>
</div>
<div class="nav-right-controls">
<select class="date-filter-select" id="dateRangeSelect">
<option value="7d">Last 7 Days</option>
<option selected="" value="30d">Last 30 Days</option>
<option value="90d">Last 90 Days</option>
<option value="year">Year to Date</option>
</select>
<button class="btn-export">
<svg fill="none" height="14" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="14">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
<polyline points="7 10 12 15 17 10"></polyline>
<line x1="12" x2="12" y1="15" y2="3"></line>
</svg>
<span>Export CSV</span>
</button>
</div>
</header>
<!-- Dashboard Content -->
<div class="dashboard-body">
<div class="page-header-row">
<div>
<h2>Merchant Performance Overview</h2>
<div>Real-time metrics synced across Stripe & Shopify channels</div>
</div>
<div class="live-status-pill">
<div class="pulse-dot"></div>
<span>Live Gateway Sync</span>
</div>
</div>
<!-- KPI Grid -->
<section aria-label="Key Performance Indicators" class="kpi-grid">
<div class="kpi-card">
<div class="kpi-meta">
<span class="kpi-title">Total Gross Revenue</span>
<span class="kpi-badge up">+18.4%</span>
</div>
<div class="kpi-value" id="kpiRevenue">$148,290.40</div>
<div class="kpi-subtext">+$23,100 vs prior 30-day window</div>
</div>
<div class="kpi-card">
<div class="kpi-meta">
<span class="kpi-title">Total Orders</span>
<span class="kpi-badge up">+12.2%</span>
</div>
<div class="kpi-value" id="kpiOrders">1,842</div>
<div class="kpi-subtext">98.2% fulfillment rate</div>
</div>
<div class="kpi-card">
<div class="kpi-meta">
<span class="kpi-title">Average Order Value (AOV)</span>
<span class="kpi-badge up">+$5.50</span>
</div>
<div class="kpi-value" id="kpiAov">$80.50</div>
<div class="kpi-subtext">Driven by bundles & upgrades</div>
</div>
<div class="kpi-card">
<div class="kpi-meta">
<span class="kpi-title">Refund & Chargeback Rate</span>
<span class="kpi-badge neutral">0.82%</span>
</div>
<div class="kpi-value" id="kpiRefunds">15 orders</div>
<div class="kpi-subtext">Well below industry benchmark (1.8%)</div>
</div>
</section>
<!-- Chart and Top Products Split -->
<section class="chart-insights-row">
<!-- SVG Sales Chart -->
<div class="card-panel">
<div class="panel-header">
<h3>Sales Velocity & Daily Volume</h3>
<span>Values in USD ($k)</span>
</div>
<div class="chart-container">
<svg class="chart-svg" preserveaspectratio="none" viewbox="0 0 700 200">
<defs>
<lineargradient id="chartGradient" x1="0" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#0284C7" stop-opacity="0.25"></stop>
<stop offset="100%" stop-color="#0284C7" stop-opacity="0.0"></stop>
</lineargradient>
</defs>
<!-- Grid lines -->
<line stroke="#F1F5F9" stroke-width="1.5" x1="0" x2="700" y1="40" y2="40"></line>
<line stroke="#F1F5F9" stroke-width="1.5" x1="0" x2="700" y1="90" y2="90"></line>
<line stroke="#F1F5F9" stroke-width="1.5" x1="0" x2="700" y1="140" y2="140"></line>
<line stroke="#E2E8F0" stroke-width="1.5" x1="0" x2="700" y1="190" y2="190"></line>
<!-- Area fill -->
<path d="M 0 150 Q 80 130 160 110 T 320 60 T 480 75 T 640 30 L 700 45 L 700 190 L 0 190 Z" fill="url(#chartGradient)"></path>
<!-- Sparkline Stroke -->
<path d="M 0 150 Q 80 130 160 110 T 320 60 T 480 75 T 640 30 L 700 45" fill="none" stroke="#0284C7" stroke-linecap="round" stroke-width="3"></path>
<!-- Data markers -->
<circle cx="160" cy="110" fill="#0284C7" r="4.5" stroke="#FFFFFF" stroke-width="2"></circle>
<circle cx="320" cy="60" fill="#0284C7" r="4.5" stroke="#FFFFFF" stroke-width="2"></circle>
<circle cx="480" cy="75" fill="#0284C7" r="4.5" stroke="#FFFFFF" stroke-width="2"></circle>
<circle cx="640" cy="30" fill="#0284C7" r="5" stroke="#FFFFFF" stroke-width="2.5"></circle>
</svg>
</div>
<div>
<span>Week 1 (Oct 01)</span>
<span>Week 2 (Oct 08)</span>
<span>Week 3 (Oct 15)</span>
<span>Week 4 (Oct 22)</span>
<span>Current (Oct 29)</span>
</div>
</div>
<!-- Top Performing Products -->
<div class="card-panel">
<div class="panel-header">
<h3>Top Products</h3>
<span>View Catalog</span>
</div>
<div class="top-products-list">
<div class="product-row">
<div class="product-meta">
<h4>Vanguard Ergonomic Chair</h4>
<span>SKU: VNG-CHAIR-01</span>
</div>
<div class="product-stat">
<div class="product-stat-rev">$48,200</div>
<div class="product-stat-sales">124 units</div>
</div>
</div>
<div class="product-row">
<div class="product-meta">
<h4>Solid Walnut Desk 60"</h4>
<span>SKU: VNG-DSK-W60</span>
</div>
<div class="product-stat">
<div class="product-stat-rev">$36,900</div>
<div class="product-stat-sales">41 units</div>
</div>
</div>
<div class="product-row">
<div class="product-meta">
<h4>Matte Aluminum Monitor Arm</h4>
<span>SKU: VNG-ARM-04</span>
</div>
<div class="product-stat">
<div class="product-stat-rev">$22,450</div>
<div class="product-stat-sales">187 units</div>
</div>
</div>
<div class="product-row">
<div class="product-meta">
<h4>Merino Wool Desk Mat</h4>
<span>SKU: VNG-MAT-GRY</span>
</div>
<div class="product-stat">
<div class="product-stat-rev">$14,200</div>
<div class="product-stat-sales">218 units</div>
</div>
</div>
</div>
</div>
</section>
<!-- Recent Orders Table -->
<section class="orders-section">
<div class="orders-toolbar">
<div class="status-filter-pills">
<button class="filter-btn active" data-filter="all">All Orders (6)</button>
<button class="filter-btn" data-filter="paid">Paid (4)</button>
<button class="filter-btn" data-filter="pending">Pending (1)</button>
<button class="filter-btn" data-filter="refunded">Refunded (1)</button>
</div>
<input class="table-search-input" id="orderSearchInput" placeholder="Filter by customer or order #..." type="text"/>
</div>
<div class="table-container">
<table class="data-table" id="ordersTable">
<thead>
<tr>
<th>Order</th>
<th>Customer</th>
<th>Items</th>
<th>Date</th>
<th>Amount</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr data-status="paid">
<td class="order-id">#ORD-9482</td>
<td>
<div class="customer-cell">
<span class="customer-name">Kathryn Murphy</span>
<span class="customer-email">k.murphy@syntaxis.design</span>
</div>
</td>
<td>2 × Ergonomic Chair</td>
<td>Oct 28, 2025 • 14:22</td>
<td>$780.00</td>
<td><span class="status-badge status-paid">● Paid</span></td>
<td><button class="action-menu-btn" title="Inspect Order">View</button></td>
</tr>
<tr data-status="paid">
<td class="order-id">#ORD-9481</td>
<td>
<div class="customer-cell">
<span class="customer-name">Devon Lane</span>
<span class="customer-email">devon.lane@spacex.com</span>
</div>
</td>
<td>1 × Solid Walnut Desk</td>
<td>Oct 28, 2025 • 11:15</td>
<td>$899.00</td>
<td><span class="status-badge status-paid">● Paid</span></td>
<td><button class="action-menu-btn" title="Inspect Order">View</button></td>
</tr>
<tr data-status="pending">
<td class="order-id">#ORD-9480</td>
<td>
<div class="customer-cell">
<span class="customer-name">Eleanor Pena</span>
<span class="customer-email">eleanor@acme-systems.io</span>
</div>
</td>
<td>1 × Monitor Arm, 1 × Desk Mat</td>
<td>Oct 27, 2025 • 19:40</td>
<td>$185.00</td>
<td><span class="status-badge status-pending">◌ Awaiting Payment</span></td>
<td><button class="action-menu-btn" title="Inspect Order">View</button></td>
</tr>
<tr data-status="paid">
<td class="order-id">#ORD-9479</td>
<td>
<div class="customer-cell">
<span class="customer-name">Cody Fisher</span>
<span class="customer-email">cody.fisher@apexlabs.org</span>
</div>
</td>
<td>3 × Merino Wool Desk Mat</td>
<td>Oct 27, 2025 • 16:04</td>
<td>$195.00</td>
<td><span class="status-badge status-paid">● Paid</span></td>
<td><button class="action-menu-btn" title="Inspect Order">View</button></td>
</tr>
<tr data-status="refunded">
<td class="order-id">#ORD-9478</td>
<td>
<div class="customer-cell">
<span class="customer-name">Kristin Watson</span>
<span class="customer-email">kristin@northstar.co</span>
</div>
</td>
<td>1 × Ergonomic Chair</td>
<td>Oct 26, 2025 • 09:12</td>
<td>$390.00</td>
<td><span class="status-badge status-refunded">✕ Refunded</span></td>
<td><button class="action-menu-btn" title="Inspect Order">View</button></td>
</tr>
<tr data-status="paid">
<td class="order-id">#ORD-9477</td>
<td>
<div class="customer-cell">
<span class="customer-name">Arlene McCoy</span>
<span class="customer-email">arlene.mccoy@veritas.tech</span>
</div>
</td>
<td>2 × Aluminum Monitor Arm</td>
<td>Oct 25, 2025 • 13:50</td>
<td>$240.00</td>
<td><span class="status-badge status-paid">● Paid</span></td>
<td><button class="action-menu-btn" title="Inspect Order">View</button></td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</main>
<script src="js/script.js"></script></body>
</html>
css/styles.css
Copy Code
/* Syntaxis starter styles for: Ecommerce Administration Dashboard
Recreate the supplied Stitch reference design.
The completed Stitch CSS is intentionally excluded from this learner starter.
*/
:root {
--bg-body: #F8FAFC;
--bg-surface: #FFFFFF;
--bg-subtle: #F1F5F9;
--border-light: #E2E8F0;
--border-focus: #CBD5E1;
--text-heading: #0F172A;
--text-body: #334155;
--text-muted: #64748B;
--brand-primary: #0284C7;
--brand-hover: #0369A1;
--status-paid-bg: #ECFDF5;
--status-paid-text: #059669;
--status-pending-bg: #FFFBEB;
--status-pending-text: #D97706;
--status-refunded-bg: #FEF2F2;
--status-refunded-text: #DC2626;
--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 14px;
--shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
--shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* {
box-sizing: border-box;
}
html, body {
margin: 0;
min-height: 100%;
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
/* TODO:
- Match the supplied reference design.
- Build responsive desktop and mobile states.
- Implement focus/hover/active/open/error/success states where required.
*/
js/script.js
Copy Code
// Syntaxis learner starter: admin-commerce
// Create a high-density ecommerce management console with live revenue metrics, SVG sales trend charts, order status filtering, search, and inventory analytics.
document.addEventListener('DOMContentLoaded', () => {
console.info('Starter ready: admin-commerce');
// TODO:
// Implement the interactions visible in the supplied Stitch reference
// using vanilla JavaScript.
});