forked from mikejed/CocoNuts-Scouting
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
557 lines (503 loc) · 26.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
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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
<!DOCTYPE html>
<html>
<head>
<title>2486 - Coconuts Scouting</title>
<script src="assets/jquery-3.6.1.min.js"></script>
<script src="assets/bootstrap.min.js"></script>
<script src="assets/qrcode.min.js"></script>
<script src="sw.js"></script>
<link rel="stylesheet" href="assets/bootstrap.min.css">
<style>
body {
touch-action: manipulation;
}
label {
font-weight: bold;
margin-top: 1rem;
}
.form-label {
margin-bottom: 0.1rem;
}
.form-check label {
font-weight: normal;
margin-top: auto;
}
.btn-huge {
--bs-btn-padding-y: 3rem;
--bs-btn-padding-x: 3rem;
--bs-btn-font-size: 5rem;
}
input.input-lg {
font-size: xx-large;
text-align: center;
}
.btn-big {
--bs-btn-padding-y: 1rem;
--bs-btn-padding-x: 1rem;
--bs-btn-font-size: 2rem;
}
#qrcode img {
display: inline-block !important;
margin: 2rem 0rem;
}
#modalQRCode img {
margin:auto;
border: 1rem solid white;
}
body{
background-color:white;
color:black;
}
.Dark{
background-color: rgb(31, 31, 31) !important;
color:azure !important;
.card.bg-light { background-color:rgb(0, 0, 0) !important; }
input,select,textarea { background-color: rgb(86, 86, 86) !important; color: rgb(255, 255, 255) !important; }
}
.Spirit{
background-color: rgb(143, 0, 0) !important;
color:rgb(150, 150, 0) !important;
.card.bg-light { background-color:rgb(109, 1, 1) !important; }
input,select,textarea { background-color: rgb(255, 244, 89) !important; color: rgb(0, 0, 0) !important; }
}
.Plasma{
background-color: rgb(86, 0, 136) !important;
color:rgb(255, 255, 255) !important;
.card.bg-light { background-color:rgb(57, 0, 74) !important; }
input,select,textarea { background-color: rgb(43, 0, 60) !important; color: rgb(255, 255, 255) !important; }
}
.load{
background-color: black;
color:azure;
}
</style>
</head>
<body>
<form>
<!--Old dark mode stuff-->
<!--@media (prefers-color-scheme: dark) { body { background-color:rgb(30, 0, 57); color:azure; } .card.bg-light { background-color:rgb(120, 0, 134) !important; } input,select,textarea { background-color: rgb(46, 46, 46) !important; color: azure !important; } .modal-content { background-color:rgb(87, 87, 87) } }-->
<div class="container">
<div class="row"><!--Formating--></div>
<div class="row">
<div class="col-md">
<!--This creates a button that loads the latest verion of the app for some reason-->
<button onclick="myFunction()">Load Newest Version</button>
<script>
function MyFunction(){
var reset = document.body;
element.classList.toggle("reset-mode")
}
</script>
</div>
<!--This makes a button that resets the form. The col text-end makes it on the right side of the screen-->
<div class="col text-end">
<input type="reset" value="Reset all fields" onClick="javascript:$('body').removeClass('was-validated');">
</div>
</div>
<!--These change the colors of the form making different themes. It runs a function
that sets the colors in the style section above-->
<div class ="col text-center">
<div class="row-md">
<input type="button" value="Cobra Mode" onclick="Dark()"/>
<script>
function Dark() {
var element = document.body;
element.classList.toggle("Dark")
}
</script>
</div>
<div class="col-md">
<div class="row-md">
<div class="col-md">
<input type="button" value="CocoNuts Mode" onclick="Spirit()"/>
<script>
function Spirit() {
var element = document.body;
element.classList.toggle("Spirit")
}
</script>
</div>
<div class="row-md">
<input type="button" value="Plasma Mode" onclick="Plasma()"/>
<script>
function Plasma() {
var element = document.body;
element.classList.toggle("Plasma")
}
</script>
</div>
</div>
</div>
</div>
<!--This is the part of the form that the data is recorded in variables-->
<div class="row">
<div class="col-md">
<!--These are the team numbers and corrasponding names in the drop down menu-->
<label for="TeamNumber-input" class="form-label">Team Number</label>
<select class="form-control" id="TeamNumber-input" required
onchange="$('#TeamName-input').val(this.options[this.selectedIndex].dataset.teamname);">
<option disabled selected value="">(select team)</option>
<!-- Change team numbers here -->
<option value="176" data-teamname="Aces High">176</option>
<option value="177" data-teamname="Bobcat Robotics">177</option>
<option value="245" data-teamname="Adambots">245</option>
<option value="324" data-teamname="Chips">324</option>
<option value="343" data-teamname="Metal-In-Motion">343</option>
<option value="424" data-teamname="Rust Belt Robotics">424</option>
<option value="461" data-teamname="Westside Boiler Invasion">461</option>
<option value="539" data-teamname="Titan Robotics">539</option>
<option value="548" data-teamname="Robostangs">548</option>
<option value="670" data-teamname="Homestead Robotics">670</option>
<option value="829" data-teamname="The Digital Goats">829</option>
<option value="862" data-teamname="Lightning Robotics">862</option>
<option value="868" data-teamname="TechHOUNDS">868</option>
<option value="876" data-teamname="Thunder Robotics">876</option>
<option value="971" data-teamname="Spartan Robotics">971</option>
<option value="987" data-teamname="HIGHROLLERS">987</option>
<option value="1023" data-teamname="Bedford Express">1023</option>
<option value="1153" data-teamname="Timberwolves">1153</option>
<option value="1241" data-teamname="THEORY6">1241</option>
<option value="1285" data-teamname="The Biggest Birds">1285</option>
<option value="1296" data-teamname="Full Metal Jackets">1296</option>
<option value="1540" data-teamname="Flaming Chickens">1540</option>
<option value="1577" data-teamname="Steampunk">1577</option>
<option value="1676" data-teamname="The Pascack PI-oneers">1676</option>
<option value="1732" data-teamname="Hilltopper Robotics">1732</option>
<option value="1807" data-teamname="Redbird Robotics">1807</option>
<option value="1923" data-teamname="The MidKnight Inventors">1923</option>
<option value="2056" data-teamname="OP Robotics">2056</option>
<option value="2122" data-teamname="Team Tators">2122</option>
<option value="2337" data-teamname="EngiNERDs">2337</option>
<option value="2468" data-teamname="Team Appreciate">2468</option>
<option value="2486" data-teamname="CocoNuts">2486</option>
<option value="2637" data-teamname="Phantom Catz">2637</option>
<option value="2638" data-teamname="Rebel Robotics">2638</option>
<option value="2714" data-teamname="BBQ">2714</option>
<option value="2826" data-teamname="Wave Robotics">2826</option>
<option value="3005" data-teamname="RoboChargers">3005</option>
<option value="3018" data-teamname="Nordic Storm">3018</option>
<option value="3322" data-teamname="Eagle Evolution">3322</option>
<option value="3464" data-teamname="Sim-City">3464</option>
<option value="3467" data-teamname="Windham Windup">3467</option>
<option value="3572" data-teamname="Wavelength">3572</option>
<option value="3604" data-teamname="Goon Squad">3604</option>
<option value="3683" data-teamname="Team DAVE">3683</option>
<option value="3928" data-teamname="Team Neutrino">3928</option>
<option value="3990" data-teamname="Tech for Kids">3990</option>
<option value="4096" data-teamname="Ctrl-Z">4096</option>
<option value="4122" data-teamname="Ossining O-Bots">4122</option>
<option value="4143" data-teamname="MARS/WARS">4143</option>
<option value="4561" data-teamname="TerrorBytes">4561</option>
<option value="4655" data-teamname="Stateline Robotics">4655</option>
<option value="4907" data-teamname="Thunderstamps">4907</option>
<option value="5112" data-teamname="The Gongoliers">5112</option>
<option value="5114" data-teamname="Titanium Tigers">5114</option>
<option value="5285" data-teamname="Sea Kings Robotics">5285</option>
<option value="5414" data-teamname="Pearadox">5414</option>
<option value="5484" data-teamname="Career Academy Robotics - Wolf Pack">5484</option>
<option value="5822" data-teamname="WolfByte">5822</option>
<option value="5851" data-teamname="Striking Vikings">5851</option>
<option value="5951" data-teamname="Makers Assemble">5951</option>
<option value="6002" data-teamname="ZooBOTix">6002</option>
<option value="6081" data-teamname="Digital Dislocators">6081</option>
<option value="6147" data-teamname="Tonkabots">6147</option>
<option value="6806" data-teamname="Mineola Wild Reds">6806</option>
<option value="7558" data-teamname="ALT-F4">7558</option>
<option value="7762" data-teamname="AutoPilots">7762</option>
<option value="8817" data-teamname="Buccaneer Robotics">8817</option>
<option value="9312" data-teamname="NERD Spark">9312</option>
<option value="9404" data-teamname="Forge">9404</option>
<option value="9408" data-teamname="Warbots">9408</option>
<option value="9450" data-teamname="Velocity Raptors">9450</option>
<option value="9462" data-teamname="Toefur's Titans">9462</option>
<option value="9478" data-teamname="Robo-Colts">9478</option>
<option value="9586" data-teamname="Anglebotics">9586</option>
<option value="9692" data-teamname="Sigma">9692</option>
</select>
<!--<input type="number" class="form-control" id="TeamNumber-input" min="1" required>-->
<!--These are the buttons/switchs in the form-->
<div class="invalid-feedback">Please set the team number.</div>
</div>
<div class="col-md">
<label for="TeamName-input" class="form-label">Team Name</label>
<input type="text" class="form-control" id="TeamName-input">
</div>
<div class="col-md">
<label for="Match-input" class="form-label">Match</label>
<input type="number" class="form-control" id="Match-input" min="1" required>
<div class="invalid-feedback">Please set the match number.</div>
</div>
</div><!-- /.row -->
<!--This creates a seperate card with its own background color to help with graphic design-->
<div class="card card-body bg-light mt-4">
<!--Auto Stuff-->
<h2>Auto</h2>
<!--Auto Mobility-->
<div class="row">
<div class="col-md">
<label for="moved-input" class="form-label">Left Zone?</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="moved-input" id="moved-1" value="1" required>
<label class="form-check-label" for="moved-1">Yes</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="moved-input" id="moved-0" value="0" required>
<label class="form-check-label" for="moved-0">No</label>
<div class="invalid-feedback">Please indicate if the robot left the zone.</div>
</div>
</div>
</div><!-- /.row -->
<!--Scoring in speaker during auto-->
<label class="form-label" for="autoSpeaker-input">Auto Speaker</label>
<div class="row">
<div class="col">
<!--This makes a green button that when pressed increases the value by 1-->
<a class="btn btn-big btn-success form-control" href="javascript:changeValue($('#autoSpeaker-input'),1)">+1</a>
</div>
<div class="col">
<!--Makes the minimum value 0-->
<input type="number" class="form-control mt-2 input-lg" id="autoSpeaker-input" min="0" value="0" required>
</div>
<div class="col">
<!--This makes a red button that decreses the value by 1 when pressed-->
<a class="btn btn-big btn-danger form-control"
href="javascript:changeValue($('#autoSpeaker-input'),-1)">-1</a>
</div>
</div><!-- /.row -->
<!--scoring in amp during auto-->
<label class="form-label" for="autoAmp-input">Auto Amp</label>
<div class="row">
<div class="col">
<a class="btn btn-big btn-success form-control" href="javascript:changeValue($('#autoAmp-input'),1)">+1</a>
</div>
<div class="col">
<input type="number" class="form-control mt-2 input-lg" id="autoAmp-input" min="0" value="0" required>
</div>
<div class="col">
<a class="btn btn-big btn-danger form-control" href="javascript:changeValue($('#autoAmp-input'),-1)">-1</a>
</div>
</div><!-- /.row -->
</div><!-- /.card -->
<div class="card card-body bg-light mt-4">
<!--TeleOp stuff-->
<h2>Score</h2>
<!--Scoring in speaker during teleOp-->
<label class="form-label" for="speaker-input">Speaker</label>
<div class="row">
<div class="col">
<a class="btn btn-big btn-success form-control" href="javascript:changeValue($('#speaker-input'),1)">+1</a>
</div>
<div class="col">
<input type="number" class="form-control mt-2 input-lg" id="speaker-input" min="0" value="0" required>
</div>
<div class="col">
<a class="btn btn-big btn-danger form-control" href="javascript:changeValue($('#speaker-input'),-1)">-1</a>
</div>
</div><!-- /.row -->
<!--Scoring in amp during teleOp-->
<label class="form-label" for="amp-input">Amp</label>
<div class="row">
<div class="col">
<a class="btn btn-big btn-success form-control" href="javascript:changeValue($('#amp-input'),1)">+1</a>
</div>
<div class="col">
<input type="number" class="form-control mt-2 input-lg" id="amp-input" min="0" value="0" required>
</div>
<div class="col">
<a class="btn btn-big btn-danger form-control" href="javascript:changeValue($('#amp-input'),-1)">-1</a>
</div>
</div><!-- /.row -->
<!--Scoring in trap-->
<label class="form-label" for="trap-input">Trap</label>
<div class="row">
<div class="col">
<a class="btn btn-big btn-success form-control" href="javascript:changeValue($('#trap-input'),1)">+1</a>
</div>
<div class="col">
<input type="number" class="form-control mt-2 input-lg" id="trap-input" min="0" value="0" required>
</div>
<div class="col">
<a class="btn btn-big btn-danger form-control" href="javascript:changeValue($('#trap-input'),-1)">-1</a>
</div>
</div><!-- /.row -->
</div><!-- /.card -->
<div class="card card-body bg-light mt-4">
<h2>Information</h2>
<div class="row">
<div class="col-md">
<!--Where the robot can pickup pieces from: ex. ground or human player station-->
<label for="pickup-input" class="form-label">Pickup Location</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="pickup-input" id="pickup-0" value="0" required>
<label class="form-check-label" for="pickup-0">Neither</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="pickup-input" id="pickup-1" value="1" required>
<label class="form-check-label" for="pickup-1">Ground</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="pickup-input" id="pickup-2" value="2" required>
<label class="form-check-label" for="pickup-2">Station</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="pickup-input" id="pickup-3" value="3" required>
<label class="form-check-label" for="pickup-3">Both</label>
<div class="invalid-feedback">Please indicate where the robot can pick up notes</div>
</div>
</div>
<div class="col-md">
<!--If the robot can climb the chain and if the can climb with another bot-->
<label for="climb-input" class="form-label">Climb</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="climb-input" id="climb-0" value="0" required>
<label class="form-check-label" for="climb-0">No</label>
</div>
<div class="col-md">
<div class="form-check">
<input class="form-check-input" type="radio" name="climb-input" id="climb-1" value="1" required>
<label class="form-check-label" for="climb-1">First</label>
</div>
</div>
<div class="col-md">
<div class="form-check">
<input class="form-check-input" type="radio" name="climb-input" id="climb-2" value="2" required>
<label class="form-check-label" for="climb-2">After</label>
</div>
<div class="invalid-feedback">Please indicate where the robot can climb on the chain</div>
</div>
</div>
<div class="col-md">
<!--What role the robot plays, do they play defense or offense or something else-->
<label for="role-input" class="form-label">Role</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="role-input" id="role-1" value="1" required>
<label class="form-check-label" for="role-1">Defense</label>
</div>
<div class="col-md">
<div class="form-check">
<input class="form-check-input" type="radio" name="role-input" id="role-2" value="2" required>
<label class="form-check-label" for="role-2">Offense</label>
</div>
</div>
<div class="col-md">
<div class="form-check">
<input class="form-check-input" type="radio" name="role-input" id="role-3" value="3" required>
<label class="form-check-label" for="role-3">Feeder</label>
</div>
</div>
<div class="col-md">
<div class="form-check">
<input class="form-check-input" type="radio" name="role-input" id="role-4" value="4" required>
<label class="form-check-label" for="role-4">other</label>
</div>
<div class="invalid-feedback">Please indicate what role the robot played</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md">
<!--Did the robot break: ex. arm fell off, bumper fell off, robot explodes-->
<label for="broken-input" class="form-label">Broken</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="broken-input" id="broken-1" value="1" required>
<label class="form-check-label" for="broken-1">Yes</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="broken-input" id="broken-0" value="0" required>
<label class="form-check-label" for="broken-0">No</label>
<div class="invalid-feedback">Please indicate wheither the robot was broken or not</div>
</div>
</div>
<div class="col-md">
<!--Did the robot get disabled during the match-->
<label for="disabled-input" class="form-label">Disabled</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="disabled-input" id="disabled-1" value="1" required>
<label class="form-check-label" for="disabled-1">Yes</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="disabled-input" id="disabled-0" value="0" required>
<label class="form-check-label" for="disabled-0">No</label>
<div class="invalid-feedback">Please indicate wheither the robot was disabled or not</div>
</div>
</div>
<!--To center the disabled and broken with role, climb, and pickup-->
<div class="col-md">
</div>
</div><!-- /.row -->
</div><!-- /.card -->
<div class="row">
<div class="col-md-8">
<!--any aditional things that can't be recorded manually-->
<label class="form-label" for="comment-input">Comment</label>
<textarea class="form-control" id="comment-input" rows="6"></textarea>
</div>
<div class="col-md-4">
<a href="javascript:showCodeModal()" class="btn btn-primary btn-big form-control mt-5" >Get Code</a>
</div>
</div><!-- /.row -->
</div><!-- /.container-->
</form>
<!-- Modal -->
<div class="modal fade" id="codeModal" tabindex="-1" aria-labelledby="codeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="codeModalLabel">Code</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-center">
<div id="modalQRCode"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function changeValue(ctl,val) {
ctl.val( isNaN(parseInt(ctl.val())) ? 1 : parseInt(ctl.val()) + val );
if (ctl.val() < 0) {ctl.val("0")}
}
//This allows data to be moved from here into a data visualization tool, its in JavaScript
const codeModal = new bootstrap.Modal('#codeModal', {});
function showCodeModal() {
$('body').addClass('was-validated');
$('#modalQRCode').html(""); // clear the QR div's previous content
$('#codeModalLabel').html('Team ' + $('#TeamNumber-input').val() + ' ' + $('#TeamName-input').val() + ' - Match '+ $('#Match-input').val());
if ($(
'#TeamNumber-input:valid').length > 0
&& $('#Match-input:valid').length > 0
&& $("input[Name='moved-input']:valid").length > 0
&& $("input[Name='pickup-input']:valid").length > 0
&& $("input[Name='climb-input']:valid").length > 0
&& $("input[Name='role-input']:valid").length > 0
&& $("input[Name='broken-input']:valid").length > 0
&& $("input[Name='disabled-input']:valid").length > 0
// && $("input[Name='role-input']:valid").length > 0
){
var data= '{'
+ '"TeamNumber":' + JSON.stringify($("#TeamNumber-input").val())
+ ',"Match":' + JSON.stringify($("#Match-input").val())
+ ',"moved":' + JSON.stringify($("input[name='moved-input']:checked").val())
+ ',"autoSpeaker":' + JSON.stringify($("#autoSpeaker-input").val())
+ ',"autoAmp":' + JSON.stringify($("#autoAmp-input").val())
+ ',"speaker":' + JSON.stringify($("#speaker-input").val())
+ ',"amp":' + JSON.stringify($("#amp-input").val())
+ ',"trap":' + JSON.stringify($("#trap-input").val())
+ ',"pickup":' + JSON.stringify($("input[name='pickup-input']:checked").val())
+ ',"climb":' + JSON.stringify($("input[name='climb-input']:checked").val())
+ ',"role":' + JSON.stringify($("input[name='role-input']:checked").val())
+ ',"broken":' + JSON.stringify($("input[name='broken-input']:checked").val())
+ ',"disabled":' + JSON.stringify($("input[name='disabled-input']:checked").val())
+ ',"Comment":' + JSON.stringify($("#comment-input").val())
+ '}';
new QRCode(document.getElementById("modalQRCode"), {text:data,width:800,height:800,correctLevel:QRCode.CorrectLevel.L});
$('#modalQRCode > img').addClass('img-fluid');
codeModal.show();
}
}
</script>
</body>
</html>