-
Notifications
You must be signed in to change notification settings - Fork 0
/
booking.html
683 lines (608 loc) · 27.3 KB
/
booking.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
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
<!doctype html>
<html class="h-100" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<link rel="apple-touch-icon" sizes="180x180" href="img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<meta name="author" content="Amer Tahri-Joutey, Hassan Chalf">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<meta name="generator" content="Eleventy v2.0.0">
<meta name="HandheldFriendly" content="true">
<title>TaxiQuick — Who We Are</title>
<link rel="stylesheet" href="css/main.css">
<style>
/* inter-300 - latin */
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 300;
font-display: swap;
src: local(''),
url('fonts/inter-v12-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/inter-v12-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* inter-400 - latin */
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local(''),
url('fonts/inter-v12-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/inter-v12-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 500;
font-display: swap;
src: local(''),
url('fonts/inter-v12-latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/inter-v12-latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 700;
font-display: swap;
src: local(''),
url('fonts/inter-v12-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/inter-v12-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
</style>
</head>
<body class="bg-black text-white mt-0" data-bs-spy="scroll" data-bs-target="#navScroll">
<nav id="navScroll" class="navbar navbar-dark bg-black fixed-top px-vw-5" tabindex="0">
<div class="container">
<a class="navbar-brand pe-md-4 fs-4 col-12 col-md-auto text-center" href="index.html">
<img src="img/taxi.png" width="30" height="30" style="margin-top: -10px;" class="d-inline-block align-text-top me-2" alt="TaxiQuick logo">
<path d="m14.12 10.163 1.715.858c.22.11.22.424 0 .534L8.267 15.34a.598.598 0 0 1-.534 0L.165 11.555a.299.299 0 0 1 0-.534l1.716-.858 5.317 2.659c.505.252 1.1.252 1.604 0l5.317-2.66zM7.733.063a.598.598 0 0 1 .534 0l7.568 3.784a.3.3 0 0 1 0 .535L8.267 8.165a.598.598 0 0 1-.534 0L.165 4.382a.299.299 0 0 1 0-.535L7.733.063z"/>
<path d="m14.12 6.576 1.715.858c.22.11.22.424 0 .534l-7.568 3.784a.598.598 0 0 1-.534 0L.165 7.968a.299.299 0 0 1 0-.534l1.716-.858 5.317 2.659c.505.252 1.1.252 1.604 0l5.317-2.659z"/>
</svg>
<span class="ms-md-1 mt-1 fw-bolder me-md-5">TaxiQuick</span>
</a>
<ul class="navbar-nav mx-auto mb-2 mb-lg-0 list-group list-group-horizontal">
<li class="nav-item">
<a class="nav-link fs-5" href="index.html" aria-label="Homepage">
Home
</a>
</li>
<li class="nav-item">
<a class="nav-link fs-5" href="about.html" aria-label="A sample content page">
About
</a>
</li>
<li class="nav-item">
<a class="nav-link fs-5" href="index.html#pricing" aria-label="Pricing section">
Pricing
</a>
</li>
</li>
<li class="nav-item">
<a class="nav-link fs-5" href="mailto:[email protected]" aria-label="A sample content page">
Contact
</a>
</li>
</ul>
</div>
</nav>
<main>
<div class="container" data-aos="fade">
<div class="row d-flex justify-content-center py-vh-5 pb-0">
<div class="col-12 col-lg-10 col-xl-8">
<div class="row">
<div class="col-12">
<h1 class="display-1 fw-bold" style="margin-top: 45px; text-align: center; cursor: default;">Booking</h1>
<p class="lead border-top pt-5 mt-5"></p>
</div>
</div>
</div>
<header class="header__container" data-aos="fade-up">
<div class="header__image__container">
<div class="header__content" data-aos="fade">
<h1>Book Your Quick Taxi Ride</h1>
<p>Fast and Easy Taxi Booking Anytime, Anywhere at the Lowest Price</p>
</div>
<div class="booking__container">
<form>
<div class="form__group">
<div class="input__group">
<input type="text" id="pickup-location" maxlength="28" required/>
<label for="pickup-location">Pickup Location</label>
<div id="pickup-suggestions"></div>
</div>
<p>Where should we pick you up?</p>
</div>
<div class="form__group">
<div class="input__group">
<input type="text" id="drop-off-location" maxlength="28" required/>
<label for="drop-off-location">Drop-off Location</label>
<div id="drop-off-suggestions"></div>
</div>
<p>Where are you heading?</p>
</div>
<div class="form__group">
<div class="input__group">
<input type="text" id="pickup-date" required/>
<label for="pickup-date">Pickup Date</label>
</div>
<p>Select date</p>
<!-- Calendar Wrapper -->
<div class="calendar-wrapper" id="calendar-wrapper">
<div class="wrapper">
<header>
<p class="current-date"></p>
<div class="icons">
<span id="prev" class="material-symbols-rounded">chevron_left</span>
<span id="next" class="material-symbols-rounded">chevron_right</span>
</div>
</header>
<div class="calendar">
<ul class="weeks">
<li>Sun</li>
<li>Mon</li>
<li>Tue</li>
<li>Wed</li>
<li>Thu</li>
<li>Fri</li>
<li>Sat</li>
</ul>
<ul class="days"></ul>
</div>
</div>
</div>
</div>
<div class="form__group">
<div class="input__group">
<input type="time" id="pickup-time" required/>
<label for="pickup-time">Pickup Time</label>
</div>
<p>Select Time</p>
</div>
</form>
<div>
<button class="btn">
<img class="btn-image" src="img/search.png" alt="Search Icon" id="search-icon">
<img class="btn-image" src="img/close.png" alt="Close Icon" id="close-icon" style="display: none;">
</button>
</div>
</div>
</header>
<div id="available-drivers" class="col-12 col-lg-10 col-xl-8" style="margin-bottom: 150px; margin-top: 50px;" data-aos="fade-up">
<img src="img/drivers.png" alt="Drivers" data-aos="fade" style="position: relative; margin-top: 40px; max-width: 38px; display: block; position: relative; margin-left: auto; margin-right: auto;">
<div class="row d-flex align-items-start" data-aos="fade-up">
<h2 style="margin-top: -15px; padding-bottom: 30px;" class="h3 pt-5 text-center border-bottom">Available drivers</h2>
<div class="driver-card" data-aos="fade-up" data-aos-delay="400">
<img src="img/driver1.jpg" alt="Profile Picture" class="profile-picture">
<div class="driver-info">
<h3>John Doe</h3>
<p>Rating: ★★★★☆</p>
<p>Experience: 6 years on the road</p>
<div class="driver-actions">
<button class="icon-btn"><i class="fas fa-comment"></i> Message</button>
<button class="icon-btn"><i class="fas fa-phone"></i> Call</button>
<button class="book-now-btn">Book Now</button>
</div>
</div>
</div>
<div class="driver-card" data-aos="fade-up" data-aos-delay="500">
<img src="img/driver2.jpg" alt="Profile Picture" class="profile-picture">
<div class="driver-info">
<h3>Jane Smith</h3>
<p>Rating: ★★★★★</p>
<p>Experience: 4 years on the road</p>
<div class="driver-actions">
<button class="icon-btn"><i class="fas fa-comment"></i> Message</button>
<button class="icon-btn"><i class="fas fa-phone"></i> Call</button>
<button class="book-now-btn">Book Now</button>
</div>
</div>
</div>
<div class="driver-card" data-aos="fade-up" data-aos-delay="600">
<img src="img/driver3.jpg" alt="Profile Picture" class="profile-picture">
<div class="driver-info">
<h3>Michael Johnson</h3>
<p>Rating: ★★★☆☆</p>
<p>Experience: 2 years on the road</p>
<div class="driver-actions">
<button class="icon-btn"><i class="fas fa-comment"></i> Message</button>
<button class="icon-btn"><i class="fas fa-phone"></i> Call</button>
<button class="book-now-btn">Book Now</button>
</div>
</div>
</div>
<div class="driver-card" data-aos="fade-up" data-aos-delay="700">
<img src="img/driver4.jpg" alt="Profile Picture" class="profile-picture">
<div class="driver-info">
<h3>Emily Davis</h3>
<p>Rating: ★★★★☆</p>
<p>Experience: 2 years on the road</p>
<div class="driver-actions">
<button class="icon-btn"><i class="fas fa-comment"></i> Message</button>
<button class="icon-btn"><i class="fas fa-phone"></i> Call</button>
<button class="book-now-btn">Book Now</button>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="bg-black border-top border-dark">
<div class="container py-vh-4 text-secondary fw-lighter">
<div class="row">
<div class="col-12 col-lg-5 py-4 text-center text-lg-start">
<a class="navbar-brand pe-md-4 fs-4 col-12 col-md-auto text-center">
<img src="img/taxi.png" width="5%" style="margin-top: -5px; filter: brightness(50%);" class="d-inline-block align-text-top" alt="TaxiQuick logo">
<span class="ms-md-1 mt-1 fw-bolder me-md-5" style="cursor: default;">TaxiQuick</span>
</a>
</div>
<div class="col border-end border-dark">
<span class="h6">Company</span>
<ul class="nav flex-column">
<li class="nav-item">
<a href="about.html" class="link-fancy link-fancy-light">About us</a>
</li>
<li class="nav-item">
<a href="/legal/taxiquick-legal-terms-and-conditions.pdf" class="link-fancy link-fancy-light" target="_blank">Legal</a>
</li>
</ul>
</div>
<div class="col border-end border-dark">
<span class="h6">Services</span>
<ul class="nav flex-column">
<li class="nav-item">
<a href="index.html#pricing" class="link-fancy link-fancy-light">Pricing</a>
</li>
<li class="nav-item">
</li>
<li class="nav-item">
<a href="index.html#testimonials" class="link-fancy link-fancy-light">Testimonials</a>
</li>
</ul>
</div>
<div class="col">
<span class="h6">Support</span>
<ul class="nav flex-column">
<li class="nav-item">
<a href="mailto:[email protected]" class="link-fancy link-fancy-light">Contact</a>
</li>
<li class="nav-item">
<a href="newsletter.html" class="link-fancy link-fancy-light">Subscribe</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/aos.js"></script>
<script>
AOS.init({
duration: 800,
});
let scrollpos = window.scrollY
const header = document.querySelector(".navbar")
const header_height = header.offsetHeight
const add_class_on_scroll = () => header.classList.add("scrolled", "shadow-sm")
const remove_class_on_scroll = () => header.classList.remove("scrolled", "shadow-sm")
window.addEventListener('scroll', function() {
scrollpos = window.scrollY;
if (scrollpos >= header_height) { add_class_on_scroll() }
else { remove_class_on_scroll() }
console.log(scrollpos)
})
function formatDate(input) {
input.value = input.value.replace(/./g, '');
}
document.getElementById('pickup-date').addEventListener('input', (event) => {
formatDate(event.target);
});
document.querySelectorAll('.input__group input').forEach(input => {
const handleLabel = () => {
const label = input.nextElementSibling;
if (input.value) {
label.classList.add('active');
} else {
label.classList.remove('active');
}
};
input.addEventListener('input', handleLabel);
input.addEventListener('focus', handleLabel);
input.addEventListener('blur', handleLabel);
handleLabel();
});
document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll('.input__group input').forEach(input => {
if (input.value) {
input.nextElementSibling.classList.add('active');
}
});
});
const dateInput = document.getElementById('pickup-date');
const calendarWrapper = document.getElementById('calendar-wrapper');
dateInput.addEventListener('click', (event) => {
calendarWrapper.classList.toggle('show');
event.stopPropagation();
});
document.addEventListener('click', (event) => {
if (!calendarWrapper.contains(event.target) && event.target !== dateInput) {
calendarWrapper.classList.remove('show');
}
});
document.querySelector('.days').addEventListener('click', (event) => {
if (event.target.tagName === 'LI' && !event.target.classList.contains('inactive') && !event.target.classList.contains('disabled')) {
const selectedDate = event.target.textContent.padStart(2, '0');
const month = (currMonth + 1).toString().padStart(2, '0');
const year = currYear;
dateInput.value = dateInput.value = `${selectedDate.padStart(2, '0')}/${month}/${year}`;
calendarWrapper.classList.remove('show');
const label = dateInput.nextElementSibling;
label.classList.add('active');
}
});
const daysTag = document.querySelector('.days');
const currentDate = document.querySelector('.current-date');
const prevNextIcon = document.querySelectorAll('.icons span');
let date = new Date();
let currYear = date.getFullYear();
let currMonth = date.getMonth();
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
const renderCalendar = () => {
const firstDayOfMonth = new Date(currYear, currMonth, 1).getDay();
const lastDateOfMonth = new Date(currYear, currMonth + 1, 0).getDate();
const lastDayOfMonth = new Date(currYear, currMonth, lastDateOfMonth).getDay();
const lastDateOfLastMonth = new Date(currYear, currMonth, 0).getDate();
let liTag = '';
for (let i = firstDayOfMonth; i > 0; i--) {
liTag += `<li class="inactive">${lastDateOfLastMonth - i + 1}</li>`;
}
for (let i = 1; i <= lastDateOfMonth; i++) {
const isToday = i === date.getDate() && currMonth === date.getMonth() && currYear === date.getFullYear();
const isPastDate = new Date(currYear, currMonth, i) < new Date().setHours(0, 0, 0, 0);
liTag += `<li class="${isToday ? 'active' : isPastDate ? 'disabled' : ''}">${i}</li>`;
}
for (let i = lastDayOfMonth; i < 6; i++) {
liTag += `<li class="inactive">${i - lastDayOfMonth + 1}</li>`;
}
currentDate.textContent = `${months[currMonth]} ${currYear}`;
daysTag.innerHTML = liTag;
};
renderCalendar();
prevNextIcon.forEach(icon => {
icon.addEventListener('click', () => {
currMonth = icon.id === 'prev' ? currMonth - 1 : currMonth + 1;
if (currMonth < 0 || currMonth > 11) {
date = new Date(currYear, currMonth, date.getDate());
currYear = date.getFullYear();
currMonth = date.getMonth();
} else {
date = new Date();
}
renderCalendar();
});
});
const input = document.getElementById("pickup-location");
const pickupsuggestions = document.getElementById("pickup-suggestions");
const dropOffInput = document.getElementById("drop-off-location");
const dropOffSuggestions = document.getElementById("drop-off-suggestions");
const londonStreetsWithPostalCodes = [
{ street: "100 Baker St", postalCode: "W1U" },
{ street: "400 Oxford St", postalCode: "W1D, W1C, W1B" },
{ street: "300 Piccadilly", postalCode: "W1J, W1A" },
{ street: "500 Earl's Court Rd", postalCode: "SW5, SW10" },
{ street: "200 Hammersmith Rd", postalCode: "W14" },
{ street: "600 Rotherhithe St", postalCode: "SE16" },
{ street: "700 Borough Rd", postalCode: "SE1" },
{ street: "800 St. John's St", postalCode: "EC1V, EC1R" },
{ street: "900 Clerkenwell Rd", postalCode: "EC1R" },
{ street: "1100 Barbican", postalCode: "EC2Y" },
{ street: "1200 Moorgate", postalCode: "EC2R" },
{ street: "1300 Liverpool St", postalCode: "EC2M" },
{ street: "1400 Victoria Park Rd", postalCode: "E9" },
{ street: "1500 Grove Rd", postalCode: "E3" },
{ street: "1600 Dalston Ln", postalCode: "E8" },
{ street: "1700 London Rd", postalCode: "SE23" },
{ street: "1800 Chiswick High Rd", postalCode: "W4" },
{ street: "1900 Mortlake Rd", postalCode: "SW14" },
{ street: "2000 Putney High St", postalCode: "SW15" },
{ street: "2100 Holloway Rd", postalCode: "N7" },
{ street: "2200 Farringdon Rd", postalCode: "EC1M" },
{ street: "2300 Lambeth Rd", postalCode: "SE1" },
{ street: "2400 Kennington Rd", postalCode: "SE11" },
{ street: "2500 Vauxhall St", postalCode: "SE11" },
{ street: "2600 Drury Ln", postalCode: "WC2B" },
{ street: "2700 Euston Square", postalCode: "NW1" },
{ street: "2800 Tottenham Court Rd", postalCode: "W1T" },
{ street: "2900 Sloane St", postalCode: "SW1X" },
{ street: "3000 Knightsbridge", postalCode: "SW1X" },
{ street: "3100 Belgravia", postalCode: "SW1W" },
{ street: "3200 Bond St", postalCode: "W1S, W1C" },
{ street: "3300 Regent St", postalCode: "W1B, W1C" },
{ street: "3400 Kings Rd", postalCode: "SW3, SW10" },
{ street: "3500 Carnaby St", postalCode: "W1F" },
{ street: "3600 Fleet St", postalCode: "EC4Y, EC4A" },
{ street: "3700 Charing Cross Rd", postalCode: "WC2H, WC2N" },
{ street: "3800 Park Ln", postalCode: "W1K" },
{ street: "3900 Shaftesbury Ave", postalCode: "W1D, WC2H" },
{ street: "4000 Downing St", postalCode: "SW1A" },
{ street: "4100 Pall Mall", postalCode: "SW1Y" },
{ street: "4200 The Strand", postalCode: "WC2R" },
{ street: "4300 Whitehall", postalCode: "SW1A" },
{ street: "4400 Portobello Rd", postalCode: "W10, W11" },
{ street: "4500 Marylebone Rd", postalCode: "NW1" },
{ street: "4600 Euston Rd", postalCode: "NW1, WC1H" },
{ street: "4700 Covent Garden", postalCode: "WC2E" },
{ street: "4800 Leicester Square", postalCode: "WC2H" },
{ street: "4900 Soho Square", postalCode: "W1D" },
{ street: "5000 St James's St", postalCode: "SW1A" },
{ street: "5100 Victoria St", postalCode: "SW1E" },
{ street: "5200 Westminster Bridge Rd", postalCode: "SE1" },
{ street: "5300 Vauxhall Bridge Rd", postalCode: "SW1V" },
{ street: "5400 Kensington High St", postalCode: "W8" },
{ street: "5500 Brompton Rd", postalCode: "SW3, SW7" },
{ street: "5600 Camden High St", postalCode: "NW1" },
{ street: "5700 Hampstead High St", postalCode: "NW3" },
{ street: "5800 High Holborn", postalCode: "WC1V" },
{ street: "5900 Ludgate Hill", postalCode: "EC4M" },
{ street: "6000 Southwark St", postalCode: "SE1" },
{ street: "6100 Borough High St", postalCode: "SE1" },
{ street: "6200 Clapham High St", postalCode: "SW4" },
{ street: "6300 Brixton Rd", postalCode: "SW9" },
{ street: "6400 Peckham High St", postalCode: "SE15" },
{ street: "6500 Old Kent Rd", postalCode: "SE1, SE15" },
{ street: "6600 Islington High St", postalCode: "N1" },
{ street: "6700 Upper St", postalCode: "N1" },
{ street: "6800 Caledonian Rd", postalCode: "N1" },
{ street: "6900 Kingsway", postalCode: "WC2B" },
{ street: "7000 The Mall", postalCode: "SW1A" },
{ street: "7100 Queensway", postalCode: "W2" },
{ street: "7200 Holland Park Ave", postalCode: "W11" },
{ street: "7300 Goldhawk Rd", postalCode: "W12" },
{ street: "7400 Edgware Rd", postalCode: "W2" },
{ street: "7500 Fitzroy St", postalCode: "W1T" },
{ street: "7600 Charlotte St", postalCode: "W1T" },
{ street: "7700 Berwick St", postalCode: "W1F" },
{ street: "7800 Great Portland St", postalCode: "W1W" },
{ street: "7900 Great Russell St", postalCode: "WC1B" },
{ street: "8000 New Bond St", postalCode: "W1S" },
{ street: "8100 Mount St", postalCode: "W1K" },
{ street: "8200 Aldgate High St", postalCode: "EC3N" },
{ street: "8300 Bishopsgate", postalCode: "EC2M" },
{ street: "8400 Threadneedle St", postalCode: "EC2R" },
{ street: "8500 Cheapside", postalCode: "EC2V" },
{ street: "8600 Cannon St", postalCode: "EC4N" },
{ street: "8700 Fenchurch St", postalCode: "EC3M" },
{ street: "8800 Leadenhall St", postalCode: "EC3V" },
{ street: "8900 Mansion House St", postalCode: "EC4N" },
{ street: "9000 Monument St", postalCode: "EC3R" },
{ street: "9100 Cornhill", postalCode: "EC3V" },
{ street: "9200 Lombard St", postalCode: "EC3V" },
{ street: "9300 Paternoster Square", postalCode: "EC4M" },
{ street: "9400 Victoria Embankment", postalCode: "WC2N, EC4Y" },
{ street: "9500 Tower Hill", postalCode: "EC3N" },
{ street: "9600 Queen Victoria St", postalCode: "EC4V" },
{ street: "9700 Upper Thames St", postalCode: "EC4V" },
{ street: "9800 Southwark Bridge Rd", postalCode: "SE1" },
{ street: "9900 Tooley St", postalCode: "SE1" },
{ street: "10000 Globe Rd", postalCode: "E2" },
{ street: "10100 Mile End Rd", postalCode: "E1, E3" },
{ street: "10200 Bethnal Green Rd", postalCode: "E2" },
{ street: "10300 Hackney Rd", postalCode: "E2" },
{ street: "10400 Commercial St", postalCode: "E1" },
{ street: "10500 Whitechapel Rd", postalCode: "E1" },
{ street: "10600 Cambridge Heath Rd", postalCode: "E2" },
{ street: "10700 Shoreditch High St", postalCode: "E1, E2" }
];
let selectedPickup = null;
const expandedLondonStreets = londonStreetsWithPostalCodes.flatMap(item => {
return item.postalCode.split(',').map(code => ({
street: item.street,
postalCode: code.trim()
}));
});
input.addEventListener("input", function() {
const query = this.value.toLowerCase();
pickupsuggestions.innerHTML = "";
if (query.length > 0) {
const matches = expandedLondonStreets.filter(item =>
item.street.toLowerCase().includes(query) ||
item.postalCode.toLowerCase().includes(query)
);
matches.forEach(match => {
const div = document.createElement("div");
div.textContent = `${match.street}, ${match.postalCode}`;
div.addEventListener("click", function() {
input.value = `${match.street}, ${match.postalCode}`;
pickupsuggestions.innerHTML = "";
});
pickupsuggestions.appendChild(div);
});
}
});
dropOffInput.addEventListener("input", function() {
const query = this.value.toLowerCase();
dropOffSuggestions.innerHTML = "";
if (query.length > 0) {
const matches = expandedLondonStreets.filter(item =>
item.street.toLowerCase().includes(query) ||
item.postalCode.toLowerCase().includes(query)
);
matches.forEach(match => {
const div = document.createElement("div");
div.textContent = `${match.street}, ${match.postalCode}`;
div.addEventListener("click", function() {
dropOffInput.value = `${match.street}, ${match.postalCode}`;
dropOffSuggestions.innerHTML = "";
});
dropOffSuggestions.appendChild(div);
});
}
});
document.addEventListener("click", function(event) {
if (!event.target.closest("#pickup-suggestions")) {
pickupsuggestions.innerHTML = "";
}
if (!event.target.closest("#drop-off-suggestions")) {
dropOffSuggestions.innerHTML = "";
}
});
flatpickr("#pickup-time", {
enableTime: true,
noCalendar: true,
dateFormat: "H:i",
time_24hr: true
});
AOS.init();
let isDriversVisible = false;
function isFormComplete() {
const requiredInputs = document.querySelectorAll('form [required]');
return Array.from(requiredInputs).every(input => input.value.trim() !== '');
}
function areLocationsDifferent() {
const pickupLocation = document.getElementById('pickup-location').value.trim();
const dropOffLocation = document.getElementById('drop-off-location').value.trim();
return pickupLocation && dropOffLocation && pickupLocation !== dropOffLocation;
}
document.querySelector('.btn').addEventListener('click', function() {
const availableDrivers = document.getElementById('available-drivers');
const searchIcon = document.getElementById('search-icon');
const closeIcon = document.getElementById('close-icon');
if (isFormComplete()) {
if (areLocationsDifferent()) {
if (isDriversVisible) {
availableDrivers.style.opacity = 0;
setTimeout(() => {
availableDrivers.style.visibility = 'hidden';
availableDrivers.style.display = 'none';
}, 500);
searchIcon.style.display = 'block';
closeIcon.style.display = 'none';
isDriversVisible = false;
} else {
availableDrivers.style.display = 'block';
availableDrivers.style.visibility = 'visible';
setTimeout(() => {
availableDrivers.style.opacity = 1;
AOS.refresh();
availableDrivers.scrollIntoView({ behavior: 'smooth' });
}, 10);
searchIcon.style.display = 'none';
closeIcon.style.display = 'block';
isDriversVisible = true;
}
} else {
alert('Pickup and drop-off locations must be different.');
}
} else {
alert('Please fill in all required fields before searching.');
}
});
</script>
</body>
</html>