File size: 20,856 Bytes
ee2a681
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93d7d97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<!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>