-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
327 lines (293 loc) · 10.6 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Domino's Sales Report</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body {
background-color: #f7f7f7;
font-family: 'Roboto', sans-serif;
}
.header {
background-color: #7A1E9E;
color: white;
padding: 15px 30px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.header h1 {
font-size: 28px;
font-weight: bold;
display: flex;
align-items: center;
}
.header input {
border-radius: 3px;
padding: 8px;
margin-right: 10px;
width: 160px;
border: 1px solid #ddd;
}
.sidebar {
background-color: #fff;
border-right: 1px solid #ddd;
height: 100vh;
padding: 20px;
font-size: 16px;
}
.sidebar h5 {
font-size: 16px;
margin-bottom: 15px;
font-weight: bold;
}
.sidebar a {
color: #007bff;
text-decoration: none;
display: block;
margin-bottom: 10px;
font-size: 14px;
}
.card {
border-radius: 10px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
height: 120px;
margin-bottom: 20px;
}
.card h5 {
font-size: 14px;
font-weight: bold;
}
.card h2 {
font-size: 28px;
margin-top: 10px;
}
.chart-container {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
height: 260px;
}
.chart-container canvas {
width: 100% !important;
height: 200px !important;
}
footer {
text-align: center;
padding: 20px;
background-color: #7A1E9E;
color: white;
position: relative;
bottom: 0;
width: 100%;
}
/* Counter animation styles */
.counter {
font-size: 28px;
font-weight: bold;
color: #fff;
}
</style>
</head>
<body>
<!-- Header Section -->
<div class="header">
<h1><i class="fas fa-pizza-slice"></i> DOMINO'S SALES REPORT</h1>
<div>
<input type="text" placeholder="Pizza Category">
<input type="date" value="2015-01-01">
<input type="date" value="2015-12-31">
</div>
</div>
<!-- Main Content -->
<div class="container-fluid">
<div class="row">
<!-- Sidebar -->
<div class="col-md-2 sidebar">
<h5>HOME</h5>
<a href="#">Best/Worst Seller</a>
<h5>Busiest Days</h5>
<a href="#">Days: Friday/Saturday</a>
<a href="#">Monthly: July/Jan</a>
<h5>Sales Performance</h5>
<a href="#">Category: Classic</a>
<a href="#">Size: Large</a>
</div>
<!-- Dashboard Cards and Charts -->
<div class="col-md-10">
<!-- Cards Row -->
<div class="row text-center">
<div class="col-md-2">
<div class="card bg-primary text-white">
<div class="card-body">
<h5>Total Revenue</h5>
<h2 class="counter" data-target="817860">0</h2>
</div>
</div>
</div>
<div class="col-md-2">
<div class="card bg-success text-white">
<div class="card-body">
<h5>Average Order Value</h5>
<h2 class="counter" data-target="38.31">0</h2>
</div>
</div>
</div>
<div class="col-md-2">
<div class="card bg-info text-white">
<div class="card-body">
<h5>Total Pizzas Sold</h5>
<h2 class="counter" data-target="50000">0</h2>
</div>
</div>
</div>
<div class="col-md-2">
<div class="card bg-warning text-white">
<div class="card-body">
<h5>Total Orders</h5>
<h2 class="counter" data-target="21000">0</h2>
</div>
</div>
</div>
<div class="col-md-2">
<div class="card bg-danger text-white">
<div class="card-body">
<h5>Avg Pizzas per Order</h5>
<h2 class="counter" data-target="2.32">0</h2>
</div>
</div>
</div>
</div>
<!-- Charts Row -->
<div class="row">
<div class="col-md-8 chart-container">
<h5>Daily Trend for Total Orders</h5>
<canvas id="dailyTrendChart"></canvas>
</div>
<div class="col-md-4 chart-container">
<h5>Monthly Trend for Total Orders</h5>
<canvas id="monthlyTrendChart"></canvas>
</div>
</div>
<div class="row">
<div class="col-md-6 chart-container">
<h5>% of Sales by Pizza Category</h5>
<canvas id="categorySalesChart"></canvas>
</div>
<div class="col-md-6 chart-container">
<h5>Total Pizzas Sold by Pizza Category</h5>
<canvas id="totalPizzasChart"></canvas>
</div>
</div>
</div>
</div>
</div>
<footer>
Domino's Sales Report | Jan 2023 - Dec 2023
</footer>
<!-- Scripts for Charts and Counters -->
<script>
// Chart.js initialization (same as before)
const dailyTrendData = [2800, 3000, 3000, 3200, 3500, 3200, 2600];
const monthlyTrendData = [1845, 1840, 1853, 935, 1841, 1792];
const categorySalesData = [23.68, 26.91, 25.46, 23.96];
const totalPizzasSold = [14888, 11987, 11649, 11050];
const ctx1 = document.getElementById('dailyTrendChart').getContext('2d');
const dailyTrendChart = new Chart(ctx1, {
type: 'bar',
data: {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
datasets: [{
label: 'Orders',
data: dailyTrendData,
backgroundColor: 'rgba(75, 192, 192, 0.6)',
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
const ctx2 = document.getElementById('monthlyTrendChart').getContext('2d');
const monthlyTrendChart = new Chart(ctx2, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [{
label: 'Orders',
data: monthlyTrendData,
backgroundColor: 'rgba(153, 102, 255, 0.6)',
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
const ctx3 = document.getElementById('categorySalesChart').getContext('2d');
const categorySalesChart = new Chart(ctx3, {
type: 'pie',
data: {
labels: ['Classic', 'Deluxe', 'Supreme', 'Veggie'],
datasets: [{
label: '% of Sales',
data: categorySalesData,
backgroundColor: [
'rgba(255, 99, 132, 0.6)',
'rgba(54, 162, 235, 0.6)',
'rgba(255, 206, 86, 0.6)',
'rgba(75, 192, 192, 0.6)'
],
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
const ctx4 = document.getElementById('totalPizzasChart').getContext('2d');
const totalPizzasChart = new Chart(ctx4, {
type: 'bar',
data: {
labels: ['Classic', 'Deluxe', 'Supreme', 'Veggie'],
datasets: [{
label: 'Total Pizzas Sold',
data: totalPizzasSold,
backgroundColor: 'rgba(255, 159, 64, 0.6)',
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
// Counter Animation
document.addEventListener('DOMContentLoaded', () => {
const counters = document.querySelectorAll('.counter');
counters.forEach(counter => {
const updateCount = () => {
const target = +counter.getAttribute('data-target');
const count = +counter.innerText;
// Calculate the increment
const increment = target / 200; // Adjust 200 for speed
if (count < target) {
counter.innerText = Math.ceil(count + increment);
setTimeout(updateCount, 1); // Adjust the timeout for smoothness
} else {
counter.innerText = target;
}
};
updateCount();
});
});
</script>
</body>
</html>