-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
693 lines (605 loc) · 25.3 KB
/
index.html
File metadata and controls
693 lines (605 loc) · 25.3 KB
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
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>macOS Flip Clock & Timer</title>
<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
<link rel="icon" href="favicon/favicon.ico" sizes="any">
<link rel="manifest" href="favicon/site.webmanifest">
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.1.17"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700&display=swap');
:root {
--bg-color: #0d0d0d;
--panel-bg: rgba(255, 255, 255, 0.03);
--flip-bg: #1a1a1a;
--flip-text: #e0e0e0;
--flip-radius: 12px;
--anim-speed: 0.6s;
--sep-color: #2a2a2a;
--text-main: #ffffff;
--text-dim: #666;
--unit-h: 90px;
--unit-w: 60px;
--font-sz: 65px;
}
body.light-theme {
--bg-color: #f5f5f7;
--panel-bg: rgba(0, 0, 0, 0.03);
--flip-bg: #ffffff;
--flip-text: #1d1d1f;
--sep-color: #d2d2d7;
--text-main: #1d1d1f;
--text-dim: #86868b;
}
@media (min-width: 768px) {
:root {
--unit-h: 160px;
--unit-w: 110px;
--font-sz: 120px;
}
}
/* Large Screen / Simulated Fullscreen sizing */
body.large-view {
--unit-h: 25vh !important;
--unit-w: 18vh !important;
--font-sz: 20vh !important;
--flip-radius: 24px !important;
}
body {
font-family: 'Inter', sans-serif;
background: var(--bg-color);
color: var(--text-main);
height: 100vh;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
transition: background 0.5s ease, color 0.5s ease;
}
.flip-unit {
position: relative;
width: var(--unit-w);
height: var(--unit-h);
margin: 0 2px;
border-radius: var(--flip-radius);
perspective: 1000px;
transition: width 0.3s ease, height 0.3s ease, box-shadow 0.3s ease;
}
.flip-unit.timer-finished {
box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
animation: shake 0.5s ease-in-out infinite;
}
@keyframes shake {
0%,
100% {
transform: translateX(0);
}
25% {
transform: translateX(-2px);
}
75% {
transform: translateX(2px);
}
}
@media (min-width: 768px) {
.flip-unit {
margin: 0 6px;
}
}
/* Plates */
.plate {
position: absolute;
left: 0;
width: 100%;
height: 50%;
background: var(--flip-bg);
overflow: hidden;
display: flex;
justify-content: center;
color: var(--flip-text);
transition: background 0.5s ease, color 0.5s ease;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translateZ(0);
backface-visibility: hidden;
}
.digit-text {
position: absolute;
width: 100%;
height: var(--unit-h);
line-height: var(--unit-h);
text-align: center;
font-size: var(--font-sz);
font-weight: 700 !important;
/* Force bold on both halves */
left: 0;
font-variant-numeric: tabular-nums;
transition: font-size 0.3s ease, line-height 0.3s ease;
}
.plate-top {
top: 0;
border-radius: var(--flip-radius) var(--flip-radius) 0 0;
z-index: 1;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.plate-top .digit-text {
top: 0;
}
.plate-bottom {
bottom: 0;
border-radius: 0 0 var(--flip-radius) var(--flip-radius);
z-index: 0;
}
.plate-bottom .digit-text {
top: 0;
transform: translateY(-50%);
}
/* The Animated Flap */
.flap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 50%;
transform-origin: bottom;
z-index: 3;
transform-style: preserve-3d;
pointer-events: none;
}
.flap.flipping {
animation: flip-down var(--anim-speed) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes flip-down {
0% {
transform: rotateX(0deg);
}
100% {
transform: rotateX(-180deg);
}
}
.flap-front,
.flap-back {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
overflow: hidden;
backface-visibility: hidden;
background: var(--flip-bg);
transition: background 0.5s ease;
transform: translateZ(0);
}
.flap-front {
z-index: 2;
border-radius: var(--flip-radius) var(--flip-radius) 0 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.flap-back {
transform: rotateX(180deg);
border-radius: 0 0 var(--flip-radius) var(--flip-radius);
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.flap-back .digit-text {
top: 0;
transform: translateY(-50%);
}
/* Navigation & UI */
.status-pill {
position: absolute;
top: 20px;
right: 20px;
font-size: 10px;
padding: 4px 8px;
border-radius: 20px;
background: var(--panel-bg);
color: var(--text-dim);
display: flex;
align-items: center;
gap: 4px;
z-index: 100;
}
.tab-button {
transition: all 0.2s ease;
opacity: 0.3;
color: var(--text-main);
font-weight: 700;
}
.tab-button.active {
opacity: 1;
}
.timer-input {
background: var(--flip-bg);
border: 2px solid var(--sep-color);
outline: none;
color: var(--text-main);
text-align: center;
border-radius: 12px;
width: 70px;
padding: 12px 0;
font-size: 1.6rem;
font-weight: 700;
transition: all 0.3s ease;
}
@media (min-width: 768px) {
.timer-input {
width: 100px;
font-size: 2.2rem;
}
}
.sep {
color: var(--sep-color);
display: flex;
flex-direction: column;
justify-content: center;
gap: 8px;
font-size: 24px;
transition: color 0.5s ease;
}
@media (min-width: 768px) {
.sep {
gap: 30px;
font-size: 60px;
}
}
#quote-container {
transition: opacity 0.6s ease;
max-width: 800px;
text-align: center;
min-height: 80px;
}
.hidden {
display: none !important;
}
.control-btn {
background: var(--panel-bg);
color: var(--text-dim);
padding: 8px;
border-radius: 50%;
transition: all 0.2s ease;
}
.control-btn:hover {
background: rgba(128, 128, 128, 0.15);
color: var(--text-main);
}
.control-btn.active {
color: #3b82f6;
background: rgba(59, 130, 246, 0.1);
}
/* Timer Finished Overlay */
#timer-overlay {
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(8px);
display: none;
opacity: 0;
transition: opacity 0.5s ease;
}
#timer-overlay.active {
display: flex;
opacity: 1;
}
.light-theme #timer-overlay {
background: rgba(255, 255, 255, 0.85);
}
.pulse-text {
animation: text-pulse 2s infinite ease-in-out;
}
@keyframes text-pulse {
0%,
100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.05);
opacity: 0.8;
}
}
</style>
</head>
<body>
<div id="wake-status" class="status-pill opacity-0 transition-opacity">
<span class="w-1.5 h-1.5 rounded-full bg-blue-500 animate-pulse"></span>
Stay Awake
</div>
<!-- Timer Finished Overlay -->
<div id="timer-overlay" class="fixed inset-0 z-[200] flex-col items-center justify-center text-center p-6">
<div class="space-y-6">
<div
class="w-20 h-20 bg-blue-600 rounded-full flex items-center justify-center mx-auto mb-4 animate-bounce">
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5"
stroke-linecap="round" stroke-linejoin="round">
<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
<path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
</svg>
</div>
<h2 class="text-4xl md:text-6xl font-bold tracking-tight pulse-text">Time's Up</h2>
<p class="text-gray-500 uppercase tracking-[0.3em] text-xs">Your countdown has finished</p>
<button onclick="dismissTimerOverlay()"
class="mt-8 bg-blue-600 hover:bg-blue-500 text-white px-12 py-4 rounded-full font-bold text-xs tracking-widest uppercase transition-all transform hover:scale-105 active:scale-95 shadow-xl">Dismiss</button>
</div>
</div>
<div id="main-panel" class="w-full max-w-6xl p-4 relative flex flex-col items-center">
<div class="flex items-center space-x-6 mb-12 z-20">
<div class="flex items-center space-x-2">
<button onclick="toggleLargeView()" id="btn-fullscreen" class="control-btn" title="Toggle Large View">
<svg id="fullscreen-icon" width="18" height="18" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<path
d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3">
</path>
</svg>
</button>
<button onclick="toggleTheme()" class="control-btn" title="Toggle Theme">
<svg id="theme-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2"></svg>
</button>
<button id="toggle-seconds" onclick="toggleSeconds()" class="control-btn active"
title="Show/Hide Seconds">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<polyline points="12 6 12 12 16 14"></polyline>
</svg>
</button>
</div>
<div class="flex space-x-10 text-[10px] font-bold uppercase tracking-[0.2em]">
<button onclick="showTab('clock')" id="tab-clock" class="tab-button active">Clock</button>
<button onclick="showTab('timer')" id="tab-timer" class="tab-button">Timer</button>
</div>
</div>
<div id="view-clock" class="flex flex-col items-center">
<div class="flex items-center" id="clock-digits"></div>
<div id="date-display"
class="mt-8 text-gray-500 font-medium tracking-[0.4em] uppercase text-[10px] md:text-xs"></div>
</div>
<div id="view-timer" class="hidden flex flex-col items-center">
<div class="flex items-center mb-12" id="timer-digits"></div>
<div id="timer-setup" class="flex flex-col items-center space-y-8">
<div class="flex items-center space-x-3 md:space-x-6">
<input type="number" id="input-hr" class="timer-input" value="00">
<div class="text-gray-400 font-bold">:</div>
<input type="number" id="input-min" class="timer-input" value="05">
<div class="text-gray-400 font-bold">:</div>
<input type="number" id="input-sec" class="timer-input" value="00">
</div>
<button onclick="startTimer()"
class="bg-blue-600 hover:bg-blue-500 text-white px-14 py-4 rounded-full font-bold text-xs tracking-widest uppercase transition-colors shadow-lg">Start
Timer</button>
</div>
<div id="timer-running" class="hidden flex space-x-4">
<button id="pause-btn" onclick="togglePause()"
class="bg-gray-500/20 text-current px-10 py-4 rounded-full text-xs tracking-widest uppercase">Pause</button>
<button onclick="stopTimer()"
class="bg-red-500/10 text-red-500 px-10 py-4 rounded-full text-xs tracking-widest uppercase border border-red-500/20">Reset</button>
</div>
</div>
<div id="quote-wrapper" class="mt-16 flex items-center group">
<button onclick="fetchQuote()" class="quote-nav-btn p-2" title="Previous Advice">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M15 18l-6-6 6-6" />
</svg>
</button>
<div id="quote-container" class="px-6">
<p id="quote-text" class="text-sm md:text-base lg:text-lg text-gray-500 italic font-light"></p>
<span id="quote-author"
class="block mt-2 text-[10px] lg:text-xs text-gray-400 uppercase tracking-widest"></span>
</div>
<button onclick="fetchQuote()" class="quote-nav-btn p-2" title="Next Advice">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M9 18l6-6-6-6" />
</svg>
</button>
</div>
</div>
<audio id="beep-sound" src="https://actions.google.com/sounds/v1/alarms/beep_short.ogg"></audio>
<script>
let showSeconds = true;
function createDigitHTML(id) {
return `
<div id="${id}" class="flip-unit">
<div class="plate plate-top"><div class="digit-text">0</div></div>
<div class="plate plate-bottom"><div class="digit-text">0</div></div>
<div class="flap">
<div class="flap-front plate-top"><div class="digit-text">0</div></div>
<div class="flap-back plate-bottom"><div class="digit-text">0</div></div>
</div>
</div>`;
}
const clockIds = ['c-h1', 'c-h2', 'c-m1', 'c-m2', 'c-s1', 'c-s2'];
const timerIds = ['t-h1', 't-h2', 't-m1', 't-m2', 't-s1', 't-s2'];
const clockContainer = document.getElementById('clock-digits');
const timerContainer = document.getElementById('timer-digits');
clockIds.forEach((id, i) => {
clockContainer.innerHTML += createDigitHTML(id);
if (i === 1) clockContainer.innerHTML += `<div id="sep-hm" class="sep"><div>•</div><div>•</div></div>`;
if (i === 3) clockContainer.innerHTML += `<div id="sep-ms" class="sep"><div>•</div><div>•</div></div>`;
});
timerIds.forEach((id, i) => {
timerContainer.innerHTML += createDigitHTML(id);
if (i === 1) timerContainer.innerHTML += `<div id="sep-t-hm" class="sep"><div>•</div><div>•</div></div>`;
if (i === 3) timerContainer.innerHTML += `<div id="sep-t-ms" class="sep"><div>•</div><div>•</div></div>`;
});
function flipTo(elementId, nextValue) {
const unit = document.getElementById(elementId);
if (!unit) return;
const topStatic = unit.querySelector('.plate-top .digit-text');
const bottomStatic = unit.querySelector('.plate-bottom .digit-text');
const flap = unit.querySelector('.flap');
const flapFront = unit.querySelector('.flap-front .digit-text');
const flapBack = unit.querySelector('.flap-back .digit-text');
const currentValue = bottomStatic.textContent;
if (currentValue === nextValue) return;
topStatic.textContent = nextValue;
flapFront.textContent = currentValue;
flapBack.textContent = nextValue;
flap.classList.remove('flipping');
requestAnimationFrame(() => {
requestAnimationFrame(() => {
flap.classList.add('flipping');
});
});
setTimeout(() => {
bottomStatic.textContent = nextValue;
}, 300);
}
function updateClock() {
const now = new Date();
const time = [
String(now.getHours()).padStart(2, '0'),
String(now.getMinutes()).padStart(2, '0'),
String(now.getSeconds()).padStart(2, '0')
].join('').split('');
clockIds.forEach((id, i) => {
if (showSeconds || i < 4) {
flipTo(id, time[i]);
}
});
document.getElementById('date-display').textContent = now.toLocaleDateString('en-US', { weekday: 'long', month: 'long', day: 'numeric' }).toUpperCase();
}
setInterval(updateClock, 1000);
updateClock();
function toggleSeconds() {
showSeconds = !showSeconds;
const btn = document.getElementById('toggle-seconds');
const clockSUnits = [document.getElementById('c-s1'), document.getElementById('c-s2'), document.getElementById('sep-ms')];
const timerSUnits = [document.getElementById('t-s1'), document.getElementById('t-s2'), document.getElementById('sep-t-ms')];
btn.classList.toggle('active', showSeconds);
clockSUnits.forEach(el => el.classList.toggle('hidden', !showSeconds));
timerSUnits.forEach(el => el.classList.toggle('hidden', !showSeconds));
updateClock();
refreshTimerUI();
}
let timerInt, timeLeft = 0, isPaused = false;
function startTimer() {
const h = parseInt(document.getElementById('input-hr').value) || 0;
const m = parseInt(document.getElementById('input-min').value) || 0;
const s = parseInt(document.getElementById('input-sec').value) || 0;
timeLeft = (h * 3600) + (m * 60) + s;
if (timeLeft <= 0) return;
document.getElementById('timer-setup').classList.add('hidden');
document.getElementById('timer-running').classList.remove('hidden');
isPaused = false;
runTimer();
}
function runTimer() {
clearInterval(timerInt);
timerInt = setInterval(() => {
if (!isPaused) {
timeLeft--;
refreshTimerUI();
if (timeLeft <= 0) {
clearInterval(timerInt);
handleTimerEnd();
}
}
}, 1000);
refreshTimerUI();
}
function handleTimerEnd() {
document.getElementById('beep-sound').play().catch(() => { });
document.getElementById('timer-overlay').classList.add('active');
timerIds.forEach(id => {
document.getElementById(id).classList.add('timer-finished');
});
}
function dismissTimerOverlay() {
document.getElementById('timer-overlay').classList.remove('active');
timerIds.forEach(id => {
document.getElementById(id).classList.remove('timer-finished');
});
stopTimer();
}
function refreshTimerUI() {
const h = Math.floor(timeLeft / 3600);
const m = Math.floor((timeLeft % 3600) / 60);
const s = Math.max(0, timeLeft % 60);
const timeStr = [String(h).padStart(2, '0'), String(m).padStart(2, '0'), String(s).padStart(2, '0')].join('').split('');
timerIds.forEach((id, i) => {
if (showSeconds || i < 4) {
flipTo(id, timeStr[i]);
}
});
}
function stopTimer() {
clearInterval(timerInt);
timeLeft = 0;
document.getElementById('timer-setup').classList.remove('hidden');
document.getElementById('timer-running').classList.add('hidden');
timerIds.forEach(id => {
flipTo(id, '0');
document.getElementById(id).classList.remove('timer-finished');
});
}
function togglePause() { isPaused = !isPaused; document.getElementById('pause-btn').textContent = isPaused ? 'Resume' : 'Pause'; }
function showTab(tab) {
document.getElementById('view-clock').classList.toggle('hidden', tab !== 'clock');
document.getElementById('view-timer').classList.toggle('hidden', tab !== 'timer');
document.getElementById('tab-clock').classList.toggle('active', tab === 'clock');
document.getElementById('tab-timer').classList.toggle('active', tab === 'timer');
}
async function fetchQuote() {
const container = document.getElementById('quote-container');
container.style.opacity = "0";
try {
const response = await fetch(`https://api.adviceslip.com/advice?t=${Date.now()}`);
if (!response.ok) throw new Error();
const data = await response.json();
setTimeout(() => {
document.getElementById('quote-text').textContent = `"${data.slip.advice}"`;
document.getElementById('quote-author').textContent = "— Daily Advice";
container.style.opacity = "1";
}, 600);
} catch (e) {
document.getElementById('quote-text').textContent = '"The two most powerful warriors are patience and time."';
document.getElementById('quote-author').textContent = "— Leo Tolstoy";
container.style.opacity = "1";
}
}
window.addEventListener('load', () => {
fetchQuote();
setInterval(fetchQuote, 60000);
});
function toggleLargeView() {
const isLarge = document.body.classList.toggle('large-view');
const btn = document.getElementById('btn-fullscreen');
const icon = document.getElementById('fullscreen-icon');
btn.classList.toggle('active', isLarge);
if (isLarge) {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen().catch(() => { });
}
icon.innerHTML = '<path d="M4 14h6v6M20 10h-6V4M14 20h-4v-6h6M10 4v6H4"></path>';
} else {
if (document.exitFullscreen && document.fullscreenElement) {
document.exitFullscreen().catch(() => { });
}
icon.innerHTML = '<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path>';
}
}
function updateThemeIcon() {
const icon = document.getElementById('theme-icon');
if (document.body.classList.contains('light-theme')) {
icon.innerHTML = '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>';
} else {
icon.innerHTML = '<path d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364-6.364l-.707.707M6.343 17.657l-.707.707m12.728 0l-.707-.707M6.343 6.343l-.707-.707M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z"></path>';
}
}
function toggleTheme() {
document.body.classList.toggle('light-theme');
updateThemeIcon();
}
function applySystemTheme() {
const prefersLight = window.matchMedia('(prefers-color-scheme: light)').matches;
document.body.classList.toggle('light-theme', prefersLight);
updateThemeIcon();
}
applySystemTheme();
</script>
</body>
</html>