| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>Interactive Dashboard</title> |
| <script src="https://cdn.tailwindcss.com"></script> |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
| <style> |
| |
| .gradient-bg { |
| background: linear-gradient(135deg, #6e8efb, #a777e3); |
| } |
| .card-hover { |
| transition: all 0.3s ease; |
| } |
| .card-hover:hover { |
| transform: translateY(-5px); |
| box-shadow: 0 10px 20px rgba(0,0,0,0.1); |
| } |
| .chart-container { |
| position: relative; |
| height: 300px; |
| } |
| .sidebar { |
| transition: all 0.3s ease; |
| overflow: hidden; |
| } |
| .sidebar-collapsed { |
| width: 5rem !important; |
| } |
| .sidebar-expanded { |
| width: 16rem !important; |
| } |
| .sidebar-item-text { |
| transition: opacity 0.3s ease; |
| } |
| .sidebar-collapsed .sidebar-item-text { |
| opacity: 0; |
| width: 0; |
| display: none; |
| } |
| .sidebar-collapsed .sidebar-badge { |
| display: none; |
| } |
| @keyframes fadeIn { |
| from { opacity: 0; transform: translateY(20px); } |
| to { opacity: 1; transform: translateY(0); } |
| } |
| .animate-fadeIn { |
| animation: fadeIn 0.5s ease-out forwards; |
| } |
| .toggle-btn { |
| transition: all 0.3s ease; |
| } |
| .toggle-btn:hover { |
| transform: scale(1.1); |
| } |
| </style> |
| </head> |
| <body class="bg-gray-100 font-sans"> |
| <div class="flex h-screen overflow-hidden"> |
| |
| <div id="sidebar" class="sidebar bg-white w-64 sidebar-expanded flex-shrink-0 shadow-lg relative"> |
| <div class="p-4 flex items-center justify-between"> |
| <span class="text-xl font-bold text-purple-600 sidebar-item-text">DashboardPro</span> |
| <button id="toggleSidebar" class="toggle-btn text-gray-500 hover:text-purple-600"> |
| <i class="fas fa-bars"></i> |
| </button> |
| </div> |
| <nav class="mt-6"> |
| <div class="px-4"> |
| <div class="py-2 px-3 flex items-center rounded-lg bg-purple-50 text-purple-600 mb-2"> |
| <i class="fas fa-home mr-3"></i> |
| <span class="sidebar-item-text">Dashboard</span> |
| </div> |
| <div class="py-2 px-3 flex items-center rounded-lg hover:bg-purple-50 text-gray-600 hover:text-purple-600 mb-2"> |
| <i class="fas fa-chart-line mr-3"></i> |
| <span class="sidebar-item-text">Analytics</span> |
| </div> |
| <div class="py-2 px-3 flex items-center rounded-lg hover:bg-purple-50 text-gray-600 hover:text-purple-600 mb-2"> |
| <i class="fas fa-envelope mr-3"></i> |
| <span class="sidebar-item-text">Messages</span> |
| <span class="ml-auto bg-red-500 text-white text-xs px-2 py-1 rounded-full sidebar-badge">5</span> |
| </div> |
| <div class="py-2 px-3 flex items-center rounded-lg hover:bg-purple-50 text-gray-600 hover:text-purple-600 mb-2"> |
| <i class="fas fa-calendar mr-3"></i> |
| <span class="sidebar-item-text">Calendar</span> |
| </div> |
| <div class="py-2 px-3 flex items-center rounded-lg hover:bg-purple-50 text-gray-600 hover:text-purple-600 mb-2"> |
| <i class="fas fa-cog mr-3"></i> |
| <span class="sidebar-item-text">Settings</span> |
| </div> |
| </div> |
| </nav> |
| <div class="absolute bottom-0 w-full p-4 border-t border-gray-200"> |
| <div class="flex items-center"> |
| <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Profile" class="w-10 h-10 rounded-full"> |
| <div class="ml-3 sidebar-item-text"> |
| <p class="text-sm font-medium text-gray-800">Sarah Johnson</p> |
| <p class="text-xs text-gray-500">Admin</p> |
| </div> |
| </div> |
| </div> |
| </div> |
|
|
| |
| <div class="flex-1 overflow-auto"> |
| |
| <header class="bg-white shadow-sm"> |
| <div class="flex items-center justify-between px-6 py-4"> |
| <div class="flex items-center"> |
| <button id="mobileToggleSidebar" class="mr-4 text-gray-500 md:hidden"> |
| <i class="fas fa-bars"></i> |
| </button> |
| <h1 class="text-2xl font-semibold text-gray-800">Dashboard Overview</h1> |
| </div> |
| <div class="flex items-center space-x-4"> |
| <div class="relative"> |
| <input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500"> |
| <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> |
| </div> |
| <button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200"> |
| <i class="fas fa-bell"></i> |
| <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span> |
| </button> |
| <div class="flex items-center"> |
| <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Profile" class="w-10 h-10 rounded-full"> |
| <span class="ml-2 hidden md:inline">Sarah Johnson</span> |
| </div> |
| </div> |
| </div> |
| </header> |
|
|
| |
| <main class="p-6"> |
| |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"> |
| <div class="bg-white rounded-xl shadow-sm p-6 card-hover animate-fadeIn" style="animation-delay: 0.1s;"> |
| <div class="flex items-center"> |
| <div class="p-3 rounded-lg bg-blue-100 text-blue-600"> |
| <i class="fas fa-users text-xl"></i> |
| </div> |
| <div class="ml-4"> |
| <p class="text-sm font-medium text-gray-500">Total Users</p> |
| <p class="text-2xl font-semibold text-gray-800">2,453</p> |
| </div> |
| </div> |
| <div class="mt-4"> |
| <span class="text-green-500 text-sm font-medium">+12% from last month</span> |
| </div> |
| </div> |
| |
| <div class="bg-white rounded-xl shadow-sm p-6 card-hover animate-fadeIn" style="animation-delay: 0.2s;"> |
| <div class="flex items-center"> |
| <div class="p-3 rounded-lg bg-purple-100 text-purple-600"> |
| <i class="fas fa-shopping-cart text-xl"></i> |
| </div> |
| <div class="ml-4"> |
| <p class="text-sm font-medium text-gray-500">Total Orders</p> |
| <p class="text-2xl font-semibold text-gray-800">1,287</p> |
| </div> |
| </div> |
| <div class="mt-4"> |
| <span class="text-green-500 text-sm font-medium">+8% from last month</span> |
| </div> |
| </div> |
| |
| <div class="bg-white rounded-xl shadow-sm p-6 card-hover animate-fadeIn" style="animation-delay: 0.3s;"> |
| <div class="flex items-center"> |
| <div class="p-3 rounded-lg bg-green-100 text-green-600"> |
| <i class="fas fa-dollar-sign text-xl"></i> |
| </div> |
| <div class="ml-4"> |
| <p class="text-sm font-medium text-gray-500">Revenue</p> |
| <p class="text-2xl font-semibold text-gray-800">$34,546</p> |
| </div> |
| </div> |
| <div class="mt-4"> |
| <span class="text-red-500 text-sm font-medium">-3% from last month</span> |
| </div> |
| </div> |
| |
| <div class="bg-white rounded-xl shadow-sm p-6 card-hover animate-fadeIn" style="animation-delay: 0.4s;"> |
| <div class="flex items-center"> |
| <div class="p-3 rounded-lg bg-yellow-100 text-yellow-600"> |
| <i class="fas fa-chart-pie text-xl"></i> |
| </div> |
| <div class="ml-4"> |
| <p class="text-sm font-medium text-gray-500">Conversion Rate</p> |
| <p class="text-2xl font-semibold text-gray-800">3.6%</p> |
| </div> |
| </div> |
| <div class="mt-4"> |
| <span class="text-green-500 text-sm font-medium">+1.2% from last month</span> |
| </div> |
| </div> |
| </div> |
|
|
| |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8"> |
| <div class="bg-white rounded-xl shadow-sm p-6 lg:col-span-2"> |
| <div class="flex items-center justify-between mb-6"> |
| <h2 class="text-lg font-semibold text-gray-800">Sales Overview</h2> |
| <div class="flex space-x-2"> |
| <button class="px-3 py-1 text-sm bg-purple-100 text-purple-600 rounded-lg">Month</button> |
| <button class="px-3 py-1 text-sm bg-gray-100 text-gray-600 rounded-lg">Week</button> |
| <button class="px-3 py-1 text-sm bg-gray-100 text-gray-600 rounded-lg">Day</button> |
| </div> |
| </div> |
| <div class="chart-container"> |
| <canvas id="salesChart"></canvas> |
| </div> |
| </div> |
| |
| <div class="bg-white rounded-xl shadow-sm p-6"> |
| <h2 class="text-lg font-semibold text-gray-800 mb-6">Traffic Sources</h2> |
| <div class="chart-container"> |
| <canvas id="trafficChart"></canvas> |
| </div> |
| <div class="mt-4 grid grid-cols-2 gap-4"> |
| <div class="flex items-center"> |
| <div class="w-3 h-3 rounded-full bg-blue-500 mr-2"></div> |
| <span class="text-sm text-gray-600">Direct</span> |
| </div> |
| <div class="flex items-center"> |
| <div class="w-3 h-3 rounded-full bg-purple-500 mr-2"></div> |
| <span class="text-sm text-gray-600">Organic</span> |
| </div> |
| <div class="flex items-center"> |
| <div class="w-3 h-3 rounded-full bg-green-500 mr-2"></div> |
| <span class="text-sm text-gray-600">Referral</span> |
| </div> |
| <div class="flex items-center"> |
| <div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div> |
| <span class="text-sm text-gray-600">Social</span> |
| </div> |
| </div> |
| </div> |
| </div> |
|
|
| |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> |
| <div class="bg-white rounded-xl shadow-sm p-6 lg:col-span-2"> |
| <h2 class="text-lg font-semibold text-gray-800 mb-6">Recent Orders</h2> |
| <div class="overflow-x-auto"> |
| <table class="min-w-full divide-y divide-gray-200"> |
| <thead> |
| <tr> |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Order ID</th> |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customer</th> |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th> |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th> |
| </tr> |
| </thead> |
| <tbody class="bg-white divide-y divide-gray-200"> |
| <tr> |
| <td class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-900">#ORD-0001</td> |
| <td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">John Smith</td> |
| <td class="px-4 py-4 whitespace-nowrap"> |
| <span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-800">Completed</span> |
| </td> |
| <td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">$245.00</td> |
| <td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">May 15, 2023</td> |
| </tr> |
| <tr> |
| <td class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-900">#ORD-0002</td> |
| <td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">Emma Johnson</td> |
| <td class="px-4 py-4 whitespace-nowrap"> |
| <span class="px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800">Processing</span> |
| </td> |
| <td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">$189.00</td> |
| <td class="px-4 py-4 whites |
| </html> |