-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
127 lines (112 loc) · 4.87 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Lucky Roll</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
<link rel="stylesheet" href="src/styles.css">
</head>
<body ng-app="app" ng-controller="MainCtrl as vm">
<header>
<h1 class="text-center">Lucky Roll</h1>
</header>
<div class="container-fluid content">
<div ng-if="vm.showInitial" class="initial-screen mx-auto">
<h2 class="text-center">New game</h2>
<form class="form-initial">
<input ng-model="vm.player" type="text" id="name" class="form-control" placeholder="Enter your name" required="" autofocus="">
<br />
<button ng-click="vm.start()" class="btn btn-lg btn-primary btn-block" type="button">START</button>
</form>
</div>
<div ng-if="vm.showPlaying" class="playing-screen">
<div class="row" >
<div class="col-md-6 score">
<div class="row">
<div class="col-md-12">
<h3>{{vm.player}}</h3>
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th ng-repeat="i in [1,2,3,4,5,6,7,8,9,10]" scope="col">{{i}}</th>
</tr>
</thead>
<tbody>
<tr>
<td ng-repeat="frame in vm.frames">
<table class="table table-bordered">
<th >{{frame.roll1}}</td>
<th>{{frame.roll2}}</td>
<th ng-if="$index + 1 === vm.frames.length">{{frame.roll3}}</th>
</table>
</td>
</tr>
<tr>
<td ng-repeat="frame in vm.frames">
{{frame.total}}
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-12" ng-if="vm.showEndingGame">
<br>
<br>
<h3>Congratulations!</h3>
<p>The game has finished and your total score is {{vm.totalScore}}</p>
<button class="btn btn-primary" ng-click="vm.start()">Play again</button>
</div>
</div>
</div>
<div class="col-md-3">
<div class="board-wrap">
<div class="board">
<div class="pins">
<div class="row mx-auto">
<div class="col-sm-3"><span ng-show="vm.pinsVisible[9]" class="pin"></span></div>
<div class="col-sm-3"><span ng-show="vm.pinsVisible[8]" class="pin"></span></div>
<div class="col-sm-3"><span ng-show="vm.pinsVisible[7]" class="pin"></span></div>
<div class="col-sm-3"><span ng-show="vm.pinsVisible[6]" class="pin"></span></div>
</div>
<div class="row mx-auto pin-row-2">
<div class="col-sm-3"><span ng-show="vm.pinsVisible[5]" class="pin"></span></div>
<div class="col-sm-3"><span ng-show="vm.pinsVisible[4]" class="pin"></span></div>
<div class="col-sm-3"><span ng-show="vm.pinsVisible[3]" class="pin"></span></div>
</div>
<div class="row mx-auto">
<div class="col-sm-3 offset-sm-3"><span ng-show="vm.pinsVisible[2]" class="pin"></span></div>
<div class="col-sm-3"><span ng-show="vm.pinsVisible[1]" class="pin"></span></div>
</div>
<div class="row mx-auto">
<div class="col-sm-12"><span ng-show="vm.pinsVisible[0]" class="pin"></span></div>
</div>
</div>
</div>
<div id="ball">
<img src="src/ball.png" alt="">
</div>
<div class="roll">
<button ng-disabled="vm.rollDisabled" ng-click="vm.roll()" class="btn btn-primary">Roll !</button>
</div>
</div>
</div>
<div class="col-md-3">
<div class="row">
<div class="col-md-12">
<h3>Stats</h3>
<p>Last roll: {{vm.fallenPins}}</p>
<p>Remaining pins: {{vm.remainingPins}}</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="node_modules/angular/angular.js"></script>
<script src="src/game.js"></script>
<script src="src/app.js"></script>
</body>
</html>