-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeDisplay.html
64 lines (51 loc) · 1.1 KB
/
timeDisplay.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
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: "IBM Plex Sans";
src: url("fonts/IBMPlexMono-Medium.ttf");
}
body {
font-family: "IBM Plex Sans";
}
p.disp {
color: #ffffff;
font-family: inherit;
margin: 0;
position: absolute;
}
</style>
<title>
</title>
<script>
dark = true;
function init() {
if (dark) {
document.body.style["background-color"] = "#101012";
} else {
document.body.style["background-color"] = "#ffffff";
}
lastTime = 0;
window.requestAnimationFrame(update);
}
function update(time) {
var deltaTime = time - lastTime;
lastTime = time;
{
let element = document.getElementById('mainTime');
const Xoffset = element.offsetWidth;
const Yoffset = element.offsetHeight;
element.style.left = (window.innerWidth - Xoffset) / 2 + "px";
element.style.top = (window.innerHeight - Yoffset) / 2 + "px";
// element.style.font-size =
}
window.requestAnimationFrame(update);
}
document.addEventListener("DOMContentLoaded", init);
</script>
</head>
<body>
<p id="mainTime" class="disp mainTime">00:00</p>
</body>
</html>