forked from DanyalAhmad2003/HCI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatistics.html
More file actions
128 lines (113 loc) · 2.74 KB
/
statistics.html
File metadata and controls
128 lines (113 loc) · 2.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>EcoBin – Statistics</title>
<link rel="stylesheet" href="css/styles.css" />
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.stats-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 1rem;
margin: 1rem 0;
}
.card {
background: #111;
border: 2px solid #C8102E;
border-radius: 0.5rem;
padding: 1rem;
text-align: center;
color: #fff;
}
.card h3 {
margin-bottom: 0.5rem;
font-size: 1.25rem;
color: #C8102E;
}
.card p {
font-size: 1.5rem;
font-weight: bold;
}
canvas {
max-width: 600px;
margin: 1rem auto;
}
</style>
</head>
<body>
<div class="glow-box" style="margin-top:2rem;">
<header><h1>EcoBin Business</h1></header>
</div>
<main style="max-width:800px; margin:0 auto; padding:1rem;">
<div class="highlight">
<h2>Statistics</h2>
<div class="stats-cards">
<div class="card">
<h3>Devices Recycled</h3>
<p>1,234</p>
</div>
<div class="card">
<h3>Points Awarded</h3>
<p>56,700</p>
</div>
<div class="card">
<h3>Materials Processed</h3>
<p>789 kg</p>
</div>
<div class="card">
<h3>Active Businesses</h3>
<p>42</p>
</div>
</div>
</div>
<div class="highlight" style="text-align:center;">
<h3>Recycled Devices by Category</h3>
<canvas id="recycleChart"></canvas>
</div>
<button class="btn" style="margin-top:1rem;" onclick="location.href='business.html'">
← Back to Business
</button>
</main>
<script>
const data = {
labels: ['Phones','Laptops','Tablets','Cameras','Others'],
datasets: [{
label: 'Units Recycled',
data: [450, 300, 150, 100, 234],
backgroundColor: 'rgba(200,16,46,0.8)',
borderColor: '#C8102E',
borderWidth: 1
}]
};
const config = {
type: 'bar',
data: data,
options: {
scales: {
y: {
beginAtZero: true,
ticks: { color: '#fff' }
},
x: {
ticks: { color: '#fff' }
}
},
plugins: {
legend: { labels: { color: '#fff' } },
tooltip: {
titleColor: '#000',
bodyColor: '#000',
backgroundColor: '#C8102E'
}
}
}
};
new Chart(
document.getElementById('recycleChart'),
config
);
</script>
</body>
</html>