-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (64 loc) · 1.61 KB
/
Copy pathindex.html
File metadata and controls
68 lines (64 loc) · 1.61 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bomb Timer</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<style>
.bomb {
margin-top: 150px;
text-align: center;
}
.match {
margin-top: 70px;
text-align: center;
}
.bomb h1 {
font-size: 10em;
}
</style>
</head>
<body>
<div class="bomb">
<h3>BOMB TIMER:</h3>
<h1><span class="c4timer">40</span></h1>
</div>
<div class="match">
<h2 class="gamestats">I am currently not in CS:GO.</h2>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.min.js"></script>
<script>
var initTick = 0;
var count = 40000;
var delay = 20;
function now() {
return window.performance ? window.performance.now() : Date.now();
}
function tick() {
var remaining = (count - (now() - initTick)) / 1000;
remaining = remaining >= 0 ? remaining : 0;
var secs = remaining.toFixed(2);
document.title = secs;
$('.c4timer').html(secs);
if (remaining) {
setTimeout(tick, delay);
} else {
document.title = "Bomb Timer";
$('.c4timer').html("*BOOM*");
}
}
</script>
<script>
var socket = io('http://127.0.0.1:1337');
socket.on('update', function(payload) {
var data = JSON.parse(payload);
console.log(payload);
if (data['timer'] == 'start') {
initTick = now();
setTimeout(tick, delay);
}
$('.gamestats').html(data['gamestring']);
});
</script>
</body>
</html>