-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
190 lines (174 loc) · 9.15 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
<!DOCTYPE html>
<html lang="en" ng-app="stPeter">
<head>
<meta charset="utf-8" />
<!-- local -->
<!-- <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css" /> -->
<!-- CDN -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css" />
<title>St. Petersburg Board Game</title>
<style>
/* until angular and all CSS is loaded */
[data-ng-cloak] {
display: none;
}
</style>
</head>
<body ng-controller="PeterCtrl as game">
<div id="rotate-container">
<p>Please rotate your device into landscape mode</p>
<div>
<span class="glyphicon glyphicon-phone grey-phone"></span>
<span class="glyphicon glyphicon-phone rotated-phone"></span>
</div>
</div>
<div id="main-container" data-ng-cloak>
<div ng-if="game.humanPlayerName">
<div id="deck-container">
<spb-deck ng-repeat="phase in game.phases"
phase-name="game.getPhaseName(phase)"
num-cards="game.decks[phase].length"
is-current-phase="game.isCurrentPhase(phase)">
</spb-deck>
</div>
<div id="scroll-down-notice">
<div uib-alert class="alert alert-info">
<strong>Heads Up!</strong>
<p>You'll have to scroll down to see everything on this device</p>
</div>
</div>
<div id="player-container">
<spb-player ng-repeat="player in game.players"
player="player"
is-turn="game.isPlayerTurn(player)"
on-play-card="game.playCard(card, player, collection)"
on-play-card-from-hand="game.playCardFromHand(card, player)">
</spb-player>
</div>
<div id="board-container" ng-if="!game.isGameOver">
<div class="inner-board-container">
<spb-board
cards="game.upperBoard"
current-player-is-human="game.getCurrentPlayer().isHuman"
on-buy-card="game.buyCard(card, collection)"
on-put-card-in-hand="game.putCardInHand(card, collection)"
name="'upper'"
human-player="game.getHumanPlayer()">
</spb-board>
<spb-board
cards="game.lowerBoard"
current-player-is-human="game.getCurrentPlayer().isHuman"
on-buy-card="game.buyCard(card, collection)"
on-put-card-in-hand="game.putCardInHand(card, collection)"
name="'lower'"
human-player="game.getHumanPlayer()">
</spb-board>
</div>
</div>
<div id="btn-container">
<div ng-if="!game.isGameOver">
<button type="button" class="btn btn-success"
ng-click="game.passTurn()"
ng-disabled="!game.getCurrentPlayer().isHuman">Next Turn (Pass)</button>
<button type="button" class="btn btn-primary"
ng-click="game.doRobotAction()"
ng-disabled="game.getCurrentPlayer().isHuman || game.aiIsWorking">
{{ game.aiIsWorking ? "Thinking..." : "AI Turn" }}
</button>
</div>
<div ng-if="game.isGameOver">
<button type="button" class="btn btn-success"
ng-click="game.newGame()">New Game</button>
</div>
</div>
</div>
<div ng-if="!game.humanPlayerName && !game.humanPlayerNameError">
Waiting for human player name...
</div>
<div ng-if="game.humanPlayerNameError" class="alert alert-danger">
<strong>Error!</strong> You must enter a name. Reload the page.
</div>
<footer>
<p>Simulation of the St Petersburg board game developed by <a href="https://kats.coffee/">Daniel Kats</a> in 2018. The rules can be found <a href="/spb_rules.pdf">here [PDF].</a>
</p>
</footer>
</div>
<script type="text/ng-template" id="upgradeModal.html">
<div class="modal-header">
<h3 class="modal-title">Pick a card to upgrade into {{ upgradeCard.name }}</h3>
</div>
<div class="modal-body">
<label for="upgradeCard">Pick the card to upgrade</label>
<select name="upgradeCard" ng-options="card as getCardString(card) for card in upgradableCards" ng-model="selected.card">
</select>
<div>Selected: {{ selected.card.name }}</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">OK</button>
<button class="btn btn-danger" ng-click="cancel()">Cancel</button>
</div>
</script>
<script type="text/ng-template" id="observatoryModal.html">
<div class="modal-header">
<h3 class="modal-title">Pick a deck to peek into</h3>
</div>
<div class="modal-body">
<label for="deck">Pick the deck to peek into</label>
<select name="deck" ng-options="phase for phase in phases" ng-model="selected.deck">
</select>
<div>Selected: {{ selected.deck }}</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">OK</button>
<button class="btn btn-danger" ng-click="cancel()">Cancel</button>
</div>
</script>
<script type="text/ng-template" id="peekingModal.html">
<div class="modal-header">
<h3 class="modal-title">Pick an action to perform</h3>
</div>
<div class="modal-body">
<div><label for="option">What do you want to do with your new card: {{ peekCard.name }}</label></div>
<select name="option" ng-options="option for option in options" ng-model="selected.option">
</select>
<div>Selected: {{ selected.option }}</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">OK</button>
</div>
</script>
<!-- CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.min.js"
integrity="sha256-VKITM616rVzV+MI3kZMNUDoY5uTsuSl1ZvEeZhNoJVk="
crossorigin="anonymous"></script>
<!-- Angular 1 for production -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js"></script>-->
<!-- Angular 1 for debugging -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ng-context-menu/1.0.2/ng-context-menu.min.js"></script>
<!-- dependency for angular-bootstrap -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular-animate.min.js" integrity="sha256-1XBp/KwjxhvrtZiQ+ecAScAyLPe4OStn2lMX0vxTq9U="
crossorigin="anonymous"></script>
<!-- this is currently used for tooltips -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/2.5.0/ui-bootstrap-tpls.min.js"></script>
<!-- local libraries (helpful for offline development) -->
<!-- <script src="node_modules/lodash/lodash.min.js"></script>
<script src="node_modules/angular/angular.js"></script>
<script src="node_modules/whatwg-fetch/fetch.js"></script> -->
<!--<script src="bower_components/ng-context-menu/dist/ng-context-menu.js"></script>-->
<!--<script src="bower_components/angular-ui-bootstrap/src/modal/modal.js"></script>-->
<script type="module">
import "./js/display.js";
</script>
<script type="module" src="js/angular-components/spb-deck.js"></script>
<!-- legacy directive -->
<script type="module" src="js/angular-directives/spb-card.js"></script>
<script type="module" src="js/angular-components/spb-player.js"></script>
<script type="module" src="js/angular-components/spb-board.js"></script>
<!-- new: component to replace legacy directive -->
<script type="module" src="js/angular-components/spb-card.js"></script>
</body>
</html>