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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>Neon Exam Countdown</title>
|
7 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
* {
|
10 |
+
margin: 0;
|
11 |
+
padding: 0;
|
12 |
+
box-sizing: border-box;
|
13 |
+
}
|
14 |
+
|
15 |
+
body {
|
16 |
+
font-family: 'Inter', sans-serif;
|
17 |
+
background: linear-gradient(135deg, #0A0A0B 0%, #141419 100%);
|
18 |
+
min-height: 100vh;
|
19 |
+
color: #fff;
|
20 |
+
overflow-x: hidden;
|
21 |
+
position: relative;
|
22 |
+
}
|
23 |
+
|
24 |
+
/* Animated background */
|
25 |
+
.particles {
|
26 |
+
position: fixed;
|
27 |
+
top: 0;
|
28 |
+
left: 0;
|
29 |
+
width: 100%;
|
30 |
+
height: 100%;
|
31 |
+
overflow: hidden;
|
32 |
+
z-index: 1;
|
33 |
+
}
|
34 |
+
|
35 |
+
.particle {
|
36 |
+
position: absolute;
|
37 |
+
width: 4px;
|
38 |
+
height: 4px;
|
39 |
+
background: radial-gradient(circle, rgba(0, 212, 255, 0.5) 0%, transparent 70%);
|
40 |
+
border-radius: 50%;
|
41 |
+
animation: float 20s infinite linear;
|
42 |
+
}
|
43 |
+
|
44 |
+
@keyframes float {
|
45 |
+
from {
|
46 |
+
transform: translateY(100vh) translateX(0);
|
47 |
+
opacity: 0;
|
48 |
+
}
|
49 |
+
10% {
|
50 |
+
opacity: 1;
|
51 |
+
}
|
52 |
+
90% {
|
53 |
+
opacity: 1;
|
54 |
+
}
|
55 |
+
to {
|
56 |
+
transform: translateY(-100vh) translateX(100px);
|
57 |
+
opacity: 0;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
/* Main container */
|
62 |
+
.container {
|
63 |
+
max-width: 1200px;
|
64 |
+
margin: 0 auto;
|
65 |
+
padding: 2rem;
|
66 |
+
position: relative;
|
67 |
+
z-index: 2;
|
68 |
+
}
|
69 |
+
|
70 |
+
/* Header */
|
71 |
+
.header {
|
72 |
+
display: flex;
|
73 |
+
justify-content: space-between;
|
74 |
+
align-items: center;
|
75 |
+
margin-bottom: 3rem;
|
76 |
+
}
|
77 |
+
|
78 |
+
h1 {
|
79 |
+
font-size: 2.5rem;
|
80 |
+
font-weight: 700;
|
81 |
+
background: linear-gradient(135deg, #00D4FF 0%, #FF0080 50%, #00FF88 100%);
|
82 |
+
-webkit-background-clip: text;
|
83 |
+
-webkit-text-fill-color: transparent;
|
84 |
+
background-clip: text;
|
85 |
+
text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
|
86 |
+
}
|
87 |
+
|
88 |
+
/* Settings button */
|
89 |
+
.settings-btn {
|
90 |
+
width: 50px;
|
91 |
+
height: 50px;
|
92 |
+
background: rgba(255, 255, 255, 0.05);
|
93 |
+
backdrop-filter: blur(10px);
|
94 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
95 |
+
border-radius: 12px;
|
96 |
+
display: flex;
|
97 |
+
align-items: center;
|
98 |
+
justify-content: center;
|
99 |
+
cursor: pointer;
|
100 |
+
transition: all 0.3s ease;
|
101 |
+
}
|
102 |
+
|
103 |
+
.settings-btn:hover {
|
104 |
+
background: rgba(255, 255, 255, 0.1);
|
105 |
+
border-color: #00D4FF;
|
106 |
+
box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
|
107 |
+
transform: scale(1.05);
|
108 |
+
}
|
109 |
+
|
110 |
+
.settings-btn svg {
|
111 |
+
width: 24px;
|
112 |
+
height: 24px;
|
113 |
+
fill: #00D4FF;
|
114 |
+
}
|
115 |
+
|
116 |
+
/* Exam cards grid */
|
117 |
+
.exams-grid {
|
118 |
+
display: grid;
|
119 |
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
120 |
+
gap: 2rem;
|
121 |
+
}
|
122 |
+
|
123 |
+
/* Exam card */
|
124 |
+
.exam-card {
|
125 |
+
background: rgba(255, 255, 255, 0.05);
|
126 |
+
backdrop-filter: blur(20px);
|
127 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
128 |
+
border-radius: 20px;
|
129 |
+
padding: 2rem;
|
130 |
+
text-align: center;
|
131 |
+
transition: all 0.3s ease;
|
132 |
+
position: relative;
|
133 |
+
overflow: hidden;
|
134 |
+
}
|
135 |
+
|
136 |
+
.exam-card::before {
|
137 |
+
content: '';
|
138 |
+
position: absolute;
|
139 |
+
top: -2px;
|
140 |
+
left: -2px;
|
141 |
+
right: -2px;
|
142 |
+
bottom: -2px;
|
143 |
+
background: linear-gradient(45deg, #00D4FF, #FF0080, #00FF88, #00D4FF);
|
144 |
+
border-radius: 20px;
|
145 |
+
opacity: 0;
|
146 |
+
z-index: -1;
|
147 |
+
transition: opacity 0.3s ease;
|
148 |
+
}
|
149 |
+
|
150 |
+
.exam-card:hover {
|
151 |
+
transform: translateY(-5px);
|
152 |
+
box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
|
153 |
+
}
|
154 |
+
|
155 |
+
.exam-card:hover::before {
|
156 |
+
opacity: 0.5;
|
157 |
+
}
|
158 |
+
|
159 |
+
.exam-name {
|
160 |
+
font-size: 1.5rem;
|
161 |
+
font-weight: 600;
|
162 |
+
margin-bottom: 1rem;
|
163 |
+
color: #fff;
|
164 |
+
}
|
165 |
+
|
166 |
+
.countdown {
|
167 |
+
font-size: 3rem;
|
168 |
+
font-weight: 700;
|
169 |
+
color: #00D4FF;
|
170 |
+
text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
|
171 |
+
margin-bottom: 0.5rem;
|
172 |
+
}
|
173 |
+
|
174 |
+
.countdown-label {
|
175 |
+
font-size: 1rem;
|
176 |
+
color: rgba(255, 255, 255, 0.7);
|
177 |
+
}
|
178 |
+
|
179 |
+
.exam-date {
|
180 |
+
font-size: 0.9rem;
|
181 |
+
color: rgba(255, 255, 255, 0.5);
|
182 |
+
margin-top: 1rem;
|
183 |
+
}
|
184 |
+
|
185 |
+
.delete-btn {
|
186 |
+
position: absolute;
|
187 |
+
top: 1rem;
|
188 |
+
right: 1rem;
|
189 |
+
width: 30px;
|
190 |
+
height: 30px;
|
191 |
+
background: rgba(255, 0, 128, 0.2);
|
192 |
+
border: 1px solid rgba(255, 0, 128, 0.5);
|
193 |
+
border-radius: 8px;
|
194 |
+
display: flex;
|
195 |
+
align-items: center;
|
196 |
+
justify-content: center;
|
197 |
+
cursor: pointer;
|
198 |
+
transition: all 0.3s ease;
|
199 |
+
opacity: 0;
|
200 |
+
}
|
201 |
+
|
202 |
+
.exam-card:hover .delete-btn {
|
203 |
+
opacity: 1;
|
204 |
+
}
|
205 |
+
|
206 |
+
.delete-btn:hover {
|
207 |
+
background: rgba(255, 0, 128, 0.4);
|
208 |
+
transform: scale(1.1);
|
209 |
+
}
|
210 |
+
|
211 |
+
/* Modal */
|
212 |
+
.modal {
|
213 |
+
display: none;
|
214 |
+
position: fixed;
|
215 |
+
top: 0;
|
216 |
+
left: 0;
|
217 |
+
width: 100%;
|
218 |
+
height: 100%;
|
219 |
+
background: rgba(0, 0, 0, 0.8);
|
220 |
+
z-index: 1000;
|
221 |
+
align-items: center;
|
222 |
+
justify-content: center;
|
223 |
+
padding: 2rem;
|
224 |
+
}
|
225 |
+
|
226 |
+
.modal.active {
|
227 |
+
display: flex;
|
228 |
+
}
|
229 |
+
|
230 |
+
.modal-content {
|
231 |
+
background: rgba(20, 20, 25, 0.95);
|
232 |
+
backdrop-filter: blur(20px);
|
233 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
234 |
+
border-radius: 20px;
|
235 |
+
padding: 2rem;
|
236 |
+
width: 100%;
|
237 |
+
max-width: 400px;
|
238 |
+
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
|
239 |
+
}
|
240 |
+
|
241 |
+
.modal-header {
|
242 |
+
display: flex;
|
243 |
+
justify-content: space-between;
|
244 |
+
align-items: center;
|
245 |
+
margin-bottom: 2rem;
|
246 |
+
}
|
247 |
+
|
248 |
+
.modal-title {
|
249 |
+
font-size: 1.5rem;
|
250 |
+
font-weight: 600;
|
251 |
+
}
|
252 |
+
|
253 |
+
.close-btn {
|
254 |
+
width: 30px;
|
255 |
+
height: 30px;
|
256 |
+
background: transparent;
|
257 |
+
border: none;
|
258 |
+
cursor: pointer;
|
259 |
+
display: flex;
|
260 |
+
align-items: center;
|
261 |
+
justify-content: center;
|
262 |
+
transition: transform 0.3s ease;
|
263 |
+
}
|
264 |
+
|
265 |
+
.close-btn:hover {
|
266 |
+
transform: rotate(90deg);
|
267 |
+
}
|
268 |
+
|
269 |
+
.form-group {
|
270 |
+
margin-bottom: 1.5rem;
|
271 |
+
}
|
272 |
+
|
273 |
+
label {
|
274 |
+
display: block;
|
275 |
+
margin-bottom: 0.5rem;
|
276 |
+
color: rgba(255, 255, 255, 0.8);
|
277 |
+
font-size: 0.9rem;
|
278 |
+
}
|
279 |
+
|
280 |
+
input {
|
281 |
+
width: 100%;
|
282 |
+
padding: 0.75rem 1rem;
|
283 |
+
background: rgba(255, 255, 255, 0.05);
|
284 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
285 |
+
border-radius: 10px;
|
286 |
+
color: #fff;
|
287 |
+
font-size: 1rem;
|
288 |
+
transition: all 0.3s ease;
|
289 |
+
}
|
290 |
+
|
291 |
+
input:focus {
|
292 |
+
outline: none;
|
293 |
+
border-color: #00D4FF;
|
294 |
+
box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
|
295 |
+
}
|
296 |
+
|
297 |
+
.add-btn {
|
298 |
+
width: 100%;
|
299 |
+
padding: 1rem;
|
300 |
+
background: linear-gradient(135deg, #00D4FF 0%, #FF0080 100%);
|
301 |
+
border: none;
|
302 |
+
border-radius: 10px;
|
303 |
+
color: #fff;
|
304 |
+
font-size: 1rem;
|
305 |
+
font-weight: 600;
|
306 |
+
cursor: pointer;
|
307 |
+
transition: all 0.3s ease;
|
308 |
+
}
|
309 |
+
|
310 |
+
.add-btn:hover {
|
311 |
+
transform: translateY(-2px);
|
312 |
+
box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5);
|
313 |
+
}
|
314 |
+
|
315 |
+
/* Empty state */
|
316 |
+
.empty-state {
|
317 |
+
text-align: center;
|
318 |
+
padding: 4rem 2rem;
|
319 |
+
}
|
320 |
+
|
321 |
+
.empty-state p {
|
322 |
+
font-size: 1.2rem;
|
323 |
+
color: rgba(255, 255, 255, 0.5);
|
324 |
+
margin-bottom: 2rem;
|
325 |
+
}
|
326 |
+
|
327 |
+
/* Responsive */
|
328 |
+
@media (max-width: 768px) {
|
329 |
+
h1 {
|
330 |
+
font-size: 2rem;
|
331 |
+
}
|
332 |
+
|
333 |
+
.exams-grid {
|
334 |
+
grid-template-columns: 1fr;
|
335 |
+
}
|
336 |
+
|
337 |
+
.countdown {
|
338 |
+
font-size: 2.5rem;
|
339 |
+
}
|
340 |
+
}
|
341 |
+
</style>
|
342 |
+
</head>
|
343 |
+
<body>
|
344 |
+
<!-- Animated particles background -->
|
345 |
+
<div class="particles" id="particles"></div>
|
346 |
+
|
347 |
+
<div class="container">
|
348 |
+
<div class="header">
|
349 |
+
<h1>Exam Countdown</h1>
|
350 |
+
<div class="settings-btn" onclick="openModal()">
|
351 |
+
<svg viewBox="0 0 24 24">
|
352 |
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/>
|
353 |
+
</svg>
|
354 |
+
</div>
|
355 |
+
</div>
|
356 |
+
|
357 |
+
<div class="exams-grid" id="examsGrid">
|
358 |
+
<!-- Exam cards will be inserted here -->
|
359 |
+
</div>
|
360 |
+
|
361 |
+
<div class="empty-state" id="emptyState" style="display: none;">
|
362 |
+
<p>No exams scheduled yet. Click the + button to add your first exam!</p>
|
363 |
+
</div>
|
364 |
+
</div>
|
365 |
+
|
366 |
+
<!-- Add Exam Modal -->
|
367 |
+
<div class="modal" id="modal">
|
368 |
+
<div class="modal-content">
|
369 |
+
<div class="modal-header">
|
370 |
+
<h2 class="modal-title">Add New Exam</h2>
|
371 |
+
<button class="close-btn" onclick="closeModal()">
|
372 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="#fff">
|
373 |
+
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
374 |
+
</svg>
|
375 |
+
</button>
|
376 |
+
</div>
|
377 |
+
<form onsubmit="addExam(event)">
|
378 |
+
<div class="form-group">
|
379 |
+
<label for="examName">Exam Name</label>
|
380 |
+
<input type="text" id="examName" required placeholder="e.g., Physics Final">
|
381 |
+
</div>
|
382 |
+
<div class="form-group">
|
383 |
+
<label for="examDate">Exam Date</label>
|
384 |
+
<input type="date" id="examDate" required>
|
385 |
+
</div>
|
386 |
+
<button type="submit" class="add-btn">Add Exam</button>
|
387 |
+
</form>
|
388 |
+
</div>
|
389 |
+
</div>
|
390 |
+
|
391 |
+
<script>
|
392 |
+
// Initialize particles
|
393 |
+
function createParticles() {
|
394 |
+
const particlesContainer = document.getElementById('particles');
|
395 |
+
for (let i = 0; i < 50; i++) {
|
396 |
+
const particle = document.createElement('div');
|
397 |
+
particle.className = 'particle';
|
398 |
+
particle.style.left = Math.random() * 100 + '%';
|
399 |
+
particle.style.animationDelay = Math.random() * 20 + 's';
|
400 |
+
particle.style.animationDuration = (15 + Math.random() * 10) + 's';
|
401 |
+
particlesContainer.appendChild(particle);
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
+
// Load exams from localStorage
|
406 |
+
let exams = JSON.parse(localStorage.getItem('exams')) || [];
|
407 |
+
|
408 |
+
// Modal functions
|
409 |
+
function openModal() {
|
410 |
+
document.getElementById('modal').classList.add('active');
|
411 |
+
}
|
412 |
+
|
413 |
+
function closeModal() {
|
414 |
+
document.getElementById('modal').classList.remove('active');
|
415 |
+
document.getElementById('examName').value = '';
|
416 |
+
document.getElementById('examDate').value = '';
|
417 |
+
}
|
418 |
+
|
419 |
+
// Add exam
|
420 |
+
function addExam(event) {
|
421 |
+
event.preventDefault();
|
422 |
+
const name = document.getElementById('examName').value;
|
423 |
+
const date = document.getElementById('examDate').value;
|
424 |
+
|
425 |
+
const exam = {
|
426 |
+
id: Date.now(),
|
427 |
+
name,
|
428 |
+
date
|
429 |
+
};
|
430 |
+
|
431 |
+
exams.push(exam);
|
432 |
+
localStorage.setItem('exams', JSON.stringify(exams));
|
433 |
+
closeModal();
|
434 |
+
renderExams();
|
435 |
+
}
|
436 |
+
|
437 |
+
// Delete exam
|
438 |
+
function deleteExam(id) {
|
439 |
+
exams = exams.filter(exam => exam.id !== id);
|
440 |
+
localStorage.setItem('exams', JSON.stringify(exams));
|
441 |
+
renderExams();
|
442 |
+
}
|
443 |
+
|
444 |
+
// Calculate days until exam
|
445 |
+
function calculateDaysUntil(examDate) {
|
446 |
+
const today = new Date();
|
447 |
+
const exam = new Date(examDate);
|
448 |
+
const diffTime = exam - today;
|
449 |
+
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
450 |
+
return diffDays;
|
451 |
+
}
|
452 |
+
|
453 |
+
// Render exams
|
454 |
+
function renderExams() {
|
455 |
+
const grid = document.getElementById('examsGrid');
|
456 |
+
const emptyState = document.getElementById('emptyState');
|
457 |
+
|
458 |
+
grid.innerHTML = '';
|
459 |
+
|
460 |
+
if (exams.length === 0) {
|
461 |
+
emptyState.style.display = 'block';
|
462 |
+
return;
|
463 |
+
}
|
464 |
+
|
465 |
+
emptyState.style.display = 'none';
|
466 |
+
|
467 |
+
// Sort exams by date
|
468 |
+
const sortedExams = [...exams].sort((a, b) => new Date(a.date) - new Date(b.date));
|
469 |
+
|
470 |
+
sortedExams.forEach(exam => {
|
471 |
+
const daysUntil = calculateDaysUntil(exam.date);
|
472 |
+
const card = document.createElement('div');
|
473 |
+
card.className = 'exam-card';
|
474 |
+
|
475 |
+
let countdownColor = '#00D4FF';
|
476 |
+
if (daysUntil <= 3) countdownColor = '#FF0080';
|
477 |
+
else if (daysUntil <= 7) countdownColor = '#00FF88';
|
478 |
+
|
479 |
+
card.innerHTML = `
|
480 |
+
<div class="delete-btn" onclick="deleteExam(${exam.id})">
|
481 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="#FF0080">
|
482 |
+
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>
|
483 |
+
</svg>
|
484 |
+
</div>
|
485 |
+
<h3 class="exam-name">${exam.name}</h3>
|
486 |
+
<div class="countdown" style="color: ${countdownColor}; text-shadow: 0 0 20px ${countdownColor}80;">
|
487 |
+
${daysUntil}
|
488 |
+
</div>
|
489 |
+
<div class="countdown-label">days remaining</div>
|
490 |
+
<div class="exam-date">${new Date(exam.date).toLocaleDateString('en-US', {
|
491 |
+
weekday: 'long',
|
492 |
+
year: 'numeric',
|
493 |
+
month: 'long',
|
494 |
+
day: 'numeric'
|
495 |
+
})}</div>
|
496 |
+
`;
|
497 |
+
|
498 |
+
grid.appendChild(card);
|
499 |
+
});
|
500 |
+
}
|
501 |
+
|
502 |
+
// Set minimum date to today
|
503 |
+
document.getElementById('examDate').min = new Date().toISOString().split('T')[0];
|
504 |
+
|
505 |
+
// Initialize
|
506 |
+
createParticles();
|
507 |
+
renderExams();
|
508 |
+
|
509 |
+
// Update countdown every day
|
510 |
+
setInterval(renderExams, 86400000);
|
511 |
+
|
512 |
+
// Close modal on outside click
|
513 |
+
window.onclick = function(event) {
|
514 |
+
const modal = document.getElementById('modal');
|
515 |
+
if (event.target === modal) {
|
516 |
+
closeModal();
|
517 |
+
}
|
518 |
+
}
|
519 |
+
</script>
|
520 |
+
</body>
|
521 |
+
</html>
|