-
Notifications
You must be signed in to change notification settings - Fork 0
/
lobby-index.html
63 lines (57 loc) · 2.42 KB
/
lobby-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
<html>
<head>
<meta charset="UTF-8">
<script src="/socket.io/socket.io.js"></script>
<script language="javascript" type="text/javascript" src="scripts/vendor/p5.js"></script>
<script language="javascript" type="text/javascript" src="scripts/vendor/p5.sound.js"></script>
<script language="javascript" type="text/javascript" src="scripts/coolor.js"></script>
<script language="javascript" type="text/javascript" src="scripts/sketch.js"></script>
<script language="javascript" type="text/javascript" src="scripts/square.js"></script>
<script src="/scripts/lobby.js"></script>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<link rel="stylesheet" type="text/css" href="css/lobby.css"/>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
</head>
<body>
<div id="lobby">
<div class="lobby-chooser">
<button class="btn game-room-btn" onclick="createPrivateRoom()">Create room</button>
<ul class="room-list" id="room-list"></ul>
</div>
</div>
<div class="container">
<div id="game-name"></div>
<div id="game">
<div class="sketch__text">
Cheese pieces left:
<span id="score__mouse"> </span>
</div>
<div class="status-container">
Mouse:
<div id="mouse-status" class="loader"></div>
</div>
<div class="status-container">
Cat:
<div id="cat-status" class="loader"></div>
</div>
<div class="controls">
<button onclick="goRight()" class="btn btn-arrows"> RIGHT </button>
<button onclick="goUp()" class="btn btn-arrows"> UP </button>
<button onclick="goLeft()" class="btn btn-arrows"> LEFT </button>
<button onclick="goDown()" class="btn btn-arrows"> DOWN </button>
</div>
<button onclick="commit()" class="btn btn-commit"> COMMIT </button>
</div>
</div>
<script type="text/javascript">
document.getElementById("room-list").addEventListener("click", function(e) {
e = e || window.event;
var target = e.target || e.srcElement, text = target.textContent || text.innerText;
if(target.tagName === 'LI'){
console.log(text)
joinGame(text);
}
});
</script>
</body>
</html>