File size: 23,506 Bytes
8ad39f4 | 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 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>MIT Art, Design and Technology University</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" />
<style>
:root {
--primary: #1a4a7c;
--secondary: #3498db;
--success: #2ecc71;
--danger: #e74c3c;
--warning: #f39c12;
--info: #2980b9;
--light: #ecf0f1;
--dark: #2c3e50;
--white: #ffffff;
--gray: #bdc3c7;
--border-radius: 8px;
--font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: var(--font-main);
}
body {
background: linear-gradient(135deg, #f0f4f8 0%, #d7e1ec 100%);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 40px 20px;
}
header {
width: 100%;
background: var(--white);
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
padding: 20px 0;
margin-bottom: 40px;
border-bottom: 3px solid var(--primary);
}
header .container {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
header img {
height: 70px;
margin-right: 20px;
border-radius: 5px;
}
header h1 {
font-size: 1.8rem;
font-weight: 600;
color: var(--primary);
margin: 0;
text-align: center;
}
.login-box {
background-color: var(--white);
border-radius: var(--border-radius);
padding: 40px;
width: 100%;
max-width: 500px;
box-shadow: 0 10px 25px rgba(0,0,0,0.15);
margin-bottom: 40px;
border-top: 4px solid var(--primary);
}
.login-box h2 {
color: var(--primary);
margin-bottom: 30px;
font-weight: 600;
text-align: center;
padding-bottom: 12px;
position: relative;
}
.login-box h2:after {
content: "";
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 80px;
height: 3px;
background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.section-buttons {
display: flex;
justify-content: space-between;
margin-bottom: 30px;
border-radius: var(--border-radius);
overflow: hidden;
box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.section-buttons button {
flex: 1;
padding: 15px 0;
background-color: var(--light);
border: none;
cursor: pointer;
font-weight: 500;
color: var(--dark);
transition: all 0.3s;
border-right: 1px solid var(--gray);
}
.section-buttons button:last-child {
border-right: none;
}
.section-buttons button:hover {
background-color: #e6f0ff;
}
.section-buttons button.active {
background-color: var(--primary);
color: var(--white);
box-shadow: 0 4px 8px rgba(26, 74, 124, 0.3);
}
.form-section {
display: none;
margin-top: 20px;
}
.form-section h3 {
color: var(--primary);
margin-bottom: 20px;
font-weight: 500;
text-align: center;
}
.input-group {
margin-bottom: 20px;
position: relative;
}
.input-group label {
display: block;
margin-bottom: 8px;
color: var(--dark);
font-size: 15px;
font-weight: 500;
}
.input-group input {
width: 100%;
padding: 14px 15px 14px 40px;
border: 1px solid var(--gray);
border-radius: var(--border-radius);
font-size: 15px;
transition: all 0.3s;
background-color: var(--light);
}
.input-group input:focus {
border-color: var(--secondary);
outline: none;
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
background-color: var(--white);
}
.input-group i {
position: absolute;
left: 15px;
top: 38px;
color: var(--gray);
transition: color 0.3s;
}
.input-group input:focus + i {
color: var(--secondary);
}
/* Fixed Password Input Styling */
.password-group {
position: relative;
}
.password-group input {
padding-right: 40px;
}
.password-toggle {
position: absolute;
right: 53px;
top: 10px; /* Align with the input field */
cursor: pointer;
color: var(--gray);
font-size: 18px;
z-index: 10;
}
.password-toggle:hover {
color: var(--dark);
}
.form-section button, .modal-container button {
width: 100%;
padding: 15px;
border: none;
border-radius: var(--border-radius);
cursor: pointer;
font-size: 16px;
font-weight: 600;
color: var(--white);
background: linear-gradient(to right, var(--primary), var(--secondary));
transition: all 0.3s;
margin-top: 15px;
box-shadow: 0 4px 10px rgba(26, 74, 124, 0.3);
}
.form-section button:hover, .modal-container button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(26, 74, 124, 0.4);
background: linear-gradient(to right, #155785, #2980b9);
}
.modal-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background-color: rgba(0,0,0,0.6);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
backdrop-filter: blur(3px);
}
.modal-container {
background: var(--white);
border-radius: var(--border-radius);
padding: 35px;
width: 100%;
max-width: 500px;
box-shadow: 0 10px 25px rgba(0,0,0,0.2);
border-top: 4px solid var(--primary);
animation: modalFadeIn 0.3s;
}
@keyframes modalFadeIn {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
.close-button {
position: absolute;
top: 15px; right: 15px;
background: var(--light);
border: none;
font-size: 20px;
color: var(--dark);
cursor: pointer;
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s;
}
.close-button:hover {
background: var(--gray);
color: var(--primary);
transform: rotate(90deg);
}
.notes-card {
width: 100%;
margin-bottom: 20px;
border: none;
border-radius: var(--border-radius);
box-shadow: 0 8px 20px rgba(0,0,0,0.1);
overflow: hidden;
}
.notes-card .card-header {
background-color: var(--primary);
color: var(--white);
padding: 15px 20px;
font-weight: 600;
}
.notes-card .card-body {
padding: 25px;
}
.notes-card .card-body h5 {
font-weight: 600;
margin-top: 15px;
color: var(--primary);
display: flex;
align-items: center;
}
.notes-card .card-body h5 i {
margin-right: 10px;
color: var(--secondary);
}
.notes-card ul {
margin-top: 15px;
padding-left: 20px;
}
.notes-card ul li {
margin-bottom: 10px;
line-height: 1.6;
}
.notes-card a {
color: var(--secondary);
text-decoration: none;
transition: color 0.3s;
}
.notes-card a:hover {
color: var(--primary);
text-decoration: underline;
}
@media (max-width: 768px) {
header h1 { font-size: 1.4rem; margin-top: 10px; }
.login-box { padding: 25px; }
.section-buttons button { font-size: 14px; padding: 12px 0; }
.modal-container { padding: 25px; margin: 0 15px; }
}
@media (max-width: 576px) {
header img { height: 50px; }
header h1 { font-size: 1.2rem; }
}
.toast-container {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 1001;
}
.toast {
background-color: rgba(26, 74, 124, 0.9);
color: var(--white);
padding: 15px 25px;
border-radius: var(--border-radius);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
margin-top: 10px;
display: flex;
align-items: center;
animation: toastFadeIn 0.3s;
backdrop-filter: blur(5px);
}
.toast i {
margin-right: 10px;
font-size: 20px;
}
@keyframes toastFadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>
<header>
<div class="container">
<img src="https://exam.mitapps.in/site/static/images/mit.jpg" alt="MIT-ADT Logo">
</div>
<br>
<h1>MIT Art, Design and Technology University, Pune</h1>
</header>
<div class="login-box">
<h2>Welcome to Attendance Portal</h2>
<div class="section-buttons">
<button id="teacherBtn" onclick="showForm('teacher')">
<i class="fas fa-chalkboard-teacher"></i> Teacher
</button>
<button id="studentBtn" onclick="showForm('student')">
<i class="fas fa-user-graduate"></i> Student
</button>
<button id="attendanceBtn" onclick="showForm('attendance')">
<i class="fas fa-clipboard-check"></i> Attendance
</button>
</div>
<div id="teacher" class="form-section">
<h3>Teacher Login</h3>
<div class="input-group">
<label for="teacherUsername">Username</label>
<input type="text" id="teacherUsername" placeholder="Enter your username" />
<i class="fas fa-user"></i>
</div>
<div class="input-group password-group">
<label for="teacherPassword">Password</label>
<input type="password" id="teacherPassword" placeholder="Enter your password" />
<i class="fas fa-lock"></i>
<span class="password-toggle" onclick="togglePassword('teacherPassword')">
<i class="fas fa-eye"></i>
</span>
</div>
<button onclick="attemptLogin('teacher')">
<i class="fas fa-sign-in-alt"></i> Login
</button>
<div class="link">
<a href="#" onclick="showSignup('Teacher'); return false;">Don't have an account? Create one</a>
</div>
</div>
<div id="student" class="form-section">
<h3>Student Login</h3>
<div class="input-group">
<label for="studentUsername">Username</label>
<input type="text" id="studentUsername" placeholder="Enter your username" />
<i class="fas fa-user"></i>
</div>
<div class="input-group password-group">
<label for="studentPassword">Password</label>
<input type="password" id="studentPassword" placeholder="Enter your password" />
<i class="fas fa-lock"></i>
<span class="password-toggle" onclick="togglePassword('studentPassword')">
<i class="fas fa-eye"></i>
</span>
</div>
<button onclick="attemptLogin('student')">
<i class="fas fa-sign-in-alt"></i> Login
</button>
<div class="link">
<a href="#" onclick="showSignup('Student'); return false;">Don't have an account? Create one</a>
</div>
</div>
<div id="attendance" class="form-section">
<h3>Mark Attendance</h3>
<button onclick="window.location.href='/mark_attendance'">
<i class="fas fa-clipboard-check"></i> Mark Attendance
</button>
</div>
</div>
<div class="modal-overlay" id="signupModal">
<div class="modal-container">
<button class="close-button" onclick="closeSignup()">×</button>
<h3 id="signupTitle">Create Account</h3>
<div class="input-group">
<label for="signupFullname">Full Name</label>
<input type="text" id="signupFullname" placeholder="Enter your full name" />
<i class="fas fa-user"></i>
</div>
<div class="input-group" id="phoneNumberGroup" style="display: none;">
<label for="signupPhoneNumber">Phone Number</label>
<input type="text" id="signupPhoneNumber" placeholder="Enter your phone number" />
<i class="fas fa-phone"></i>
</div>
<div class="input-group" id="enrollmentGroup" style="display: none;">
<label for="signupEnrollment">Enrollment Number</label>
<input type="text" id="signupEnrollment" placeholder="e.g, ADT24SOCBD053" />
<i class="fas fa-id-card"></i>
</div>
<div class="input-group" id="studentNumberGroup" style="display: none;">
<label for="signupStudentNumber">Student Number</label>
<input type="text" id="signupStudentNumber" placeholder="Enter Student Number" />
<i class="fas fa-id-badge"></i>
</div>
<div class="input-group" id="parentNumberGroup" style="display: none;">
<label for="signupParentNumber">Parent Number</label>
<input type="text" id="signupParentNumber" placeholder="Enter Parent Mobile Number" />
<i class="fas fa-phone"></i>
</div>
<div class="input-group" id="parentEmailGroup" style="display: none;">
<label for="signupParentEmail">Parent Email</label>
<input type="email" id="signupParentEmail" placeholder="Enter Parent Email ID" />
<i class="fas fa-envelope-open"></i>
</div>
<div class="input-group">
<label for="signupEmail">Email Address</label>
<input type="email" id="signupEmail" placeholder="Enter your email address" />
<i class="fas fa-envelope"></i>
</div>
<div class="input-group">
<label for="signupUsername">Username</label>
<input type="text" id="signupUsername" placeholder="Choose a username" />
<i class="fas fa-user-circle"></i>
</div>
<div class="input-group password-group">
<label for="signupPassword">Password</label>
<input type="password" id="signupPassword" placeholder="Choose a password" />
<i class="fas fa-lock"></i>
<span class="password-toggle" onclick="togglePassword('signupPassword')">
<i class="fas fa-eye"></i>
</span>
</div>
<div class="input-group password-group">
<label for="confirmPassword">Confirm Password</label>
<input type="password" id="confirmPassword" placeholder="Confirm your password" />
<i class="fas fa-check-circle"></i>
<span class="password-toggle" onclick="togglePassword('confirmPassword')">
<i class="fas fa-eye"></i>
</span>
</div>
<button onclick="createAccount()">
<i class="fas fa-user-plus"></i> Create Account
</button>
<div class="link">
<a href="#" onclick="closeSignup(); return false;">Already have an account? Login</a>
</div>
</div>
</div>
<div class="toast-container" id="toastContainer"></div>
<div class="container">
<div class="card notes-card">
<div class="card-header">
<i class="fas fa-info-circle"></i> Important Information
</div>
<div class="card-body">
<h5><i class="fas fa-exclamation-circle"></i> Important Note:</h5>
<ul>
<li>Upload a clear front-facing photo in your student profile to activate Face Recognition Attendance.</li>
<li>Be present in class on time – attendance is auto-marked using your face.</li>
<li>Manual attendance is not allowed – ensure your face is visible and unobstructed.</li>
<li>Minimum 75% attendance (via face recognition) is mandatory for exam eligibility.</li>
</ul>
<h5><i class="fas fa-link"></i> Weblinks:</h5>
<ul>
<li><i class="fas fa-external-link-alt"></i> University Website: <a href="https://www.mituniversity.ac.in/" target="_blank">www.mituniversity.ac.in</a></li>
<li><i class="fas fa-external-link-alt"></i> A B o C: <a href="#" target="_blank">www.abc.gov.in</a> (<a href="#" target="_blank">A I C G</a>)</li>
<li><i class="fas fa-external-link-alt"></i> D N: <a href="#" target="_blank">ni</a></li>
<li><i class="fas fa-external-link-alt"></i> A P: <a href="#" target="_blank">ain</a></li>
</ul>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => showForm('teacher'));
function showForm(section) {
document.querySelectorAll('.form-section').forEach(el => el.style.display = 'none');
document.querySelectorAll('.section-buttons button').forEach(btn => btn.classList.remove('active'));
document.getElementById(section).style.display = 'block';
document.getElementById(section + 'Btn').classList.add('active');
}
function showSignup(role) {
window.currentSignupRole = role;
document.getElementById('signupTitle').textContent = role + " Signup";
const enrollmentGroup = document.getElementById('enrollmentGroup');
const studentNumberGroup = document.getElementById('studentNumberGroup');
const parentNumberGroup = document.getElementById('parentNumberGroup');
const parentEmailGroup = document.getElementById('parentEmailGroup');
const phoneNumberGroup = document.getElementById('phoneNumberGroup');
if (role === 'Student') {
enrollmentGroup.style.display = 'block';
studentNumberGroup.style.display = 'block';
parentNumberGroup.style.display = 'block';
parentEmailGroup.style.display = 'block';
phoneNumberGroup.style.display = 'none';
} else if (role === 'Teacher') {
enrollmentGroup.style.display = 'none';
studentNumberGroup.style.display = 'none';
parentNumberGroup.style.display = 'none';
parentEmailGroup.style.display = 'none';
phoneNumberGroup.style.display = 'block';
}
document.getElementById('signupModal').style.display = 'flex';
}
function closeSignup() {
document.getElementById('signupModal').style.display = 'none';
}
function createAccount() {
const fullname = document.getElementById('signupFullname').value;
const email = document.getElementById('signupEmail').value;
const username = document.getElementById('signupUsername').value;
const password = document.getElementById('signupPassword').value;
const confirmPassword = document.getElementById('confirmPassword').value;
const role = window.currentSignupRole.toLowerCase();
let data = {
full_name: fullname,
email: email,
username: username,
password: password,
role: role,
};
if (role === 'student') {
data.enrollment_number = document.getElementById('signupEnrollment').value;
data.student_number = document.getElementById('signupStudentNumber').value;
data.parent_number = document.getElementById('signupParentNumber').value;
data.parent_email = document.getElementById('signupParentEmail').value;
if (!data.enrollment_number || !data.student_number || !data.parent_number || !data.parent_email) {
showToast('Please fill all student details!', 'error');
return;
}
} else if (role === 'teacher') {
data.phone_number = document.getElementById('signupPhoneNumber').value;
if (!data.phone_number) {
showToast('Please enter phone number!', 'error');
return;
}
}
if (!fullname || !email || !username || !password || !confirmPassword) {
showToast('Please fill all fields!', 'error');
return;
}
if (password !== confirmPassword) {
showToast('Passwords do not match!', 'error');
return;
}
fetch('/signup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => {
if (data.success) {
showToast('Account created successfully!', 'success');
setTimeout(() => closeSignup(), 1500);
} else {
showToast(data.message, 'error');
}
})
.catch(() => showToast('An error occurred. Please try again.', 'error'));
}
function attemptLogin(type) {
const username = document.getElementById(type + 'Username').value;
const password = document.getElementById(type + 'Password').value;
if (!username || !password) {
showToast('Please enter both username and password', 'error');
return;
}
const data = { username, password, role: type };
fetch('/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => {
if (data.success) {
showToast('Login successful! Redirecting...', 'success');
setTimeout(() => window.location.href = data.redirect, 1500);
} else {
showToast(data.message, 'error');
}
})
.catch(() => showToast('An error occurred. Please try again.', 'error'));
}
function showToast(message, type = 'info') {
const toastContainer = document.getElementById('toastContainer');
const toast = document.createElement('div');
toast.className = 'toast';
let icon = type === 'success' ? 'check-circle' : type === 'error' ? 'exclamation-triangle' : 'info-circle';
toast.innerHTML = `<i class="fas fa-${icon}"></i> ${message}`;
toastContainer.appendChild(toast);
setTimeout(() => {
toast.style.opacity = '0';
toast.style.transform = 'translateY(20px)';
toast.style.transition = 'all 0.3s';
setTimeout(() => toastContainer.removeChild(toast), 300);
}, 10000);
}
function togglePassword(id) {
const input = document.getElementById(id);
const toggleButton = input.parentElement.querySelector('.password-toggle');
const icon = toggleButton.querySelector('i');
if (input.type === 'password') {
input.type = 'text';
icon.classList.remove('fa-eye');
icon.classList.add('fa-eye-slash');
} else {
input.type = 'password';
icon.classList.remove('fa-eye-slash');
icon.classList.add('fa-eye');
}
}
window.onclick = function(e) {
if (e.target === document.getElementById('signupModal')) closeSignup();
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/js/bootstrap.min.js"></script>
</body>
</html> |