-
Notifications
You must be signed in to change notification settings - Fork 7
/
oldham-bingo.html
73 lines (72 loc) · 1.66 KB
/
oldham-bingo.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
<head>
<title>Oldham Bingo</title>
</head>
<body>
{{> homepage }}
</body>
<template name="homepage">
<h1>Let's Play Some Bingo!</h1>
{{#if not_signed_in}}
{{> signin}}
{{else}}
<div id="bingo-board-container">
{{> board}}
</div>
<div id="right-column">
{{#if winner}}
{{winner.username}} has won!
<div id="new-game-button">Play Again?</div>
{{/if}}
{{> chat}}
{{> scoreboard}}
</div>
{{/if}}
</template>
<template name="scoreboard">
<div id="scoreboard-container">
<h2>Current Players:</h2>
<ul>
{{#each players}}
<li>{{this.username}}<span class="num_squares">{{this.num_squares}} ({{this.num_bingo}} needed)</span></li>
{{/each}}
</ul>
</div>
</template>
<template name="chat">
<div id="scoreboard-container">
<h2>Chat:</h2>
<form action='#'>
<input type='text' id='chat_message' />
<input type='submit' value='>' id='chat_message_submit'/>
</form>
<ul>
{{#each messages}}
<li><b>{{this.user}}</b>: {{this.msg}}</li>
{{/each}}
</ul>
</div>
</template>
<template name="winner">
</template>
<template name="signin">
<div id="signin-container">
<form id="signin_form">
Your Name:
<input id="signin_username" type="text" />
<input id="signin_button" type="submit" value="Achieve Compilers Nirvana" />
</form>
</div>
</template>
<template name="board">
<table id="bingo-board">
<tbody>
{{#each rows}}
<tr>
{{#each cols}}
<td id="{{id}}" {{#if acquired}} class="acquired" {{/if}}>{{text}}</td>
{{/each}}
</tr>
{{/each}}
</tbody>
</table>
</template>