forked from DLu/ros_clock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
64 lines (54 loc) · 1.97 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
<html>
<head>
<meta charset="utf-8" />
<title>ROS Clock</title>
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P&display=swap" rel="stylesheet">
<link href="terminal.css" rel="stylesheet">
<script src="info.js"></script>
<script src="countdown.js"></script>
</head>
<body>
<h1>ROS Clock</h1>
<div id="contents"></div>
<script>
function update()
{
updateDict();
var contents = document.getElementById("contents");
contents.innerHTML = '';
for (key in timing)
{
var entry = timing[key];
var row = document.createElement('div');
row.setAttribute('class', "row " + entry["status"]);
contents.appendChild(row);
var head = document.createElement('span');
head.setAttribute('class', 'distro')
head.appendChild(document.createTextNode(key));
row.appendChild(head);
row.appendChild(document.createTextNode(entry["status"]));
if (entry["status"] != "expired")
{
row.appendChild(document.createElement('br'));
var countdown = document.createElement('span');
countdown.setAttribute('class', 'countdown')
countdown.appendChild(document.createTextNode('Time Remaining: '));
countdown.appendChild(document.createTextNode(deltaToString(entry["delta"])));
row.appendChild(countdown);
if (entry["status"] == "future")
{
row.appendChild(document.createElement('br'));
var countdown = document.createElement('span');
countdown.setAttribute('class', 'countdown')
countdown.appendChild(document.createTextNode('Time to Release: '));
countdown.appendChild(document.createTextNode(deltaToString(entry["release"])));
row.appendChild(countdown);
}
}
}
}
setInterval(update, 1000);
update();
</script>
</body>
</html>