-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (95 loc) · 3.18 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE HTML>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131200902-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-131200902-1');
</script>
<title>Is er een regering?</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<table cellpadding="0">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3">
<h1>JA</h1>
<p><span id="time"></span></p>
</td>
</tr>
<tr>
<td colspan="3">
<small><span id="time-elections"></span></small>
<h4>sinds VK2019</h4>
</td>
</tr>
</table>
<script lang="js">
var fallenSince = new Date("2019/09/30 8:30").getTime();
var election = new Date("2019/5/26 16:00").getTime();
function setElapsed() {
var elapsed = (Date.now() - fallenSince) / 1000;
let out = '';
let passed = Math.floor(elapsed / 86400);
if( passed >= 1 ) {
out += '<b>' + passed + '</b>';
out += passed == 1? 'dag': 'dagen ';
elapsed = elapsed % 86400;
}
passed = Math.floor(elapsed / 3600);
if( passed >= 1 ) {
out += '<b>' + passed + '</b>';
out += 'uur ';
elapsed = elapsed % 3600;
}
passed = Math.floor(elapsed / 60);
if( passed >= 1 ) {
out += '<b>' + passed + '</b>';
out += passed == 1? 'minuut': 'minuten ';
elapsed = elapsed % 60;
}
passed = Math.floor(elapsed);
out += '<b>' + passed + '</b>';
out += passed == 1? 'seconde': 'seconden';
document.getElementById('time').innerHTML = out;
}
function setElapsedElection() {
var elapsed = (fallenSince- election) / 1000;
let out = '';
let passed = Math.floor(elapsed / 86400);
if( passed >= 1 ) {
out += '<b>' + passed + '</b>';
out += passed == 1? 'dag': 'dagen ';
elapsed = elapsed % 86400;
}
passed = Math.floor(elapsed / 3600);
if( passed >= 1 ) {
out += '<b>' + passed + '</b>';
out += 'uur ';
elapsed = elapsed % 3600;
}
passed = Math.floor(elapsed / 60);
if( passed >= 1 ) {
out += '<b>' + passed + '</b>';
out += passed == 1? 'minuut': 'minuten ';
elapsed = elapsed % 60;
}
passed = Math.floor(elapsed);
out += '<b>' + passed + '</b>';
out += passed == 1? 'seconde': 'seconden';
document.getElementById('time-elections').innerHTML = out;
}
setElapsed();
setElapsedElection();
setInterval(setElapsed, 1000);
</script>
</body>
</html>