Repository navigation
Expand file tree
/
Copy pathclock.html
More file actions
70 lines (64 loc) · 1.55 KB
/
Copy pathclock.html
File metadata and controls
70 lines (64 loc) · 1.55 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Visual Clock</title>
<style>
* {
box-sizing: border-box;
}
body {
background: url('giyu-tomioka-5120x2880-23653.jpg') no-repeat center center fixed;
background-size: cover;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
color: #fff;
font-family: 'Poppins', sans-serif;
}
}
.clock {
text-align: center;
padding: 20px 40px;
border: 2px solid #00ffff;
border-radius: 20px;
box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
}
#time {
font-size: 4em;
letter-spacing: 2px;
}
#date {
font-size: 1.3em;
opacity: 0.8;
}
</style>
</head>
<body>
<div class="clock">
<div id="time"></div>
<div id="date"></div>
</div>
<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 day = now.toLocaleDateString(undefined, {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
});
document.getElementById("time").textContent = `${hours}:${minutes}:${seconds}`;
document.getElementById("date").textContent = day;
}
setInterval(updateClock, 1000);
updateClock();
</script>
</body>
</html>