Update templates/frontpage.html
Browse files- templates/frontpage.html +459 -455
templates/frontpage.html
CHANGED
|
@@ -1,455 +1,459 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>ML Learning Platform</title>
|
| 7 |
-
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
-
<style>
|
| 10 |
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
| 11 |
-
body {
|
| 12 |
-
font-family: 'Inter', sans-serif;
|
| 13 |
-
margin: 0;
|
| 14 |
-
overflow: hidden; /* Prevent scrolling to keep the canvas in place */
|
| 15 |
-
height: 100vh;
|
| 16 |
-
color: grey; /* Changed all text to grey */
|
| 17 |
-
position: relative;
|
| 18 |
-
background-color: #ffffff; /* Solid white background */
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
/* Styles for the canvas background */
|
| 22 |
-
#canvas {
|
| 23 |
-
position: fixed;
|
| 24 |
-
top: 0;
|
| 25 |
-
left: 0;
|
| 26 |
-
z-index: -1; /* Puts the canvas behind other content */
|
| 27 |
-
display: block;
|
| 28 |
-
background-color: transparent;
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
.button-hover {
|
| 32 |
-
transition: all 0.3s ease;
|
| 33 |
-
}
|
| 34 |
-
.button-hover:hover {
|
| 35 |
-
transform: translateY(-2px);
|
| 36 |
-
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
| 37 |
-
}
|
| 38 |
-
.stats-card {
|
| 39 |
-
background: rgba(255, 255, 255, 0.1);
|
| 40 |
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 41 |
-
}
|
| 42 |
-
.content-card {
|
| 43 |
-
background: rgba(255, 255, 255, 0.05);
|
| 44 |
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 45 |
-
backdrop-filter: blur(10px);
|
| 46 |
-
}
|
| 47 |
-
.modal {
|
| 48 |
-
background: rgba(0, 0, 0, 0.75);
|
| 49 |
-
}
|
| 50 |
-
.modal-content {
|
| 51 |
-
background: #1f2937;
|
| 52 |
-
border: 1px solid #374151;
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
/* Ensure main content is visible on top of the canvas */
|
| 56 |
-
main, footer, .content-container {
|
| 57 |
-
position: relative;
|
| 58 |
-
z-index: 1;
|
| 59 |
-
}
|
| 60 |
-
</style>
|
| 61 |
-
</head>
|
| 62 |
-
<body class="min-h-screen text-white">
|
| 63 |
-
<!-- The Bouncing Canvas is now the background -->
|
| 64 |
-
<canvas id="canvas"></canvas>
|
| 65 |
-
|
| 66 |
-
<!-- Main content container -->
|
| 67 |
-
<div class="container mx-auto px-4 py-8">
|
| 68 |
-
<div class="text-center mt-8">
|
| 69 |
-
<h1 class="text-4xl sm:text-5xl font-bold text-gray-800 mb-4">Machine Learning Platform</h1>
|
| 70 |
-
<p class="text-gray-600 text-sm sm:text-base">Explore the world of artificial intelligence and machine learning</p>
|
| 71 |
-
</div>
|
| 72 |
-
|
| 73 |
-
<!-- Main Content - Desktop Cards (visible on medium and up) -->
|
| 74 |
-
<div class="hidden md:grid grid-cols-1 md:grid-cols-2 gap-8 mb-12 mt-20">
|
| 75 |
-
<!-- Left Side - Test Assessment Card -->
|
| 76 |
-
<div class="content-card rounded-2xl p-6">
|
| 77 |
-
<h3 class="text-xl sm:text-2xl font-bold mb-3 text-green-600">Test Your Knowledge</h3>
|
| 78 |
-
<p class="text-sm mb-4 text-gray-600">"Test yourself and see what you know about ML"</p>
|
| 79 |
-
<p class="mb-4 text-xs sm:text-sm text-gray-500">Assess your current machine learning knowledge and identify areas for improvement</p>
|
| 80 |
-
<button onclick="takeQuiz()" class="button-hover bg-gradient-to-r from-green-500 to-teal-600 hover:from-green-600 hover:to-teal-700 text-white px-6 py-3 rounded-full font-semibold text-base shadow-lg w-full">
|
| 81 |
-
<i class="fas fa-graduation-cap mr-2"></i>Take Assessment
|
| 82 |
-
</button>
|
| 83 |
-
</div>
|
| 84 |
-
|
| 85 |
-
<!-- Right Side - Start Learning Card -->
|
| 86 |
-
<div class="content-card rounded-2xl p-6">
|
| 87 |
-
<h3 class="text-xl sm:text-2xl font-bold mb-3 text-blue-600">Start Your ML Journey</h3>
|
| 88 |
-
<p class="text-sm mb-4 text-gray-600">"Start your ML learning with start button"</p>
|
| 89 |
-
<p class="mb-4 text-xs sm:text-sm text-gray-500">Build foundational skills and progress to advanced machine learning concepts</p>
|
| 90 |
-
<button onclick="startLearning()" class="button-hover bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-6 py-3 rounded-full font-semibold text-base shadow-lg w-full">
|
| 91 |
-
<i class="fas fa-rocket mr-2"></i>Start Learning
|
| 92 |
-
</button>
|
| 93 |
-
</div>
|
| 94 |
-
</div>
|
| 95 |
-
|
| 96 |
-
<!-- Mobile Buttons (visible on small screens) -->
|
| 97 |
-
<div class="block md:hidden mb-12 flex flex-col gap-4 mt-20">
|
| 98 |
-
<button onclick="takeQuiz()" class="button-hover bg-gradient-to-r from-green-500 to-teal-600 hover:from-green-600 hover:to-teal-700 text-white px-6 py-3 rounded-full font-semibold text-sm shadow-lg w-full">
|
| 99 |
-
<i class="fas fa-graduation-cap mr-2"></i>Test Your Knowledge
|
| 100 |
-
</button>
|
| 101 |
-
<button onclick="startLearning()" class="button-hover bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-6 py-3 rounded-full font-semibold text-sm shadow-lg w-full">
|
| 102 |
-
<i class="fas fa-rocket mr-2"></i>Start Learning
|
| 103 |
-
</button>
|
| 104 |
-
</div>
|
| 105 |
-
</div>
|
| 106 |
-
|
| 107 |
-
<!-- Modal Message Box -->
|
| 108 |
-
<div id="messageModal" class="fixed inset-0 z-50 flex items-center justify-center modal hidden">
|
| 109 |
-
<div class="modal-content p-8 rounded-2xl shadow-lg max-w-sm w-full mx-4 transform transition-all scale-95 duration-300">
|
| 110 |
-
<h3 id="modalTitle" class="text-2xl font-bold mb-4 text-center"></h3>
|
| 111 |
-
<p id="modalMessage" class="text-gray-300 mb-6 text-center"></p>
|
| 112 |
-
<div class="flex justify-center">
|
| 113 |
-
<button onclick="hideMessage()" class="button-hover bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-8 py-3 rounded-full font-semibold shadow-lg">
|
| 114 |
-
OK
|
| 115 |
-
</button>
|
| 116 |
-
</div>
|
| 117 |
-
</div>
|
| 118 |
-
</div>
|
| 119 |
-
|
| 120 |
-
<script>
|
| 121 |
-
/**
|
| 122 |
-
* Shows a custom message box as a modal.
|
| 123 |
-
* @param {string} title The title of the message box.
|
| 124 |
-
* @param {string} message The message to display.
|
| 125 |
-
*/
|
| 126 |
-
function showMessage(title, message) {
|
| 127 |
-
const modal = document.getElementById('messageModal');
|
| 128 |
-
const modalTitle = document.getElementById('modalTitle');
|
| 129 |
-
const modalMessage = document.getElementById('modalMessage');
|
| 130 |
-
|
| 131 |
-
modalTitle.textContent = title;
|
| 132 |
-
modalMessage.textContent = message;
|
| 133 |
-
|
| 134 |
-
modal.classList.remove('hidden');
|
| 135 |
-
document.body.style.overflow = 'hidden'; // Prevents scrolling
|
| 136 |
-
}
|
| 137 |
-
|
| 138 |
-
/**
|
| 139 |
-
* Hides the custom message box.
|
| 140 |
-
*/
|
| 141 |
-
function hideMessage() {
|
| 142 |
-
const modal = document.getElementById('messageModal');
|
| 143 |
-
modal.classList.add('hidden');
|
| 144 |
-
document.body.style.overflow = ''; // Restores scrolling
|
| 145 |
-
}
|
| 146 |
-
|
| 147 |
-
/**
|
| 148 |
-
* Function to handle the start learning button click.
|
| 149 |
-
*/
|
| 150 |
-
function startLearning() {
|
| 151 |
-
// Redirects to home.html when the button is clicked
|
| 152 |
-
window.location.href = '/home';
|
| 153 |
-
}
|
| 154 |
-
|
| 155 |
-
/**
|
| 156 |
-
* Function to handle the take quiz button click.
|
| 157 |
-
*/
|
| 158 |
-
function takeQuiz() {
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
//
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
const
|
| 168 |
-
|
| 169 |
-
canvas.
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
this.
|
| 176 |
-
this.
|
| 177 |
-
this.
|
| 178 |
-
this.
|
| 179 |
-
this.
|
| 180 |
-
this.
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
const
|
| 187 |
-
tempCtx
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
this.
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
this.
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
ctx.
|
| 201 |
-
ctx.
|
| 202 |
-
ctx.
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
ctx.
|
| 210 |
-
ctx.
|
| 211 |
-
ctx.
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
this.
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
this.
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
this.
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
this.
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
this.
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
const
|
| 250 |
-
const
|
| 251 |
-
const
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
const
|
| 256 |
-
const
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
ball1.
|
| 260 |
-
|
| 261 |
-
ball2.
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
const
|
| 265 |
-
const
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
const
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
const
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
ball1.
|
| 284 |
-
|
| 285 |
-
ball2.
|
| 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 |
-
const
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
const
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
let
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
balls[i].
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
const
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
const
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
controlledBall
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
const
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
controlledBall.
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
let
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
controlledBall.
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
controlledBall =
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
const
|
| 416 |
-
const
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
modal.
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>ML Learning Platform</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
| 11 |
+
body {
|
| 12 |
+
font-family: 'Inter', sans-serif;
|
| 13 |
+
margin: 0;
|
| 14 |
+
overflow: hidden; /* Prevent scrolling to keep the canvas in place */
|
| 15 |
+
height: 100vh;
|
| 16 |
+
color: grey; /* Changed all text to grey */
|
| 17 |
+
position: relative;
|
| 18 |
+
background-color: #ffffff; /* Solid white background */
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/* Styles for the canvas background */
|
| 22 |
+
#canvas {
|
| 23 |
+
position: fixed;
|
| 24 |
+
top: 0;
|
| 25 |
+
left: 0;
|
| 26 |
+
z-index: -1; /* Puts the canvas behind other content */
|
| 27 |
+
display: block;
|
| 28 |
+
background-color: transparent;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.button-hover {
|
| 32 |
+
transition: all 0.3s ease;
|
| 33 |
+
}
|
| 34 |
+
.button-hover:hover {
|
| 35 |
+
transform: translateY(-2px);
|
| 36 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
| 37 |
+
}
|
| 38 |
+
.stats-card {
|
| 39 |
+
background: rgba(255, 255, 255, 0.1);
|
| 40 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 41 |
+
}
|
| 42 |
+
.content-card {
|
| 43 |
+
background: rgba(255, 255, 255, 0.05);
|
| 44 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 45 |
+
backdrop-filter: blur(10px);
|
| 46 |
+
}
|
| 47 |
+
.modal {
|
| 48 |
+
background: rgba(0, 0, 0, 0.75);
|
| 49 |
+
}
|
| 50 |
+
.modal-content {
|
| 51 |
+
background: #1f2937;
|
| 52 |
+
border: 1px solid #374151;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/* Ensure main content is visible on top of the canvas */
|
| 56 |
+
main, footer, .content-container {
|
| 57 |
+
position: relative;
|
| 58 |
+
z-index: 1;
|
| 59 |
+
}
|
| 60 |
+
</style>
|
| 61 |
+
</head>
|
| 62 |
+
<body class="min-h-screen text-white">
|
| 63 |
+
<!-- The Bouncing Canvas is now the background -->
|
| 64 |
+
<canvas id="canvas"></canvas>
|
| 65 |
+
|
| 66 |
+
<!-- Main content container -->
|
| 67 |
+
<div class="container mx-auto px-4 py-8">
|
| 68 |
+
<div class="text-center mt-8">
|
| 69 |
+
<h1 class="text-4xl sm:text-5xl font-bold text-gray-800 mb-4">Machine Learning Platform</h1>
|
| 70 |
+
<p class="text-gray-600 text-sm sm:text-base">Explore the world of artificial intelligence and machine learning</p>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<!-- Main Content - Desktop Cards (visible on medium and up) -->
|
| 74 |
+
<div class="hidden md:grid grid-cols-1 md:grid-cols-2 gap-8 mb-12 mt-20">
|
| 75 |
+
<!-- Left Side - Test Assessment Card -->
|
| 76 |
+
<div class="content-card rounded-2xl p-6">
|
| 77 |
+
<h3 class="text-xl sm:text-2xl font-bold mb-3 text-green-600">Test Your Knowledge</h3>
|
| 78 |
+
<p class="text-sm mb-4 text-gray-600">"Test yourself and see what you know about ML"</p>
|
| 79 |
+
<p class="mb-4 text-xs sm:text-sm text-gray-500">Assess your current machine learning knowledge and identify areas for improvement</p>
|
| 80 |
+
<button onclick="takeQuiz()" class="button-hover bg-gradient-to-r from-green-500 to-teal-600 hover:from-green-600 hover:to-teal-700 text-white px-6 py-3 rounded-full font-semibold text-base shadow-lg w-full">
|
| 81 |
+
<i class="fas fa-graduation-cap mr-2"></i>Take Assessment
|
| 82 |
+
</button>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<!-- Right Side - Start Learning Card -->
|
| 86 |
+
<div class="content-card rounded-2xl p-6">
|
| 87 |
+
<h3 class="text-xl sm:text-2xl font-bold mb-3 text-blue-600">Start Your ML Journey</h3>
|
| 88 |
+
<p class="text-sm mb-4 text-gray-600">"Start your ML learning with start button"</p>
|
| 89 |
+
<p class="mb-4 text-xs sm:text-sm text-gray-500">Build foundational skills and progress to advanced machine learning concepts</p>
|
| 90 |
+
<button onclick="startLearning()" class="button-hover bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-6 py-3 rounded-full font-semibold text-base shadow-lg w-full">
|
| 91 |
+
<i class="fas fa-rocket mr-2"></i>Start Learning
|
| 92 |
+
</button>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<!-- Mobile Buttons (visible on small screens) -->
|
| 97 |
+
<div class="block md:hidden mb-12 flex flex-col gap-4 mt-20">
|
| 98 |
+
<button onclick="takeQuiz()" class="button-hover bg-gradient-to-r from-green-500 to-teal-600 hover:from-green-600 hover:to-teal-700 text-white px-6 py-3 rounded-full font-semibold text-sm shadow-lg w-full">
|
| 99 |
+
<i class="fas fa-graduation-cap mr-2"></i>Test Your Knowledge
|
| 100 |
+
</button>
|
| 101 |
+
<button onclick="startLearning()" class="button-hover bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-6 py-3 rounded-full font-semibold text-sm shadow-lg w-full">
|
| 102 |
+
<i class="fas fa-rocket mr-2"></i>Start Learning
|
| 103 |
+
</button>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
|
| 107 |
+
<!-- Modal Message Box -->
|
| 108 |
+
<div id="messageModal" class="fixed inset-0 z-50 flex items-center justify-center modal hidden">
|
| 109 |
+
<div class="modal-content p-8 rounded-2xl shadow-lg max-w-sm w-full mx-4 transform transition-all scale-95 duration-300">
|
| 110 |
+
<h3 id="modalTitle" class="text-2xl font-bold mb-4 text-center"></h3>
|
| 111 |
+
<p id="modalMessage" class="text-gray-300 mb-6 text-center"></p>
|
| 112 |
+
<div class="flex justify-center">
|
| 113 |
+
<button onclick="hideMessage()" class="button-hover bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-8 py-3 rounded-full font-semibold shadow-lg">
|
| 114 |
+
OK
|
| 115 |
+
</button>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<script>
|
| 121 |
+
/**
|
| 122 |
+
* Shows a custom message box as a modal.
|
| 123 |
+
* @param {string} title The title of the message box.
|
| 124 |
+
* @param {string} message The message to display.
|
| 125 |
+
*/
|
| 126 |
+
function showMessage(title, message) {
|
| 127 |
+
const modal = document.getElementById('messageModal');
|
| 128 |
+
const modalTitle = document.getElementById('modalTitle');
|
| 129 |
+
const modalMessage = document.getElementById('modalMessage');
|
| 130 |
+
|
| 131 |
+
modalTitle.textContent = title;
|
| 132 |
+
modalMessage.textContent = message;
|
| 133 |
+
|
| 134 |
+
modal.classList.remove('hidden');
|
| 135 |
+
document.body.style.overflow = 'hidden'; // Prevents scrolling
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* Hides the custom message box.
|
| 140 |
+
*/
|
| 141 |
+
function hideMessage() {
|
| 142 |
+
const modal = document.getElementById('messageModal');
|
| 143 |
+
modal.classList.add('hidden');
|
| 144 |
+
document.body.style.overflow = ''; // Restores scrolling
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* Function to handle the start learning button click.
|
| 149 |
+
*/
|
| 150 |
+
function startLearning() {
|
| 151 |
+
// Redirects to home.html when the button is clicked
|
| 152 |
+
window.location.href = '/home';
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
/**
|
| 156 |
+
* Function to handle the take quiz button click.
|
| 157 |
+
*/
|
| 158 |
+
function takeQuiz() {
|
| 159 |
+
window.location.href = '/Test-home';
|
| 160 |
+
|
| 161 |
+
// Here you would typically redirect to the quiz page, e.g.,
|
| 162 |
+
// window.location.href = '/assessment';
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
// --- Bouncing balls canvas code ---
|
| 166 |
+
|
| 167 |
+
const canvas = document.getElementById('canvas');
|
| 168 |
+
const ctx = canvas.getContext('2d');
|
| 169 |
+
canvas.width = window.innerWidth;
|
| 170 |
+
canvas.height = window.innerHeight;
|
| 171 |
+
|
| 172 |
+
// Ball class with improved physics and dynamic color
|
| 173 |
+
class Ball {
|
| 174 |
+
constructor(name, x, y, dx, dy) {
|
| 175 |
+
this.name = name;
|
| 176 |
+
this.x = x;
|
| 177 |
+
this.y = y;
|
| 178 |
+
this.dx = dx;
|
| 179 |
+
this.dy = dy;
|
| 180 |
+
this.isControlled = false;
|
| 181 |
+
this.isHovered = false;
|
| 182 |
+
|
| 183 |
+
// Set the font size based on screen width
|
| 184 |
+
const fontSize = window.innerWidth < 768 ? '12px' : '16px';
|
| 185 |
+
|
| 186 |
+
const tempCanvas = document.createElement('canvas');
|
| 187 |
+
const tempCtx = tempCanvas.getContext('2d');
|
| 188 |
+
tempCtx.font = `bold ${fontSize} Arial`;
|
| 189 |
+
const metrics = tempCtx.measureText(this.name);
|
| 190 |
+
this.width = metrics.width;
|
| 191 |
+
this.height = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent;
|
| 192 |
+
|
| 193 |
+
this.radius = Math.max(this.width, this.height) / 2;
|
| 194 |
+
this.mass = this.radius * 0.1;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
draw() {
|
| 198 |
+
// Glow effect for hover and control
|
| 199 |
+
if (this.isHovered || this.isControlled) {
|
| 200 |
+
ctx.fillStyle = 'rgba(0, 153, 255, 0.3)';
|
| 201 |
+
ctx.beginPath();
|
| 202 |
+
ctx.roundRect(this.x - this.width/2 - 3, this.y - this.height/2 - 3, this.width + 6, this.height + 6, 5);
|
| 203 |
+
ctx.fill();
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
// Draw the machine learning algorithm's name
|
| 207 |
+
ctx.fillStyle = this.isControlled ? '#3498db' : '#555555';
|
| 208 |
+
const fontSize = window.innerWidth < 768 ? '12px' : '16px';
|
| 209 |
+
ctx.font = `bold ${fontSize} Arial`;
|
| 210 |
+
ctx.textAlign = 'center';
|
| 211 |
+
ctx.textBaseline = 'middle';
|
| 212 |
+
ctx.fillText(this.name, this.x, this.y);
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
update() {
|
| 216 |
+
if (!this.isControlled) {
|
| 217 |
+
this.x += this.dx;
|
| 218 |
+
this.y += this.dy;
|
| 219 |
+
|
| 220 |
+
if (this.x + this.width / 2 > canvas.width) {
|
| 221 |
+
this.dx *= -1;
|
| 222 |
+
this.x = canvas.width - this.width / 2;
|
| 223 |
+
}
|
| 224 |
+
if (this.x - this.width / 2 < 0) {
|
| 225 |
+
this.dx *= -1;
|
| 226 |
+
this.x = this.width / 2;
|
| 227 |
+
}
|
| 228 |
+
if (this.y + this.height / 2 > canvas.height) {
|
| 229 |
+
this.dy *= -1;
|
| 230 |
+
this.y = canvas.height - this.height / 2;
|
| 231 |
+
}
|
| 232 |
+
if (this.y - this.height / 2 < 0) {
|
| 233 |
+
this.dy *= -1;
|
| 234 |
+
this.y = this.height / 2;
|
| 235 |
+
}
|
| 236 |
+
}
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
function rotate(dx, dy, angle) {
|
| 241 |
+
const rotatedVelocities = {
|
| 242 |
+
x: dx * Math.cos(angle) - dy * Math.sin(angle),
|
| 243 |
+
y: dx * Math.sin(angle) + dy * Math.cos(angle)
|
| 244 |
+
};
|
| 245 |
+
return rotatedVelocities;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
function resolveCollision(ball1, ball2) {
|
| 249 |
+
const dx = ball1.x - ball2.x;
|
| 250 |
+
const dy = ball1.y - ball2.y;
|
| 251 |
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
| 252 |
+
const sumOfRadii = ball1.radius + ball2.radius;
|
| 253 |
+
|
| 254 |
+
if (distance < sumOfRadii) {
|
| 255 |
+
const overlap = sumOfRadii - distance;
|
| 256 |
+
const pushBackVectorX = dx / distance * overlap * 0.5;
|
| 257 |
+
const pushBackVectorY = dy / distance * overlap * 0.5;
|
| 258 |
+
|
| 259 |
+
ball1.x += pushBackVectorX;
|
| 260 |
+
ball1.y += pushBackVectorY;
|
| 261 |
+
ball2.x -= pushBackVectorX;
|
| 262 |
+
ball2.y -= pushBackVectorY;
|
| 263 |
+
|
| 264 |
+
const angle = -Math.atan2(dy, dx);
|
| 265 |
+
const m1 = ball1.mass;
|
| 266 |
+
const m2 = ball2.mass;
|
| 267 |
+
|
| 268 |
+
const u1 = rotate(ball1.dx, ball1.dy, angle);
|
| 269 |
+
const u2 = rotate(ball2.dx, ball2.dy, angle);
|
| 270 |
+
|
| 271 |
+
const v1 = {
|
| 272 |
+
x: ((u1.x * (m1 - m2)) / (m1 + m2)) + ((u2.x * 2 * m2) / (m1 + m2)),
|
| 273 |
+
y: u1.y
|
| 274 |
+
};
|
| 275 |
+
const v2 = {
|
| 276 |
+
x: ((u2.x * (m2 - m1)) / (m1 + m2)) + ((u1.x * 2 * m1) / (m1 + m2)),
|
| 277 |
+
y: u2.y
|
| 278 |
+
};
|
| 279 |
+
|
| 280 |
+
const vFinal1 = rotate(v1.x, v1.y, -angle);
|
| 281 |
+
const vFinal2 = rotate(v2.x, v2.y, -angle);
|
| 282 |
+
|
| 283 |
+
ball1.dx = vFinal1.x;
|
| 284 |
+
ball1.dy = vFinal1.y;
|
| 285 |
+
ball2.dx = vFinal2.x;
|
| 286 |
+
ball2.dy = vFinal2.y;
|
| 287 |
+
}
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
const algorithmNames = [
|
| 291 |
+
'Supervised', 'Unsupervised', 'Python', 'LLM', 'RAG', 'Agentic AI',
|
| 292 |
+
'Reinforcement Learning', 'Deep Learning', 'Computer Vision',
|
| 293 |
+
'Generative AI', 'Natural Language Processing', 'Vector Embeddings',
|
| 294 |
+
'Transformers', 'Prompt Engineering', 'Data Science', 'Machine Learning'
|
| 295 |
+
];
|
| 296 |
+
|
| 297 |
+
const mobileAlgorithmNames = [
|
| 298 |
+
'Supervised', 'Unsupervised', 'LLM', 'RAG','Deep Learning', 'Computer Vision',
|
| 299 |
+
'Generative AI', 'NLP', 'Vector Embeddings'
|
| 300 |
+
];
|
| 301 |
+
|
| 302 |
+
let balls = [];
|
| 303 |
+
|
| 304 |
+
function getRandomPosition() {
|
| 305 |
+
return {
|
| 306 |
+
x: Math.random() * (canvas.width * 0.8) + (canvas.width * 0.1),
|
| 307 |
+
y: Math.random() * (canvas.height * 0.8) + (canvas.height * 0.1)
|
| 308 |
+
};
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
function getRandomVelocity() {
|
| 312 |
+
const speed = 2;
|
| 313 |
+
const angle = Math.random() * 2 * Math.PI;
|
| 314 |
+
return {
|
| 315 |
+
dx: Math.cos(angle) * speed,
|
| 316 |
+
dy: Math.sin(angle) * speed
|
| 317 |
+
};
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
function initializeBalls() {
|
| 321 |
+
const names = window.innerWidth < 768 ? mobileAlgorithmNames : algorithmNames;
|
| 322 |
+
balls = names.map(name => {
|
| 323 |
+
const pos = getRandomPosition();
|
| 324 |
+
const vel = getRandomVelocity();
|
| 325 |
+
return new Ball(name, pos.x, pos.y, vel.dx, vel.dy);
|
| 326 |
+
});
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
let controlledBall = null;
|
| 330 |
+
let startX, startY;
|
| 331 |
+
|
| 332 |
+
function animate() {
|
| 333 |
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
| 334 |
+
|
| 335 |
+
for (let i = 0; i < balls.length; i++) {
|
| 336 |
+
balls[i].update();
|
| 337 |
+
balls[i].draw();
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
for (let i = 0; i < balls.length; i++) {
|
| 341 |
+
for (let j = i + 1; j < balls.length; j++) {
|
| 342 |
+
resolveCollision(balls[i], balls[j]);
|
| 343 |
+
}
|
| 344 |
+
}
|
| 345 |
+
requestAnimationFrame(animate);
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
canvas.addEventListener('mousedown', (event) => {
|
| 349 |
+
const mouseX = event.clientX;
|
| 350 |
+
const mouseY = event.clientY;
|
| 351 |
+
|
| 352 |
+
for (let i = 0; i < balls.length; i++) {
|
| 353 |
+
const ball = balls[i];
|
| 354 |
+
const distance = Math.sqrt((mouseX - ball.x) ** 2 + (mouseY - ball.y) ** 2);
|
| 355 |
+
if (distance < ball.radius) {
|
| 356 |
+
controlledBall = ball;
|
| 357 |
+
controlledBall.isControlled = true;
|
| 358 |
+
startX = controlledBall.x;
|
| 359 |
+
startY = controlledBall.y;
|
| 360 |
+
break;
|
| 361 |
+
}
|
| 362 |
+
}
|
| 363 |
+
});
|
| 364 |
+
|
| 365 |
+
canvas.addEventListener('mousemove', (event) => {
|
| 366 |
+
const mouseX = event.clientX;
|
| 367 |
+
const mouseY = event.clientY;
|
| 368 |
+
|
| 369 |
+
let isHovering = false;
|
| 370 |
+
balls.forEach(ball => {
|
| 371 |
+
const distance = Math.sqrt((mouseX - ball.x) ** 2 + (mouseY - ball.y) ** 2);
|
| 372 |
+
if (distance < ball.radius) {
|
| 373 |
+
ball.isHovered = true;
|
| 374 |
+
isHovering = true;
|
| 375 |
+
} else {
|
| 376 |
+
ball.isHovered = false;
|
| 377 |
+
}
|
| 378 |
+
});
|
| 379 |
+
|
| 380 |
+
if (isHovering || controlledBall) {
|
| 381 |
+
canvas.style.cursor = 'pointer';
|
| 382 |
+
} else {
|
| 383 |
+
canvas.style.cursor = 'default';
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
if (controlledBall) {
|
| 387 |
+
controlledBall.x = mouseX;
|
| 388 |
+
controlledBall.y = mouseY;
|
| 389 |
+
}
|
| 390 |
+
});
|
| 391 |
+
|
| 392 |
+
canvas.addEventListener('mouseup', () => {
|
| 393 |
+
if (controlledBall) {
|
| 394 |
+
const speedFactor = 0.1;
|
| 395 |
+
let dx = (controlledBall.x - startX) * speedFactor;
|
| 396 |
+
let dy = (controlledBall.y - startY) * speedFactor;
|
| 397 |
+
|
| 398 |
+
const maxSpeed = 10;
|
| 399 |
+
if (Math.sqrt(dx*dx + dy*dy) > maxSpeed) {
|
| 400 |
+
const angle = Math.atan2(dy, dx);
|
| 401 |
+
dx = Math.cos(angle) * maxSpeed;
|
| 402 |
+
dy = Math.sin(angle) * maxSpeed;
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
controlledBall.dx = dx;
|
| 406 |
+
controlledBall.dy = dy;
|
| 407 |
+
|
| 408 |
+
controlledBall.isControlled = false;
|
| 409 |
+
controlledBall = null;
|
| 410 |
+
}
|
| 411 |
+
});
|
| 412 |
+
|
| 413 |
+
// Functions for the modal message box
|
| 414 |
+
function showMessage(title, message) {
|
| 415 |
+
const modal = document.getElementById('messageModal');
|
| 416 |
+
const modalTitle = document.getElementById('modalTitle');
|
| 417 |
+
const modalMessage = document.getElementById('modalMessage');
|
| 418 |
+
|
| 419 |
+
modalTitle.textContent = title;
|
| 420 |
+
modalMessage.textContent = message;
|
| 421 |
+
|
| 422 |
+
modal.classList.remove('hidden');
|
| 423 |
+
document.body.style.overflow = 'hidden'; // Prevents scrolling
|
| 424 |
+
}
|
| 425 |
+
|
| 426 |
+
function hideMessage() {
|
| 427 |
+
const modal = document.getElementById('messageModal');
|
| 428 |
+
modal.classList.add('hidden');
|
| 429 |
+
document.body.style.overflow = ''; // Restores scrolling
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
function startLearning() {
|
| 433 |
+
window.location.href = '/home';
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
function takeQuiz() {
|
| 437 |
+
window.location.href = '/Test-home';
|
| 438 |
+
|
| 439 |
+
// Here you would typically redirect to the quiz page, e.g.,
|
| 440 |
+
// window.location.href = '/assessment';
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
// Adjust canvas size dynamically on screen resize
|
| 444 |
+
function resizeCanvas() {
|
| 445 |
+
canvas.width = window.innerWidth;
|
| 446 |
+
canvas.height = window.innerHeight;
|
| 447 |
+
|
| 448 |
+
// Re-initialize the balls to adjust the number of names
|
| 449 |
+
initializeBalls();
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
window.addEventListener('resize', resizeCanvas);
|
| 453 |
+
|
| 454 |
+
// Start the animation and initialize balls on page load
|
| 455 |
+
initializeBalls();
|
| 456 |
+
animate();
|
| 457 |
+
</script>
|
| 458 |
+
</body>
|
| 459 |
+
</html>
|