-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
45 lines (45 loc) · 1.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
@import url('https://fonts.googleapis.com/css2?family=Dosis:wght@500&display=swap');
html {
height: 100%;
}
body {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: dimgrey;
}
.date , .time {
color:gainsboro;
font-weight: bolder;
font-family: 'Dosis', sans-serif;
font-size: 4rem;
}
</style>
<title>HI!</title>
</head>
<body>
<div class="date"></div>
<div class="time"></div>
<script src="./node_modules/luxon/build/global/luxon.min.js"></script>
<script>
window.onload = function() {
let tick = () => {
let date = luxon.DateTime.local().toFormat('yyyy/MM/dd')
let time = luxon.DateTime.local().toFormat('HH:mm:ss')
document.querySelector('.date').textContent = date
document.querySelector('.time').textContent = time
}
tick()
setInterval(tick, 1000)
}
</script>
</body>
</html>