-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgames.html
86 lines (73 loc) · 2.41 KB
/
games.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
<!DOCTYPE HTML>
<html>
<head>
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/styles.css" rel="stylesheet">
<title>Fooseball Display</title>
</head>
<body>
<div id="scores" class="container">
<div class="row">
<div class="col-sm-12">
<h2>Previous Saved Games</h2>
</div>
</div>
<div class="row">
<ul id="score-list">
</ul>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.velocity.min.js"></script>
<script src="/js/velocity.ui.min.js"></script>
<script src="/js/scores.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var socket = io.connect();
socket.on('connect', function () {
console.log("connected!!");
socket.emit('status', 'Display connected');
});
socket.on('gamescores', function(data){
console.log(data);
$.each( data, function( key, value ) {
var scoreItem = '<li>\
<h4>'+value["gameDate"]+'</h4>\
<table class="table table-condensed">\
<thead>\
<tr>\
<th>Players</th>\
<th>Scores</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>\
<img id="blue-player-1" src="http://avatars.io/instagram/'+value["bluePlayer1"]+'" class="img-circle" width="32px" height="32px" rel=""> '+value["bluePlayer1"]+'\
<img id="blue-player-1" src="http://avatars.io/instagram/'+value["bluePlayer2"]+'" class="img-circle" width="32px" height="32px" rel=""> '+value["bluePlayer2"]+'\
</td>\
<td>'+value["bluepoints"]+'</td>\
</tr>\
<tr>\
<td>\
<img id="blue-player-1" src="http://avatars.io/instagram/'+value["redPlayer1"]+'" class="img-circle" width="32px" height="32px" rel=""> '+value["redPlayer1"]+'\
<img id="blue-player-1" src="http://avatars.io/instagram/'+value["redPlayer2"]+'" class="img-circle" width="32px" height="32px" rel=""> '+value["redPlayer2"]+'\
</td>\
<td>'+value["redpoints"]+'</td>\
</tr>\
</tbody>\
</table>\
</li>'
$('#score-list').append(scoreItem);
console.log(key + ": " + value["redpoints"]);
});
// console.log(data);
// scores = data
// $(".data").html(scores);
});
});
</script>
</body>
</html>