-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrescueFlowStep3.html
579 lines (535 loc) · 21 KB
/
rescueFlowStep3.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
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Standard Favicon -->
<link rel="icon" type="image/png" href="./assets/Color_Logo_Blue.png" />
<link
href="https://unpkg.com/[email protected]/css/boxicons.min.css"
rel="stylesheet"
/>
<!-- For Apple devices -->
<link
rel="apple-touch-icon"
sizes="512x512"
href="./assets/Color_Logo_Blue.png"
/>
<!-- For general use, like on Android -->
<link
rel="icon"
type="image/png"
sizes="256x256"
href="./assets/Color_Logo_Blue.png"
/>
<link
rel="icon"
type="image/png"
sizes="512x512"
href="./assets/Color_Logo_Blue.png"
/>
<!-- Web App Manifest -->
<link rel="manifest" href="/site.webmanifest" />
<title>DRN Rescue Flow - Step 3</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="./globals.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap"
rel="stylesheet"
/>
<script>
function goBack() {
if (document.referrer.startsWith(window.location.origin)) {
window.history.back();
} else {
// Handle the case when there is no history to go back to
// For example, redirect to a different page or display an error message
console.log("No page on the same domain to go back to.");
}
}
function refresh() {
window.location.href = "/";
}
function toggleFabMenu() {
const overlay = document.getElementById("overlay");
const fabMenuContainer = document.getElementById("fabMenuContainer");
const fabLogo = document.getElementById("fabLogo"); // Get the logo by its ID
const fabClose = document.getElementById("fabClose"); // Get the 'X' span by its ID
const fabContainer = document.getElementById("fabContainer"); // Get the 'X' span by its ID
const fab = document.getElementById("fab"); // Get the 'X' span by its ID
// Toggle the active class on the overlay and the FAB menu
overlay.classList.toggle("active");
fabMenuContainer.classList.toggle("active");
// Check if the menu is active or not
if (fabMenuContainer.classList.contains("active")) {
// Menu is active, show 'X' and hide logo
fabLogo.style.display = "none"; // Hide the logo
fabClose.style.display = "block"; // Show the 'X'
} else {
// Menu is not active, hide 'X' and show logo
fabLogo.style.display = "block"; // Show the logo
fabClose.style.display = "none"; // Hide the 'X'
}
}
function reportLostDisc() {
window.location.href = "reportLostDisc.html";
}
function requestCourse() {
window.location.href = "requestCourse.html";
}
function openSettings() {
window.location.href = "settings.html";
}
// Function to get the value of a query parameter from the URL
function getQueryParam(parameterName) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(parameterName);
}
function skipStep() {
// Retrieve the "color" query parameter from the URL
const stateInputValue = getQueryParam("state");
console.log(stateInputValue);
const courseInputValue = getQueryParam("course");
console.log(courseInputValue);
const phoneInputValue = getQueryParam("phone");
console.log(phoneInputValue);
let firstInitialInputValue =
document.getElementById("inputInitial").value;
let lastNameInputValue = document.getElementById("inputName").value;
if (
firstInitialInputValue == "" ||
firstInitialInputValue == "First Initial"
) {
firstInitialInputValue = "";
}
if (lastNameInputValue == "") {
lastNameInputValue = "";
}
window.location.href = `rescueFlowStep4.html?state=${encodeURIComponent(
stateInputValue
)}&course=${encodeURIComponent(
courseInputValue
)}&phone=${encodeURIComponent(
phoneInputValue
)}&initial=${encodeURIComponent(
firstInitialInputValue
)}&name=${encodeURIComponent(lastNameInputValue)}`;
}
function searchName() {
// Retrieve the "color" query parameter from the URL
const stateInputValue = getQueryParam("state");
console.log(stateInputValue);
const courseInputValue = getQueryParam("course");
console.log(courseInputValue);
const phoneInputValue = getQueryParam("phone");
console.log(phoneInputValue);
let firstInitialInputValue =
document.getElementById("inputInitial").value;
let lastNameInputValue = document.getElementById("inputName").value;
if (
firstInitialInputValue == "" ||
firstInitialInputValue == "First Initial"
) {
firstInitialInputValue = "";
}
if (lastNameInputValue == "") {
lastNameInputValue = "";
}
// Check if a disc is found (you can modify this condition)
var disc_found = true; // Change this condition as needed
if (firstInitialInputValue == "J" && lastNameInputValue == "Doe") {
disc_found = true;
}
if (disc_found) {
var popupVerify = document.getElementById("popup-verify");
popupVerify.style.display = "flex";
//search the found_discs array from /js/discs.js for the any discs matching this name display the array of disc info in the popup-verify
const matchingDiscs = found_discs.filter(
(disc) => disc.Name === "J. Doe"
);
console.log(matchingDiscs);
if (matchingDiscs.length === 0) {
// Handle the case where no matching discs are found
console.log("No matching discs found");
window.location.href = `rescueFlowStep4.html?state=${encodeURIComponent(
stateInputValue
)}&course=${encodeURIComponent(
courseInputValue
)}&phone=${encodeURIComponent(
phoneInputValue
)}&initial=${encodeURIComponent(
firstInitialInputValue
)}&name=${encodeURIComponent(lastNameInputValue)}`;
} else {
const discInfoHTML = matchingDiscs
.map(
(matchingDisc) => `
<div class="col-6 disc-item" style="padding-right: 3.5px; padding-left: 3.5px;">
<div class="course-box">
<div class="course-box-detail">
<div class="div-block-2">
<div class="circle-overlay">
<img src="./assets/pin.png">
</div>
<div class="text-block-2"><div class="course-wrapper">${matchingDisc.Course}</div></div>
</div>
<div class="course-image">
<img src="./assets/course-image.png" alt="image">
</div>
<div class="course-list">
<ul>
<li><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill: rgba(0, 0, 0, 1);transform: ;msFilter:;"><path d="M13.4 2.096a10.08 10.08 0 0 0-8.937 3.331A10.054 10.054 0 0 0 2.096 13.4c.53 3.894 3.458 7.207 7.285 8.246a9.982 9.982 0 0 0 2.618.354l.142-.001a3.001 3.001 0 0 0 2.516-1.426 2.989 2.989 0 0 0 .153-2.879l-.199-.416a1.919 1.919 0 0 1 .094-1.912 2.004 2.004 0 0 1 2.576-.755l.412.197c.412.198.85.299 1.301.299A3.022 3.022 0 0 0 22 12.14a9.935 9.935 0 0 0-.353-2.76c-1.04-3.826-4.353-6.754-8.247-7.284zm5.158 10.909-.412-.197c-1.828-.878-4.07-.198-5.135 1.494-.738 1.176-.813 2.576-.204 3.842l.199.416a.983.983 0 0 1-.051.961.992.992 0 0 1-.844.479h-.112a8.061 8.061 0 0 1-2.095-.283c-3.063-.831-5.403-3.479-5.826-6.586-.321-2.355.352-4.623 1.893-6.389a8.002 8.002 0 0 1 7.16-2.664c3.107.423 5.755 2.764 6.586 5.826.198.73.293 1.474.282 2.207-.012.807-.845 1.183-1.441.894z"></path><circle cx="7.5" cy="14.5" r="1.5"></circle><circle cx="7.5" cy="10.5" r="1.5"></circle><circle cx="10.5" cy="7.5" r="1.5"></circle><circle cx="14.5" cy="7.5" r="1.5"></circle></svg><span>${matchingDisc.Color} ${matchingDisc.Disc}</span></li>
<li><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill: rgba(0, 0, 0, 1);transform: ;msFilter:;"><path d="M15 11h7v2h-7zm1 4h6v2h-6zm-2-8h8v2h-8zM4 19h10v-1c0-2.757-2.243-5-5-5H7c-2.757 0-5 2.243-5 5v1h2zm4-7c1.995 0 3.5-1.505 3.5-3.5S9.995 5 8 5 4.5 6.505 4.5 8.5 6.005 12 8 12z"></path></svg><span>${matchingDisc.Name}</span></li>
<li><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill: rgba(0, 0, 0, 1);transform: ;msFilter:;"><path d="M13.707 3.293A.996.996 0 0 0 13 3H4a1 1 0 0 0-1 1v9c0 .266.105.52.293.707l8 8a.997.997 0 0 0 1.414 0l9-9a.999.999 0 0 0 0-1.414l-8-8zM12 19.586l-7-7V5h7.586l7 7L12 19.586z"></path><circle cx="8.496" cy="8.495" r="1.505"></circle></svg><span>${matchingDisc.Brand}</span></li>
</ul>
<a href="#" class="btn-2" onclick="claimDisc(${matchingDisc.ID})">Claim Disc</a>
</div>
</div>
</div>
</div>
</div>
`
)
.join("");
// Insert the HTML content into the "discInfoVerify" element
const discInfoVerifyElement =
document.getElementById("discInfoVerify");
discInfoVerifyElement.innerHTML = discInfoHTML;
}
} else {
window.location.href = `rescueFlowStep4.html?state=${encodeURIComponent(
stateInputValue
)}&course=${encodeURIComponent(
courseInputValue
)}&phone=${encodeURIComponent(
phoneInputValue
)}&initial=${encodeURIComponent(
firstInitialInputValue
)}&name=${encodeURIComponent(lastNameInputValue)}`;
}
}
function closePopupVerify() {
var popupVerify = document.getElementById("popup-verify");
popupVerify.style.display = "none";
}
function claimDisc(discID) {
var popupVerify = document.getElementById("popup-verify");
popupVerify.style.display = "none";
window.location.href = `claimDisc.html?id=${discID}`;
}
function openInventory() {
window.location.href = "searchInventory.html";
}
</script>
<style>
@media (max-width: 767px) {
.form-control {
width: 100% !important;
}
}
.form-control::placeholder {
color: var(--primary-blue);
text-align: left !important;
}
.form-control {
border: none;
width: 100% !important;
max-width: 500px !important;
border-radius: 0 !important;
height: 50px !important;
margin: 0 auto !important;
display: block !important;
}
.select-box {
height: auto;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
max-width: 400px !important;
}
.where .line-break {
display: block; /* Makes the span behave like a line break */
margin: 0; /* Removes any default margin */
}
.where .smaller-text {
display: block; /* Ensures this text appears on a new line */
margin-top: -5px; /* Adjusts the space above this line, set as needed */
}
body {
height: 100dvh;
background-color: var(--primary-blue) !important;
}
</style>
</head>
<body>
<section class="main-section text-center" id="reverse">
<div class="container" style="margin-top: 40px">
<i
class="fa fa-arrow-left"
style="
position: absolute;
top: 80px;
left: 20px;
font-size: 30px;
color: white;
padding: 5px;
"
aria-hidden="true"
onclick="goBack()"
></i>
<div class="d-flex align-items-center flex-column text-center mb-3">
<img
class="icon-logo"
src="./assets/icon_logo_transparent_300x300_secondary.png"
alt="logo"
onclick="refresh()"
/>
</div>
<div
class="rescue d-flex align-items-center flex-column text-center mb-2"
>
<h3 class="m-0 text-white">
RESCUE FLOW <span class="fw-light">wizard</span>
</h3>
<h3 class="m-0 text-white">
3 <span class="overtext-secondary">/ 5</span>
</h3>
</div>
<h3 class="mt-3 text-white text-center mb-3 where">
Throw and a <span class="secondary-missing-text">Miss</span>.
<span class="line-break"></span>
<span class="smaller-text">Not to worry, Let's keep searching</span>
</h3>
<div
class="row mb-4 select-box d-flex justify-content-center align-items-center"
style="height: auto; width: 100%"
>
<!-- <span class="m-0 text-white fw-light" style="font-size: 16px"
>*Enter J. Doe to simulate</span
> -->
<div class="col-4 pe-0 arrow one">
<select id="inputInitial" class="form-select" style>
<option selected>First Initial</option>
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
<option>E</option>
<option>F</option>
<option>G</option>
<option>H</option>
<option>I</option>
<option>J</option>
<option>K</option>
<option>L</option>
<option>M</option>
<option>N</option>
<option>O</option>
<option>P</option>
<option>Q</option>
<option>R</option>
<option>S</option>
<option>T</option>
<option>U</option>
<option>V</option>
<option>W</option>
<option>X</option>
<option>Y</option>
<option>Z</option>
</select>
</div>
<div class="col-8 pe-0" style="max-width: 60%">
<input
type="text"
class="form-control"
id="inputName"
placeholder="Enter Last Name"
pattern="[a-zA-Z\-]+"
/>
</div>
</div>
<div
class="row mb-3 select-box d-flex justify-content-center"
style="margin: auto"
>
<button class="stepbutton text-white mb-3" onClick="searchName()">
Let's try this again
</button>
<div class="pb-5">
<button
class="rememberbtn fw-light white-border"
onClick="skipStep()"
>
Didn't write one
</button>
</div>
</div>
</div>
<div class="demo-banner">
This is a demo version of the DRN Platform. Please enter "J. Doe" to
simulate the flow.
</div>
</section>
<div class="fab-menu-container" id="fabMenuContainer">
<div class="fab-menu" id="fabMenu">
<div class="fab-menu-item">
<a
class="fab-menu-item-text-left"
href="/reportLostDisc.html"
style="text-decoration: none"
>Report <br />
Lost Disc</a
>
<i class="bx bxs-analyse bx-sm" onclick="reportLostDisc()"></i>
</div>
<div class="fab-menu-item">
<a
class="fab-menu-item-text"
href="/requestCourse.html"
style="text-decoration: none"
>Request a Course</a
>
<i class="bx bx-map-pin bx-sm" onclick="requestCourse()"></i>
</div>
<div class="fab-menu-item">
<i class="bx bx-cog bx-sm" onclick="openSettings()"></i>
<a
class="fab-menu-item-text-right"
href="/settings.html"
style="text-decoration: none"
>Settings</a
>
</div>
</div>
</div>
<footer class="footer" id="f-reverse">
<div class="overlay" id="overlay" onclick="toggleFabMenu()"></div>
<div class="container">
<div class="footer-content row">
<div class="col-2">
<a class="d-flex align-items-center flex-column" href="/home.html">
<span class="img">
<img src="./assets/home.png" alt="home" />
</span>
<span>HOME</span>
</a>
</div>
<div class="col-2">
<a
class="d-flex align-items-center flex-column"
href="/searchInventory.html"
>
<span class="img">
<img
class="search"
src="./assets/search.png"
alt="home"
width="18"
/>
</span>
<span>SEARCH ALL</span>
</a>
<!-- <div class="wizardbox d-flex align-items-center">
<img src="./assets/arrow-down.png" alt="arrow">
<p>if you don’t want to use the wizard you can always just enter
the information manually on our search page</p>
</div> -->
</div>
<div class="col-2">
<a class="d-flex align-items-center flex-column" href="/store.html">
<span class="img">
<img src="./assets/disk-store.png" alt="home" />
</span>
<span>DISC STORE</span>
</a>
</div>
<div class="col-2">
<a
class="d-flex align-items-center flex-column"
href="/courses.html"
>
<span class="img">
<img src="./assets/courses.png" alt="home" />
</span>
<span>COURSES</span>
</a>
</div>
</div>
<!-- <button class="btnaction"><img class="btnlogo" src="./assets/app_center_btn_logo.png" alt="btnlogo"></button> -->
</div>
</footer>
<div class="fab-container" onclick="toggleFabMenu()" id="fabContainer">
<button class="fab" id="fab">
<img
src="./assets/app_center_btn_logo.png"
alt="Disc Rescue Network Logo"
class="logo-fab"
id="fabLogo"
/>
<span id="fabClose" style="display: none; z-index: 15">X</span>
<!-- Hidden by default -->
</button>
</div>
<div id="popup-verify" class="popup" style="flex-direction: column">
<div
class="popup-content"
id="popup-verify-content"
style="padding: 10px 5px !important"
>
<!-- <span class="close" id="close" onclick="closePopupVerify()"
>×</span
> -->
<div
class="course-section-popup"
style="margin: 0px !important; width: 100%"
>
<div
class="row"
id="discInfoVerify"
style="
color: var(--primary-black) !important;
margin: 0px !important;
padding: 0px !important;
width: 100% !important;
"
>
<!-- disc info will be populated here -->
</div>
</div>
<div id="loading-bar" class="loading-bar"></div>
</div>
<div
class="d-flex justify-content-center align-items-center mt-2 mb-2"
style="
flex-direction: column;
width: 90%;
max-width: 450px;
background: transparent;
justify-content: flex-start;
margin: auto;
padding-bottom: 50px;
"
>
<button class="stepbutton text-white mt-2 mb-3" onClick="skipStep()">
None of these are mine
</button>
<button
class="rememberbtn fw-light"
style="width: 80%; max-width: 450px"
onClick="openInventory()"
>
Let me see more of these type of discs
</button>
</div>
</div>
<script src="js/discs.js"></script>
</body>
</html>