-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (60 loc) · 2.09 KB
/
index.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cranleigh Lockdown</title>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center;
color:#fff;
background-color: #0c223f;
transition: background-color 1s ease-in-out;
}
#countdown {
font-size: 2em;
margin: 20px;
}
#lockdownMessage {
font-size: 2em;
margin: 20px;
color: #ffffff;
display: none;
}
</style>
</head>
<body>
<h1 id="lockdownHeader">Lockdown is coming</h1>
<div id="countdown"></div>
<div id="lockdownMessage" style="color:#fff;">LOCKDOWN</div>
<script>
// Function to update the countdown
function updateCountdown() {
const currentTime = new Date();
const targetTime = new Date(currentTime);
// Set target time to 10 AM today
targetTime.setHours(10, 0, 0, 0);
// Calculate the time difference
let timeDiff = targetTime - currentTime;
let hours = Math.floor(timeDiff / (1000 * 60 * 60));
let minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
// Display the countdown
document.getElementById('countdown').innerHTML = `${hours}h ${minutes}m ${seconds}s`;
// If the countdown reaches 0, trigger lockdown
if (timeDiff <= 0) {
document.body.style.backgroundColor = '#ff0000'; // Red background
document.getElementById('lockdownMessage').style.display = 'block';
document.getElementById('lockdownHeader').innerHTML = 'Lockdown is here!';
document.getElementById('countdown').style.display = 'none';
clearInterval(countdownInterval);
}
}
// Update the countdown every second
const countdownInterval = setInterval(updateCountdown, 1000);
// Initial update
updateCountdown();
</script>
</body>
</html>