-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (44 loc) · 1.34 KB
/
Copy pathindex.html
File metadata and controls
51 lines (44 loc) · 1.34 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
<html>
<head>
<style>
.centered {
position: fixed;
top: 50%;
left: 50%;
/* bring your own prefixes */
transform: translate(-50%, -50%);
text-align: center;
}
.countstyle {
font-size: 17.5rem;
}
.textstyle {
font-size: 8rem;
}
</style>
<script>
setInterval(function() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == XMLHttpRequest.DONE) {
if (xmlhttp.status == 200) {
document.getElementById("count").innerHTML = xmlhttp.responseText.replace('"', '').replace('"', '');
} else if (xmlhttp.status == 400) {
alert('There was an error 400');
} else {
alert('something else other than 200 was returned');
}
}
};
xmlhttp.open("GET", "/count", true);
xmlhttp.send();
}, 1000);
</script>
</head>
<body>
<div class="centered">
<span class="countstyle" id="count"></span><br/>
<span class="textstyle">person on coffee machine</span>
</div>
</body>
</html>