Caceras's picture
WEbsite structure interactive dashboard - Initial Deployment
ee2a681 verified
<!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 href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
<style>
.sidebar {
transition: all 0.3s ease;
}
.dashboard-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
#globe-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.3;
}
</style>
</head>
<body class="bg-gray-50">
<div id="globe-bg"></div>
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-indigo-800 text-white w-64 md:w-72 flex-shrink-0 transform -translate-x-full md:translate-x-0 transition-transform duration-300 ease-in-out fixed h-full z-50" id="sidebar">
<div class="p-4 flex items-center justify-between border-b border-indigo-700">
<h1 class="text-2xl font-bold">Analytics<span class="text-indigo-300">Pro</span></h1>
<button id="sidebarToggle" class="md:hidden">
<i data-feather="x"></i>
</button>
</div>
<div class="p-4">
<div class="flex items-center space-x-3 p-3 rounded-lg bg-indigo-700 mb-4">
<div class="w-10 h-10 rounded-full bg-indigo-500 flex items-center justify-center">
<i data-feather="user"></i>
</div>
<div>
<p class="font-medium">John Doe</p>
<p class="text-xs text-indigo-300">Admin</p>
</div>
</div>
<nav class="mt-6">
<div class="space-y-2">
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg bg-indigo-700 text-white">
<i data-feather="home"></i>
<span>Dashboard</span>
</a>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition">
<i data-feather="bar-chart-2"></i>
<span>Analytics</span>
</a>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition">
<i data-feather="users"></i>
<span>Customers</span>
</a>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition">
<i data-feather="shopping-bag"></i>
<span>Products</span>
</a>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition">
<i data-feather="settings"></i>
<span>Settings</span>
</a>
</div>
</nav>
</div>
</div>
<!-- Main Content -->
<div class="flex-1 flex flex-col overflow-hidden ml-0 md:ml-64">
<!-- Top Navigation -->
<header class="bg-white shadow-sm z-10">
<div class="flex items-center justify-between p-4">
<button id="mobileSidebarToggle" class="md:hidden">
<i data-feather="menu"></i>
</button>
<div class="flex items-center space-x-4">
<div class="relative">
<i data-feather="search" class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 rounded-lg border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent">
</div>
<button class="p-2 rounded-full hover:bg-gray-100">
<i data-feather="bell"></i>
</button>
</div>
</div>
</header>
<!-- Dashboard Content -->
<main class="flex-1 overflow-y-auto p-4 md:p-6">
<div class="mb-6">
<h2 class="text-2xl font-bold text-gray-800">Dashboard Overview</h2>
<p class="text-gray-600">Welcome back! Here's what's happening with your business today.</p>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="dashboard-card bg-white rounded-xl shadow-sm p-6 border-l-4 border-blue-500" data-aos="fade-up">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">Total Revenue</p>
<h3 class="text-2xl font-bold mt-1">$24,780</h3>
<p class="text-sm text-green-500 mt-2 flex items-center">
<i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
<span>12.5% from last month</span>
</p>
</div>
<div class="p-3 rounded-lg bg-blue-50 text-blue-500">
<i data-feather="dollar-sign"></i>
</div>
</div>
</div>
<div class="dashboard-card bg-white rounded-xl shadow-sm p-6 border-l-4 border-purple-500" data-aos="fade-up" data-aos-delay="100">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">New Customers</p>
<h3 class="text-2xl font-bold mt-1">1,254</h3>
<p class="text-sm text-green-500 mt-2 flex items-center">
<i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
<span>8.2% from last month</span>
</p>
</div>
<div class="p-3 rounded-lg bg-purple-50 text-purple-500">
<i data-feather="users"></i>
</div>
</div>
</div>
<div class="dashboard-card bg-white rounded-xl shadow-sm p-6 border-l-4 border-yellow-500" data-aos="fade-up" data-aos-delay="200">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">Active Projects</p>
<h3 class="text-2xl font-bold mt-1">42</h3>
<p class="text-sm text-red-500 mt-2 flex items-center">
<i data-feather="trending-down" class="w-4 h-4 mr-1"></i>
<span>3.1% from last month</span>
</p>
</div>
<div class="p-3 rounded-lg bg-yellow-50 text-yellow-500">
<i data-feather="briefcase"></i>
</div>
</div>
</div>
<div class="dashboard-card bg-white rounded-xl shadow-sm p-6 border-l-4 border-green-500" data-aos="fade-up" data-aos-delay="300">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">Conversion Rate</p>
<h3 class="text-2xl font-bold mt-1">3.8%</h3>
<p class="text-sm text-green-500 mt-2 flex items-center">
<i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
<span>1.4% from last month</span>
</p>
</div>
<div class="p-3 rounded-lg bg-green-50 text-green-500">
<i data-feather="percent"></i>
</div>
</div>
</div>
</div>
<!-- Charts Section -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
<div class="bg-white p-6 rounded-xl shadow-sm lg:col-span-2" data-aos="fade-up">
<div class="flex justify-between items-center mb-6">
<h3 class="font-bold text-lg">Revenue Overview</h3>
<div class="flex space-x-2">
<button class="px-3 py-1 text-sm bg-indigo-100 text-indigo-700 rounded-md">Monthly</button>
<button class="px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded-md">Weekly</button>
<button class="px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded-md">Daily</button>
</div>
</div>
<canvas id="revenueChart" height="300"></canvas>
</div>
<div class="bg-white p-6 rounded-xl shadow-sm" data-aos="fade-up" data-aos-delay="100">
<h3 class="font-bold text-lg mb-6">Traffic Sources</h3>
<canvas id="trafficChart" height="300"></canvas>
</div>
</div>
<!-- Recent Activity & Top Products -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div class="bg-white p-6 rounded-xl shadow-sm" data-aos="fade-up">
<h3 class="font-bold text-lg mb-6">Recent Activity</h3>
<div class="space-y-4">
<div class="flex items-start space-x-3">
<div class="p-2 bg-indigo-100 text-indigo-600 rounded-lg">
<i data-feather="shopping-cart"></i>
</div>
<div>
<p class="font-medium">New order received</p>
<p class="text-sm text-gray-500">#ORD-2023-00125 from John Smith</p>
<p class="text-xs text-gray-400 mt-1">2 minutes ago</p>
</div>
</div>
<div class="flex items-start space-x-3">
<div class="p-2 bg-green-100 text-green-600 rounded-lg">
<i data-feather="user-plus"></i>
</div>
<div>
<p class="font-medium">New customer registered</p>
<p class="text-sm text-gray-500">Sarah Johnson from London</p>
<p class="text-xs text-gray-400 mt-1">15 minutes ago</p>
</div>
</div>
<div class="flex items-start space-x-3">
<div class="p-2 bg-yellow-100 text-yellow-600 rounded-lg">
<i data-feather="alert-circle"></i>
</div>
<div>
<p class="font-medium">High traffic alert</p>
<p class="text-sm text-gray-500">Server load reached 85% capacity</p>
<p class="text-xs text-gray-400 mt-1">1 hour ago</p>
</div>
</div>
<div class="flex items-start space-x-3">
<div class="p-2 bg-blue-100 text-blue-600 rounded-lg">
<i data-feather="message-square"></i>
</div>
<div>
<p class="font-medium">New support ticket</p>
<p class="text-sm text-gray-500">"Need help with checkout process"</p>
<p class="text-xs text-gray-400 mt-1">3 hours ago</p>
</div>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-sm" data-aos="fade-up" data-aos-delay="100">
<h3 class="font-bold text-lg mb-6">Top Products</h3>
<div class="space-y-4">
<div class="flex items-center space-x-4">
<img src="http://static.photos/technology/120x120/1" alt="Product" class="w-12 h-12 rounded-md object-cover">
<div class="flex-1">
<p class="font-medium">Premium Headphones</p>
<div class="flex items-center justify-between">
<p class="text-sm text-gray-500">Electronics</p>
<p class="text-sm font-medium">$199.99</p>
</div>
</div>
</div>
<div class="flex items-center space-x-4">
<img src="http://static.photos/technology/120x120/2" alt="Product" class="w-12 h-12 rounded-md object-cover">
<div class="flex-1">
<p class="font-medium">Smart Watch</p>
<div class="flex items-center justify-between">
<p class="text-sm text-gray-500">Wearables</p>
<p class="text-sm font-medium">$249.99</p>
</div>
</div>
</div>
<div class="flex items-center space-x-4">
<img src="http://static.photos/technology/120x120/3" alt="Product" class="w-12 h-12 rounded-md object-cover">
<div class="flex-1">
<p class="font-medium">Wireless Earbuds</p>
<div class="flex items-center justify-between">
<p class="text-sm text-gray-500">Audio</p>
<p class="text-sm font-medium">$129.99</p>
</div>
</div>
</div>
<div class="flex items-center space-x-4">
<img src="http://static.photos/technology/120x120/4" alt="Product" class="w-12 h-12 rounded-md object-cover">
<div class="flex-1">
<p class="font-medium">Bluetooth Speaker</p>
<div class="flex items-center justify-between">
<p class="text-sm text-gray-500">Audio</p>
<p class="text-sm font-medium">$89.99</p>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script>
// Initialize AOS
AOS.init({
duration: 800,
easing: 'ease-in-out',
once: true
});
// Initialize Feather Icons
feather.replace();
// Toggle Sidebar on Mobile
const sidebar = document.getElementById('sidebar');
const sidebarToggle = document.getElementById('sidebarToggle');
const mobileSidebarToggle = document.getElementById('mobileSidebarToggle');
mobileSidebarToggle.addEventListener('click', () => {
sidebar.classList.remove('-translate-x-full');
});
sidebarToggle.addEventListener('click', () => {
sidebar.classList.add('-translate-x-full');
});
// Initialize Vanta.js Globe
VANTA.GLOBE({
el: "#globe-bg",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0x3f83f8,
backgroundColor: 0xf8fafc
});
// Charts
document.addEventListener('DOMContentLoaded', function() {
// Revenue Chart
const revenueCtx = document.getElementById('revenueChart').getContext('2d');
const revenueChart = new Chart(revenueCtx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Revenue',
data: [12000, 19000, 15000, 18000, 21000, 25000, 22000, 28000, 24000, 30000, 27000, 32000],
borderColor: '#6366F1',
backgroundColor: 'rgba(99, 102, 241, 0.1)',
borderWidth: 2,
fill: true,
tension: 0.4
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true,
grid: {
drawBorder: false
}
},
x: {
grid: {
display: false
}
}
}
}
});
// Traffic Chart
const trafficCtx = document.getElementById('trafficChart').getContext('2d');
const trafficChart = new Chart(trafficCtx, {
type: 'doughnut',
data: {
labels: ['Direct', 'Organic', 'Referral', 'Social', 'Email'],
datasets: [{
data: [35, 25, 20, 15, 5],
backgroundColor: [
'#6366F1',
'#8B5CF6',
'#EC4899',
'#F59E0B',
'#10B981'
],
borderWidth: 0
}]
},
options: {
responsive: true,
cutout: '70%',
plugins: {
legend: {
position: 'bottom'
}
}
}
});
});
</script>
</body>
</html>