-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
96 lines (87 loc) · 2.01 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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Timer Display</title>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #f0f0f000;
font-family: system-ui;
}
.top-bar {
display: fixed;
position: absolute;
top: 1rem;
color: blue;
font-weight: 700;
}
.black-square {
width: 50vh;
height: 50vh;
background-color: black;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.content {
text-align: center;
}
.number {
font-size: 25vh;
color: white;
font-weight: bold;
}
.text {
font-size: 5vh;
color: white;
}
</style>
</head>
<body>
<div class="top-bar">
<div id="customerId"></div>
<div id="playerId"></div>
<div id="directorId"></div>
<div id="aspectRatio"></div>
</div>
<div class="black-square">
<div class="content">
<div class="number">5</div>
<div class="text">minutes</div>
</div>
</div>
</body>
</html>
<script>
const params = getUrlParams();
for (const [key, value] of Object.entries(params)) {
const element = document.getElementById(key);
if (element) {
element.innerText = key + ": " + value;
}
}
let value = 10;
setInterval(() => {
value--;
if (value < 1) value = 10;
document.querySelector(".number").innerHTML = value.toString();
}, 10000);
function getUrlParams() {
const params = new URLSearchParams(window.location.search);
let result = {};
for (let [key, value] of params.entries()) {
result[key] = value;
}
return result;
}
</script>