-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (39 loc) · 873 Bytes
/
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
<html>
<head>
<title>Score memes</title>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
}
ul {
margin: 20px;
font-size: 16px;
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<ul>
<li>
<strong>Wins: </strong>
<span id="wins">0</span>
</li>
<li>
<strong>Losses: </strong>
<span id="losses">0</span>
</li>
</ul>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io();
var wins = document.getElementById('wins');
var losses = document.getElementById('losses');
socket.on('update', function(scores) {
wins.innerText = scores.wins.toLocaleString();
losses.innerText = scores.losses.toLocaleString();
});
</script>
</body>
</html>