-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrescueFlowStep2.html
More file actions
464 lines (422 loc) · 17.6 KB
/
rescueFlowStep2.html
File metadata and controls
464 lines (422 loc) · 17.6 KB
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
<!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" />
<!-- 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 2</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"
/>
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
<script>
let simulatedDisc;
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
// 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() {
closePopupVerify();
// Retrieve the "color" query parameter from the URL
const stateInputValue = getQueryParam("state");
console.log(stateInputValue);
const courseInputValue = getQueryParam("course");
console.log(courseInputValue);
let phoneInputValue = document.getElementById("inputPhone").value;
if (phoneInputValue == "") {
phoneInputValue = "";
}
window.location.href = `rescueFlowStep3.html?state=${encodeURIComponent(
stateInputValue
)}&course=${encodeURIComponent(
courseInputValue
)}&phone=${encodeURIComponent(phoneInputValue)}`;
}
function searchPhoneNumber() {
// Retrieve the "color" query parameter from the URL
const stateInputValue = getQueryParam("state");
console.log(stateInputValue);
const courseInputValue = getQueryParam("course");
console.log(courseInputValue);
const phoneInputValue = document.getElementById("inputPhone").value;
// Check if a disc is found (you can modify this condition)
var disc_found = false; // Change this condition as needed
if (phoneInputValue == "999-123-4567") {
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 discID that was passed in the URL & display the disc info in the popup-verify
const matchingDisc = found_discs.find(
(disc) => disc.PhoneNumber === "4567"
);
console.log(matchingDisc);
simulatedDisc = matchingDisc;
const discInfoHTML = `
<div class="disc-item">
<div class="course-box">
<div class="course-box-detail flow-step">
<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>
</div>
</div>
</div>
</div>`;
// Insert the HTML content into the "discInfoVerify" element
const discInfoVerifyElement =
document.getElementById("discInfoVerify");
discInfoVerifyElement.innerHTML = discInfoHTML;
} else {
window.location.href = `rescueFlowStep3.html?state=${encodeURIComponent(
stateInputValue
)}&course=${encodeURIComponent(
courseInputValue
)}&phone=${encodeURIComponent(phoneInputValue)}`;
}
}
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 closePopupVerify() {
var popupVerify = document.getElementById("popup-verify");
popupVerify.style.display = "none";
}
function claimDisc() {
var popupVerify = document.getElementById("popup-verify");
popupVerify.style.display = "none";
console.log(simulatedDisc);
const simulatedDiscID = simulatedDisc.ID;
console.log(simulatedDiscID);
window.location.href = `claimDisc.html?id=${simulatedDiscID}`;
}
function formatPhoneNumber(inputField) {
var input = inputField.value;
input = input.replace(/\D/g, ""); // Remove all non-numeric characters
// Basic formatting for US numbers (you can modify this as needed)
if (input.length > 3 && input.length <= 6) {
input = input.slice(0, 3) + "-" + input.slice(3);
} else if (input.length > 6) {
input =
input.slice(0, 3) +
"-" +
input.slice(3, 6) +
"-" +
input.slice(6, 10);
}
inputField.value = input; // Set the formatted value back to the input field
}
</script>
<style>
.select-box {
height: auto;
display: flex;
justify-content: center;
align-items: center;
}
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">2 <span class="overtext-secondary">/ 5</span></h3>
</div>
<h3 class="mt-3 text-white text-center mb-3 where">
New Phone, <span class="secondary-missing-text">Who Dis?</span>
</h3>
<div
class="row mb-4 select-box d-flex justify-content-center align-items-center"
style="height: auto"
>
<div class="col-12 col-md-10 col-lg-8" style="padding: 0">
<!-- <span class="m-0 text-white fw-light" style="font-size: 16px"
>*Enter 999-123-4567 to simulate</span
> -->
<input
type="tel"
class="form-control"
id="inputPhone"
placeholder="PHONE NUMBER WRITTEN ON THE DISC"
inputmode="numeric"
oninput="formatPhoneNumber(this)"
/>
</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="searchPhoneNumber()"
>
Locate My Disc
</button>
<div class="pb-5">
<button class="rememberbtn fw-light white-border" onClick="skipStep()">
Didn't Write One
</button>
</div>
</div>
</div>
</div>
<div class="demo-banner">
This is a demo version of the DRN Platform. Please enter 999-123-4567 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"
>
<!-- <span class="close" id="close" onclick="closePopupVerify()"
>×</span
> -->
<div class="verify-info">
<div
class="verify-row m-0"
id="discInfoVerify"
style="
color: var(--primary-black) !important;
width: 65%;
max-width: 400px;
"
>
<!-- 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"
style="width: 90%; max-width: 450px"
onClick="claimDisc()"
>
Perfect! Give me my disc back!
</button>
<button
class="rememberbtn fw-light"
style="width: 80%; max-width: 450px"
onClick="skipStep()"
>
This is not mine
</button>
</div>
</div>
<script src="js/discs.js"></script>
</body>
</html>