forked from Yeti-Robotics/angular-scouting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcasino.html
265 lines (258 loc) · 10.7 KB
/
casino.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
<script>
$(document).ready(function () {
$('#byteCoinsWagered').slider({
formatter: function (value) {
return 'Byte Coins: ' + value;
},
tooltip: 'hide'
});
$('#withenPoints').slider({
formatter: function (value) {
return 'Withen Points: ' + value;
},
tooltip: 'hide'
});
$('#pointsPredicted').slider({
formatter: function (value) {
return 'Minumum Points: ' + value;
},
tooltip: 'hide'
});
});
</script>
<div id="match-modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="close"><span>×</span></button>
<h4 class="modal-title">Future Matches</h4>
</div>
<div class="modal-body">
<div class="table-responsive">
<table class="table">
<tr>
<th class="text-center">#</th>
<th class="text-center danger" colspan="3">Red Alliance</th>
<th class="text-center info" colspan="3">Blue Alliance</th>
</tr>
<tr ng-repeat="match in Schedule" ng-click="selectMatch(match)" role="button">
<td class="text-center">{{match.matchNumber}}</td>
<td class="text-center danger">{{match.Teams[0].teamNumber}}</td>
<td class="text-center danger">{{match.Teams[1].teamNumber}}</td>
<td class="text-center danger">{{match.Teams[2].teamNumber}}</td>
<td class="text-center info">{{match.Teams[3].teamNumber}}</td>
<td class="text-center info">{{match.Teams[4].teamNumber}}</td>
<td class="text-center info">{{match.Teams[5].teamNumber}}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="confirm-wager-modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="confirm-header modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button><span style="color:white;">Confirm</span>
</div>
<div class="modal-body">
<label for="wageredByteCoins">How many ByteCoins would you like to wager? </label>
<div ng-show="manuallyEnterByteCoins">
<input class="form-control" type="number" ng-model="currentWager.wageredByteCoins">
</div>
<div class="row" ng-show="!manuallyEnterByteCoins">
<div class="col-xs-7">
<input id="byteCoinsWagered" type="number" data-slider-min="0" data-slider-step="1" data-slider-value="0" name="wageredByteCoins" data-slider-handle="custom" ng-model="currentWager.wageredByteCoins" />
</div>
<div class="col-xs-4">
<span class="slider-value">{{currentWager.wageredByteCoins}} Byte Coins</span>
</div>
</div>
<div style="margin-top: .5vh; margin-bottom: .5vh">
<button class="btn center-block btn-info" type="button" ng-click="toggleManualByteCoins()">
<span ng-show="!manuallyEnterByteCoins">Manually enter Byte Coins to wager</span>
<span ng-show="manuallyEnterByteCoins">Enter Byte Coins with the slider</span>
</button>
</div>
<div class="table-responsive">
<table class="table table-hover table-condensed table-bordered">
<tbody>
<tr>
<td>Byte Coins this wager would cost you:</td>
<td>{{currentWager.wageredByteCoins}}</td>
</tr>
<tr>
<td>Multiplier (calculated from your wager type):</td>
<td>{{currentWager.getMultiplier()}}</td>
</tr>
<tr>
<td>Byte Coins this wager could win you:</td>
<td>{{currentWager.getValue()}}</td>
</tr>
<tr>
<td>Net Byte Coin profit:</td>
<td>{{currentWager.getValue() - currentWager.wageredByteCoins}}</td>
</tr>
<tr>
<td>Byte Coins left after wager:</td>
<td>{{byteCoins - currentWager.wageredByteCoins}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="sendWager()">Send Wager</button>
</div>
</div>
</div>
</div>
<h1 class="text-center" ng-show="!settings.enableCasino">Wagering is currently disabled</h1>
<div class="container-fluid" ng-show="settings.enableCasino">
<fieldset>
<legend>Your Byte Coins: {{byteCoins}}</legend>
<div class="btn-group btn-group-vertical center-block" data-toggle="buttons">
<label class="btn btn-primary" ng-click="currentWager.wagerType = 'alliance'">Predict a match winner
<input class="ng-hide" type="radio" value="alliance">
</label>
<label class="btn btn-primary" ng-click="currentWager.wagerType = 'closeMatch'">Predict a close game
<input class="ng-hide" type="radio" value="closeMatch">
</label>
<label class="btn btn-primary" ng-click="currentWager.wagerType = 'points'">Predict minimum points in a match
<input class="ng-hide" type="radio" value="points">
</label>
</div>
</fieldset>
<br/>
<fieldset ng-show="currentWager.wagerType === 'alliance'">
<legend>Make a wager on an alliance!</legend>
<label for="match">What match do you want to wager for?</label>
<button class="btn btn-block btn-primary" type="button" data-toggle="modal" data-target="#match-modal">Choose a match</button>
<div ng-show="selectedMatch != false">
<table class="table">
<tr class="primary">
<td colspan="7" class="text-center">Selected Match</td>
</tr>
<tr>
<th class="text-center">#</th>
<th class="text-center danger" colspan="3">Red Alliance</th>
<th class="text-center info" colspan="3">Blue Alliance</th>
</tr>
<tr>
<td class="text-center">{{selectedMatch.number}}</td>
<td class="text-center danger">{{selectedMatch.red[0]}}</td>
<td class="text-center danger">{{selectedMatch.red[1]}}</td>
<td class="text-center danger">{{selectedMatch.red[2]}}</td>
<td class="text-center info">{{selectedMatch.blue[0]}}</td>
<td class="text-center info">{{selectedMatch.blue[1]}}</td>
<td class="text-center info">{{selectedMatch.blue[2]}}</td>
</tr>
</table>
</div>
<br/>
<label for="alliancePredicted">Who do you think will win?</label>
<div class="btn-group btn-group-justified" data-toggle="buttons">
<div class="btn-group" role="group">
<label class="btn btn-danger" ng-click="currentWager.alliancePredicted = 'red'">Red Alliance
<input class="ng-hide" type="radio" ng-click="currentWager.alliancePredicted">
</label>
</div>
<div class="btn-group" role="group">
<label class="btn btn-primary" ng-click="currentWager.alliancePredicted = 'blue'">Blue Alliance
<input class="ng-hide" type="radio" ng-model="currentWager.alliancePredicted">
</label>
</div>
</div>
</fieldset>
<fieldset ng-show="currentWager.wagerType === 'closeMatch'">
<legend>Predict a close game</legend>
<label for="match">What match do you want to wager for?</label>
<button class="btn btn-block btn-primary" type="button" data-toggle="modal" data-target="#match-modal">Choose a match</button>
<div ng-show="selectedMatch != false">
<table class="table">
<tr class="primary">
<td colspan="7" class="text-center">Selected Match</td>
</tr>
<tr>
<th class="text-center">#</th>
<th class="text-center danger" colspan="3">Red Alliance</th>
<th class="text-center info" colspan="3">Blue Alliance</th>
</tr>
<tr>
<td class="text-center">{{selectedMatch.number}}</td>
<td class="text-center danger">{{selectedMatch.red[0]}}</td>
<td class="text-center danger">{{selectedMatch.red[1]}}</td>
<td class="text-center danger">{{selectedMatch.red[2]}}</td>
<td class="text-center info">{{selectedMatch.blue[0]}}</td>
<td class="text-center info">{{selectedMatch.blue[1]}}</td>
<td class="text-center info">{{selectedMatch.blue[2]}}</td>
</tr>
</table>
</div>
<br/>
<label for="pointsWithen">How many points do you think the alliances will be within?</label>
<div class="row">
<div class="col-xs-7">
<input id="withenPoints" type="text" data-slider-min="0" data-slider-handle="custom" data-slider-max="51" data-slider-step="1" data-slider-value="0" name="pointsWithen" ng-model="currentWager.withenPoints" />
</div>
<div class="col-xs-4">
<span class="slider-value">{{currentWager.withenPoints}} Points</span>
</div>
</div>
</fieldset>
<fieldset ng-show="currentWager.wagerType === 'points'">
<legend>Wager on minimum points scored</legend>
<label for="match">What match do you want to wager for?</label>
<button class="btn btn-block btn-primary" type="button" data-toggle="modal" data-target="#match-modal">Choose a match</button>
<div ng-show="selectedMatch != false">
<table class="table">
<tr class="primary">
<td colspan="7" class="text-center">Selected Match</td>
</tr>
<tr>
<th class="text-center">#</th>
<th class="text-center danger" colspan="3">Red Alliance</th>
<th class="text-center info" colspan="3">Blue Alliance</th>
</tr>
<tr>
<td class="text-center">{{selectedMatch.number}}</td>
<td class="text-center danger">{{selectedMatch.red[0]}}</td>
<td class="text-center danger">{{selectedMatch.red[1]}}</td>
<td class="text-center danger">{{selectedMatch.red[2]}}</td>
<td class="text-center info">{{selectedMatch.blue[0]}}</td>
<td class="text-center info">{{selectedMatch.blue[1]}}</td>
<td class="text-center info">{{selectedMatch.blue[2]}}</td>
</tr>
</table>
</div>
<br/>
<label for="pointsPredicted">Points the alliance will score</label>
<div class="row">
<div class="col-xs-7">
<input id="pointsPredicted" data-slider-id='pointsPredictedSlider' type="text" data-slider-min="109" data-slider-handle="custom" data-slider-max="301" data-slider-step="1" data-slider-value="100" name="pointsPredicted" ng-model="currentWager.minPointsPredicted" />
</div>
<div class="col-xs-4">
<span class="slider-value">{{currentWager.minPointsPredicted}} Points</span>
</div>
</div>
<label for="alliancePredicted">Which alliance?</label>
<div class="btn-group btn-group-justified" data-toggle="buttons">
<div class="btn-group" role="group">
<label class="btn btn-danger" ng-click="currentWager.alliancePredicted = 'red'">Red Alliance
<input class="ng-hide" type="radio" ng-click="currentWager.alliancePredicted">
</label>
</div>
<div class="btn-group" role="group">
<label class="btn btn-primary" ng-click="currentWager.alliancePredicted = 'blue'">Blue Alliance
<input class="ng-hide" type="radio" ng-model="currentWager.alliancePredicted">
</label>
</div>
</div>
</fieldset>
<br>
<div ng-show="currentWager.wagerType">
<button class="btn btn-primary btn-block" type="button" data-toggle="modal" data-target="#confirm-wager-modal">Make wager</button>
</div>
</div>