-
Notifications
You must be signed in to change notification settings - Fork 2
/
play.html
436 lines (424 loc) · 15.6 KB
/
play.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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<div id="match-heading" class="mt-4 text-primary h5 mx-0 mx-lg-5 px-2"></div>
<div class="mx-lg-5 px-2 mb-3">
<span>
<img src="assets/images/coin.png" width="20" height="20" alt="">
</span>
<span id="toss-win" class="mt-3"></span>
<span id="innings-indicator"></span>
</div>
<div class="shadow shadow-lg mx-0 mx-lg-5 px-3 py-2 mb-3" style="border-radius: 10px;">
<div class="row py-2">
<div class="col-12 fw-bold text-secondary mb-2" id="teamBatted">
<span id="teamBattedNameScoreWicket" class="h4"></span>
</div>
<div class="col-7 fw-bold text-success">
<span id="teamName" class="h4"></span>
<span id="scoreAndWicket" class="h4"></span>
</div>
<div class="text-end col-5 h4" id="showOver"></div>
<div class="col-12 mt-1">
<div class="alert alert-warning p-1" id="verdict"></div>
</div>
</div>
<div class="score-counter d-none">
<button type="button" class="btn rounded-circle btn-secondary m-2" onclick="regularRunsCount('0')">0</button>
<button type="button" class="btn rounded-circle btn-primary m-2" onclick="regularRunsCount('1')">1</button>
<button type="button" class="btn rounded-circle btn-primary m-2" onclick="regularRunsCount('2')">2</button>
<button type="button" class="btn rounded-circle btn-primary m-2" onclick="regularRunsCount('3')">3</button>
<button type="button" class="btn rounded-circle btn-success m-2" onclick="regularRunsCount('4')">4</button>
<button type="button" class="btn rounded-circle btn-purple m-2" onclick="regularRunsCount('6')">6</button>
<a href="javascript:void(0)" class="m-2 text-secondary fw-bold text-decoration-none" onclick="showHideRuns()"><i
class="fas fa-angle-double-right fa-2x"></i></a>
<button type="button" class="btn rounded-circle btn-dark m-2 d-none" id="fiveRun"
onclick="regularRunsCount('5')">5</button>
<button type="button" class="btn rounded-circle btn-dark m-2 d-none" id="sevenRun"
onclick="regularRunsCount('7')">7</button>
</div>
<div class="score-counter d-none my-3">
<button type="button" class="btn btn-primary m-2" data-bs-toggle="modal" data-bs-target="#bye">
Bye
</button>
<button type="button" class="btn btn-primary m-2" data-bs-toggle="modal" data-bs-target="#leg-bye">
Leg-Bye
</button>
<button type="button" class="btn btn-secondary m-2" onclick="wideBallModal()">
Wide ball
</button>
<button type="button" class="btn btn-warning m-2" onclick="noBallModal()">
No Ball
</button>
</div>
<div class="score-counter d-none my-1">
<button type="button" class="btn rounded-pill btn-danger m-2" onclick="dismiss('bowled')">Bowled</button>
<button type="button" class="btn rounded-pill btn-danger m-2" onclick="dismiss('lbw')">LBW</button>
<button type="button" class="btn rounded-pill btn-danger m-2" onclick="caughtOut()">Caught</button>
<button type="button" class="btn rounded-pill btn-danger m-2" onclick="stumpedOut()">Stumped</button>
<button type="button" class="btn rounded-pill btn-danger m-2" onclick="runOutModal()">Run Out</button>
<button type="button" class="btn rounded-pill btn-danger m-2" onclick="dismiss('hw')">Hit
Wicket</button>
</div>
<div class="shadow shadow-lg p-1 my-3">
<span class="h5">This over:</span>
<span class="p-2 my-3" id="over"></span>
</div>
<table class="table table-hover mt-3">
<thead>
<tr class="fw-bold">
<th>Bats.</th>
<th>R</th>
<th>B</th>
<th>0s</th>
<th>4s</th>
<th>6s</th>
<th>SR</th>
</tr>
</thead>
<tbody>
<tr id="batsman1"></tr>
<tr id="batsman2"></tr>
</tbody>
</table>
<table class="table table-hover">
<thead>
<tr class="fw-bold">
<th>Bowl.</th>
<th>O</th>
<th>M</th>
<th>R</th>
<th>W</th>
<th>Eco</th>
<!-- <th>0s</th>
<th>4s</th>
<th>6s</th>
<th>Wd</th>
<th>Nb</th> -->
</tr>
</thead>
<tbody>
<tr id="bowler"></tr>
</tbody>
</table>
<!-- <div class="score-counter d-none my-1 text-end">
<button type="button" class="btn rounded-pill btn-secondary m-2" onclick="undoState()"><i
class="fas fa-undo-alt"></i> Undo</button>
</div> -->
</div>
<div class="modal fade" tabindex="-1" id="no-ball">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">No ball</h5>
</div>
<div class="modal-body">
<div>
<label class="form-label text-success h5">Runs Taken:</label>
<select class="form-control" id="runsTaken_nb">
<option value="0" selected>No runs, simply a no-ball</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
</div>
<div class="mt-3 d-none" id="nb_runs_from_div">
<label class="form-label text-success h5">Runs from:</label>
<select class="form-control" id="runsFrom_nb">
<option value="bat" selected>bat</option>
<option value="bye">bye</option>
<option value="lb">leg-bye</option>
</select>
</div>
<div class="form-check form-switch mt-3">
<input class="form-check-input" type="checkbox" id="isRunOut">
<label class="form-check-label" for="isRunOut">Run out</label>
</div>
<div class="mt-3 d-none" id="nb_who_got_out_div">
<label class="form-label text-success h5">Who got out?</label>
<select class="form-control" id="whoGotOutOption_nb"></select>
</div>
<div class="mt-3 d-none" id="nb_on_which_end_div">
<label class="form-label text-success h5">On which end?</label>
<select class="form-control" id="onWhichEnd_nb">
<option value="keeperEnd">Keeper's end</option>
<option value="bowlerEnd">Bowler's end</option>
</select>
</div>
<div class="mt-3 d-none" id="nb_run_out_by">
<label class="form-label text-success h5">Run out by:</label>
<select class="form-control" id="runOutByOption_nb"></select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="noBallCount" data-bs-dismiss="modal"
onclick="noBall()">Set</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="bye">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Bye</h5>
</div>
<div class="modal-body">
<div class="form-check">
<input class="form-check-input" type="radio" name="b_rb" value="1" id="oneB" checked>
<label class="form-check-label" for="oneB">1b</label>
</div>
<div class="form-check mt-3">
<input class="form-check-input" type="radio" name="b_rb" value="2" id="twoB">
<label class="form-check-label" for="twoB">2b</label>
</div>
<div class="form-check mt-3">
<input class="form-check-input" type="radio" name="b_rb" value="3" id="threeB">
<label class="form-check-label" for="threeB">3b</label>
</div>
<div class="form-check mt-3">
<input class="form-check-input" type="radio" name="b_rb" value="4" id="fourB">
<label class="form-check-label" for="fourB">4b</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-bs-dismiss="modal" onclick="byeCount()">Set</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="leg-bye">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Leg Bye</h5>
</div>
<div class="modal-body">
<div class="form-check">
<input class="form-check-input" type="radio" name="lb_rb" value="1" id="oneLb" checked>
<label class="form-check-label" for="oneLb">1lb</label>
</div>
<div class="form-check mt-3">
<input class="form-check-input" type="radio" name="lb_rb" value="2" id="twoLb">
<label class="form-check-label" for="twoLb">2lb</label>
</div>
<div class="form-check mt-3">
<input class="form-check-input" type="radio" name="lb_rb" value="3" id="threeLb">
<label class="form-check-label" for="threeLb">3lb</label>
</div>
<div class="form-check mt-3">
<input class="form-check-input" type="radio" name="lb_rb" value="4" id="fourLb">
<label class="form-check-label" for="fourLb">4lb</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-bs-dismiss="modal"
onclick="legByeCount()">Set</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="caught-out">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Caught Out</h5>
</div>
<div class="modal-body">
<div>
<label class="form-label text-success h5">Who got out?</label>
<select class="form-control" id="whoGotOutOption_c"></select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">On which end?</label>
<select class="form-control" id="onWhichEnd_c">
<option value="keeperEnd">Keeper's end</option>
<option value="bowlerEnd">Bowler's end</option>
</select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">Caught by:</label>
<select class="form-control" id="caughtByOption"></select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="caughtBy" data-bs-dismiss="modal">Caught</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="run-out">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Run Out</h5>
</div>
<div class="modal-body">
<div>
<label class="form-label text-success h5">Runs taken:</label>
<select class="form-control" id="runsTaken_r">
<option value="0">No run</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</div>
<div class="mt-3 d-none" id="r_runs_from_div">
<label class="form-label text-success h5">Runs from:</label>
<select class="form-control" id="runsFrom_r">
<option value="bat">bat</option>
<option value="bye">bye</option>
<option value="lb">leg-bye</option>
</select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">Who got out?</label>
<select class="form-control" id="whoGotOutOption_r"></select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">On which end?</label>
<select class="form-control" id="onWhichEnd_r">
<option value="keeperEnd">Keeper's end</option>
<option value="bowlerEnd">Bowler's end</option>
</select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">Run-out by:</label>
<select class="form-control" id="runOutByOption_r"></select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="runOutBy" data-bs-dismiss="modal"
onclick="runOut()">Run-out</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="stumped-out">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Stumped By</h5>
</div>
<div class="modal-body">
<select class="form-control" id="stumpedByOption"></select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="stumpedBy" data-bs-dismiss="modal">Stumped</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="wide-ball">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Wide ball</h5>
</div>
<div class="modal-body">
<div>
<label class="form-label text-success h5">Bye runs:</label>
<select class="form-control" id="wide_byes">
<option value="0" selected>No byes, simply a wide</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">Dismissal?</label>
<select class="form-control" id="wide_dismissal">
<option value="no-wicket" selected>No dismissal, simply a wide</option>
<option value="run-out">Run out</option>
<option value="stumpting">Stumping</option>
<option value="hit-wicket">Hit wicket</option>
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-bs-dismiss="modal" onclick="wideBall()">Set</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="wide-ball-run-out">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Run out(Wide ball)</h5>
</div>
<div class="modal-body">
<div class="mt-3">
<label class="form-label text-success h5">Who got out?</label>
<select class="form-control" id="whoGotOutOption_wr"></select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">On which end?</label>
<select class="form-control" id="onWhichEnd_wr">
<option value="keeperEnd">Keeper's end</option>
<option value="bowlerEnd">Bowler's end</option>
</select>
</div>
<div class="mt-3">
<label class="form-label text-success h5">Run-out by:</label>
<select class="form-control" id="runOutByOption_wr"></select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="runOutBy_wr" data-bs-dismiss="modal"
onclick="wideAndRunOut()">Run-out</button>
</div>
</div>
</div>
</div>
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" id="new-batsman">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-body">
<div id="batting-modal-message" class="my-2"></div>
<div class="mt-3">
<label class="form-label text-success h5">Chose new batsman:</label>
<select class="form-control" id="newBatsman"></select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-bs-dismiss="modal" id="setnewBatsman">Set</button>
</div>
</div>
</div>
</div>
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" id="new-bowler">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Chose new bowler</h5>
</div>
<div class="modal-body">
<select class="form-control" id="newBowler"></select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-bs-dismiss="modal" id="setNewBowler">Set</button>
</div>
</div>
</div>
</div>
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" id="second-innings-modal">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-body">
<div id="second-innings-message" class="my-2 display-6"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-bs-dismiss="modal" id="proceed">Proceed</button>
</div>
</div>
</div>
</div>