Spaces:
Running
Running
Ctrl+K
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>CRM 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"> <script> tailwind.config = { theme: { extend: { colors: { primary: '#4F46E5', secondary: '#10B981', danger: '#EF4444', warning: '#F59E0B', info: '#3B82F6', dark: '#1F2937', light: '#F3F4F6' } } } } </script> <style> .sidebar { transition: all 0.3s ease; } .sidebar.collapsed { width: 70px; } .sidebar.collapsed .sidebar-text { display: none; } .sidebar.collapsed .logo-text { display: none; } .sidebar.collapsed .user-info { display: none; } .chart-container { position: relative; height: 300px; width: 100%; } .progress-bar { transition: width 0.5s ease; } </style> </head> <body class="bg-gray-100 font-sans"> <div class="flex h-screen overflow-hidden"> <!-- Sidebar --> <div id="sidebar" class="sidebar bg-white text-gray-800 w-64 shadow-lg flex flex-col"> <div class="p-4 flex items-center justify-between border-b border-gray-200"> <div class="flex items-center"> <div class="bg-primary text-white p-2 rounded-lg"> <i class="fas fa-cube text-xl"></i> </div> <span class="logo-text ml-3 text-xl font-bold">CRM Pro</span> </div> <button id="toggleSidebar" class="text-gray-500 hover:text-gray-700"> <i class="fas fa-bars"></i> </button> </div> <!-- User Profile --> <div class="user-info p-4 flex items-center border-b border-gray-200"> <div class="h-10 w-10 rounded-full bg-primary flex items-center justify-center text-white"> <span>JD</span> </div> <div class="ml-3"> <div class="font-medium">John Doe</div> <div class="text-sm text-gray-500">Admin</div> </div> </div> <!-- Navigation --> <nav class="flex-1 overflow-y-auto"> <div class="p-2"> <div class="mb-1"> <div class="text-xs uppercase font-semibold text-gray-500 px-4 py-2 sidebar-text">Main</div> <a href="#" class="flex items-center px-4 py-3 text-primary bg-primary bg-opacity-10 rounded-lg mx-2"> <i class="fas fa-tachometer-alt"></i> <span class="sidebar-text ml-3">Dashboard</span> </a> </div> <div class="mb-1"> <div class="text-xs uppercase font-semibold text-gray-500 px-4 py-2 sidebar-text">Management</div> <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:text-primary hover:bg-primary hover:bg-opacity-10 rounded-lg mx-2"> <i class="fas fa-users"></i> <span class="sidebar-text ml-3">Customers</span> </a> <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:text-primary hover:bg-primary hover:bg-opacity-10 rounded-lg mx-2"> <i class="fas fa-briefcase"></i> <span class="sidebar-text ml-3">Leads</span> </a> <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:text-primary hover:bg-primary hover:bg-opacity-10 rounded-lg mx-2"> <i class="fas fa-calendar-alt"></i> <span class="sidebar-text ml-3">Appointments</span> </a> <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:text-primary hover:bg-primary hover:bg-opacity-10 rounded-lg mx-2"> <i class="fas fa-file-invoice-dollar"></i> <span class="sidebar-text ml-3">Invoices</span> </a> </div> <div class="mb-1"> <div class="text-xs uppercase font-semibold text-gray-500 px-4 py-2 sidebar-text">Settings</div> <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:text-primary hover:bg-primary hover:bg-opacity-10 rounded-lg mx-2"> <i class="fas fa-cog"></i> <span class="sidebar-text ml-3">Settings</span> </a> <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:text-primary hover:bg-primary hover:bg-opacity-10 rounded-lg mx-2"> <i class="fas fa-user-shield"></i> <span class="sidebar-text ml-3">Permissions</span> </a> </div> </div> </nav> <!-- Sidebar Footer --> <div class="p-4 border-t border-gray-200"> <button class="flex items-center justify-center w-full px-4 py-2 bg-primary text-white rounded-lg hover:bg-opacity-90 transition"> <i class="fas fa-plus"></i> <span class="sidebar-text ml-2">New Project</span> </button> </div> </div> <!-- Main Content --> <div class="flex-1 overflow-auto"> <!-- Top Navigation --> <header class="bg-white shadow-sm"> <div class="px-6 py-4 flex items-center justify-between"> <div class="flex items-center"> <h1 class="text-xl font-semibold text-gray-900">Dashboard</h1> </div> <div class="flex items-center space-x-4"> <div class="relative"> <button class="p-2 text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100"> <i class="fas fa-bell"></i> <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-danger"></span> </button> </div> <div class="relative"> <button class="p-2 text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100"> <i class="fas fa-envelope"></i> <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-danger"></span> </button> </div> <div class="relative"> <button id="userMenuButton" class="flex items-center space-x-2"> <div class="h-8 w-8 rounded-full bg-primary flex items-center justify-center text-white"> <span>JD</span> </div> <span class="hidden md:block">John Doe</span> <i class="fas fa-chevron-down text-xs"></i> </button> <div id="userMenu" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-10"> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Your Profile</a> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Settings</a> <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Sign out</a> </div> </div> </div> </div> </header> <!-- Main Content Area --> <main class="p-6"> <!-- Stats Cards --> <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6"> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Total Customers</p> <h3 class="text-2xl font-bold mt-1">1,254</h3> <p class="text-sm text-green-500 mt-1">+12% from last month</p> </div> <div class="p-3 rounded-full bg-primary bg-opacity-10 text-primary"> <i class="fas fa-users text-xl"></i> </div> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Active Projects</p> <h3 class="text-2xl font-bold mt-1">42</h3> <p class="text-sm text-green-500 mt-1">+5 from last week</p> </div> <div class="p-3 rounded-full bg-secondary bg-opacity-10 text-secondary"> <i class="fas fa-briefcase text-xl"></i> </div> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Revenue</p> <h3 class="text-2xl font-bold mt-1">$28,450</h3> <p class="text-sm text-red-500 mt-1">-2% from last month</p> </div> <div class="p-3 rounded-full bg-warning bg-opacity-10 text-warning"> <i class="fas fa-dollar-sign text-xl"></i> </div> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Pending Tasks</p> <h3 class="text-2xl font-bold mt-1">18</h3> <p class="text-sm text-green-500 mt-1">-3 from yesterday</p> </div> <div class="p-3 rounded-full bg-info bg-opacity-10 text-info"> <i class="fas fa-tasks text-xl"></i> </div> </div> </div> </div> <!-- Charts and Recent Activities --> <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6"> <!-- Sales Chart --> <div class="bg-white rounded-lg shadow p-6 lg:col-span-2"> <div class="flex items-center justify-between mb-4"> <h2 class="text-lg font-semibold">Sales Overview</h2> <div class="flex space-x-2"> <button class="px-3 py-1 text-xs bg-primary text-white rounded">This Month</button> <button class="px-3 py-1 text-xs bg-gray-100 text-gray-600 rounded">Last Month</button> </div> </div> <div class="chart-container"> <canvas id="salesChart"></canvas> </div> </div> <!-- Recent Activities --> <div class="bg-white rounded-lg shadow p-6"> <h2 class="text-lg font-semibold mb-4">Recent Activities</h2> <div class="space-y-4"> <div class="flex items-start"> <div class="p-2 bg-primary bg-opacity-10 text-primary rounded-full mr-3"> <i class="fas fa-user-plus text-sm"></i> </div> <div> <p class="text-sm font-medium">New customer added</p> <p class="text-xs text-gray-500">John Smith - 10 min ago</p> </div> </div> <div class="flex items-start"> <div class="p-2 bg-secondary bg-opacity-10 text-secondary rounded-full mr-3"> <i class="fas fa-file-invoice-dollar text-sm"></i> </div> <div> <p class="text-sm font-medium">Invoice #1234 paid</p> <p class="text-xs text-gray-500">Acme Corp - 2 hours ago</p> </div> </div> <div class="flex items-start"> <div class="p-2 bg-warning bg-opacity-10 text-warning rounded-full mr-3"> <i class="fas fa-calendar-check text-sm"></i> </div> <div> <p class="text-sm font-medium">Meeting scheduled</p> <p class="text-xs text-gray-500">With Sarah Johnson - Yesterday</p> </div> </div> <div class="flex items-start"> <div class="p-2 bg-info bg-opacity-10 text-info rounded-full mr-3"> <i class="fas fa-comment-alt text-sm"></i> </div> <div> <p class="text-sm font-medium">New message received</p> <p class="text-xs text-gray-500">From Michael Brown - Yesterday</p> </div> </div> <div class="flex items-start"> <div class="p-2 bg-danger bg-opacity-10 text-danger rounded-full mr-3"> <i class="fas fa-exclamation-triangle text-sm"></i> </div> <div> <p class="text-sm font-medium">Project deadline approaching</p> <p class="text-xs text-gray-500">Website Redesign - 2 days ago</p> </div> </div> </div> <button class="mt-4 text-primary text-sm font-medium">View All Activities</button> </div> </div> <!-- Projects and Tasks --> <div class="grid grid-cols-1 lg:grid-cols-2 gap-6"> <!-- Projects --> <div class="bg-white rounded-lg shadow"> <div class="p-6 border-b border-gray-200"> <h2 class="text-lg font-semibold">Active Projects</h2> </div> <div class="divide-y divide-gray-200"> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center justify-between"> <div> <h3 class="font-medium">Website Redesign</h3> <p class="text-sm text-gray-500">Due in 5 days</p> </div> <div class="w-24 h-2 bg-gray-200 rounded-full"> <div class="progress-bar h-2 rounded-full bg-primary" style="width: 75%"></div> </div> </div> </div> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center justify-between"> <div> <h3 class="font-medium">Mobile App Development</h3> <p class="text-sm text-gray-500">Due in 12 days</p> </div> <div class="w-24 h-2 bg-gray-200 rounded-full"> <div class="progress-bar h-2 rounded-full bg-secondary" style="width: 45%"></div> </div> </div> </div> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center justify-between"> <div> <h3 class="font-medium">Marketing Campaign</h3> <p class="text-sm text-gray-500">Due in 3 days</p> </div> <div class="w-24 h-2 bg-gray-200 rounded-full"> <div class="progress-bar h-2 rounded-full bg-warning" style="width: 90%"></div> </div> </div> </div> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center justify-between"> <div> <h3 class="font-medium">CRM Implementation</h3> <p class="text-sm text-gray-500">Due in 7 days</p> </div> <div class="w-24 h-2 bg-gray-200 rounded-full"> <div class="progress-bar h-2 rounded-full bg-info" style="width: 30%"></div> </div> </div> </div> </div> <div class="p-4 border-t border-gray-200"> <button class="text-primary text-sm font-medium">View All Projects</button> </div> </div> <!-- Tasks --> <div class="bg-white rounded-lg shadow"> <div class="p-6 border-b border-gray-200"> <div class="flex items-center justify-between"> <h2 class="text-lg font-semibold">Tasks</h2> <button class="text-primary text-sm font-medium">Add New</button> </div> </div> <div class="divide-y divide-gray-200"> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center"> <input type="checkbox" class="rounded text-primary focus:ring-primary mr-3"> <div> <h3 class="font-medium">Prepare project proposal</h3> <p class="text-sm text-gray-500">High Priority</p> </div> </div> </div> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center"> <input type="checkbox" class="rounded text-primary focus:ring-primary mr-3"> <div> <h3 class="font-medium">Client meeting at 2 PM</h3> <p class="text-sm text-gray-500">Medium Priority</p> </div> </div> </div> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center"> <input type="checkbox" class="rounded text-primary focus:ring-primary mr-3" checked> <div> <h3 class="font-medium line-through text-gray-400">Send monthly reports</h3> <p class="text-sm text-gray-500">Completed</p> </div> </div> </div> <div class="p-4 hover:bg-gray-50"> <div class="flex items-center"> <input type="checkbox" class="rounded text-primary focus:ring-primary mr-3"> <div> <h3 class="font-medium">Update website content</h3> <p class="text-sm text-gray-500">Low Priority</p> </div> </div> </div> </div> <div class="p-4 border-t border-gray-200"> <button class="text-primary text-sm font-medium">View All Tasks</button> </div> </div> </div> </main> </div> </div> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script> // Toggle sidebar document.getElementById('toggleSidebar').addEventListener('click', function() { document.getElementById('sidebar').classList.toggle('collapsed'); }); // Toggle user menu document.getElementById('userMenuButton').addEventListener('click', function() { document.getElementById('userMenu').classList.toggle('hidden'); }); // Close user menu when clicking outside document.addEventListener('click', function(event) { const userMenu = document.getElementById('userMenu'); const userMenuButton = document.getElementById('userMenuButton'); if (!userMenu.contains(event.target) && !userMenuButton.contains(event.target)) { userMenu.classList.add('hidden'); } }); // Sales Chart const salesCtx = document.getElementById('salesChart').getContext('2d'); const salesChart = new Chart(salesCtx, { type: 'line', data: { labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], datasets: [ { label: '2023', data: [5000, 7000, 6500, 8000, 9000, 10000, 11000, 10500, 9500, 12000, 11500, 13000], borderColor: '#4F46E5', backgroundColor: 'rgba(79, 70, 229, 0.05)', fill: true, tension: 0.4 }, { label: '2022', data: [4000, 6000, 5500, 7000, 8000, 8500, 9000, 9500, 8500, 10000, 10500, 11000], borderColor: '#10B981', backgroundColor: 'rgba(16, 185, 129, 0.05)', fill: true, tension: 0.4 } ] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { position: 'top', }, tooltip: { mode: 'index', intersect: false, } }, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return '$' + value.toLocaleString(); } } } } } }); // Animate progress bars document.querySelectorAll('.progress-bar').forEach(bar => { const width = bar.style.width; bar.style.width = '0'; setTimeout(() => { bar.style.width = width; }, 100); }); </script> </body> </html> - Initial Deployment
bd7b304 verified