-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
265 lines (192 loc) · 11.4 KB
/
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<!DOCTYPE html>
<html lang="en">
<head>
<title>dotBox</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/start/jquery-ui.min.css">
<link rel="stylesheet" href="css/dotBox.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!--Page Header -->
<div class="jumbotron">
<div class="container">
<h1>DotBox</h1>
<p>A game of dots, lines, and boxes.</p>
</div>
</div>
<!-- This will contain the DotBox game canvas when the game is started -->
<div id="canvasContainer" class="container"></div>
<!-- Main UI container for and Options -->
<div class="container" id="mainContainer">
<!-- Shows the rules of the game -->
<div class="page-header">
<h1>Rules</h1>
<ul>
<li>Each turn connects a line by clicking two adjacent dots.</li>
<li>Score a box after connecting the fourth side.</li>
<li>When you score you get a free turn.</li>
<li>Player who scored most boxes wins.</li>
</ul>
</div>
<!-- Form controls for Game Options -->
<div class="page-header">
<!-- Triggers a new game -->
<button id="newGameBtn" type="button"
class="btn btn-primary pull-right">New Game
</button>
<h2>Game Options</h2>
<!-- Main panel for game options -->
<div class="panel panel-default">
<div class="panel-body">
<div id="globalError" class="alert alert-danger alert-dismissable hidden">
<button type="button" class="close" aria-hidden="true">×</button>
<b>Oh snap!</b> You need to fix your error(s) before you start a <strong>New Game</strong>.
</div>
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="playerMode" class="col-sm-3 control-label">Play as</label>
<div class="col-sm-4">
<select class="form-control" id="playerMode" data-bind="value: playerMode">
<option value="pvc">Player vs Computer</option>
<option value="pvp">Player vs Player</option>
</select>
</div>
</div>
<div class="form-group" data-bind="css: {'has-error has-feedback': !isP1NameValid()}">
<label for="p1Name"
class="col-sm-3 control-label">Player Name</label>
<div class="col-sm-4">
<input type="text" id="p1Name" class="form-control"
data-bind="value: playerName1, valueUpdate: 'afterkeydown'">
<span class="glyphicon glyphicon-remove form-control-feedback hidden" data-bind="css {hidden: isP1NameValid()}"></span>
</div>
</div>
<div class="form-group hidden" data-bind="css {hidden: isP1NameValid()}">
<div class="col-sm-7">
<div class="alert alert-danger"><b>Player Name</b> must be between 1 and 10 characters.</div>
</div>
</div>
<div class="form-group" data-bind="visible: useAi() == false, css: {'has-error has-feedback': !isP2NameValid()}">
<label for="p2Name"
class="col-sm-3 control-label">2nd Player Name</label>
<div class="col-sm-4">
<input type="text" id="p2Name" class="form-control"
data-bind="value: playerName2, valueUpdate: 'afterkeydown'" >
<span class="glyphicon glyphicon-remove form-control-feedback hidden" data-bind="css {hidden: isP2NameValid()}"></span>
</div>
</div>
<div class="form-group hidden" data-bind="css {hidden: isP2NameValid()}">
<div class="col-sm-7">
<div class="alert alert-danger"><b>2nd Player Name</b> must be between 1 and 10 characters.</div>
</div>
</div>
<div class="form-group">
<label for="dotColCount" class="col-sm-3 control-label">Game Size</label>
<div class="col-sm-4 sliderWrapper" >
<div id="slider" data-bind="slider: uiScale, sliderOptions: {min: 1.0, max: 2.5, range: 'min', step: 0.01}"></div>
</div>
</div>
<div class="form-group" data-bind="css: {'has-error has-feedback': !isDotColsValid()}">
<label for="dotColCount" class="col-sm-3 control-label">Num. of Columns</label>
<div class="col-sm-2">
<input type="number" id="dotColCount"
class="form-control" data-bind="value: dotCols, valueUpdate: 'afterkeydown'">
</div>
</div>
<div class="form-group hidden" data-bind="css: {hidden: isDotColsValid()}">
<div class="col-sm-7">
<div class="alert alert-danger"><b>Num. of Columns</b> is required and must be between 6 and 20.</div>
</div>
</div>
<div class="form-group" data-bind="css: {'has-error has-feedback': !isDotRowsValid()}">
<label for="dotRowCount" class="col-sm-3 control-label">Num. of Rows</label>
<div class="col-sm-2">
<input type="number" id="dotRowCount"
class="form-control" data-bind="value: dotRows, valueUpdate: 'afterkeydown'">
</div>
</div>
<div class="form-group hidden" data-bind="css: {hidden: isDotRowsValid()}">
<div class="col-sm-7">
<div class="alert alert-danger"><b>Num. of Rows</b> is required and must be between 3 and 20.</div>
</div>
</div>
<div class="form-group fgQuickGame">
<div class="col-sm-3">
<div class="checkbox">
<label>
<input type="checkbox" data-bind="checked: quickGame"> <b>Quick Game</b>
</label>
</div>
</div>
</div>
<div class="form-group" data-bind="visible: quickGame, css: {'has-error has-feedback': !isFillPercentValid()}">
<label for="fillPercent" class="col-sm-3 control-label">Fill Percent %</label>
<div class="col-sm-2">
<input type="number" id="fillPercent"
class="form-control" data-bind="value: fillPercent, valueUpdate: 'afterkeydown'">
</div>
</div>
<div class="form-group hidden" data-bind="css: {hidden: isFillPercentValid()}">
<div class="col-sm-7">
<div class="alert alert-danger"><b>Fill Percent %</b> is required and must be between 1 and 100.
</div>
</div>
</div>
<div class="qg-hint">
<div class="bs-callout bs-callout-info ">
<h4>Quick Game</h4>
<p>Randomly connects a percentage of the lines to make
the game shorter and get to the fun part quicker.
Use <b>Fill %</b> to control the percentage of lines
that are connected before the game starts.
</p>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Message for Canvas failure -->
<div class="container hidden" id="failContainer">
<div class="bs-callout bs-callout-danger">
<h4>#BrowserFail</h4>
<p>Your browser doesn't support the HTML5 Canvas element. Try updating to a modern browser like Chrome.
</p>
<a href="https://www.google.com/intl/en/chrome/browser/" class="btn btn-primary btn-lg" role="button">Download Chrome</a>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="lib/jquery.ui.touch-punch.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-3.0.0.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="http://code.createjs.com/createjs-2013.09.25.min.js"></script>
<script src="lib/dotBox-min.js"></script>
<!--<script src="lib/Observer-1.0.2.js" ></script>-->
<!--<script src="src/dotBox.utility.js"></script>-->
<!--<script src="src/dotBox.utility.line.js"></script>-->
<!--<script src="src/dotBox.utility.iterators.js"></script>-->
<!--<script src="src/dotBox.boxState.js"></script>-->
<!--<script src="src/dotBox.lineState.js"></script>-->
<!--<script src="src/dotBox.gameEngine.js"></script>-->
<!--<script src="src/dotBox.model.js"></script>-->
<!--<script src="src/dotBox.views.constants.js"></script>-->
<!--<script src="src/dotBox.views.viewContext.js"></script>-->
<!--<script src="src/dotBox.views.Color.js"></script>-->
<!--<script src="src/dotBox.views.board.js"></script>-->
<!--<script src="src/dotBox.views.score.js"></script>-->
<!--<script src="src/dotBox.views.gameOver.js"></script>-->
<!--<script src="src/dotBox.ai.utility.js"></script>-->
<!--<script src="src/dotBox.ai.AiPlayer.js"></script>-->
<!--<script src="src/dotBox.ai.AvoidThirdSide.js"></script>-->
<!--<script src="src/dotBox.ai.SingleBoxCloser.js"></script>-->
<!--<script src="src/dotBox.controller.js"></script>-->
<!--<script src="src/dotBox.game.js" ></script>-->
<!--<script src="src/dotBox.viewModel.js" ></script>-->
<!--<script src="src/dotBox.ko.js" ></script>-->
<!--<script src="src/app.js"></script>-->
</body>
</html>