-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
300 lines (261 loc) · 16.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
initial-scale=1, shrink-to-fit=no" />
<!-- Fonts -->
<link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet'>
<!-- Bootstrap and FontAwesome -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<link rel="stylesheet" href="./style.css" />
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet" />
<script defer src="./js/fontawesome/all.min.js"></script>
<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})
</script>
<!-- PubNub SDK -->
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.7.2.2.min.js"></script>
<!-- Application logic -->
<script src="./js/keys.js"></script>
<script src="./js/theme.js"></script>
<script src="./js/pubnub_setup.js"></script>
<!-- Interactive Demo Framework -->
<script type="text/javascript"
src="https://darryncampbell-pubnub.github.io/pubnub-demo-utils/js/interactive-demo-interface/v2/demo-interface.js"></script>
</head>
<!-- Interactive demo hosts this content in a window 824 pixels wide -->
<body id="body" onload="onload();">
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
<!-- Shown if no PubNub keys found in setup.js -->
<div class="container alert alert-danger alert-dismissible fade show" style="display:none" id="noKeysAlert"
role="alert">
<i class="fa-solid fa-triangle-exclamation"></i>
<strong>Cannot find PubNub keys.</strong> Please specify your PubNub keys in keys.js.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<!-- Main app body -->
<div class="container-fluid px-2">
<div class="row gy-2 px-0">
<div class="col">
<div id="map-canvas" class="mapcanvas">.</div>
</div>
</div>
<div class="row">
<div class="col-lg-5 col-md-5 gy-2 px-2">
<div class="px-0">
<div class="card text-dark mb-1 delivery-info-pane" style="width:100%;">
<div class="card-header text-center" id="selected-name">Delivery Information</div>
<ul class="list-group list-group-flush" id="deliveryInformationUL">
<li class="list-group-item" id="liManualAddress">
<div class="form-group">
<label for="txtManualAddress">Delivery Address</label>
<textarea class="form-control" id="txtManualAddress" rows=""></textarea>
</div>
</li>
<li class="list-group-item">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="chkFindMyLocation"
onchange="handleChkFindMyLocation();">
<label class="form-check-label" for="chkFindMyLocation">Find My Location</label>
<span class="location-span" id="spanDetectedLocation">Not Requested</span>
</div>
</li>
</ul>
</div>
<div class="card text-dark mb-1" style="width:100%;">
<div class="card-header text-center" id="selected-name">Vehicle En-Route</div>
<ul class="list-group list-group-flush" id="vehicleInformationUL">
<li class="list-group-item" id="vehicleInfo-selectFromMap">
Please Select a vehicle from the map
</li>
<li class="list-group-item" id="vehicleInfo-details" style="display:none">
</li>
<li class="list-group-item" id="vehicleInfo-messageDriver" style="display:none">
<label for="txtMessageDriver">Send Driver a message:</label>
<input type="text" class="form-control" id="txtMessageDriver"
maxlength="140"></input>
</li>
<li class="list-group-item" id="vehicleInfo-eta" style="display:none">
ETA:
</li>
</ul>
</div>
</div>
</div>
<div class="col gy-2 ps-2 order-pane">
<div class="px-1">
<!-- Tabs to choose what you want delivered -->
<!-- https://getbootstrap.com/docs/5.2/components/navs-tabs/ -->
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="package-delivery-tab" data-bs-toggle="tab"
data-bs-target="#package-delivery-tab-pane" type="button" role="tab"
aria-controls="package-delivery-tab-pane" aria-selected="true">Packages</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="taxi-tab" data-bs-toggle="tab"
data-bs-target="#taxi-tab-pane" type="button" role="tab"
aria-controls="taxi-tab-pane" aria-selected="false">Taxi / Rideshare</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="food-delivery-tab" data-bs-toggle="tab"
data-bs-target="#food-delivery-tab-pane" type="button" role="tab"
aria-controls="food-delivery-tab-pane" aria-selected="false">Food</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="package-delivery-tab-pane" role="tabpanel"
aria-labelledby="package-delivery-tab" tabindex="0">
<H3 class="tab-header">You Have 3 orders pending</H3>
<H2><i class="fa-solid fa-truck-fast" style="float:right"></i></H2>
<div>Please select packages to deliver:</div>
<H4 style="margin-top:10px">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="chkPackage1" checked>
<label class="form-check-label" for="chkPackage1"> Order# 96841: Socks / Hats</label>
</div>
</H4>
<H4 style="margin-top:10px">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="chkPackage2">
<label class="form-check-label" for="chkPackage2"> Order# 96842:
Kitchenware</label>
</div>
</H4>
<H4 style="margin-top:10px">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="chkPackage3">
<label class="form-check-label" for="chkPackage3"> Order# 96843: Cuddly
Toy</label>
</div>
</H4>
<button type="button" class="btn btn-pn" style="margin-top:10px;width:100%"
id="btnSummonPackageDelivery"
onclick="summonVehicle(THEME_PACKAGE_DELIVERY)">Deliver These
Packages</button>
</div>
<div class="tab-pane fade" id="taxi-tab-pane" role="tabpanel" aria-labelledby="taxi-tab"
tabindex="0">
<H3 class="tab-header">What vehicle would you like?</H3>
<H2><i class="fa-solid fa-car-side" style="float:right"></i></H2>
<div>Friendly drivers, fast service:</div>
<div class="btn-group" role="group">
<div class="form-check" style="margin-left: 10px">
<H4 style="margin-top:10px">
<input type="radio" class="form-check-input" name="chkTaxi" id="chkTaxi1"
checked>
<label class="form-check-label" for="chkTaxi1" id="lblTaxi1">4-Seater
Car</label>
</H4>
<H4 style="margin-top:10px">
<input type="radio" class="form-check-input" name="chkTaxi" id="chkTaxi2">
<label class="form-check-label" for="chkTaxi2" id="lblTaxi2">6-Seater
Minivan</label>
</H4>
<H4 style="margin-top:10px">
<input type="radio" class="form-check-input" name="chkTaxi" id="chkTaxi3">
<label class="form-check-label" for="chkTaxi3" id="lblTaxi3">12-Seater
Minibus</label>
</H4>
</div>
</div>
<button type="button" class="btn btn-pn" style="margin-top:10px;width:100%"
id="btnSummonTaxi" onclick="summonVehicle(THEME_TAXI)">Order Taxi</button>
</div>
</div>
<div class="tab-pane fade" id="food-delivery-tab-pane" role="tabpanel"
aria-labelledby="food-delivery-tab" tabindex="0">
<H3 class="tab-header">What would you like to eat?</H3>
<H2><i class="fa-solid fa-pizza-slice" style="float:right"></i></H2>
<div>Hungry? Thirsty? We can help with that.</div>
<H4 style="margin-top:10px">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="chkFood1">
<label class="form-check-label" for="chkFood1" id="lblFood1">Italian: Pizza</label>
</div>
</H4>
<H4 style="margin-top:10px">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="chkFood2">
<label class="form-check-label" for="chkFood2" id="lblFood2">Sushi</label>
</div>
</H4>
<H4 style="margin-top:10px">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="chkFood3">
<label class="form-check-label" for="chkFood3" id="lblFood3">Cup of Coffee</label>
</div>
</H4>
<button type="button" class="btn btn-pn" style="margin-top:10px;width:100%"
id="btnSummonFoodDelivery" onclick="summonVehicle(THEME_FOOD_DELIVERY)">Order
Food</button>
</div>
</div>
</div>
</div>
</div>
<!-- Modal: Error -->
<div class="modal" id="errorModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content p-2">
<div class="modal-header alert alert-danger">
<h5 class="modal-title" id="errorModalTitle">Problem</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3" id="errorModalMessage"></div>
</div>
</div>
</div>
</div>
<!-- Modal: Initial Help -->
<div class="modal" id="helpModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content p-2">
<div class="modal-header alert alert-info">
<h5 class="modal-title" id="helpModalTitle">Getting Started</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3" id="helpModalMessage">
<ol class="list-group list-group-numbered">
<li class="list-group-item border-0 d-flex justify-content-between align-items-start"><div class="ms-2 me-auto">Choose a delivery location</div></li>
<li class="list-group-item border-0 d-flex justify-content-between align-items-start"><div class="ms-2 me-auto">Select something to deliver from either the 'Packages', 'Taxi / Rideshare' or 'Food' tabs</div></li>
<li class="list-group-item border-0 d-flex justify-content-between align-items-start"><div class="ms-2 me-auto">You will see the vehicle start its journey. Click the vehicle to see its status</div></li>
<li class="list-group-item border-0 d-flex justify-content-between align-items-start"><div class="ms-2 me-auto">Open this app in multiple tabs and all your journeys will still be shown</div></li>
</ol>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Bootstrap -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
crossorigin="anonymous"></script>
<!-- Application logic -->
<script src="./js/pubnub_handler.js"></script>
<script src="./js/map.js"></script>
<script src="./js/deliveryInfo_helper.js"></script>
<script src="./js/vehicleInfo_helper.js"></script>
<!-- Mocked Server logic -->
<script src="./server/mockedServer.js"></script>
<script>
// Map
var jsElem = window.document.createElement('script');
jsElem.src = "https://maps.googleapis.com/maps/api/js?key=" + GOOGLE_KEY + "&callback=initialize";
jsElem.type = 'text/javascript';
document.getElementById('body').append(jsElem);
</script>
</body>
</html>