-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics.html
More file actions
511 lines (485 loc) · 27.6 KB
/
analytics.html
File metadata and controls
511 lines (485 loc) · 27.6 KB
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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Analytics - Library Management</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/lucide@latest/dist/umd/lucide.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
</head>
<body class="bg-gray-50 font-inter">
<!-- Sidebar -->
<div class="fixed left-0 top-0 h-full w-60 bg-white border-r border-gray-200 z-30">
<div class="flex flex-col h-full">
<!-- Logo -->
<div class="flex items-center px-6 py-5 border-b border-gray-100">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 bg-emerald-500 rounded-lg flex items-center justify-center">
<i data-lucide="book-open" class="w-5 h-5 text-white"></i>
</div>
<span class="text-xl font-semibold text-gray-900">Library App</span>
</div>
</div>
<!-- Navigation -->
<nav class="flex-1 px-4 py-6 space-y-2">
<a href="#" data-page="index.html" class="nav-item flex items-center px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200">
<i data-lucide="layout-dashboard" class="w-5 h-5 mr-3"></i>
Dashboard
</a>
<a href="#" data-page="members.html" class="nav-item flex items-center px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200">
<i data-lucide="users" class="w-5 h-5 mr-3"></i>
Members
</a>
<a href="#" data-page="add-books.html" class="nav-item flex items-center px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200">
<i data-lucide="book-plus" class="w-5 h-5 mr-3"></i>
Add Books
</a>
<a href="#" data-page="checkout-books.html" class="nav-item flex items-center px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200">
<i data-lucide="book-check" class="w-5 h-5 mr-3"></i>
Check-out Books
</a>
<a href="#" data-page="analytics.html" class="nav-item active flex items-center px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200">
<i data-lucide="bar-chart-3" class="w-5 h-5 mr-3"></i>
Analytics
</a>
<a href="#" data-page="settings.html" class="nav-item flex items-center px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200">
<i data-lucide="settings" class="w-5 h-5 mr-3"></i>
Settings
</a>
<a href="#" data-page="help.html" class="nav-item flex items-center px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200">
<i data-lucide="help-circle" class="w-5 h-5 mr-3"></i>
Help
</a>
</nav>
<!-- Logout -->
<div class="px-4 pb-6">
<button class="nav-item flex items-center w-full px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 text-red-600 hover:bg-red-50">
<i data-lucide="log-out" class="w-5 h-5 mr-3"></i>
Logout
</button>
</div>
</div>
</div>
<!-- Main Content -->
<div class="ml-60">
<!-- Top Navbar -->
<header class="sticky top-0 bg-white border-b border-gray-200 z-20">
<div class="flex items-center justify-between px-8 py-4">
<!-- Search Bar -->
<div class="flex-1 max-w-2xl">
<div class="relative">
<i data-lucide="search" class="absolute left-4 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"></i>
<input type="text" placeholder="Search analytics data..."
class="w-full pl-12 pr-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent transition-all duration-200">
</div>
</div>
<!-- Right Section -->
<div class="flex items-center space-x-4 ml-8">
<!-- Date Range -->
<select class="px-4 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm font-medium focus:outline-none focus:ring-2 focus:ring-emerald-500">
<option>Last 30 days</option>
<option>Last 7 days</option>
<option>Last 3 months</option>
<option>Last 6 months</option>
<option>Last year</option>
</select>
<!-- Export Button -->
<button class="px-4 py-2 bg-emerald-500 text-white rounded-lg text-sm font-medium hover:bg-emerald-600 transition-colors duration-200">
<i data-lucide="download" class="w-4 h-4 mr-2 inline"></i>
Export Report
</button>
<!-- Notifications -->
<button class="relative p-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-all duration-200">
<i data-lucide="bell" class="w-5 h-5"></i>
<span class="absolute -top-1 -right-1 w-3 h-3 bg-red-500 rounded-full"></span>
</button>
<!-- User Profile -->
<div class="flex items-center space-x-3">
<img src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop&crop=face"
alt="User" class="w-8 h-8 rounded-full">
<div class="hidden md:block">
<p class="text-sm font-medium text-gray-900">Admin</p>
</div>
<i data-lucide="chevron-down" class="w-4 h-4 text-gray-400"></i>
</div>
</div>
</div>
</header>
<!-- Analytics Content -->
<main class="p-8">
<!-- Page Header -->
<div class="flex items-center justify-between mb-8">
<div>
<h1 class="text-2xl font-bold text-gray-900">Analytics</h1>
<p class="text-gray-600 mt-1">Library performance insights and statistics</p>
</div>
<div class="flex items-center space-x-3">
<button class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 transition-colors duration-200">
<i data-lucide="calendar" class="w-4 h-4 mr-2 inline"></i>
Custom Range
</button>
<button class="px-4 py-2 bg-emerald-500 text-white rounded-lg text-sm font-medium hover:bg-emerald-600 transition-colors duration-200">
<i data-lucide="download" class="w-4 h-4 mr-2 inline"></i>
Export Report
</button>
</div>
</div>
<!-- Key Metrics -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="stat-card bg-white rounded-2xl p-6 border border-gray-100">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-600">Total Circulation</h3>
<i data-lucide="trending-up" class="w-4 h-4 text-emerald-500"></i>
</div>
<p class="text-3xl font-bold text-gray-900">3,247</p>
<div class="flex items-center mt-2">
<span class="text-xs font-medium text-emerald-600 bg-emerald-50 px-2 py-1 rounded-full">+15.3%</span>
<span class="text-xs text-gray-500 ml-2">vs last month</span>
</div>
</div>
<div class="stat-card bg-white rounded-2xl p-6 border border-gray-100">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-600">Active Members</h3>
<i data-lucide="users" class="w-4 h-4 text-blue-500"></i>
</div>
<p class="text-3xl font-bold text-gray-900">1,089</p>
<div class="flex items-center mt-2">
<span class="text-xs font-medium text-emerald-600 bg-emerald-50 px-2 py-1 rounded-full">+8.2%</span>
<span class="text-xs text-gray-500 ml-2">vs last month</span>
</div>
</div>
<div class="stat-card bg-white rounded-2xl p-6 border border-gray-100">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-600">Collection Utilization</h3>
<i data-lucide="book" class="w-4 h-4 text-purple-500"></i>
</div>
<p class="text-3xl font-bold text-gray-900">73.2%</p>
<div class="flex items-center mt-2">
<span class="text-xs font-medium text-emerald-600 bg-emerald-50 px-2 py-1 rounded-full">+2.1%</span>
<span class="text-xs text-gray-500 ml-2">vs last month</span>
</div>
</div>
<div class="stat-card bg-white rounded-2xl p-6 border border-gray-100">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-medium text-gray-600">Revenue</h3>
<i data-lucide="dollar-sign" class="w-4 h-4 text-emerald-500"></i>
</div>
<p class="text-3xl font-bold text-gray-900">$12,450</p>
<div class="flex items-center mt-2">
<span class="text-xs font-medium text-red-600 bg-red-50 px-2 py-1 rounded-full">-3.5%</span>
<span class="text-xs text-gray-500 ml-2">vs last month</span>
</div>
</div>
</div>
<!-- Charts Section -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
<!-- Circulation Trends -->
<div class="bg-white rounded-2xl p-6 border border-gray-100">
<div class="flex items-center justify-between mb-6">
<h3 class="text-lg font-semibold text-gray-900">Circulation Trends</h3>
<div class="flex items-center space-x-4 text-sm">
<div class="flex items-center">
<div class="w-3 h-3 bg-emerald-500 rounded-full mr-2"></div>
<span class="text-gray-600">Checkouts</span>
</div>
<div class="flex items-center">
<div class="w-3 h-3 bg-blue-500 rounded-full mr-2"></div>
<span class="text-gray-600">Returns</span>
</div>
</div>
</div>
<canvas id="circulationChart" class="w-full h-64"></canvas>
</div>
<!-- Member Growth -->
<div class="bg-white rounded-2xl p-6 border border-gray-100">
<div class="flex items-center justify-between mb-6">
<h3 class="text-lg font-semibold text-gray-900">Member Growth</h3>
<div class="flex items-center space-x-4 text-sm">
<div class="flex items-center">
<div class="w-3 h-3 bg-purple-500 rounded-full mr-2"></div>
<span class="text-gray-600">New Members</span>
</div>
</div>
</div>
<canvas id="memberChart" class="w-full h-64"></canvas>
</div>
</div>
<!-- Category Analysis & Top Books -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
<!-- Popular Categories -->
<div class="bg-white rounded-2xl p-6 border border-gray-100">
<h3 class="text-lg font-semibold text-gray-900 mb-6">Popular Categories</h3>
<canvas id="categoryChart" class="w-full h-64"></canvas>
</div>
<!-- Top Performing Books -->
<div class="bg-white rounded-2xl p-6 border border-gray-100">
<h3 class="text-lg font-semibold text-gray-900 mb-6">Top Performing Books</h3>
<div class="space-y-4">
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 bg-emerald-500 rounded-lg flex items-center justify-center text-white text-sm font-bold">1</div>
<div>
<p class="font-medium text-gray-900">Harry Potter Series</p>
<p class="text-sm text-gray-500">J.K. Rowling</p>
</div>
</div>
<div class="text-right">
<p class="font-semibold text-gray-900">156</p>
<p class="text-xs text-gray-500">checkouts</p>
</div>
</div>
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 bg-blue-500 rounded-lg flex items-center justify-center text-white text-sm font-bold">2</div>
<div>
<p class="font-medium text-gray-900">The Hunger Games</p>
<p class="text-sm text-gray-500">Suzanne Collins</p>
</div>
</div>
<div class="text-right">
<p class="font-semibold text-gray-900">134</p>
<p class="text-xs text-gray-500">checkouts</p>
</div>
</div>
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 bg-purple-500 rounded-lg flex items-center justify-center text-white text-sm font-bold">3</div>
<div>
<p class="font-medium text-gray-900">Dune</p>
<p class="text-sm text-gray-500">Frank Herbert</p>
</div>
</div>
<div class="text-right">
<p class="font-semibold text-gray-900">98</p>
<p class="text-xs text-gray-500">checkouts</p>
</div>
</div>
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 bg-amber-500 rounded-lg flex items-center justify-center text-white text-sm font-bold">4</div>
<div>
<p class="font-medium text-gray-900">The Great Gatsby</p>
<p class="text-sm text-gray-500">F. Scott Fitzgerald</p>
</div>
</div>
<div class="text-right">
<p class="font-semibold text-gray-900">87</p>
<p class="text-xs text-gray-500">checkouts</p>
</div>
</div>
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 bg-red-500 rounded-lg flex items-center justify-center text-white text-sm font-bold">5</div>
<div>
<p class="font-medium text-gray-900">To Kill a Mockingbird</p>
<p class="text-sm text-gray-500">Harper Lee</p>
</div>
</div>
<div class="text-right">
<p class="font-semibold text-gray-900">76</p>
<p class="text-xs text-gray-500">checkouts</p>
</div>
</div>
</div>
</div>
</div>
<!-- Detailed Analytics Table -->
<div class="bg-white rounded-2xl border border-gray-100">
<div class="p-6 border-b border-gray-100">
<div class="flex items-center justify-between">
<h3 class="text-lg font-semibold text-gray-900">Detailed Analytics</h3>
<div class="flex items-center space-x-3">
<select class="px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm">
<option>All Categories</option>
<option>Fiction</option>
<option>Non-Fiction</option>
<option>Science</option>
<option>Technology</option>
</select>
<button class="px-3 py-2 bg-emerald-50 text-emerald-600 rounded-lg text-sm font-medium hover:bg-emerald-100 transition-colors duration-200">
View Details
</button>
</div>
</div>
</div>
<div class="overflow-x-auto">
<table class="w-full text-sm">
<thead>
<tr class="text-left text-gray-500 border-b border-gray-100">
<th class="px-6 py-4 font-medium">Book Title</th>
<th class="px-6 py-4 font-medium">Author</th>
<th class="px-6 py-4 font-medium">Category</th>
<th class="px-6 py-4 font-medium">Total Checkouts</th>
<th class="px-6 py-4 font-medium">Avg. Duration</th>
<th class="px-6 py-4 font-medium">Rating</th>
<th class="px-6 py-4 font-medium">Revenue</th>
</tr>
</thead>
<tbody class="text-gray-900">
<tr class="border-b border-gray-50 hover:bg-gray-50 transition-colors duration-200">
<td class="px-6 py-4 font-medium">Harry Potter and the Sorcerer's Stone</td>
<td class="px-6 py-4">J.K. Rowling</td>
<td class="px-6 py-4">
<span class="inline-block px-2 py-1 bg-purple-50 text-purple-600 text-xs font-medium rounded-full">Fantasy</span>
</td>
<td class="px-6 py-4">156</td>
<td class="px-6 py-4">12 days</td>
<td class="px-6 py-4">
<div class="flex items-center">
<span class="text-yellow-400">★★★★★</span>
<span class="ml-1 text-gray-500">4.8</span>
</div>
</td>
<td class="px-6 py-4">$468</td>
</tr>
<tr class="border-b border-gray-50 hover:bg-gray-50 transition-colors duration-200">
<td class="px-6 py-4 font-medium">The Hunger Games</td>
<td class="px-6 py-4">Suzanne Collins</td>
<td class="px-6 py-4">
<span class="inline-block px-2 py-1 bg-red-50 text-red-600 text-xs font-medium rounded-full">Dystopian</span>
</td>
<td class="px-6 py-4">134</td>
<td class="px-6 py-4">10 days</td>
<td class="px-6 py-4">
<div class="flex items-center">
<span class="text-yellow-400">★★★★☆</span>
<span class="ml-1 text-gray-500">4.5</span>
</div>
</td>
<td class="px-6 py-4">$402</td>
</tr>
<tr class="border-b border-gray-50 hover:bg-gray-50 transition-colors duration-200">
<td class="px-6 py-4 font-medium">Dune</td>
<td class="px-6 py-4">Frank Herbert</td>
<td class="px-6 py-4">
<span class="inline-block px-2 py-1 bg-blue-50 text-blue-600 text-xs font-medium rounded-full">Sci-Fi</span>
</td>
<td class="px-6 py-4">98</td>
<td class="px-6 py-4">15 days</td>
<td class="px-6 py-4">
<div class="flex items-center">
<span class="text-yellow-400">★★★★★</span>
<span class="ml-1 text-gray-500">4.7</span>
</div>
</td>
<td class="px-6 py-4">$294</td>
</tr>
</tbody>
</table>
</div>
</div>
</main>
</div>
<script>
// Initialize Lucide Icons
document.addEventListener('DOMContentLoaded', function() {
lucide.createIcons();
initializeAnalyticsCharts();
});
function initializeAnalyticsCharts() {
// Circulation Trends Chart
const circulationCtx = document.getElementById('circulationChart');
if (circulationCtx) {
new Chart(circulationCtx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [
{
label: 'Checkouts',
data: [320, 450, 380, 520, 480, 560],
borderColor: '#10b981',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
borderWidth: 3,
fill: true,
tension: 0.4
},
{
label: 'Returns',
data: [280, 420, 350, 480, 450, 520],
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 3,
fill: true,
tension: 0.4
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: { legend: { display: false } },
scales: {
x: { grid: { display: false } },
y: { beginAtZero: true, grid: { color: 'rgba(107, 114, 128, 0.1)' } }
}
}
});
}
// Member Growth Chart
const memberCtx = document.getElementById('memberChart');
if (memberCtx) {
new Chart(memberCtx, {
type: 'bar',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [{
label: 'New Members',
data: [45, 52, 38, 65, 59, 48],
backgroundColor: '#8b5cf6',
borderRadius: 8,
borderSkipped: false
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: { legend: { display: false } },
scales: {
x: { grid: { display: false } },
y: { beginAtZero: true, grid: { color: 'rgba(107, 114, 128, 0.1)' } }
}
}
});
}
// Category Chart
const categoryCtx = document.getElementById('categoryChart');
if (categoryCtx) {
new Chart(categoryCtx, {
type: 'doughnut',
data: {
labels: ['Fiction', 'Non-Fiction', 'Science', 'Technology', 'History', 'Children'],
datasets: [{
data: [35, 25, 15, 12, 8, 5],
backgroundColor: [
'#10b981',
'#3b82f6',
'#8b5cf6',
'#f59e0b',
'#ef4444',
'#06b6d4'
],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
labels: { usePointStyle: true, padding: 20 }
}
}
}
});
}
}
</script>
</body>
</html>