-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (43 loc) · 1.5 KB
/
index.html
File metadata and controls
43 lines (43 loc) · 1.5 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HexClock</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
<style>
body {
font-family: "Inter", Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
width: 100%;
margin: 0;
}
#clock {
font-size: 2.5rem;
color: #ffffff;
justify-content: center;
}
</style>
<script>
function updateClock() {
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
const hexColor = `#${hours}${minutes}${seconds}`;
document.body.style.backgroundColor = hexColor;
document.getElementById('clock').textContent = hexColor;
}
setInterval(updateClock, 1000);
window.onload = updateClock;
</script>
</head>
<body style="background-color: #000000;">
<div id="clock">#000000</div>
</body>
</html>