-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
297 lines (283 loc) · 12.6 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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<head>
<link rel="icon" href="img/favicon.ico">
<link rel="stylesheet" href="css/style.css">
<title>NextGen Scoring</title>
</head>
<body>
<div id = "app">
<!-- Menu Buttons -->
<div id="menubuttons">
<a href="./mainmenu.html">Back to the Main Menu</a>
<a class="help" onclick="help()">Help</a>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span id="closeModal" class="close">×</span>
<h1>HELP MENU: GAMETIME INPUT CODES AND KEYS</h1>
<h3>FIELD GOAL CODES</h3>
<p>J - 2- or 3- point shot</br>
Y - 3-point shot</br>
D - Dunk</br>
L - Layup</br>
P - Tip-in</br>
W - Wrong basket (defensive team scores in offensive team basket)
</p>
<h3>NON-FIELD GOAL CODES</h3>
<p>E - Free Throw</br>
K - Block</br>
R - Rebound</br>
T - Turnover</br>
A - Assist</br>
S - Steal</br>
F - Foul</br>
O - Timeout
</p>
<h3>RESULT CODES</h3>
<p>G or Q - Good field goal (2- or 3-pointer)</br>
Y - Good 3-point field goal</br>
R - Missed field goal (followed by a rebound)</br>
X - Missed 3-point field goal (followed by a rebound)</br>
K - Missed field goal (due to a blocked shot)</br>
P - Made field goal in the paint</br>
F - Made field goal on a fast break</br>
Z - Made field goal in the paint on a fast break</br>
E - Made free throw
</p>
<h3>SPECIAL KEYS</h3>
<p>H or V - Select the home team or the visiting team</br>
C - Change time, period, stats</br>
F2 - Make "quick" roster changes to player numbers and names</br>
F6 - Make player substitutions</br>
F7 - Change the clock time</br>
F10 - Clear and do not complete any partially keyed action</br>
SPACEBAR - Start or Stop the Clock</br>
ESC - Return to Main Menu
</p>
</div>
</div>
</div>
<!-- SCORE BAR AND CLOCK -->
<div id = "scorebar">
<div id = "home">
<div class = "fouls">
<div class = "fouls-top">
<h3 class = "fouls">Fouls</h3>
<h3 class = "fouls">{{ home_fouls }}</h3>
</div>
<div class = "fouls-bottom">
<h4 class = "fouls">Full: {{ home_full }}</h4>
<h4 class = "fouls">Partial: {{ home_partial }}</h4>
</div>
</div>
<div class = "score">
<h2 class = "score" id="homescoreshowhide">Home</h2>
<h2 class = "score">{{ home_score }}</h2>
</div>
</div>
<div class = "clock" id="clockdiv">
<!--<h2 class = "clock" id = "clockh2" onclick="launchClockPrompt()">20:00</h2>-->
<span onclick="launchClockPrompt()" id = "clockminutes">20</span><span onclick="launchClockPrompt()" id = "clockseparator">:</span><span onclick="launchClockPrompt()" id = "clockseconds">00</span>
<h2 class = "clock" onclick="launchClockPrompt()"> {{ period }}</h2>
<h3 class = "clock" id="clockisstopped">**Clock is stopped**</h3>
</div>
<div id = "visitor">
<div class = "score">
<h2 class = "score" id="visitorscoreshowhide">Visitor</h2>
<h2 class = "score">{{ vis_score }}</h2>
</div>
<div class = "fouls">
<div class = "fouls-top">
<h3 class = "fouls">Fouls</h3>
<h3 class = "fouls">{{ vis_fouls }}</h3>
</div>
<div class = "fouls-bottom">
<h4 class = "fouls">Full: {{ vis_full }}</h4>
<h4 class = "fouls">Partial: {{ vis_partial }}</h4>
</div>
</div>
</div>
</div> <!-- end scorebar div -->
<!-- Stats -->
<div id = "playerstats">
<!--<div id = "app">-->
<div id = "ps-home">
<h2 id = "pshometeamname" class="playteam">{{ teams[0] }}</h2>
<table class="playerstatstable" cellpadding="3">
<tr>
<th>IN</th> <!-- "*" if in game -->
<th>##</th> <!-- player number -->
<th>--Name--</th> <!-- player name -->
<th>FG</th> <!-- field goals -->
<th>FA</th> <!-- field goal attempts -->
<th>3M</th> <!-- 3 pointer made -->
<th>3A</th> <!-- 3 pointer attempts -->
<th>FT</th> <!-- free throw made -->
<th>FTA</th> <!-- free throw attempted -->
<th>RB</th> <!-- rebound -->
<th>AS</th> <!-- assist -->
<th>TO</th> <!-- turnovers -->
<!-- note: steals are not displayed due to space (visual layout, not memory) constraints -->
<th>PF</th> <!-- personal foul -->
<th>TP</th> <!-- total points -->
</tr>
<tr v-for="player in home_team">
<td>{{ player.in_game }}</td>
<td>{{ player.number }}</td>
<td>{{ player.name }}</td>
<td>{{ player.fg }}</td>
<td>{{ player.fa }}</td>
<td>{{ player.m3 }}</td>
<td>{{ player.a3 }}</td>
<td>{{ player.ftm }}</td>
<td>{{ player.fta }}</td>
<td>{{ player.rb_off + player.rb_def }}</td>
<td>{{ player.as }}</td>
<td>{{ player.to }}</td>
<td>{{ player.pf }}</td>
<td>{{ player.tp }}</td>
</tr>
<tr>
<td>{{ home_totals.in_game }}</td>
<td>{{ home_totals.number }}</td>
<td>{{ home_totals.name }}</td>
<td>{{ home_totals.fg }}</td>
<td>{{ home_totals.fa }}</td>
<td>{{ home_totals.m3 }}</td>
<td>{{ home_totals.a3 }}</td>
<td>{{ home_totals.ftm }}</td>
<td>{{ home_totals.fta }}</td>
<td>{{ home_totals.rb_off + home_totals.rb_def }}</td>
<td>{{ home_totals.as }}</td>
<td>{{ home_totals.to }}</td>
<td>{{ home_totals.pf }}</td>
<td>{{ home_totals.tp }}</td>
</tr>
</table>
<home_team_stats></home_team_stats>
</div>
<!--</div> -->
<div id = "ps-visitor">
<h2 id = "psvisitorteamname" class="playteam">{{ teams[1] }}</h2>
<table class="playerstatstable" cellpadding="3">
<tr>
<th>IN</th> <!-- "*" if in game -->
<th>##</th> <!-- player number -->
<th>--Name--</th> <!-- player name -->
<th>FG</th> <!-- field goals -->
<th>FA</th> <!-- field goal attempts -->
<th>3M</th> <!-- 3 pointer made -->
<th>3A</th> <!-- 3 pointer attempts -->
<th>FT</th> <!-- free throw made -->
<th>FTA</th> <!-- free throw attempted -->
<th>RB</th> <!-- rebound -->
<th>AS</th> <!-- assist -->
<th>TO</th> <!-- turnovers -->
<th>PF</th> <!-- personal foul -->
<th>TP</th> <!-- total points -->
</tr>
<tr v-for="player in vis_team">
<td>{{ player.in_game }}</td>
<td>{{ player.number }}</td>
<td>{{ player.name }}</td>
<td>{{ player.fg }}</td>
<td>{{ player.fa }}</td>
<td>{{ player.m3 }}</td>
<td>{{ player.a3 }}</td>
<td>{{ player.ftm }}</td>
<td>{{ player.fta }}</td>
<td>{{ player.rb_off + player.rb_def }}</td>
<td>{{ player.as }}</td>
<td>{{ player.to }}</td>
<td>{{ player.pf }}</td>
<td>{{ player.tp }}</td>
</tr>
<tr>
<td>{{ vis_totals.in_game }}</td>
<td>{{ vis_totals.number }}</td>
<td>{{ vis_totals.name }}</td>
<td>{{ vis_totals.fg }}</td>
<td>{{ vis_totals.fa }}</td>
<td>{{ vis_totals.m3 }}</td>
<td>{{ vis_totals.a3 }}</td>
<td>{{ vis_totals.ftm }}</td>
<td>{{ vis_totals.fta }}</td>
<td>{{ vis_totals.rb_off + vis_totals.rb_def }}</td>
<td>{{ vis_totals.as }}</td>
<td>{{ vis_totals.to }}</td>
<td>{{ vis_totals.pf }}</td>
<td>{{ vis_totals.tp }}</td>
</tr>
</table>
<vis_team_stats></vis_team_stats>
<!-- <p>FG%: 0.000 3FG%: 0.000 FT%: 0.000</p>
<p>TEAM: TURNOVERS: 00 BLOCKS: 00 STEALS: 00</p>
<p>paint: 00 offto: 00 2ndch: 00 fastb: 00</p>-->
</div>
</div> <!-- end stats div -->
<div id = "inputmodal">
<input id = "userinput" type = "text" name = "userinput" autofocus>
<h3 id = "inputvalidator">Enter input...</h3>
</div>
<!-- Play By Play -->
<div id = "playbyplaybox">
<h2>Play-by-Play</h2>
<table cellpadding="3">
<tr>
<th>Time</th>
<th>Team</th>
<th>Play</th>
<th>Score (Home-Visitor)</th>
</tr>
<tr v-for="play in playlist">
<td>{{ play.time }}</td>
<td class="playteam">{{ play.team }}</td>
<td>{{ play.playdscrp }}</td>
<td>{{ play.score }}</td>
</tr>
</table>
</div><!-- end play by play div -->
</div> <!-- end app div -->
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script src="js/easytimer.min.js"></script>
<script src="js/jquery.min.js"></script>
<script>
//Keep clock functionality on the frontend
// Uses EasyTimer.js from Github https://albert-gonzalez.github.io/easytimer.js/
var timer = new Timer();
timer.start({countdown: true, startValues: {seconds: 1200}});
timer.pause();
var paused = true;
$('#clockdiv #clockh2').html(timer.getTimeValues().toString());
timer.addEventListener('secondsUpdated', function (e) {
//$('#clockdiv #clockh2').html(timer.getTimeValues().toString());
$('#clockdiv #clockminutes').html(timer.getTimeValues().minutes);
if(timer.getTimeValues().seconds < 10) {
$('#clockdiv #clockseconds').html('0' + timer.getTimeValues().seconds); // add leading zero because EasyTimer doesn't do it :-/
} else {
$('#clockdiv #clockseconds').html(timer.getTimeValues().seconds);
}
});
timer.addEventListener('targetAchieved', function (e) {
//$('#clockdiv #clockh2').html('00:00');
$('#clockdiv #clockminutes').html('00');
$('#clockdiv #clockseconds').html('00');
});
document.body.onkeyup = function(e){
if(e.keyCode == 32){ // used to have && e.target == document.body but with the new user input methods we had to remove it
if(paused) {
timer.start();
paused = false;
$("#clockisstopped").toggle();
} else {
timer.pause();
paused = true;
$("#clockisstopped").toggle();
}
}
}
</script>
</body>
</html>