-
Notifications
You must be signed in to change notification settings - Fork 6
/
banned.html
56 lines (48 loc) · 1.47 KB
/
banned.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
<!DOCTYPE html>
<html lang="en">
<head>
<style>
html {
background-color: black;
}
body {
text-align: center;
color: white;
font-family: sans-serif;
}
div {
margin-top: 25vh;
}
</style>
</head>
<body>
<div>
<h1>You have been banned from InfiniCanvas</h1>
<h2>You will be unbanned in:</h2>
<h3 id="duration"></h3>
</div>
<script>
var banEnd = __USER_BAN_DURATION_;
var h3 = window.document.getElementById('duration');
if (banEnd == Infinity) {
h3.innerHTML = 'never';
} else {
(loop = function () {
var now = new Date().getTime();
var remaining = banEnd - now;
if (remaining <= 0) window.location.reload(true);
else requestAnimationFrame(loop);
var o = {
day: ~~(remaining / 86400000),
hour: ~~(remaining / 3600000) % 24,
minute: ~~(remaining / 60000) % 60,
second: ~~(remaining / 1000) % 60,
}
var str = '';
for (var t in o)
if (o[t]) str += o[t] + ' ' + (o[t] == 1 ? t : t + 's') + ', ';
h3.innerHTML = (str ? str.replace(/, ([^,]*)$/, '').replace(/, ([^,]*)$/, ` and $1`) : 'less than a second');;
})();
}
</script>
</body>