-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathstudent_dashboard.html
More file actions
628 lines (547 loc) · 15.3 KB
/
Copy pathstudent_dashboard.html
File metadata and controls
628 lines (547 loc) · 15.3 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
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Student Dashboard - Achievement Management System</title>
<link rel="stylesheet" href="{{ url_for('static', filename = 'styles.css') }}" />
<script src="{{ url_for('static', filename = 'script.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.dashboard-container {
max-width: 1400px !important;
width: 95%;
}
.dashboard-stats {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 30px;
}
.stat-card {
flex: 1 1 200px; /* grow/shrink but never below 200 px */
max-width: calc(33.333% - 14px); /* max 1/3 width so lone card stays bounded */
min-width: 200px;
background: rgba(255, 0, 0, 0.1);
border-radius: 10px;
padding: 20px;
text-align: center;
border: 1px solid var(--border-color);
transition: transform 0.3s ease;
}
.stat-card:hover {
transform: translateY(-5px);
}
.stat-number {
font-size: 32px;
font-weight: bold;
color: var(--primary-color);
}
.stat-label {
font-size: 16px;
margin-top: 10px;
}
.student-info {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 30px;
}
.student-avatar {
width: 80px;
height: 80px;
border-radius: 50%;
background-color: var(--primary-color);
display: flex;
justify-content: center;
align-items: center;
color: white;
font-size: 32px;
font-weight: bold;
}
.student-details h2 {
margin: 0;
font-size: 24px;
}
.dashboard-actions {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-top: 30px;
}
.dashboard-action {
flex: 1 1 250px; /* grow/shrink but never below 250 px */
max-width: calc(33.333% - 14px); /* prevent a lone card stretching to full width */
min-width: 250px;
background: var(--glass-bg);
border-radius: 15px;
padding: 25px;
text-align: center;
border: 1px solid var(--border-color);
transition: all 0.3s ease;
text-decoration: none;
color: var(--text-color);
}
.dashboard-action:hover {
transform: translateY(-5px);
background: rgba(255, 0, 0, 0.1);
}
.action-icon {
font-size: 36px;
margin-bottom: 15px;
color: var(--primary-color);
}
.action-title {
font-size: 18px;
font-weight: 600;
margin-bottom: 10px;
}
.action-description {
font-size: 14px;
opacity: 0.8;
}
.recent-section {
margin-top: 40px;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.section-title {
font-size: 20px;
font-weight: 600;
}
.view-all {
color: var(--primary-color);
text-decoration: none;
font-weight: 500;
}
.view-all:hover {
text-decoration: underline;
}
.recent-achievements {
display: grid;
/* auto-fit collapses empty phantom columns so the last card
does not stretch across the full row when the row is incomplete.
auto-fill would leave invisible tracks that force the card to
fill 100% width. */
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
/* hard cap so a single surviving card never grows past one column width */
max-width: 100%;
gap: 20px;
}
/* When only 1 card survives on the last row, stop it from filling the grid */
.recent-achievement {
max-width: 350px;
}
.recent-achievement {
background: var(--glass-bg);
border-radius: 10px;
padding: 15px;
border: 1px solid var(--border-color);
max-width: 350px; /* duplicated from grid rule above for specificity safety */
}
.achievement-tag {
background-color: var(--primary-color);
color: white;
display: inline-block;
padding: 3px 10px;
border-radius: 5px;
font-size: 12px;
margin-bottom: 10px;
}
.achievement-name {
font-weight: 600;
margin-bottom: 5px;
font-size: 16px;
}
.achievement-date {
font-size: 13px;
opacity: 0.7;
}
@media (max-width: 768px) {
.dashboard-stats {
flex-direction: column;
}
/* On mobile remove the max-width caps so cards fill the full column */
.stat-card,
.dashboard-action {
max-width: 100%;
}
.recent-achievements {
grid-template-columns: 1fr;
}
.recent-achievement {
max-width: 100%;
}
}
.toggle-container {
position: fixed;
top: 20px;
right: 20px;
z-index: 100;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
padding: 20px;
text-align: center;
background: var(--glass-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border-color);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
z-index: 50;
}
.header-text {
color: var(--text-color);
font-size: 20px;
font-weight: 600;
margin: 0;
}
.header-text strong {
color: var(--primary-color);
}
/* ===== Full Dashboard Footer ===== */
/* ===== Full Width Footer Wrapper ===== */
.footer {
position: relative;
margin-top: 60px;
/* FORCE full viewport width */
width: 100vw;
margin-left: calc(-50vw + 50%);
background: var(--glass-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-top: 1px solid var(--border-color);
}
/* ===== Footer Main Content ===== */
.footer-content {
width: 100%;
padding: 40px 80px;
display: grid;
grid-template-columns: 2fr 1fr 1fr;
gap: 40px;
}
/* ===== Branding ===== */
.footer-brand h3 {
margin: 0 0 10px;
color: var(--primary-color);
font-size: 20px;
}
.footer-brand p {
font-size: 14px;
opacity: 0.8;
}
/* ===== Footer Links ===== */
.footer-links h4 {
margin-bottom: 10px;
font-size: 15px;
color: var(--text-color);
}
.footer-links a {
display: block;
font-size: 14px;
color: var(--text-secondary);
text-decoration: none;
margin-bottom: 6px;
}
.footer-links a:hover {
color: var(--primary-color);
}
/* ===== Bottom Bar ===== */
.footer-bottom {
width: 100%;
border-top: 1px solid var(--border-color);
text-align: center;
padding: 15px 80px;
font-size: 13px;
color: var(--text-secondary);
}
.footer-bottom strong {
color: var(--primary-color);
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
.footer-content {
grid-template-columns: 1fr;
text-align: center;
padding: 30px 20px;
}
.footer-bottom {
padding: 15px 20px;
}
}
/* ===== Page Layout for Sticky Footer ===== */
.dashboard-page {
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Main content grows, footer pushed down */
.dashboard-main {
flex: 1;
padding-top: 120px; /* header space */
}
/* ===== FINAL PERFORMANCE CHART LAYOUT ===== */
.performance-charts{
display:flex;
justify-content:center;
gap:48px;
flex-wrap:wrap;
margin-top:25px;
}
.performance-card{
width:390px;
background:var(--glass-bg);
border:1px solid var(--border-color);
border-radius:12px;
padding:18px;
text-align:center;
}
.performance-card canvas{
width:100% !important;
height:240px !important;
}
/* performance score big card */
.score-card{
width:100%;
background:linear-gradient(90deg,#2b0f1a,#1c1f3a);
text-align:center;
padding:25px;
border-radius:14px;
margin-bottom:20px;
}
.score-number{
font-size:48px;
font-weight:bold;
color:#ff3b3b;
}
</style>
</head>
<body class="dashboard-page">
<!-- Header -->
<header class="header">
<h1 class="header-text">
<strong>Achievement-Management-System</strong>
</h1>
</header>
<div class="toggle-container">
<button id="mode-toggle">Dark Mode 🌙</button>
</div>
<main class="dashboard-main">
<div class="container dashboard-container">
<!-- existing dashboard content -->
</div>
</main>
<div class="title">Student Dashboard</div>
<div class="content">
<!-- Student Info -->
<div class="student-info">
<div class="student-avatar">{{ student.name[0] }}</div>
<div class="student-details">
<h2>{{ student.name }}</h2>
<p>Student ID: {{ student.id }} • {{ student.dept }} Department</p>
</div>
</div>
<!-- Stats Cards -->
<div class="dashboard-stats">
<div class="stat-card">
<div class="stat-number">12</div>
<div class="stat-label">Total Achievements</div>
</div>
<div class="stat-card">
<div class="stat-number">5</div>
<div class="stat-label">First Positions</div>
</div>
<div class="stat-card">
<div class="stat-number">4</div>
<div class="stat-label">This Semester</div>
</div>
</div>
<!-- Dashboard Actions -->
<div class="dashboard-actions">
<a href="{{ url_for('student-achievements') }}" class="dashboard-action">
<div class="action-icon">🏆</div>
<div class="action-title">My Achievements</div>
<div class="action-description">View and manage all your achievements</div>
</a>
<a href="#" class="dashboard-action">
<div class="action-icon">📊</div>
<div class="action-title">Analytics</div>
<div class="action-description">Track your achievement progress over time</div>
</a>
<a href="{{ url_for('student-profile') }}" class="dashboard-action">
<div class="action-icon">👤</div>
<div class="action-title">Profile</div>
<div class="action-description">Update your personal information</div>
</a>
</div>
<!-- ================= STUDENT PERFORMANCE SECTION ================= -->
<div class="recent-section">
<div class="section-header">
<div class="section-title">📊 Student Performance</div>
</div>
<!-- category cards -->
<div class="dashboard-stats">
<div class="stat-card">
<div class="stat-number" id="hackathons">0</div>
<div class="stat-label">Hackathons</div>
</div>
<div class="stat-card">
<div class="stat-number" id="coding">0</div>
<div class="stat-label">Coding</div>
</div>
<div class="stat-card">
<div class="stat-number" id="papers">0</div>
<div class="stat-label">Papers</div>
</div>
<div class="stat-card">
<div class="stat-number" id="extra">0</div>
<div class="stat-label">Extracurricular</div>
</div>
</div>
<!-- score -->
<div class="score-card">
<div class="score-number" id="score">0</div>
<div>Performance Score</div>
</div>
<!-- charts -->
<div class="performance-charts">
<div class="performance-card">
<h4>Category Distribution</h4>
<canvas id="categoryChart"></canvas>
</div>
<div class="performance-card">
<h4>Position Breakdown</h4>
<canvas id="positionChart"></canvas>
</div>
<div class="performance-card">
<h4>Monthly Progress</h4>
<canvas id="monthlyChart"></canvas>
</div>
</div>
</div>
<!-- ================= END ================= -->
<!-- Recent Achievements -->
<div class="recent-section">
<div class="section-header">
<div class="section-title">Recent Achievements</div>
<a href="{{ url_for('student-achievements') }}" class="view-all">View All</a>
</div>
<div class="recent-achievements">
<div class="recent-achievement">
<div class="achievement-tag">Hackathon</div>
<div class="achievement-name">National Code Challenge</div>
<div class="achievement-date">March 15, 2025</div>
</div>
<div class="recent-achievement">
<div class="achievement-tag">Paper</div>
<div class="achievement-name">Medical Informatics Conference</div>
<div class="achievement-date">February 22, 2025</div>
</div>
<div class="recent-achievement">
<div class="achievement-tag">Coding</div>
<div class="achievement-name">CodeFest 2025</div>
<div class="achievement-date">January 10, 2025</div>
</div>
</div>
</div>
<div class="logout-section" style="text-align: center; margin-top: 40px;">
<a href="{{ url_for('student_logout') }}" style="color: var(--primary-color); text-decoration: none;">Logout</a>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer">
<div class="footer-content">
<div class="footer-brand">
<h3>Achievement Management System</h3>
<p>Track, manage, and showcase student achievements efficiently.</p>
</div>
<div class="footer-links">
<h4>Quick Links</h4>
<a href="{{ url_for('student-achievements') }}">My Achievements</a>
<a href="#">Analytics</a>
<a href="{{ url_for('student-profile') }}">Profile</a>
</div>
<div class="footer-links">
<h4>Support</h4>
<a href="#">Help</a>
<a href="#">Privacy Policy</a>
<a href="#">Terms of Use</a>
</div>
</div>
<div class="footer-bottom">
© 2026 <strong>OSCG</strong> · Open Source Project
</div>
</footer>
<script>
const data = {
hackathon: 5,
coding: 4,
papers: 3,
extracurricular: 2,
first: 3,
second: 2,
third: 2,
participation: 7,
monthly:[2,5,3,6,4,7,5,3,4,6,2,5]
};
let score = (data.first*10)+(data.second*8)+(data.third*6)+(data.participation*3);
document.getElementById("hackathons").innerText=data.hackathon;
document.getElementById("coding").innerText=data.coding;
document.getElementById("papers").innerText=data.papers;
document.getElementById("extra").innerText=data.extracurricular;
document.getElementById("score").innerText=score;
Chart.defaults.color = "#cccccc";
Chart.defaults.font.family = "Poppins";
// Category Doughnut
new Chart(document.getElementById('categoryChart'), {
type: 'doughnut',
data: {
labels: ['Hackathons','Coding','Papers','Extracurricular'],
datasets: [{
data: [data.hackathon,data.coding,data.papers,data.extracurricular],
backgroundColor:['#ff4d4d','#36a2eb','#ffce56','#4caf50'],
borderWidth:0
}]
},
options:{plugins:{legend:{position:'bottom'}},cutout:'55%'}
});
// Position Bar
new Chart(document.getElementById('positionChart'), {
type:'bar',
data:{
labels:['1st','2nd','3rd','Participation'],
datasets:[{
data:[data.first,data.second,data.third,data.participation],
backgroundColor:'rgba(255,0,0,0.6)',
borderRadius:6
}]
},
options:{plugins:{legend:{display:false}},scales:{y:{beginAtZero:true}}}
});
// Monthly Line
new Chart(document.getElementById('monthlyChart'), {
type:'line',
data:{
labels:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
datasets:[{
data:data.monthly,
borderColor:'#ff4d4d',
backgroundColor:'rgba(255,0,0,0.1)',
fill:true,
tension:0.4
}]
},
options:{plugins:{legend:{display:false}}}
});
</script>
</body>
</html>