-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
368 lines (337 loc) · 15.8 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="jquery-3.4.1.min.js"></script>
<title>BREAD Scouting App</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body onload="hideEverything(); setup()">
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>-->
<!--<script src="script.js"></script>-->
<form id="form" name="form">
<input type="hidden" class="hidden" id="img-size" name="img-size"/>
<input type="hidden" class="hidden" id="start-time" name="start-time"/>
<input type="hidden" class="hidden" id="shots" name="shots" value="">
<input type="hidden" class="hidden" id="climb-start" name="climb-start">
<input type="hidden" class="hidden" id="climb-end" name="climb-end">
<input type="hidden" class="hidden" id="cap1Time" name="cap1Time"/>
<input type="hidden" class="hidden" id="cap2Time" name="cap2Time"/>
<input type="hidden" class="hidden" id="cap3Time" name="cap3Time"/>
<input type="hidden" class="hidden" id="rotTime" name="rotTime"/>
<input type="hidden" class="hidden" id="posTime" name="posTime"/>
<div id="first-page">
<h1>BREAD Scouting</h1>
<div class="basic-info">
<p>Name: <input type="text" name="Name" size="15"><br></p>
<p>Team #: <input type="text" name="Team#" size="14"><br></p>
<p>Match #: <input type="text" name="Match#" size="13"><br></p>
<p>Alliance Station:
<select name="Alliance-station">
<option value="Red1">Red 1</option>
<option value="Red2">Red 2</option>
<option value="Red3">Red 3</option>
<option value="Blue1">Blue 1</option>
<option value="Blue2">Blue 2</option>
<option value="Blue3">Blue 3</option>
</select>
</p>
<p id="absent">Absent:
<label class="switch">
<input type="checkbox" name="absent">
<span class="slider round"></span>
</label>
</p>
</div>
<!--driverSlider represents initiation line and the robot position on the line-->
<div id="before-slide">
<p>Robot Start Position:</p>
<!--when the flip button is clicked, the sector and shield generator switch positions-->
<button id="flip-button" type="button" onclick="flip()">Flip</button>
</div>
<div class="start-position-slide">
<p id="sp-sector">Sector</p>
<br>
<input name="startPostion" type="range" min="1" max="100" value="50" class="slider-position"
id="start-slide">
<br>
<p id="sp-generator">Shield <br> Generator</p>
</div>
<!--starts a countdown from 2:30 and is used to mark timestamps for certain data points-->
<div class="start-countdown">
<button id="start-button" type="button" onclick="toGamePage()">Start</button>
<p id="demo"></p>
</div>
</div>
<div id="game-page">
<div class="buttons">
<button id="back-button" type="button" onclick="toStartPage()"><</button>
<button id="moved-off-line" type="button" onclick="movedOffLine()">Moved off line</button>
<button id="flip-button-game" type="button" onclick="flipField()">Flip</button>
<button id="stages-button" type="button" onclick="showStages()">Stages</button>
<button id="panel-button" type="button" onclick="showControl()">Control Panel</button>
<button id="fouls-button" type="button" onclick="showFouls()">Fouls</button>
<button id="forward-button" type="button" onclick="toEndgame()">></button>
</div>
<div id="off-line">
<p>Moved off initiation line: </p>
<label class="switch">
<input type="checkbox" id="offLine" name="offLine">
<span class="slider round"></span>
</label>
<button id="save-off-line" type="button" onclick="closeOffLine()">Close</button>
</div>
<div class="popup" id="scoring">
<h2>Record Shot</h2>
<input name="x" type="hidden" class="num" id="x"/>
<input name="y" type="hidden" class="num" id="y"/>
<input name="time" type="hidden" class="num" id="time"/>
<div id="inner-bloc" class="shot-bloc">
<label for="inner">Inner: </label>
<div class="selector">
<input class="num" type="number" name="inner" id="inner" value="0">
<input type="button" class="incButton" value="+" onclick="inc('inner')">
</div>
</div>
<div id="outer-bloc" class="shot-bloc">
<label for="outer">Outer: </label>
<input class="num" type="number" name="outer" id="outer" value="0">
<input type="button" class="incButton" value="+" onclick="inc('outer')">
</div>
<div id="lower-bloc" class="shot-bloc">
<label for="lower">Lower: </label>
<input class="num" type="number" name="lower" id="lower" value="0">
<input type="button" class="incButton" value="+" onclick="inc('lower')">
</div>
<div id="miss-bloc" class="shot-bloc">
<label for="miss">Miss: </label>
<input class="num" type="number" name="miss" id="miss" value="0">
<input type="button" class="incButton" value="+" onclick="inc('miss')">
</div>
<br>
<input type="button" id="save-shot" onClick="saveShot()" value="Save"/>
</div>
<div id="fouls" class="popup">
<div class="type-foul">
<label for="trench">Trench: </label>
<input class="num" type="number" name="trench" id="trench" value="0">
<input type="button" class="incButton" value="+" onclick="inc('trench')">
</div>
<div class="type-foul">
<label for="pin">Pin: </label>
<input class="num" type="number" name="pin" id="pin" value="0">
<input type="button" class="incButton" value="+" onclick="inc('pin')">
</div>
<div class="type-foul">
<label for="human">Human:</label>
<input class="num" type="number" name="human" id="human" value="0">
<input type="button" class="incButton" value="+" onclick="inc('human')">
</div>
<div class="type-foul">
<label for="touch">Touch Climb: </label>
<input class="num" type="number" name="touch" id="touch" value="0">
<input type="button" class="incButton" value="+" onclick="inc('touch')">
</div>
<div class="type-foul">
<label for="rdz">Opponents Rendezvous: </label>
<input class="num" type="number" name="rdz" id="rdz" value="0">
<input type="button" class="incButton" value="+" onclick="inc('rdz')">
</div>
<div class="type-foul">
<label for="protecc">Protected Zones: </label>
<input class="num" type="number" name="protecc" id="protecc" value="0">
<input type="button" class="incButton" value="+" onclick="inc('protecc')">
</div>
<div class="type-foul">
<label for="tech">Other Techs: </label>
<input class="num" type="number" name="tech" id="tech" value="0">
<input type="button" class="incButton" value="+" onclick="inc('tech')">
</div>
<div class="type-foul">
<label for="foul">Other Fouls: </label>
<input class="num" type="number" name="foul" id="foul" value="0">
<input type="button" class="incButton" value="+" onclick="inc('foul')">
</div>
<br>
<input type="button" id="save-fouls" onClick="hideFouls()" value="Save"/>
</div>
<!-- <div id="stages" class="popup">-->
<!-- <div>-->
<!-- <label for="stage-one">Stage 1 Capacity: </label>-->
<!-- <input id="stage-one" type="button" value="1" onclick="stageOneTime()"/>-->
<!-- </div>-->
<!-- <br>-->
<!-- <div>-->
<!-- <label for="stage-two">Stage 2 Capacity: </label>-->
<!-- <input id="stage-two" type="button" value="2" onclick="stageTwoTime()"/>-->
<!-- </div>-->
<!-- <br>-->
<!-- <div>-->
<!-- <label for="stage-three">Stage 3 Capacity: </label>-->
<!-- <input id="stage-three" type="button" value="3" onclick="stageThreeTime()"/>-->
<!-- </div>-->
<!-- <br>-->
<!-- <input id="save-stages" type="button" value="Close" onclick="hideStages()"/>-->
<!-- </div>-->
<!-- <div id="control-panel">-->
<!-- <button type="button" id="rotation" onclick="rotationTime()">Rotation</button>-->
<!-- <button type="button" id="position" onclick="positionTime()">Position</button>-->
<!-- <button type="button" id="close-control" onclick="hideControl()">Close</button>-->
<!-- </div>-->
<div class="image">
<img id="field-image" src="strategy-map.jpg" alt="Map of field and alliance stations."
onclick="showPoints(); coordinates()"/>
</div>
</div>
<div id="endgame-page">
<h2>ENDGAME</h2>
<div class="top-buttons">
<button id="back-button-endgame" type="button" onclick="backToGamePage()"> <</button>
<button id="forward-button-endgame" type="button" onclick="toNotesPage()"> ></button>
</div>
<!--information relating to climbs-->
<div class="climb">
<p id="start-stop-climb">Climb:
<button type="button" onclick="startClimb()" id="begin-climb">Start</button>
<button type="button" onclick="endClimb()" id="stop-climb">Stop</button>
</p>
<p id="climb-success">Climb Successful:
<label class="switch">
<input type="checkbox" name="climbSucc">
<span class="slider round"></span>
</label>
</p>
<p id="buddy-climb">Buddy Climb:
<label class="switch">
<input type="checkbox" name="buddy">
<span class="slider round"></span>
</label>
</p>
<p id="assisted">Got Assisted:
<label class="switch">
<input type="checkbox" name="assisted">
<span class="slider round"></span>
</label>
</p>
<p id="level-climb">Level Climb:
<label class="switch">
<input type="checkbox" name="level">
<span class="slider round"></span>
</label>
</p>
<p id="parked">Parked:
<label class="switch">
<input type="checkbox" name="parked">
<span class="slider round"></span>
</label>
</p>
<p id="climb-rp">Climb RP:
<label class="switch">
<input type="checkbox" name="rp">
<span class="slider round"></span>
</label>
</p>
</div>
</div>
<div id="note-page">
<div class="top">
<input id="backToEndgame" type="button" onclick="backToEnd()" value="<"/>
<h1 id="notes-title">Notes</h1>
</div>
<p id="e-stop">E-Stop:
<label class="switch">
<input type="checkbox" name="estop">
<span class="slider round"></span>
</label>
</p>
<p id="broke">Broke:
<label class="switch">
<input type="checkbox" name="broke">
<span class="slider round"></span>
</label>
</p>
<p id="yellow-card">Yellow Card:
<label class="switch">
<input type="checkbox" name="yellow">
<span class="slider round"></span>
</label>
</p>
<p id="red-card">Red Card:
<label class="switch">
<input type="checkbox" name="red">
<span class="slider round"></span>
</label>
</p>
<p id="disqualified">Disqualified:
<label class="switch">
<input type="checkbox" name="dq">
<span class="slider round"></span>
</label>
</p>
<div class="points">
<label for="total-rp">Total RP: </label>
<input type="number" id="total-rp" name="total-rp" min="0">
</div>
<br>
<div class="points">
<label for="total-points">Total Points: </label>
<input type="number" id="total-points" name="total-points" min="0">
</div>
<div class="driver-rank-div">
<h2 id="driver-p">Driver Rank: </h2>
<input type="range" min="0" max="5" value="0" class="slider-ranks" id="driver-rank" name="driveRank">
<h4 id="display-drive" style="text-align:left;"></h4>
<p id="info-drive"></p>
</div>
<div class="human-rank-div">
<h2 id="human-p">Human Player Rank: </h2>
<input type="range" min="0" max="5" value="0" class="slider-ranks" id="player-rank" name="playRank">
<h4 id="display-hp" style="text-align:left;"></h4>
<p id="info-hp"></p>
</div>
<div class="defense-rank-div">
<h2 id="defense-p">Defense: </h2>
<input type="range" min="0" max="5" value="0" class="slider-ranks" id="defense-rank" name="defRank">
<h4 id="display-def" style="text-align:left;"></h4>
<p id="info-def"></p>
</div>
<div class="defense-avoid-div">
<h2 id="defense-avoid-p">Defense Avoidance: </h2>
<input type="range" min="0" max="5" value="0" class="slider-ranks" id="defense-avoid-rank"
name="defAvoidRank">
<h4 id="display-defavoid" style="text-align:left;"></h4>
<p id="info-defavoid"></p>
</div>
<div class="written-notes">
<label for="notes">Notes:</label>
<br>
<textarea rows=5 cols=25 name="notes" id="notes"></textarea>
</div>
<br>
<input name="submit" id="submit" type="submit" value="Submit Data">
</div>
</form>
<!--<script nomodule src="fetch.umd.js"></script>-->
<!--<script src="https://polyfill.io/v3/polyfill.min.js"></scriptsrc></script>-->
<script>
// var fetch = import( "./fetch.umd.js");
const scriptURL = 'https://script.google.com/macros/s/AKfycbwLn5_ClOMM5NxS1Dfhcl_LtDziT633FNIBcIhNK8a17vBvvzEm/exec';
const form = document.forms['form'];
form.addEventListener('submit', e => {
if (!('fetch' in window)) {
console.log('Fetch API not found, try including the polyfill');
return;
}
e.preventDefault();
fetch(scriptURL, {method: 'POST', body: new FormData(form) /*headers: {'Content-Type': 'application/json', 'Access-Control-Allow-Origin':'*'}*/, mode: 'no-cors'})
.then(response => console.log('Success!', response))
.catch(error => console.error('Error!', error));
form.reset();
location.reload();
});
</script>
<script src="script.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</body>
</html>