File size: 37,400 Bytes
a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c a8c30ea a49841c | 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 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EduPredict - Student Performance Analytics</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.gradient-bg {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.sidebar {
transition: all 0.3s ease;
}
.card-hover:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.risk-high {
background-color: #fef2f2;
border-left: 4px solid #ef4444;
}
.risk-medium {
background-color: #fffbeb;
border-left: 4px solid #f59e0b;
}
.risk-low {
background-color: #ecfdf5;
border-left: 4px solid #10b981;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<!-- Auth Modal -->
<div id="authModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<div class="bg-white rounded-xl p-8 w-full max-w-md">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">Welcome to EduPredict</h2>
<button onclick="closeAuthModal()" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div id="loginForm">
<div class="mb-4">
<label class="block text-gray-700 mb-2" for="loginEmail">Email</label>
<input type="email" id="loginEmail" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2" for="loginPassword">Password</label>
<input type="password" id="loginPassword" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<button onclick="login()" class="w-full gradient-bg text-white py-2 rounded-lg font-semibold mb-4 hover:opacity-90 transition">Sign In</button>
<p class="text-center text-gray-600">Don't have an account? <button onclick="showRegisterForm()" class="text-purple-600 font-medium hover:underline">Register</button></p>
</div>
<div id="registerForm" class="hidden">
<div class="mb-4">
<label class="block text-gray-700 mb-2" for="regName">Full Name</label>
<input type="text" id="regName" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div class="mb-4">
<label class="block text-gray-700 mb-2" for="regEmail">Email</label>
<input type="email" id="regEmail" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div class="mb-4">
<label class="block text-gray-700 mb-2" for="regPassword">Password</label>
<input type="password" id="regPassword" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2" for="regConfirmPassword">Confirm Password</label>
<input type="password" id="regConfirmPassword" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<button onclick="register()" class="w-full gradient-bg text-white py-2 rounded-lg font-semibold mb-4 hover:opacity-90 transition">Create Account</button>
<p class="text-center text-gray-600">Already have an account? <button onclick="showLoginForm()" class="text-purple-600 font-medium hover:underline">Sign In</button></p>
</div>
</div>
</div>
<!-- Main Layout -->
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div id="sidebar" class="sidebar bg-white w-64 border-r flex flex-col">
<div class="p-4 border-b">
<div class="flex items-center">
<div class="gradient-bg p-2 rounded-lg mr-3">
<i class="fas fa-graduation-cap text-white text-xl"></i>
</div>
<h1 class="text-xl font-bold text-gray-800">EduPredict</h1>
</div>
</div>
<div class="flex-1 overflow-y-auto">
<nav class="p-4">
<div class="mb-6">
<p class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3">Dashboard</p>
<ul>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg bg-purple-50 text-purple-600 font-medium">
<i class="fas fa-chart-pie mr-3"></i>
<span>Overview</span>
</a>
</li>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100 mt-1">
<i class="fas fa-users mr-3"></i>
<span>Students</span>
</a>
</li>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100 mt-1">
<i class="fas fa-chart-line mr-3"></i>
<span>Performance</span>
</a>
</li>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100 mt-1">
<i class="fas fa-calendar-alt mr-3"></i>
<span>Attendance</span>
</a>
</li>
</ul>
</div>
<div class="mb-6">
<p class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3">Analytics</p>
<ul>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100">
<i class="fas fa-brain mr-3"></i>
<span>AI Predictions</span>
</a>
</li>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100 mt-1">
<i class="fas fa-exclamation-triangle mr-3"></i>
<span>At-Risk Students</span>
</a>
</li>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100 mt-1">
<i class="fas fa-chart-bar mr-3"></i>
<span>Reports</span>
</a>
</li>
</ul>
</div>
<div>
<p class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3">Settings</p>
<ul>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100">
<i class="fas fa-cog mr-3"></i>
<span>Account</span>
</a>
</li>
<li>
<a href="#" class="flex items-center py-2 px-3 rounded-lg text-gray-700 hover:bg-gray-100 mt-1">
<i class="fas fa-sign-out-alt mr-3"></i>
<span>Logout</span>
</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<!-- Main Content -->
<div class="flex-1 overflow-auto">
<!-- Top Navigation -->
<header class="bg-white border-b sticky top-0 z-10">
<div class="flex justify-between items-center p-4">
<div class="flex items-center">
<button id="sidebarToggle" class="mr-4 text-gray-600 hover:text-gray-900">
<i class="fas fa-bars"></i>
</button>
<h2 class="text-xl font-semibold text-gray-800">Dashboard Overview</h2>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<button class="text-gray-600 hover:text-gray-900">
<i class="fas fa-bell"></i>
<span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span>
</button>
</div>
<div class="flex items-center">
<div class="w-8 h-8 rounded-full gradient-bg flex items-center justify-center text-white font-semibold mr-2">JD</div>
<span class="text-gray-700">John Doe</span>
</div>
</div>
</div>
</header>
<!-- Main Content Area -->
<main class="p-6">
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-xl shadow-sm p-6 card-hover transition">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">Total Students</p>
<h3 class="text-2xl font-bold text-gray-800 mt-1">1,248</h3>
<p class="text-sm text-green-500 mt-2"><i class="fas fa-arrow-up mr-1"></i> 12% from last term</p>
</div>
<div class="p-3 rounded-lg bg-blue-50 text-blue-600">
<i class="fas fa-users text-xl"></i>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-sm p-6 card-hover transition">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">At-Risk Students</p>
<h3 class="text-2xl font-bold text-gray-800 mt-1">87</h3>
<p class="text-sm text-red-500 mt-2"><i class="fas fa-arrow-up mr-1"></i> 5% from last term</p>
</div>
<div class="p-3 rounded-lg bg-red-50 text-red-600">
<i class="fas fa-exclamation-triangle text-xl"></i>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-sm p-6 card-hover transition">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">Avg. Attendance</p>
<h3 class="text-2xl font-bold text-gray-800 mt-1">89%</h3>
<p class="text-sm text-yellow-500 mt-2"><i class="fas fa-arrow-down mr-1"></i> 3% from last term</p>
</div>
<div class="p-3 rounded-lg bg-green-50 text-green-600">
<i class="fas fa-calendar-check text-xl"></i>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-sm p-6 card-hover transition">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">Prediction Accuracy</p>
<h3 class="text-2xl font-bold text-gray-800 mt-1">92%</h3>
<p class="text-sm text-purple-500 mt-2"><i class="fas fa-arrow-up mr-1"></i> 7% improved</p>
</div>
<div class="p-3 rounded-lg bg-purple-50 text-purple-600">
<i class="fas fa-brain text-xl"></i>
</div>
</div>
</div>
</div>
<!-- Charts Row -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
<!-- Performance Trend Chart -->
<div class="bg-white rounded-xl shadow-sm p-6 col-span-2">
<div class="flex justify-between items-center mb-6">
<h3 class="text-lg font-semibold text-gray-800">Performance Trend Analysis</h3>
<div class="flex space-x-2">
<button class="px-3 py-1 text-sm bg-gray-100 rounded-lg">Term 1</button>
<button class="px-3 py-1 text-sm bg-purple-100 text-purple-600 rounded-lg">Term 2</button>
<button class="px-3 py-1 text-sm bg-gray-100 rounded-lg">Term 3</button>
</div>
</div>
<div class="h-80">
<canvas id="performanceChart"></canvas>
</div>
</div>
<!-- Risk Distribution Chart -->
<div class="bg-white rounded-xl shadow-sm p-6">
<h3 class="text-lg font-semibold text-gray-800 mb-6">Risk Level Distribution</h3>
<div class="h-80">
<canvas id="riskChart"></canvas>
</div>
</div>
</div>
<!-- At-Risk Students and Recent Activity -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- At-Risk Students -->
<div class="bg-white rounded-xl shadow-sm p-6 lg:col-span-2">
<div class="flex justify-between items-center mb-6">
<h3 class="text-lg font-semibold text-gray-800">At-Risk Students</h3>
<button class="text-sm text-purple-600 font-medium hover:underline">View All</button>
</div>
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="text-left text-gray-500 text-sm border-b">
<th class="pb-3 font-medium">Student</th>
<th class="pb-3 font-medium">Class</th>
<th class="pb-3 font-medium">Risk Level</th>
<th class="pb-3 font-medium">Prediction Score</th>
<th class="pb-3 font-medium">Action</th>
</tr>
</thead>
<tbody class="divide-y">
<tr class="risk-high">
<td class="py-4">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center text-red-600 font-semibold mr-3">SM</div>
<div>
<p class="font-medium">Sarah Miller</p>
<p class="text-sm text-gray-500">ID: #STU-2045</p>
</div>
</div>
</td>
<td class="py-4">Grade 10-B</td>
<td class="py-4">
<span class="px-3 py-1 rounded-full text-xs font-medium bg-red-100 text-red-700">High Risk</span>
</td>
<td class="py-4">
<div class="flex items-center">
<div class="w-16 bg-gray-200 rounded-full h-1.5 mr-2">
<div class="bg-red-500 h-1.5 rounded-full" style="width: 85%"></div>
</div>
<span>85%</span>
</div>
</td>
<td class="py-4">
<button class="text-sm text-purple-600 font-medium hover:underline">Intervene</button>
</td>
</tr>
<tr class="risk-medium">
<td class="py-4">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-yellow-100 flex items-center justify-center text-yellow-600 font-semibold mr-3">RJ</div>
<div>
<p class="font-medium">Robert Johnson</p>
<p class="text-sm text-gray-500">ID: #STU-1872</p>
</div>
</div>
</td>
<td class="py-4">Grade 11-A</td>
<td class="py-4">
<span class="px-3 py-1 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700">Medium Risk</span>
</td>
<td class="py-4">
<div class="flex items-center">
<div class="w-16 bg-gray-200 rounded-full h-1.5 mr-2">
<div class="bg-yellow-500 h-1.5 rounded-full" style="width: 65%"></div>
</div>
<span>65%</span>
</div>
</td>
<td class="py-4">
<button class="text-sm text-purple-600 font-medium hover:underline">Monitor</button>
</td>
</tr>
<tr class="risk-low">
<td class="py-4">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center text-green-600 font-semibold mr-3">AD</div>
<div>
<p class="font-medium">Amanda Davis</p>
<p class="text-sm text-gray-500">ID: #STU-2156</p>
</div>
</div>
</td>
<td class="py-4">Grade 9-C</td>
<td class="py-4">
<span class="px-3 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700">Low Risk</span>
</td>
<td class="py-4">
<div class="flex items-center">
<div class="w-16 bg-gray-200 rounded-full h-1.5 mr-2">
<div class="bg-green-500 h-1.5 rounded-full" style="width: 30%"></div>
</div>
<span>30%</span>
</div>
</td>
<td class="py-4">
<button class="text-sm text-purple-600 font-medium hover:underline">Review</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Recent Activity -->
<div class="bg-white rounded-xl shadow-sm p-6">
<div class="flex justify-between items-center mb-6">
<h3 class="text-lg font-semibold text-gray-800">Recent Interventions</h3>
<button class="text-sm text-purple-600 font-medium hover:underline">View All</button>
</div>
<div class="space-y-4">
<div class="flex">
<div class="mr-3">
<div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center text-purple-600">
<i class="fas fa-user-graduate"></i>
</div>
</div>
<div>
<p class="font-medium">Tutoring session scheduled</p>
<p class="text-sm text-gray-500">For Sarah Miller (High Risk)</p>
<p class="text-xs text-gray-400 mt-1">2 hours ago</p>
</div>
</div>
<div class="flex">
<div class="mr-3">
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600">
<i class="fas fa-envelope"></i>
</div>
</div>
<div>
<p class="font-medium">Parent notification sent</p>
<p class="text-sm text-gray-500">For Robert Johnson (Medium Risk)</p>
<p class="text-xs text-gray-400 mt-1">5 hours ago</p>
</div>
</div>
<div class="flex">
<div class="mr-3">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center text-green-600">
<i class="fas fa-chart-line"></i>
</div>
</div>
<div>
<p class="font-medium">Performance improved</p>
<p class="text-sm text-gray-500">Michael Brown (Previously High Risk)</p>
<p class="text-xs text-gray-400 mt-1">1 day ago</p>
</div>
</div>
<div class="flex">
<div class="mr-3">
<div class="w-10 h-10 rounded-full bg-yellow-100 flex items-center justify-center text-yellow-600">
<i class="fas fa-exclamation-circle"></i>
</div>
</div>
<div>
<p class="font-medium">New at-risk student</p>
<p class="text-sm text-gray-500">Emily Wilson identified (Medium Risk)</p>
<p class="text-xs text-gray-400 mt-1">2 days ago</p>
</div>
</div>
</div>
</div>
</div>
<!-- AI Prediction Section -->
<div class="bg-white rounded-xl shadow-sm p-6 mt-6">
<div class="flex justify-between items-center mb-6">
<h3 class="text-lg font-semibold text-gray-800">AI Performance Prediction</h3>
<button class="px-4 py-2 gradient-bg text-white rounded-lg font-medium hover:opacity-90 transition">
<i class="fas fa-plus mr-2"></i> New Prediction
</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<div class="mb-4">
<label class="block text-gray-700 mb-2">Select Student</label>
<select class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
<option>Select a student</option>
<option>Sarah Miller (Grade 10-B)</option>
<option>Robert Johnson (Grade 11-A)</option>
<option>Amanda Davis (Grade 9-C)</option>
<option>Michael Brown (Grade 12-D)</option>
</select>
</div>
<div class="mb-4">
<label class="block text-gray-700 mb-2">Academic Records</label>
<input type="file" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div class="mb-4">
<label class="block text-gray-700 mb-2">Attendance Data</label>
<input type="file" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
</div>
<div>
<div class="bg-gray-50 border rounded-xl p-6 h-full flex flex-col justify-center">
<div class="text-center">
<div class="w-20 h-20 gradient-bg rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-brain text-white text-3xl"></i>
</div>
<h4 class="text-lg font-semibold text-gray-800 mb-2">Run Performance Prediction</h4>
<p class="text-gray-600 mb-6">Upload student data and our AI will analyze performance patterns to predict future outcomes and identify risk factors.</p>
<button class="px-6 py-2 gradient-bg text-white rounded-lg font-medium hover:opacity-90 transition">
<i class="fas fa-play mr-2"></i> Analyze Now
</button>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script>
// Authentication functions
function showRegisterForm() {
document.getElementById('loginForm').classList.add('hidden');
document.getElementById('registerForm').classList.remove('hidden');
}
function showLoginForm() {
document.getElementById('registerForm').classList.add('hidden');
document.getElementById('loginForm').classList.remove('hidden');
}
function closeAuthModal() {
document.getElementById('authModal').classList.add('hidden');
}
function login() {
const email = document.getElementById('loginEmail').value;
const password = document.getElementById('loginPassword').value;
if(email && password) {
// In a real app, you would validate credentials with a backend
document.getElementById('authModal').classList.add('hidden');
} else {
alert('Please enter both email and password');
}
}
function register() {
const name = document.getElementById('regName').value;
const email = document.getElementById('regEmail').value;
const password = document.getElementById('regPassword').value;
const confirmPassword = document.getElementById('regConfirmPassword').value;
if(password !== confirmPassword) {
alert('Passwords do not match');
return;
}
if(name && email && password) {
// In a real app, you would register the user with a backend
showLoginForm();
alert('Registration successful! Please login.');
} else {
alert('Please fill in all fields');
}
}
// Sidebar toggle
document.getElementById('sidebarToggle').addEventListener('click', function() {
const sidebar = document.getElementById('sidebar');
sidebar.classList.toggle('hidden');
sidebar.classList.toggle('md:flex');
});
// Initialize charts when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
// Performance Trend Chart
const performanceCtx = document.getElementById('performanceChart').getContext('2d');
const performanceChart = new Chart(performanceCtx, {
type: 'line',
data: {
labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 5', 'Week 6', 'Week 7'],
datasets: [
{
label: 'High Performers',
data: [85, 82, 84, 87, 89, 88, 90],
borderColor: '#10b981',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
tension: 0.3,
fill: true
},
{
label: 'Average Students',
data: [72, 70, 73, 75, 74, 76, 77],
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
tension: 0.3,
fill: true
},
{
label: 'At-Risk Students',
data: [58, 55, 53, 52, 50, 49, 48],
borderColor: '#ef4444',
backgroundColor: 'rgba(239, 68, 68, 0.1)',
tension: 0.3,
fill: true
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
},
tooltip: {
mode: 'index',
intersect: false,
}
},
scales: {
y: {
beginAtZero: false,
min: 40,
max: 100,
ticks: {
callback: function(value) {
return value + '%';
}
}
}
}
}
});
// Risk Distribution Chart
const riskCtx = document.getElementById('riskChart').getContext('2d');
const riskChart = new Chart(riskCtx, {
type: 'doughnut',
data: {
labels: ['High Risk', 'Medium Risk', 'Low Risk'],
datasets: [{
data: [15, 25, 60],
backgroundColor: [
'#ef4444',
'#f59e0b',
'#10b981'
],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
},
tooltip: {
callbacks: {
label: function(context) {
const label = context.label || '';
const value = context.raw || 0;
const total = context.dataset.data.reduce((a, b) => a + b, 0);
const percentage = Math.round((value / total) * 100);
return `${label}: ${percentage}% (${value} students)`;
}
}
}
},
cutout: '70%'
}
});
// Show auth modal by default (in a real app, you'd check for existing session)
document.getElementById('authModal').classList.remove('hidden');
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Jansome/da-model" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |