-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgames.ejs
44 lines (43 loc) · 2.16 KB
/
games.ejs
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
<!doctype html>
<html xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<meta property="og:title" content="<%= gameName %> - A multiplayer game written in javascript using the HTML5 canvas, node.js, and Socket.IO"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://snakes.eric-wieser.tk/"/>
<meta property="og:description" content="A game for two (or more) players. Control the snakes with the arrow keys and WASD. Eat or be eaten!"/>
<meta property="og:image" content="http://eric-wieser.tk/images/snaps/snakes.png" />
<meta property="fb:admins" content="eric.wieser"/>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/style.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Dosis:300,600|Ubuntu" />
<title><%= gameName %> - A multiplayer game written in javascript using the HTML5 canvas, node.js, and Socket.IO</title>
</head>
<body>
<div id="games" class="vertical-center">
<div>
<div class="box">
<h1><%= gameName %> - game list</h1>
<ul class="games">
<% games.forEach(function(game) { %><li>
<a href="/games/<%= game.name %>">
<span class="name"><%= game.name %></span>
<span class="count"><%= game.connectedPlayerCount() + (game.connectedPlayerCount() == 1 ? " player" : " players") %></span>
<div class="score-bar inline">
<% game.scores().forEach(function(score) {%>
<div style="background-color: <%= score[2] %>; width: <%= score[1]/10 %>%" title="<%= score[0] %>"></div>
<% }); %>
</div>
</a>
</li><% }); %>
</ul>
<form id="new" class="one-box-form">
<button type="submit">Create a game</button>
<input id="name" placeholder="New game" autocomplete="off" autofocus="autofocus" />
</form>
<script>$('#new').submit(function() { location.pathname = 'games/' + $('#name').val(); return false; });</script>
<small>Type a name for your room above, and press Enter</small>
</div>
</div>
</div>
</body>
</html>