-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathfeedbackForm.html
More file actions
677 lines (615 loc) · 21.5 KB
/
feedbackForm.html
File metadata and controls
677 lines (615 loc) · 21.5 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" href="favicon.svg" />
<title>Car Rental Service — Feedback</title>
<!-- Professional, legible type -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
:root{
--bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--card:#ffffff;
--text:#1f2937;
--muted:#6b7280;
--line:#e5e7eb;
--brand:#2563eb;
--brand-hover:#1d4ed8;
--ok:#16a34a;
--error:#e11d48;
--radius:16px;
--shadow:0 10px 25px rgba(0,0,0,0.1);
--shadow-hover:0 20px 40px rgba(0,0,0,0.15);
--ring:0 0 0 4px rgba(37,99,235,.12);
--gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
margin:0;
background: var(--bg);
color:var(--text);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
line-height:1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
position: relative;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--bg);
z-index: -1;
}
/* Header — Enhanced */
.header{
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 100;
}
.container{
max-width:1200px; margin-inline:auto;
padding:16px 24px; display:flex; align-items:center; justify-content:space-between;
}
.logo img{height:40px; transition: transform 0.3s ease}
.logo:hover img{transform: scale(1.05)}
.navbar-list{display:flex; gap:24px; list-style:none; margin:0; padding:0}
.navbar-link{
text-decoration:none; color:var(--muted); font-weight:600; font-size:.95rem;
padding:8px 16px; border-radius:12px; transition: all .3s ease;
position: relative;
}
.navbar-link:hover{
color: var(--brand);
background: rgba(37, 99, 235, 0.1);
transform: translateY(-1px);
}
.header-contact{
display:flex; align-items:center; gap:12px;
color:var(--muted); font-weight:600;
background: rgba(37, 99, 235, 0.1);
padding: 8px 16px;
border-radius: 12px;
transition: all 0.3s ease;
}
.header-contact:hover {
background: rgba(37, 99, 235, 0.15);
transform: translateY(-1px);
}
.contact-link{color:var(--brand); text-decoration:none; font-weight: 700}
/* Main */
main{
padding: 60px 20px;
position: relative;
}
.shell{
max-width:900px; margin: 0 auto;
position: relative;
}
.title{
margin: 0 0 20px;
font-weight:800;
letter-spacing:-0.02em;
line-height:1.1;
font-size: clamp(2.5rem, 4vw, 3.5rem);
color: #000000;
text-align: center;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.subtitle{
margin:0 0 40px;
color: rgba(255, 255, 255, 0.9);
font-weight:500;
font-size: 1.2rem;
text-align: center;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.card{
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 24px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
padding: 40px;
animation: cardSlideIn 0.6s ease-out;
position: relative;
overflow: hidden;
}
.card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: var(--gradient-primary);
}
@keyframes cardSlideIn {
from {
opacity: 0;
transform: translateY(30px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
fieldset{
border: 2px solid rgba(37, 99, 235, 0.1);
border-radius: 20px;
padding: 24px;
margin: 24px 0;
transition: all 0.3s ease;
background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(10px);
position: relative;
}
fieldset:hover{
border-color: rgba(37, 99, 235, 0.3);
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
background: rgba(255, 255, 255, 0.8);
}
legend{
padding: 0 12px;
font-weight: 700;
font-size: 1.1rem;
color: var(--brand);
background: rgba(255, 255, 255, 0.9);
border-radius: 8px;
}
label{
display:block;
margin: 16px 0 8px;
font-weight: 600;
color: var(--text);
font-size: 0.95rem;
letter-spacing: 0.01em;
}
.row{ display:grid; gap:20px }
.row.cols-2{ grid-template-columns:1fr 1fr }
@media (max-width: 760px){ .row.cols-2{ grid-template-columns:1fr } }
input, select, textarea{
width:100%;
appearance: none;
border: 2px solid rgba(37, 99, 235, 0.1);
background: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(10px);
border-radius: 16px;
padding: 16px 20px;
font-size: 1rem;
color: var(--text);
outline: none;
transition: all 0.3s ease;
font-weight: 500;
}
input:focus, select:focus, textarea:focus{
border-color: var(--brand);
box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
background: rgba(255, 255, 255, 0.95);
transform: translateY(-1px);
}
input::placeholder, textarea::placeholder{
color: var(--muted);
font-weight: 400;
}
.hint{ color:var(--muted); font-size:.92rem; margin:2px 0 10px }
/* Ratings grid — TWO COLUMNS */
.ratings-grid{
display:grid; gap:12px; margin-top:8px;
grid-template-columns: 1fr 1fr;
}
@media (max-width: 760px){
.ratings-grid{ grid-template-columns: 1fr; }
}
/* Rating items */
.question{
padding: 20px;
border: 2px solid rgba(37, 99, 235, 0.1);
border-radius: 16px;
background: rgba(255, 255, 255, 0.6);
backdrop-filter: blur(10px);
transition: all 0.3s ease;
}
.question:hover {
border-color: rgba(37, 99, 235, 0.2);
background: rgba(255, 255, 255, 0.8);
transform: translateY(-1px);
}
/* Stars — Enhanced */
.stars{
display: inline-flex;
gap: 8px;
direction: rtl;
margin-top: 8px;
}
.stars input{ display: none }
.stars label{
cursor: pointer;
font-size: 28px;
line-height: 1;
color: #e5e7eb;
transition: all 0.2s ease;
padding: 4px;
border-radius: 8px;
}
.stars label:hover,
.stars label:hover ~ label{
color: #fbbf24;
transform: translateY(-2px) scale(1.1);
background: rgba(251, 191, 36, 0.1);
}
.stars input:checked ~ label{
color: #fbbf24;
transform: scale(1.05);
}
textarea{
min-height: 120px;
resize: vertical;
font-family: inherit;
}
.actions{
display: flex;
gap: 16px;
align-items: center;
margin-top: 32px;
justify-content: center;
}
.btn{
border: 0;
border-radius: 16px;
padding: 16px 32px;
font-weight: 700;
cursor: pointer;
background: var(--gradient-primary);
color: white;
font-size: 1.1rem;
transition: all 0.3s ease;
box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
position: relative;
overflow: hidden;
}
.btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s ease;
}
.btn:hover{
transform: translateY(-3px);
box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
}
.btn:hover::before {
left: 100%;
}
.btn:active{
transform: translateY(-1px) scale(0.98);
}
/* Toast — Enhanced */
.toast{
position: fixed;
right: 24px;
bottom: 24px;
z-index: 1000;
background: rgba(0, 0, 0, 0.9);
backdrop-filter: blur(20px);
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
padding: 16px 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
transform: translateY(20px);
opacity: 0;
pointer-events: none;
font-weight: 600;
max-width: 300px;
}
.toast.show{ animation: toastIn 0.4s ease forwards }
.toast.hide{ animation: toastOut 0.3s ease forwards }
@keyframes fadeIn{
from{opacity:0; transform: translateY(8px)}
to{opacity:1; transform:none}
}
@keyframes toastIn{
to{ transform: translateY(0); opacity:1; pointer-events:auto }
}
@keyframes toastOut{
to{ transform: translateY(20px); opacity:0; pointer-events:none }
}
/* Responsive Design */
@media (max-width: 768px) {
.container {
padding: 12px 16px;
flex-direction: column;
gap: 16px;
}
.navbar-list {
gap: 16px;
}
.header-contact {
padding: 6px 12px;
font-size: 0.9rem;
}
main {
padding: 40px 16px;
}
.card {
padding: 24px;
border-radius: 20px;
}
fieldset {
padding: 20px;
margin: 20px 0;
}
.title {
font-size: 2rem;
}
.subtitle {
font-size: 1rem;
}
.ratings-grid {
grid-template-columns: 1fr;
gap: 16px;
}
.btn {
padding: 14px 28px;
font-size: 1rem;
}
}
@media (max-width: 480px) {
.container {
padding: 8px 12px;
}
.navbar-list {
flex-wrap: wrap;
justify-content: center;
gap: 12px;
}
.card {
padding: 20px;
}
fieldset {
padding: 16px;
}
input, select, textarea {
padding: 14px 16px;
}
}
@media (prefers-reduced-motion: reduce){
*,*::before,*::after{ animation:none !important; transition:none !important }
}
</style>
</head>
<body>
<header class="header">
<div class="container">
<a class="logo" href="/src/index.html" aria-label="VehiGo Home">
<img src="./assets/images/vehigologo.png" alt="VehiGo" />
</a>
<nav aria-label="Primary">
<ul class="navbar-list">
<li><a class="navbar-link" href="/src/index.html">Home</a></li>
<li><a class="navbar-link" href="index.html#featured-car">Explore cars</a></li>
<li><a class="navbar-link" href="./src/pages/about.html">About us</a></li>
<li><a class="navbar-link" href="#blog">Blog</a></li>
</ul>
</nav>
<div class="header-contact">
<a class="contact-link" href="tel:1800100100">1800-100-100</a>
<span aria-label="Support hours">Mon–Sat · 9:00–18:00</span>
</div>
</div>
</header>
<main>
<div class="shell">
<h1 class="title">Feedback</h1>
<p class="subtitle">Your experience helps us improve. This takes less than a minute.</p>
<section class="card" aria-labelledby="formTitle">
<form id="feedbackForm" novalidate>
<fieldset>
<legend>Customer</legend>
<div class="row cols-2">
<div>
<label for="name">Name</label>
<input id="name" name="name" type="text" placeholder="Jane Doe" required />
</div>
<div>
<label for="email">Email</label>
<input id="email" name="email" type="email" placeholder="jane@domain.com" required />
</div>
</div>
<div class="row cols-2">
<div>
<label for="phone">Phone</label>
<input id="phone" name="phone" type="tel" inputmode="tel" pattern="[0-9+\-\s]{7,15}" placeholder="+91 98765 43210" required />
<div class="hint">Digits, spaces, +, and - are allowed.</div>
</div>
<div>
<label for="reservationNumber">Reservation Number</label>
<input id="reservationNumber" name="reservationNumber" type="text" placeholder="e.g. VG-34218" required />
</div>
</div>
</fieldset>
<fieldset>
<legend>Rental</legend>
<div class="row cols-2">
<div>
<label for="location">Location</label>
<input id="location" name="location" type="text" placeholder="Pune Airport" required />
</div>
<div class="row">
<div>
<label for="rentalDatesFrom">From</label>
<input id="rentalDatesFrom" name="rentalDatesFrom" type="date" required />
</div>
<div>
<label for="rentalDatesTo">To</label>
<input id="rentalDatesTo" name="rentalDatesTo" type="date" required />
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Ratings</legend>
<!-- TWO-COLUMN GRID -->
<div class="ratings-grid">
<div class="question">
<label for="r1_5">Overall Experience</label>
<div class="stars" role="radiogroup" aria-label="Overall Experience">
<input id="r1_5" type="radio" name="rating1" value="5" required>
<label for="r1_5" aria-label="5 stars">★</label>
<input id="r1_4" type="radio" name="rating1" value="4">
<label for="r1_4" aria-label="4 stars">★</label>
<input id="r1_3" type="radio" name="rating1" value="3">
<label for="r1_3" aria-label="3 stars">★</label>
<input id="r1_2" type="radio" name="rating1" value="2">
<label for="r1_2" aria-label="2 stars">★</label>
<input id="r1_1" type="radio" name="rating1" value="1">
<label for="r1_1" aria-label="1 star">★</label>
</div>
</div>
<div class="question">
<label for="r2_5">Vehicle Quality</label>
<div class="stars" role="radiogroup" aria-label="Vehicle Quality">
<input id="r2_5" type="radio" name="rating2" value="5" required><label for="r2_5">★</label>
<input id="r2_4" type="radio" name="rating2" value="4"><label for="r2_4">★</label>
<input id="r2_3" type="radio" name="rating2" value="3"><label for="r2_3">★</label>
<input id="r2_2" type="radio" name="rating2" value="2"><label for="r2_2">★</label>
<input id="r2_1" type="radio" name="rating2" value="1"><label for="r2_1">★</label>
</div>
</div>
<div class="question">
<label for="r3_5">Reservation Process</label>
<div class="stars" role="radiogroup" aria-label="Reservation Process">
<input id="r3_5" type="radio" name="rating3" value="5" required><label for="r3_5">★</label>
<input id="r3_4" type="radio" name="rating3" value="4"><label for="r3_4">★</label>
<input id="r3_3" type="radio" name="rating3" value="3"><label for="r3_3">★</label>
<input id="r3_2" type="radio" name="rating3" value="2"><label for="r3_2">★</label>
<input id="r3_1" type="radio" name="rating3" value="1"><label for="r3_1">★</label>
</div>
</div>
<div class="question">
<label for="r4_5">Pickup Process</label>
<div class="stars" role="radiogroup" aria-label="Pickup Process">
<input id="r4_5" type="radio" name="rating4" value="5" required><label for="r4_5">★</label>
<input id="r4_4" type="radio" name="rating4" value="4"><label for="r4_4">★</label>
<input id="r4_3" type="radio" name="rating4" value="3"><label for="r4_3">★</label>
<input id="r4_2" type="radio" name="rating4" value="2"><label for="r4_2">★</label>
<input id="r4_1" type="radio" name="rating4" value="1"><label for="r4_1">★</label>
</div>
</div>
<div class="question">
<label for="r5_5">Return Process</label>
<div class="stars" role="radiogroup" aria-label="Return Process">
<input id="r5_5" type="radio" name="rating5" value="5" required><label for="r5_5">★</label>
<input id="r5_4" type="radio" name="rating5" value="4"><label for="r5_4">★</label>
<input id="r5_3" type="radio" name="rating5" value="3"><label for="r5_3">★</label>
<input id="r5_2" type="radio" name="rating5" value="2"><label for="r5_2">★</label>
<input id="r5_1" type="radio" name="rating5" value="1"><label for="r5_1">★</label>
</div>
</div>
<div class="question">
<label for="r6_5">Cleanliness</label>
<div class="stars" role="radiogroup" aria-label="Cleanliness">
<input id="r6_5" type="radio" name="rating6" value="5" required><label for="r6_5">★</label>
<input id="r6_4" type="radio" name="rating6" value="4"><label for="r6_4">★</label>
<input id="r6_3" type="radio" name="rating6" value="3"><label for="r6_3">★</label>
<input id="r6_2" type="radio" name="rating6" value="2"><label for="r6_2">★</label>
<input id="r6_1" type="radio" name="rating6" value="1"><label for="r6_1">★</label>
</div>
</div>
</div>
<label for="comments" style="margin-top:14px">Additional Comments</label>
<textarea id="comments" name="comments" placeholder="What went well? What could be better?"></textarea>
<label for="overallExperience">Would you recommend us?</label>
<select id="overallExperience" name="overallExperience" required>
<option disabled selected value="">Select an option</option>
<option value="Yes, definitely">Yes, definitely</option>
<option value="Yes, maybe">Yes, maybe</option>
<option value="No, probably not">No, probably not</option>
<option value="No, definitely not">No, definitely not</option>
</select>
</fieldset>
<div class="actions">
<button type="submit" class="btn">Submit Feedback</button>
</div>
</form>
</section>
</div>
</main>
<div id="toast" class="toast" role="status" aria-live="polite">Thank you — feedback submitted.</div>
<script>
const form = document.getElementById('feedbackForm');
const toast = document.getElementById('toast');
const dateFrom = document.getElementById('rentalDatesFrom');
const dateTo = document.getElementById('rentalDatesTo');
const phone = document.getElementById('phone');
function showToast(msg){
toast.textContent = msg;
toast.classList.remove('hide'); toast.classList.add('show');
clearTimeout(showToast._t);
showToast._t = setTimeout(()=>{ toast.classList.remove('show'); toast.classList.add('hide'); }, 2200);
}
function validateDates(){
if(!dateFrom.value || !dateTo.value) return true;
const from = new Date(dateFrom.value);
const to = new Date(dateTo.value);
if (to < from){
dateTo.setCustomValidity('End date must be on or after the start date.');
dateTo.reportValidity();
return false;
}
dateTo.setCustomValidity('');
return true;
}
dateFrom?.addEventListener('change', validateDates);
dateTo?.addEventListener('change', validateDates);
phone.addEventListener('input', () => {
phone.value = phone.value.replace(/[^\d+\-\s]/g, '');
});
// Keyboard support for star groups
document.querySelectorAll('.stars').forEach(group=>{
group.tabIndex = 0;
group.addEventListener('keydown', e=>{
const radios = Array.from(group.querySelectorAll('input[type="radio"]')).reverse(); // logical LTR
const idx = radios.findIndex(r=>r.checked);
if(['ArrowLeft','ArrowDown'].includes(e.key)){
e.preventDefault();
const i = Math.max(0, idx - 1);
(radios[i] || radios[0]).checked = true;
}else if(['ArrowRight','ArrowUp'].includes(e.key)){
e.preventDefault();
const i = Math.min(radios.length-1, idx + 1);
(radios[i] || radios[radios.length-1]).checked = true;
}
});
});
form.addEventListener('submit', (e)=>{
e.preventDefault();
if(!validateDates()) return;
if(!form.checkValidity()){
showToast('Please complete required fields.');
return;
}
// simulate submit
form.reset();
showToast('Thank you — feedback submitted.');
});
</script>
</body>
</html>