Spaces:
Running
Running
File size: 25,232 Bytes
5c0334f | 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 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Student Attendance System</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Custom animations */
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.animate-pulse {
animation: pulse 2s infinite;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* Custom checkbox */
input[type="checkbox"].custom-checkbox {
appearance: none;
-webkit-appearance: none;
width: 24px;
height: 24px;
border: 2px solid #e2e8f0;
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
input[type="checkbox"].custom-checkbox:checked {
background-color: #4f46e5;
border-color: #4f46e5;
}
input[type="checkbox"].custom-checkbox:checked::after {
content: "✓";
color: white;
font-size: 14px;
font-weight: bold;
}
</style>
</head>
<body class="bg-gray-50">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-indigo-600 text-white shadow-lg">
<div class="container mx-auto px-4 py-4">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-clipboard-check text-2xl"></i>
<h1 class="text-xl font-bold">Attendance Portal</h1>
</div>
<div class="flex items-center space-x-4">
<div class="hidden md:flex items-center space-x-2 bg-indigo-500 px-3 py-1 rounded-full">
<i class="fas fa-user-graduate"></i>
<span id="student-name">John Doe</span>
</div>
<button class="bg-white text-indigo-600 px-4 py-1 rounded-full font-medium hover:bg-indigo-50 transition">Logout</button>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-1 container mx-auto px-4 py-6">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Left Column - Student Info and Today's Classes -->
<div class="lg:col-span-1 space-y-6">
<!-- Student Profile Card -->
<div class="bg-white rounded-xl shadow-md p-6">
<div class="flex items-center space-x-4 mb-4">
<div class="relative">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Student" class="w-16 h-16 rounded-full object-cover border-2 border-indigo-100">
<span class="absolute bottom-0 right-0 bg-green-500 rounded-full w-4 h-4 border-2 border-white"></span>
</div>
<div>
<h2 class="font-bold text-lg" id="full-name">John Doe</h2>
<p class="text-gray-600" id="student-id">ID: S10024</p>
<p class="text-gray-600" id="student-courses">Computer Science</p>
</div>
</div>
<div class="grid grid-cols-3 gap-2 text-center">
<div class="bg-indigo-50 rounded-lg p-2">
<p class="text-gray-500 text-sm">Total Classes</p>
<p class="font-bold">48</p>
</div>
<div class="bg-indigo-50 rounded-lg p-2">
<p class="text-gray-500 text-sm">Present</p>
<p class="font-bold">42</p>
</div>
<div class="bg-indigo-50 rounded-lg p-2">
<p class="text-gray-500 text-sm">Attendance</p>
<p class="font-bold text-green-600">87.5%</p>
</div>
</div>
</div>
<!-- Today's Classes -->
<div class="bg-white rounded-xl shadow-md p-6">
<h3 class="font-bold text-lg mb-4 flex items-center">
<i class="fas fa-calendar-day mr-2 text-indigo-600"></i>
Today's Schedule
</h3>
<div class="space-y-3">
<div class="flex justify-between items-center p-3 bg-indigo-50 rounded-lg">
<div>
<p class="font-medium">Data Structures</p>
<p class="text-sm text-gray-500">9:00 AM - 10:30 AM</p>
</div>
<div class="text-green-500">
<i class="fas fa-check-circle"></i>
</div>
</div>
<div class="flex justify-between items-center p-3 bg-indigo-50 rounded-lg">
<div>
<p class="font-medium">Algorithms</p>
<p class="text-sm text-gray-500">11:00 AM - 12:30 PM</p>
</div>
<div class="text-orange-500">
<i class="fas fa-clock"></i>
</div>
</div>
<div class="flex justify-between items-center p-3 bg-gray-50 rounded-lg">
<div>
<p class="font-medium">Database Systems</p>
<p class="text-sm text-gray-500">2:00 PM - 3:30 PM</p>
</div>
<div class="text-gray-400">
<i class="fas fa-lock"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Right Column - Attendance Form -->
<div class="lg:col-span-2">
<div class="bg-white rounded-xl shadow-md overflow-hidden">
<!-- Attendance Form Header -->
<div class="bg-indigo-600 text-white px-6 py-4">
<div class="flex justify-between items-center">
<h2 class="text-xl font-bold flex items-center">
<i class="fas fa-user-check mr-2"></i>
Mark Attendance
</h2>
<div class="flex items-center space-x-2">
<span id="current-date" class="font-medium">June 15, 2023</span>
</div>
</div>
</div>
<!-- Attendance Form Body -->
<div class="p-6">
<!-- Current Class Info -->
<div class="bg-indigo-50 rounded-lg p-4 mb-6">
<div class="flex justify-between items-center">
<div>
<h3 class="font-bold text-lg" id="current-class-name">Algorithms</h3>
<p class="text-gray-600" id="current-class-time">11:00 AM - 12:30 PM</p>
</div>
<div class="bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-sm font-medium">
Active Now
</div>
</div>
</div>
<!-- Geo Location Check -->
<div class="mb-6">
<div class="flex items-center justify-between mb-3">
<h4 class="font-medium">Location Verification</h4>
<div class="flex items-center space-x-2">
<span class="text-sm text-gray-500">Your location:</span>
<span id="location-status" class="text-sm font-medium text-green-600">Verified</span>
</div>
</div>
<div class="flex items-center space-x-4">
<div class="flex-1 bg-gray-100 rounded-lg p-3">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-700">Approximate Location</p>
<p id="location-details" class="text-sm text-gray-500">University Main Building, Room 204</p>
</div>
<button id="refresh-location" class="text-indigo-600 hover:text-indigo-800">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
<div class="bg-green-100 text-green-800 px-3 py-2 rounded-lg">
<i class="fas fa-check-circle mr-1"></i>
<span>Match</span>
</div>
</div>
</div>
<!-- Attendance Marking -->
<div class="mb-6">
<h4 class="font-medium mb-3">Confirm Attendance</h4>
<div class="bg-indigo-50 rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<div class="flex items-center space-x-3">
<input type="checkbox" id="confirm-attendance" class="custom-checkbox">
<label for="confirm-attendance" class="text-gray-700 font-medium">I confirm that I'm attending this class</label>
</div>
</div>
<div class="flex items-center justify-between">
<div>
<p class="text-xs text-gray-500">Note: Marking false attendance may lead to disciplinary action.</p>
</div>
<div>
<p class="text-xs text-gray-500">Session will expire in: <span id="timer" class="font-bold">14:32</span></p>
</div>
</div>
</div>
</div>
<!-- QR Code Option -->
<div class="mb-8">
<h4 class="font-medium mb-3">Alternative Verification</h4>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<button id="scan-qr-btn" class="bg-indigo-100 hover:bg-indigo-200 text-indigo-800 font-medium py-3 px-4 rounded-lg flex items-center justify-center space-x-2 transition">
<i class="fas fa-qrcode"></i>
<span>Scan QR Code</span>
</button>
<button class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium py-3 px-4 rounded-lg flex items-center justify-center space-x-2 transition">
<i class="fas fa-fingerprint"></i>
<span>Use Biometric</span>
</button>
</div>
</div>
<!-- Submit Button -->
<button id="submit-attendance" class="w-full bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-4 rounded-lg shadow-md flex items-center justify-center space-x-2 transition disabled:opacity-50 disabled:cursor-not-allowed" disabled>
<i class="fas fa-check-circle"></i>
<span>Submit Attendance</span>
</button>
</div>
</div>
<!-- Attendance History -->
<div class="mt-6 bg-white rounded-xl shadow-md overflow-hidden">
<div class="bg-indigo-600 text-white px-6 py-4">
<h2 class="text-xl font-bold flex items-center">
<i class="fas fa-history mr-2"></i>
Recent Attendance
</h2>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Class</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Time</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">June 14, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Database Systems</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2:00 PM - 3:30 PM</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Present</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">June 14, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Algorithms</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">11:00 AM - 12:30 PM</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Present</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">June 12, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Data Structures</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">9:00 AM - 10:30 AM</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">Absent</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">June 10, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Computer Networks</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4:00 PM - 5:30 PM</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Present</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-100 border-t border-gray-200 py-4">
<div class="container mx-auto px-4">
<p class="text-center text-gray-600 text-sm">© 2023 University Attendance System. All rights reserved.</p>
</div>
</footer>
</div>
<!-- QR Code Modal -->
<div id="qr-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-xl p-6 w-full max-w-sm">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-bold">Scan QR Code</h3>
<button id="close-qr-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="bg-gray-100 rounded-lg p-4 flex flex-col items-center mb-4">
<div class="bg-white p-4 rounded-lg mb-4">
<!-- Placeholder for QR code -->
<div class="w-48 h-48 bg-gray-200 flex items-center justify-center text-gray-500">
<div class="text-center">
<i class="fas fa-qrcode text-4xl mb-2"></i>
<p class="text-sm">QR Code Display</p>
</div>
</div>
</div>
<p class="text-sm text-gray-600 text-center">Point your camera at the QR code displayed by your instructor</p>
</div>
<button class="w-full bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-4 rounded-lg transition">
Use Camera
</button>
</div>
</div>
<!-- Success Modal -->
<div id="success-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-xl p-6 w-full max-w-sm">
<div class="flex flex-col items-center text-center">
<div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4">
<i class="fas fa-check-circle text-green-600 text-3xl"></i>
</div>
<h3 class="text-xl font-bold mb-2">Attendance Recorded!</h3>
<p class="text-gray-600 mb-4">Your attendance has been successfully submitted for <span class="font-medium">Algorithms</span> class.</p>
<button id="close-success-modal" class="w-full bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-4 rounded-lg transition">
Close
</button>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Set current date
const now = new Date();
const options = { year: 'numeric', month: 'long', day: 'numeric' };
document.getElementById('current-date').textContent = now.toLocaleDateString('en-US', options);
// Timer countdown
let minutes = 14;
let seconds = 32;
const timerElement = document.getElementById('timer');
const timerInterval = setInterval(() => {
seconds--;
if (seconds < 0) {
minutes--;
seconds = 59;
}
if (minutes < 0) {
clearInterval(timerInterval);
timerElement.textContent = "Expired";
timerElement.classList.add('text-red-500');
document.getElementById('submit-attendance').disabled = true;
} else {
timerElement.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
}
}, 1000);
// Attendance checkbox
const confirmAttendance = document.getElementById('confirm-attendance');
const submitButton = document.getElementById('submit-attendance');
confirmAttendance.addEventListener('change', () => {
submitButton.disabled = !confirmAttendance.checked;
});
// QR Code Modal
const qrModal = document.getElementById('qr-modal');
const scanQrBtn = document.getElementById('scan-qr-btn');
const closeQrModal = document.getElementById('close-qr-modal');
scanQrBtn.addEventListener('click', () => {
qrModal.classList.remove('hidden');
});
closeQrModal.addEventListener('click', () => {
qrModal.classList.add('hidden');
});
// Submit Attendance
const successModal = document.getElementById('success-modal');
const closeSuccessModal = document.getElementById('close-success-modal');
submitButton.addEventListener('click', () => {
qrModal.classList.add('hidden');
successModal.classList.remove('hidden');
clearInterval(timerInterval);
});
closeSuccessModal.addEventListener('click', () => {
successModal.classList.add('hidden');
// In a real app, this would redirect or refresh the page
});
// Refresh location
const refreshLocationBtn = document.getElementById('refresh-location');
refreshLocationBtn.addEventListener('click', () => {
// Simulate refreshing location
refreshLocationBtn.classList.add('animate-spin');
setTimeout(() => {
refreshLocationBtn.classList.remove('animate-spin');
}, 1000);
})
});
</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=Jay-Lokhande/attedancedemo" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |