-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCODE_MAIN
45 lines (43 loc) · 997 Bytes
/
CODE_MAIN
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time Toggle Button</title>
<style>
.clock {
display: block;
font-size: 2rem;
text-align: center;
}
.hidden {
display: none;
}
</style>
</head>
<body>
<button onclick="toggleClock()">Toggle Time</button>
<div class="clock" id="clock">Loading...</div>
<script>
function toggleClock() {
var clock = document.getElementById("clock");
if (clock.classList.contains("hidden")) {
clock.classList.remove("hidden");
updateTime();
} else {
clock.classList.add("hidden");
}
}
function updateTime() {
var clock = document.getElementById("clock");
clock.innerText = new Date().toLocaleTimeString();
setTimeout(updateTime, 1000);
}
</script>
</body>
</html>
<script>
setTimeout(function() {
alert("If there are any ideas or bugs, let me know at Nana HQ");
}, Math.floor(Math.random() * (26180 - 10000 + 1)) + 10000);
</script>