-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
65 lines (63 loc) · 2.24 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
<!DOCTYPE html>
<html>
<head>
<title>Feed</title>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<div id="round-overlay"></div>
<template id="round-template">
{{#if map}}
{{#equals map.mode "competitive"}}
<div class="game-info">
<div class="outer-mask">
<div class="inner-mask">
<div class="content">Game Info</div>
</div>
</div>
<div class="data border">
<div class="score">
<div class="t text-color {{#equals player.team 'T'}} highlight {{/equals}}">T</div>
<span>{{ map.team_t.score }}</span>
<span class="text-color"> - </span>
<span>{{ map.team_ct.score }}</span>
<div class="ct text-color {{#equals player.team 'CT'}} highlight {{/equals}}">CT</div>
</div>
<div class="box3rd border text-color">K</div>
<div class="box3rd border text-color">A</div>
<div class="box3rd border text-color">D</div>
<div class="box3rd border">{{ player.match_stats.kills }}</div>
<div class="box3rd border">{{ player.match_stats.assists }}</div>
<div class="box3rd border">{{ player.match_stats.deaths }}</div>
<div class="clr"></div>
</div>
</div>
{{/equals}}
{{/if}}
</template>
<script src="/socket.io/socket.io.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"></script>
<script>
Handlebars.registerHelper('equals', function(a, b, opts) {
if(a == b) // Or === depending on your needs
return opts.fn(this);
else
return opts.inverse(this);
});
var socket = io();
var steamid = "76561197984143124";
socket.on('data', function(data) {
console.log(data);
if (data.player.activity == "menu")
steamid = data.player.steamid;
if (data.player.steamid == steamid) {
var source = $("#round-template").html();
var template = Handlebars.compile(source);
$('#round-overlay').html(template(data));
}
});
</script>
</body>
</html>