forked from InnoWebLabs/Vehigo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedbackForm.html
More file actions
414 lines (373 loc) · 16.6 KB
/
Copy pathfeedbackForm.html
File metadata and controls
414 lines (373 loc) · 16.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
<!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:#f7f7f9;
--card:#ffffff;
--text:#0f1720;
--muted:#5b6776;
--line:#e6e8ee;
--brand:#2563eb; /* calm blue */
--ok:#16a34a;
--error:#e11d48;
--radius:14px;
--shadow:0 6px 20px rgba(15,23,32,.06);
--ring:0 0 0 4px rgba(37,99,235,.12);
}
*{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;
}
/* Header — understated */
.header{
background:var(--card);
border-bottom:1px solid var(--line);
}
.container{
max-width:960px; margin-inline:auto;
padding:12px 20px; display:flex; align-items:center; justify-content:space-between;
}
.logo img{height:36px}
.navbar-list{display:flex; gap:18px; list-style:none; margin:0; padding:0}
.navbar-link{
text-decoration:none; color:var(--muted); font-weight:600; font-size:.95rem;
padding:6px 8px; border-radius:8px; transition: color .2s ease, background .2s ease;
}
.navbar-link:hover{ color:var(--text); background:#f1f5f9 }
.header-contact{display:flex; align-items:center; gap:10px; color:var(--muted); font-weight:600}
.contact-link{color:var(--text); text-decoration:none}
/* Main */
main{ padding: 40px 16px }
.shell{
max-width:820px; margin: 0 auto;
}
.title{
margin: 4px 0 16px;
font-weight:700; letter-spacing:.2px;
line-height:1.2;
font-size: clamp(1.4rem, 2.2vw, 2rem);
}
.subtitle{
margin:0 0 20px; color:var(--muted); font-weight:500;
font-size: 1rem;
}
.card{
background:var(--card);
border:1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 20px;
animation: fadeIn .35s ease both;
}
fieldset{
border:1px solid var(--line);
border-radius:12px;
padding:16px;
margin:16px 0;
transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
fieldset:hover{ border-color:#d9dce3; transform: translateY(-1px) }
legend{ padding:0 6px; font-weight:700; font-size:.95rem }
label{ display:block; margin:12px 2px 8px; font-weight:600; color:#1f2a37 }
.row{ display:grid; gap:12px }
.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:1px solid var(--line);
background: #fbfbfd;
border-radius: 10px;
padding: 12px 14px;
font-size: 1rem; color:var(--text);
outline: none;
transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus, textarea:focus{
border-color: #c8d0e1; box-shadow: var(--ring); background:#fff;
}
input::placeholder, textarea::placeholder{ color:#9aa6b2 }
.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:12px 12px;
border:1px dashed var(--line);
border-radius:10px;
background:#fff;
}
/* Stars — calm, keyboard accessible */
.stars{ display:inline-flex; gap:6px; direction: rtl }
.stars input{ display:none }
.stars label{
cursor:pointer; font-size:24px; line-height:1; color:#cfd6e4; transition: transform .12s ease, color .12s ease;
}
.stars label:hover,
.stars label:hover ~ label{ color:#94a3b8; transform: translateY(-1px) }
.stars input:checked ~ label{ color:#fbbf24 } /* amber */
textarea{ min-height:110px; resize: vertical }
.actions{ display:flex; gap:12px; align-items:center; margin-top:12px }
.btn{
border:0; border-radius:10px; padding:12px 16px; font-weight:700; cursor:pointer;
background: var(--brand); color:white;
transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
box-shadow: 0 8px 18px rgba(37,99,235,.22);
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.03) }
.btn:active{ transform: translateY(0) scale(.99) }
/* Toast — understated */
.toast{
position: fixed; right: 20px; bottom: 20px; z-index: 1000;
background: #0f1720; color: #fff; border:1px solid #263040;
border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
transform: translateY(12px); opacity:0; pointer-events:none;
}
.toast.show{ animation: toastIn .25s ease forwards }
.toast.hide{ animation: toastOut .2s ease forwards }
@keyframes fadeIn{ from{opacity:0; transform: translateY(8px)} to{opacity:1; transform:none} }
@keyframes toastIn{ to{ transform:none; opacity:1; pointer-events:auto } }
@keyframes toastOut{ to{ transform: translateY(12px); opacity:0; pointer-events:none } }
@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="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="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>