-
Notifications
You must be signed in to change notification settings - Fork 0
/
appledrtimer.html
44 lines (38 loc) · 1.31 KB
/
appledrtimer.html
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
<style>
body {
color: #ffffff;
font-size: 48px;
font-family: monospace;
}
#overlay {
text-align: center;
}
</style>
<div id="overlay">
<div>STREAMED FOR:</div>
<div class="time">
<div id="hours">Calculating...</div>
<div id="minutes">Calculating...</div>
<div id="seconds">Calculating...</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const hours = document.getElementById('hours');
const minutes = document.getElementById('minutes');
const seconds = document.getElementById('seconds');
const targetDate = new Date(Date.UTC(2024, 5, 28, 13, 30, 0));
function updateTimeDifference() {
const now = new Date();
const difference = now - targetDate;
const hours = Math.floor(difference / (1000 * 60 * 60));
const minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((difference % (1000 * 60)) / 1000);
hours.textContent = hours + 'h';
minutes.textContent = minutes + 'm';
seconds.textContent = seconds + 's';
}
setInterval(updateTimeDifference, 200);
updateTimeDifference();
});
</script>