-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (70 loc) · 3.03 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
<!DOCTYPE html>
<html ng-app="4InARow">
<head>
<title>4 In A Row Tic-Tac-Toe</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min.js"></script>
<script src="http://cdn.firebase.com/v0/firebase.js"></script>
<script src="http://cdn.firebase.com/libs/angularfire/0.3.0/angularfire.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="js/app.js"></script>
<script src="js/defaults.js"></script>
<script src="js/controllers/app_controller.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet">
</head>
<body ng-controller="AppController">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">4 In a Row</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#" ng-click="newGame()">New Game</a></li>
<li><a href="#" ng-click="clearMatrix()">Start Over</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
<div class="container" style="margin-top: 75px;" ng-hide="inProgress()">
<p>To join a game, enter it's code, or leave it empty and hit the button to start a new game. The other player can use the code to join your game.</p>
<p>
<input ng-model="newGameCode"> <button ng-click="newGame()" class="btn btn-xs btn-primary">Start Game</button>
</p>
</div>
<div class="container" style="margin-top: 75px;" ng-show="inProgress()">
<div class="alert alert-success" ng-show="hasWinner()">{{game.winner}} is the winner!</div>
<div class="jumbotron">
<div class="row">
<div class="col-md-2">
I'm <select ng-model="myColor">
<option value="white"></option>
<option>red</option>
<option>blue</option>
</select>
</div>
<div class="col-md-2">
Turn: <span ng-style="{'color': game.turn}">{{game.turn}}</span>
</div>
<div class="col-md-4">
Game Code: {{gameCode}}
</div>
</div>
<table>
<tr ng-repeat="row in game.matrix">
<td ng-repeat="cell in row" ng-style="{'background-color': cell.color}"
ng-click="makeMove(myColor,$parent.$index,$index)"></td>
</tr>
</table>
</div>
</div>
</body>
</html>