-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
551 lines (532 loc) · 21.1 KB
/
index.html
File metadata and controls
551 lines (532 loc) · 21.1 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Multi-Modal Grand Rapids</title>
<meta property="og:description" content="End the parking spiral." />
<meta property="og:type" content="website" />
<link
rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🚗</text></svg>"
/>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<link
rel="stylesheet"
href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
crossorigin=""
/>
<link rel="stylesheet" href="src/styles.css" />
</head>
<body class="bg-slate-50 text-slate-900 flex flex-col min-h-screen">
<main class="max-w-md mx-auto px-2 py-2 flex-1 w-full">
<div id="appView">
<div>
<!-- Step 1: Destination, Day and Time -->
<section
class="bg-white rounded-xl shadow-sm border border-slate-200 p-4 relative"
>
<a
href="/"
id="resetButton"
class="absolute top-4 right-4 w-6 h-6 rounded flex items-center justify-center text-slate-400 hover:text-slate-600 hover:bg-slate-100 hidden"
aria-label="Clear location"
title="Clear location"
>
<svg
class="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
/>
</svg>
</a>
<div id="whereWhenContent">
<h2 class="font-semibold text-lg">Where are you going?</h2>
<label class="block mt-4 text-sm font-medium">Destination</label>
<div class="mt-1 relative">
<select
id="destinationSelect"
class="w-full rounded-lg border border-slate-300 px-3 py-2 pr-10 bg-white appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 20 20%22%3E%3Cpath stroke=%22%236b7280%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M6 8l4 4 4-4%22/%3E%3C/svg%3E')] bg-[length:1.25rem_1.25rem] bg-[right_0.75rem_center] bg-no-repeat min-w-0"
>
<!-- Options populated from data/config.json destinations -->
</select>
</div>
<div
class="mt-4 grid grid-cols-[1fr_1fr_auto] gap-3 items-end min-w-0"
>
<div class="min-w-0">
<label class="block text-sm font-medium">Day</label>
<select
id="daySelect"
class="mt-1 w-full rounded-lg border border-slate-300 px-3 py-2 pr-10 bg-white appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 20 20%22%3E%3Cpath stroke=%22%236b7280%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M6 8l4 4 4-4%22/%3E%3C/svg%3E')] bg-[length:1.25rem_1.25rem] bg-[right_0.75rem_center] bg-no-repeat min-w-0"
>
<option value="" disabled>---</option>
<option value="monday">Monday</option>
<option value="tuesday">Tuesday</option>
<option value="wednesday">Wednesday</option>
<option value="thursday">Thursday</option>
<option value="friday">Friday</option>
<option value="saturday">Saturday</option>
<option value="sunday">Sunday</option>
</select>
</div>
<div class="min-w-0">
<label class="block text-sm font-medium">Time</label>
<select
id="timeSelect"
class="mt-1 w-full rounded-lg border border-slate-300 px-3 py-2 pr-10 bg-white appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 20 20%22%3E%3Cpath stroke=%22%236b7280%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M6 8l4 4 4-4%22/%3E%3C/svg%3E')] bg-[length:1.25rem_1.25rem] bg-[right_0.75rem_center] bg-no-repeat"
></select>
</div>
<button
type="button"
id="saveButton"
class="h-[42px] w-[42px] flex items-center justify-center bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:bg-slate-300 disabled:text-slate-500 disabled:cursor-not-allowed transition-colors"
disabled
title="Save and collapse"
aria-label="Save and collapse"
>
<svg
class="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 13l4 4L19 7"
/>
</svg>
</button>
</div>
</div>
<div id="whereWhenMinimized" class="hidden">
<button
type="button"
id="whereWhenExpand"
class="w-full flex items-center justify-between text-sm font-medium text-slate-500 text-left hover:text-slate-700 cursor-pointer py-1"
aria-label="Edit details"
title="Edit details"
>
<div class="flex-1 text-left">
<div
class="font-semibold text-slate-900 text-sm"
id="minimizedDestination"
>
Van Andel Arena
</div>
<div class="text-xs text-slate-500 mt-0.5">
<span id="minimizedDay"></span>
<span id="minimizedTimeSeparator" class="mx-0.5 hidden"
>@</span
>
<span id="minimizedTime"></span>
</div>
</div>
<svg
class="ml-4 w-4 h-4 text-slate-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"
/>
</svg>
</button>
</div>
<!-- TODO: Show flexibility toggle when ready -->
<button
type="button"
id="flexibilityToggle"
class="hidden mt-4 w-full flex items-center justify-between text-sm font-medium text-slate-500 text-left hover:text-slate-700 cursor-pointer"
>
<span>Flexibility</span>
<span id="flexibilityArrow">▼</span>
</button>
<div id="flexibilityContent" class="hidden mt-4">
<div class="mt-2">
<div class="flex items-center justify-between">
<label class="text-sm font-medium"
>Willing to arrive early</label
>
<span class="text-sm text-slate-600">
<span id="earlyValue">-15</span> min
</span>
</div>
<input
id="earlySlider"
type="range"
min="0"
max="60"
step="5"
value="15"
class="w-full mt-2"
/>
</div>
<div class="mt-4">
<div class="flex items-center justify-between">
<label class="text-sm font-medium"
>Willing to arrive late</label
>
<span class="text-sm text-slate-600">
<span id="lateValue">+0</span> min
</span>
</div>
<input
id="lateSlider"
type="range"
min="0"
max="60"
step="5"
value="0"
class="w-full mt-2"
/>
</div>
</div>
</section>
<!-- Step 2: Mode + People + Sliders -->
<section
id="preferencesSection"
class="bg-white rounded-xl shadow-sm border border-slate-200 p-4 mt-1 relative"
>
<button
type="button"
id="resetModesButton"
class="absolute top-4 right-4 w-6 h-6 rounded flex items-center justify-center text-slate-400 hover:text-slate-600 hover:bg-slate-100 hidden"
aria-label="Clear selected preferences"
title="Clear selected preferences"
>
<svg
class="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
/>
</svg>
</button>
<div class="flex items-center w-full gap-2 min-h-9">
<h2 class="font-semibold text-lg min-w-0 shrink leading-tight">
How will you get there?
</h2>
<div class="flex flex-1 min-w-0 justify-center items-center">
<button
type="button"
id="openModesExplainModal"
class="inline-flex shrink-0 items-center gap-1 text-xs px-2 py-1 rounded border border-slate-300 bg-white text-slate-700 hover:bg-slate-50 hover:border-slate-400 font-medium transition-colors"
title="What each travel mode means"
>
<svg
class="h-3.5 w-3.5 shrink-0"
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle cx="12" cy="12" r="10" fill="#1e293b" />
<circle cx="12" cy="8" r="2" fill="#f8fafc" />
<rect
x="10.25"
y="11.5"
width="3.5"
height="8.5"
rx="1.25"
fill="#f8fafc"
/>
</svg>
Explain modes
</button>
</div>
<div class="w-10 shrink-0" aria-hidden="true"></div>
</div>
<div id="preferencesSectionControls" class="relative">
<div class="mt-2 grid grid-cols-3 gap-2">
<button
type="button"
class="modeBtn rounded-lg border border-slate-300 py-2"
data-mode="drive"
>
🚗 Drive
</button>
<button
type="button"
class="modeBtn rounded-lg border border-slate-300 py-2"
data-mode="rideshare"
>
🚕 Uber/Lyft
</button>
<button
type="button"
class="modeBtn rounded-lg border border-slate-300 py-2"
data-mode="transit"
>
🚌 The Rapid
</button>
<button
type="button"
class="modeBtn rounded-lg border border-slate-300 py-2"
data-mode="shuttle"
>
🚐 DASH
</button>
<button
type="button"
class="modeBtn rounded-lg border border-slate-300 py-2"
data-mode="micromobility"
>
🛴 Lime
</button>
<button
type="button"
class="modeBtn rounded-lg border border-slate-300 py-2"
data-mode="bike"
>
🚲 Bike
</button>
</div>
<!-- Walk distance -->
<div id="walkBlock" class="mt-4">
<div class="flex items-center justify-between">
<label class="text-sm font-medium">Willing to walk</label>
<span class="text-sm text-slate-600">
<span id="walkValue">1.5</span
><span id="walkUnit"> miles</span>
<span id="walkTime"
>(<span id="walkTimeValue">30</span> min)</span
>
</span>
</div>
<input
id="walkSlider"
type="range"
min="0"
max="2"
step="0.1"
value="1.5"
class="w-full mt-2 disabled:opacity-50 disabled:cursor-not-allowed"
/>
</div>
<!-- Cost -->
<div class="mt-4">
<div class="flex items-center justify-between">
<label id="costLabel" class="text-sm font-medium"
>Willing to pay</label
>
<span class="text-sm text-slate-600">
<span id="costPrefix">$</span><span id="costValue">40</span>
</span>
</div>
<input
id="costSlider"
type="range"
min="0"
max="50"
value="40"
step="1"
class="w-full mt-2 disabled:opacity-50 disabled:cursor-not-allowed"
/>
</div>
<!-- TODO: Show people toggle when ready -->
<button
type="button"
id="peopleToggle"
class="hidden mt-6 w-full flex items-center justify-between text-sm font-medium text-slate-500 text-left hover:text-slate-700 cursor-pointer"
>
<span>People</span>
<span id="peopleArrow">▼</span>
</button>
<div id="peopleContent" class="hidden mt-4">
<div class="flex items-center gap-2">
<button
class="w-10 h-10 rounded-lg border border-slate-300 bg-white"
onclick="adjustPeople(-1)"
aria-label="Decrease people"
>
−
</button>
<div
id="peopleCount"
class="flex-1 text-center font-semibold text-lg"
>
1
</div>
<button
class="w-10 h-10 rounded-lg border border-slate-300 bg-white"
onclick="adjustPeople(1)"
aria-label="Increase people"
>
+
</button>
</div>
</div>
</div>
</section>
<!-- Step 4: Results -->
<div class="mt-6 -mx-2">
<div id="results" class="space-y-2"></div>
</div>
</div>
</div>
<div id="modesView" class="hidden">
<div class="bg-white rounded-xl shadow-sm border border-slate-200 p-4">
<div class="flex flex-wrap items-start justify-between gap-2 mb-3">
<h2 class="font-semibold text-lg">How each mode works</h2>
<a
id="modesPageBackLink"
href="#/visit"
class="text-sm text-blue-600 hover:underline shrink-0"
>← Planner</a
>
</div>
<p class="text-sm text-slate-600 mb-4">
These are the travel options you can combine on the visit page.
Where we have location data, a map shows how the app uses it around
Grand Rapids.
</p>
<div
id="modesPageSections"
class="grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3"
></div>
</div>
</div>
<div id="dataView" class="hidden">
<div class="bg-white rounded-xl shadow-sm border border-slate-200 p-4">
<div
id="dataViewParkingModes"
class="hidden mt-2 mb-3 flex items-center gap-2"
></div>
<div
id="dataViewStrategiesFilters"
class="hidden mt-2 mb-3 flex items-center gap-2"
></div>
<div
id="dataViewDestinationsBar"
class="hidden mt-2 mb-3 flex items-center gap-2"
></div>
<div
id="dataViewRoutesModes"
class="hidden mt-2 mb-3 flex flex-wrap items-center gap-2"
></div>
<div id="dataViewIndex" class="space-y-1"></div>
<div
id="dataViewMap"
class="hidden mt-2 mb-2 rounded-lg border border-slate-200 overflow-hidden"
style="height: calc(100vh - 10rem)"
></div>
<div id="dataViewDetail" class="hidden">
<h2
id="dataViewDetailTitle"
class="font-medium text-base mt-2 mb-1"
></h2>
<pre
id="dataViewContent"
class="overflow-auto bg-slate-50 p-3 rounded-lg border border-slate-200 whitespace-pre-wrap break-words"
></pre>
</div>
</div>
</div>
</main>
<div
id="modesExplainModal"
class="hidden fixed inset-0 z-[100] flex items-stretch justify-center bg-slate-900/50 p-2 sm:p-4"
role="dialog"
aria-modal="true"
aria-hidden="true"
aria-labelledby="modesExplainModalTitle"
>
<div
id="modesExplainModalPanel"
class="flex flex-col w-full max-w-4xl max-h-full min-h-0 bg-white rounded-xl border border-slate-200 shadow-xl overflow-hidden"
>
<div
class="flex items-start justify-between gap-3 p-4 border-b border-slate-200 shrink-0"
>
<div class="min-w-0">
<h2 id="modesExplainModalTitle" class="font-semibold text-lg">
How each mode works
</h2>
<p class="text-sm text-slate-600 mt-1">
Where we have location data, a map shows how the app uses it
around Grand Rapids.
</p>
</div>
<button
type="button"
id="modesExplainModalClose"
class="shrink-0 rounded-lg p-2 text-slate-500 hover:text-slate-800 hover:bg-slate-100"
aria-label="Close"
>
<svg
class="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
</div>
<div
class="flex-1 min-h-0 overflow-y-auto overscroll-contain p-4"
id="modesExplainModalScroll"
>
<div
id="modesExplainModalSections"
class="grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3"
></div>
</div>
</div>
</div>
<div id="footer" class="py-2 text-center text-xs text-slate-400 shrink-0">
<a href="https://plangr.com" class="text-slate-500 hover:text-slate-600"
><b>Plan GR</b></a
>
is an
<a
href="https://github.com/citizenlabsgr/multimodality"
target="_blank"
rel="noopener noreferrer"
class="text-slate-500 hover:text-slate-600"
><b>open source</b></a
>
project by
<a
href="https://citizenlabs.org/"
target="_blank"
rel="noopener noreferrer"
class="text-slate-500 hover:text-slate-600"
><b>Citizen Labs</b></a
>.
</div>
<script
src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
crossorigin=""
></script>
<script src="src/script.js"></script>
</body>
</html>