-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
378 lines (358 loc) · 17 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
<!DOCTYPE html>
<html>
<head>
<title>2486 - Coconuts Scouting</title>
<script src="assets/jquery-3.6.1.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;
}
#qrcode img {
display: inline-block !important;
margin: 2rem 0rem;
}
</style>
</head>
<body>
<form>
<div class="container">
<div class="row">
<div class="col text-end">
<input type="reset" value="Reset all fields" onClick="javascript:$('body').removeClass('was-validated');">
</div>
</div>
<div class="row">
<div class="col">
<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="60" data-teamname="Bionic Bulldogs">60</option>
<option value="498" data-teamname="Cobra Commanders">498</option>
<option value="991" data-teamname="BroncoBots">991</option>
<option value="1165" data-teamname="Paradise">1165</option>
<option value="1212" data-teamname="Sentinels">1212</option>
<option value="1726" data-teamname="N.E.R.D.S">1726</option>
<option value="2375" data-teamname="Dragon">2375</option>
<option value="2403" data-teamname="Plasma">2403</option>
<option value="2478" data-teamname="Westwood">2478</option>
<option value="2486" data-teamname="CocoNuts">2486</option>
<option value="2662" data-teamname="RoboKrew">2662</option>
<option value="3187" data-teamname="Arcadia Titan">3187</option>
<option value="3853" data-teamname="Pridetronics">3853</option>
<option value="3944" data-teamname="All Knights">3944</option>
<option value="4146" data-teamname="Some Assembly Required">4146</option>
<option value="4183" data-teamname="Bit Buckets">4183</option>
<option value="4565" data-teamname="Skyline">4565</option>
<option value="6127" data-teamname="Pumatrons">6127</option>
<option value="6352" data-teamname="LAUNCH">6352</option>
<option value="6413" data-teamname="Degrees of Freedom">6413</option>
<option value="6479" data-teamname="AZTECH">6479</option>
<option value="6833" data-teamname="Phoenix">6833</option>
<option value="7703" data-teamname="RoboBears">7703</option>
<option value="7755" data-teamname="Phantom Circuts">7755</option>
<option value="9059" data-teamname="COLTech">9059</option>
<option value="9091" data-teamname="A.W.E">9091</option>
</select>
<!--<input type="number" class="form-control" id="TeamNumber-input" min="1" required>-->
<div class="invalid-feedback">
Please set the team number.
</div>
</div>
<div class="col">
<label for="TeamName-input" class="form-label">Team Name</label>
<input type="text" class="form-control" id="TeamName-input">
</div>
<div class="col">
<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 -->
<hr class="mt-4 mb-1">
<div class="row">
<div class="col">
<label for="DockedStatus-input" class="form-label">Dock Status(Auto)</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="DockAuto-input" id="DockAuto-1" value="1" required>
<label class="form-check-label" for="DockAuto-1">
Not Docked
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="DockAuto-input" id="DockAuto-2" value="2" required>
<label class="form-check-label" for="DockAuto-2">
Docked
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="DockAuto-input" id="DockAuto-3" value="3" required>
<label class="form-check-label" for="DockAuto-3">
Docked/Engaged
</label>
</div>
</div>
<div class="col">
<div class="row">
<label class="form-check-label" for="Parked-input">Parked</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="Parked-input">
</div>
<div class="row">
<label class="form-check-label" for="CompatAuto-input">CompatAuto</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="CompatAuto-input">
</div>
</div>
</div>
</div>
<div class="col">
<label class="form-check-label" for="PiecesScored-input">Pieces Scored</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="PiecesScored-input">
</div>
</div>
<hr class="mt-4 mb-1">
<div class="row">
<div class="col">
High
<a class="btn btn-success btn-huge form-control" href="javascript:changeValue($('#High-input'),1)">+1</a>
</div>
<div class="col">
Medium
<a class="btn btn-success btn-huge form-control" href="javascript:changeValue($('#Medium-input'),1)">+1</a>
</div>
<div class="col">
Low
<a class="btn btn-success btn-huge form-control" href="javascript:changeValue($('#Low-input'),1)">+1</a>
</div>
</div>
<div class="row">
<div class="col">
<input type="number" class="form-control" id="High-input" min="0" value="0" required>
</div>
<div class="col">
<input type="number" class="form-control" id="Medium-input" min="0" value="0" required>
</div>
<div class="col">
<input type="number" class="form-control" id="Low-input" min="0" value="0" required>
</div>
</div>
<div class="row">
<div class="col">
<a class="btn btn-danger form-control" href="javascript:changeValue($('#High-input'),-1)">-1</a>
</div>
<div class="col">
<a class="btn btn-danger form-control" href="javascript:changeValue($('#Medium-input'),-1)">-1</a>
</div>
<div class="col">
<a class="btn btn-danger form-control" href="javascript:changeValue($('#Low-input'),-1)">-1</a>
</div>
</div>
<hr class="mt-4 mb-1">
<div class="row">
<div class="col">
<label for="DockEnd-input" class="form-label">Dock Status</label>
<!--Options for docked status-->
<div class="form-check">
<input class="form-check-input" type="radio" name="DockEnd-input" id="DockEnd-1" value="1" required>
<label class="form-check-label" for="DockEnd-1">
Not Docked
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="DockEnd-input" id="DockEnd-2" value="2" required>
<label class="form-check-label" for="DockEnd-2">
Docked
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="DockEnd-input" id="DockEnd-3" value="3" required>
<label class="form-check-label" for="DockEnd-3">
Docked/Engaged
</label>
</div>
</div>
<!--Options for Type Scored-->
<div class="col">
<label for="PrefStart-input" class="form-label">Type Scored</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="TypeScored-input" id="TypeScored-1" value="1" required>
<label class="form-check-label" for="TypeScored-1">
Cones
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="TypeScored-input" id="TypeScored-2" value="2" required>
<label class="form-check-label" for="TypeScored-2">
Cubes
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="TypeScored-input" id="TypeScored-3" value="3" required>
<label class="form-check-label" for="TypeScored-3">
Both
</label>
</div>
</div>
<div class="col">
<div class="row">
<label for="DriveSkill-input" class="form-label">Driving Skill</label>
<input type="range" class="form-range" id="DriveSkill-input" min="1" max="5">
</div>
<div class="row">
<label for="Aggression-input" class="form-label">Aggression</label>
<input type="range" class="form-range" id="Aggression-input" min="1" max="5">
</div>
</div>
</div>
<!--Outlier and Defense Only-->
<div class="row">
<div class="col">
<label for="PrefStart-input" class="form-label">Cycle Time</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="CycleTime-input" id="CycleTime-1" value="1" required>
<label class="form-check-label" for="CycleTime-1">
Fast
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="CycleTime-input" id="CycleTime-2" value="2" required>
<label class="form-check-label" for="CycleTime-2">
Medium
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="CycleTime-input" id="CycleTime-3" value="3" required>
<label class="form-check-label" for="CycleTime-3">
Slow
</label>
</div>
</div>
<div class="col">
<div class="row">
<label class="form-check-label" for="Outlier-input">Outlier</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="Outlier-input">
</div>
</div>
<div class="row">
<label class="form-check-label" for="BreakImpact-input">Break Impact</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="BreakImpact-input">
</div>
</div>
</div>
<div class="col">
<div class="row">
<label class="form-check-label" for="DefenseOnly-input">Defense Only</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="DefenseOnly-input">
</div>
</div>
<div class="row">
<label class="form-check-label" for="Penalty-input">Penalty</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="Penalty-input">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<label class="form-check-label" for="Ground-input">Pickup Ground</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="Ground-input">
</div>
</div>
<div class="col">
<label class="form-check-label" for="Shelf-input">Pickup Shelf</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="Shelf-input">
</div>
</div>
<div class="col">
<label for="PiecePref" class="form-label">Cone < - > Cube Preference</label>
<input type="range" class="form-range" id="PiecePref" min="1" max="5">
</div>
</div>
<div class="row">
<div class="col">
<label class="form-label" for="Comment-input">Comment</label>
<textarea class="form-control" id="Comment-input" rows="6"></textarea>
</div>
<div class="col">
<a href="javascript:updateQR()" class="btn btn-primary form-control" style="margin-top: 2.5rem;">Get Code</a>
<div id="qrcode"></div>
</div>
</div>
</div><!-- /.container-->
</form>
<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")}
}
function updateQR() {
$('body').addClass('was-validated');
$("#qrcode").html(""); // clear the QR div's previous content
if ($(
'#TeamNumber-input:valid').length > 0
&& $('#Match-input:valid').length > 0
&& $("input[Name='DockAuto-input']:valid").length > 0
&& $("input[Name='DockEnd-input']:valid").length > 0
&& $("input[Name='TypeScored-input']:valid").length > 0
&& $("input[Name='CycleTime-input']:valid").length > 0
){
var data= '{'
+ '"TeamNumber":' + JSON.stringify($("#TeamNumber-input").val())
+ ',"TeamName":' + JSON.stringify($("#TeamName-input").val())
+ ',"Match":' + JSON.stringify($("#Match-input").val())
+ ',"DockAuto":' + JSON.stringify($("input[name='DockAuto-input']:checked").val())
+ ',"Parked":' + JSON.stringify(Number($("#Parked-input").is(":checked")))
+ ',"CompatAuto":' + JSON.stringify(Number($("#CompatAuto-input").is(":checked")))
+ ',"PiecesScored":' + JSON.stringify(Number($("#PiecesScored-input").is(":checked")))
+ ',"High":' + JSON.stringify($("#High-input").val())
+ ',"Medium":' + JSON.stringify($("#Medium-input").val())
+ ',"Low":' + JSON.stringify($("#Low-input").val())
+ ',"DockEnd":' + JSON.stringify($("input[name='DockEnd-input']:checked").val())
+ ',"TypeScored":' + JSON.stringify($("input[name='TypeScored-input']:checked").val())
+ ',"DriveSkill":' + JSON.stringify($("#DriveSkill-input").val())
+ ',"Aggression":' + JSON.stringify($("#Aggression-input").val())
+ ',"CycleTime":' + JSON.stringify($("input[name='CycleTime-input']:checked").val())
+ ',"Outlier":' + JSON.stringify(Number($("#Outlier-input").is(":checked")))
+ ',"BreakImpact":' + JSON.stringify(Number($("#BreakImpact-input").is(":checked")))
+ ',"DefenseOnly":' + JSON.stringify(Number($("#DefenseOnly-input").is(":checked")))
+ ',"Penalty":' + JSON.stringify(Number($("#Ground-input").is(":checked")))
+ ',"ShelfPickup":' + JSON.stringify(Number($("#Shelf-input").is(":checked")))
+ ',"GroundPickup":' + JSON.stringify(Number($("#Penalty-input").is(":checked")))
+ ',"Comment":' + JSON.stringify($("#Comment-input").val())
+ ',"PiecePref":' + JSON.stringify($("#PiecePref").val())
+ '}';
new QRCode(document.getElementById("qrcode"), {text:data,width:480,height:480,correctLevel:QRCode.CorrectLevel.L});
}
}
</script>
</body>
</html>