-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
500 lines (483 loc) · 21.1 KB
/
Copy pathindex.html
File metadata and controls
500 lines (483 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./images/favicon-32x32.png" />
<link rel="stylesheet" href="/style.css" />
<title>Frontend Mentor | Multi-step form</title>
</head>
<body
class="flex min-h-screen w-[250px] flex-col items-center overscroll-auto min-[251px]:w-full xxs:justify-center xxs:bg-gray-100">
<div class="flex w-full">
<!-- grid -->
<div
class="mx-auto grid w-full grid-cols-12 bg-gray-100 xxs:w-[490px] xxs:items-center xxs:justify-center xxs:rounded-lg xxs:bg-white xxs:p-5 sm:w-[610px] sm:gap-5 md:w-[720px]">
<!-- Left box -->
<div
class="left col-span-full h-full bg-[url(./images/bg-sidebar-mobile.svg)] bg-cover bg-no-repeat py-10 xxs:col-span-4 xxs:my-5 xxs:rounded-lg xxs:bg-white xxs:bg-[url(./images/bg-sidebar-desktop.svg)] xxs:bg-left-bottom xxs:py-5">
<ul
class="flex list-none justify-center space-x-5 pb-10 max-[250px]:space-x-2 max-[160px]:space-x-1 xxs:flex-col xxs:space-y-5">
<li class="hidden xxs:flex"></li>
<li class="flex space-x-2 text-center xxs:text-start sm:space-x-3">
<div>
<p
class="step-1 left-side-steps flex h-8 w-8 items-center justify-center rounded-full border bg-gray-200 font-medium">
1
</p>
</div>
<div class="hidden flex-col text-xs xxs:flex">
<span class="text-blue-400">STEP 1</span>
<p class="text-xs font-semibold text-white">YOUR INFO</p>
</div>
</li>
<li class="flex space-x-2 text-center xxs:text-start sm:space-x-3">
<div>
<p
class="step-2 left-side-steps flex h-8 w-8 items-center justify-center rounded-full border font-medium text-white">
2
</p>
</div>
<div class="hidden flex-col text-xs xxs:flex">
<span class="text-blue-400">STEP 2</span>
<p class="text-xs font-semibold text-white">SELECT PLAN</p>
</div>
</li>
<li class="flex space-x-2 text-center xxs:text-start sm:space-x-3">
<div>
<p
class="step-3 left-side-steps flex h-8 w-8 items-center justify-center rounded-full border font-medium text-white">
3
</p>
</div>
<div class="hidden flex-col text-xs xxs:flex">
<span class="text-blue-400">STEP 3</span>
<p class="text-xs font-medium text-white sm:font-semibold">
ADD-ONS
</p>
</div>
</li>
<li class="flex space-x-2 text-center xxs:text-start sm:space-x-3">
<div>
<p
class="step-4 left-side-steps flex h-8 w-8 items-center justify-center rounded-full border font-medium text-white">
4
</p>
</div>
<div class="hidden flex-col text-xs xxs:flex">
<span class="text-blue-400">STEP 4</span>
<p class="text-xs font-medium text-white sm:font-semibold">
SUMMARY
</p>
</div>
</li>
</ul>
</div>
<!-- Right box : Contain All 4 Steps -->
<div class="right col-span-full px-5 pt-5 xxs:col-span-8 xxs:bg-white">
<!-- Step-1 : Start -->
<div
id="step_1"
class="form-box steps -translate-y-16 rounded-lg bg-white p-5 xxs:-translate-y-0">
<div class="info space-y-1">
<h3 class="text-xl font-bold">Personal info</h3>
<p class="text-sm text-gray-500">
Please provide your name, email address, and phone number.
</p>
</div>
<form
onsubmit="return false"
name="myForm"
class="mt-5 space-y-3 xxs:space-y-5">
<div class="name relative flex flex-col">
<label for="name" class="mb-1 text-sm font-medium text-gray-600"
>Name</label
>
<input
type="text"
name="name"
class="rounded-md border-2 border-gray-200 px-3 py-1 focus:border-gray-300 focus:outline-none"
placeholder="e.g. Stephen King" />
<span
id="nameMsgErr"
class="absolute right-0 top-0 hidden translate-y-1 text-xs font-semibold text-red-700"
>This field is required</span
>
</div>
<div class="email relative flex flex-col">
<label
for="email"
class="mb-1 text-sm font-medium text-gray-600"
>Email Address</label
>
<input
type="email"
name="email"
class="rounded-md border-2 border-gray-200 px-3 py-1 focus:border-gray-300 focus:outline-none"
placeholder="e.g. stephenking@lorem.com" />
<span
id="emailMsgErr"
class="absolute right-0 top-0 hidden translate-y-1 text-xs font-semibold text-red-700"
>This field is required</span
>
</div>
<div class="phone-number relative flex flex-col">
<label for="ph" class="mb-1 text-sm font-medium text-gray-600"
>Phone Number</label
>
<input
type="number"
name="phone"
class="rounded-md border-2 border-gray-200 px-3 py-1 focus:border-gray-300 focus:outline-none"
placeholder="e.g. +1 234 567 890" />
<span
id="phoneMsgErr"
class="absolute right-0 top-0 hidden translate-y-1 text-xs font-semibold text-red-700"
>This field is required</span
>
</div>
<div
class="btn hidden w-full bg-white text-right xxs:block xxs:bg-white xxs:pt-3">
<button
type="submit"
onclick="return stepHandler(1)"
class="rounded-md bg-[hsl(213,_96%,_18%)] px-4 py-2 text-xs font-medium text-white hover:cursor-pointer hover:opacity-80">
Next Step
</button>
</div>
</form>
</div>
<!-- Step 1 : End -->
<!-- Step-2 : Start -->
<div
id="step_2"
class="form-box steps hidden -translate-y-12 rounded-lg bg-white p-5 xxs:-translate-y-0 xxs:pt-0 sm:px-4">
<div class="info sm:ps-2">
<h3 class="text-xl font-bold">Select your plan</h3>
<p class="text-sm text-gray-500">
You have the option of monthly or yearly billing.
</p>
</div>
<form
onsubmit="return false"
name="myForm"
class="justify-between space-y-3 sm:flex sm:flex-wrap">
<div class="hidden sm:block"></div>
<div
class="arcade relative flex flex-col hover:cursor-pointer xxs:basis-[30%]">
<div
id="plan_1"
onclick="SelectPlanHandler(1)"
class="selectPlan flex basis-1/3 rounded-lg border-2 border-blue-600 bg-blue-50 p-3 text-base sm:flex-col sm:space-y-5">
<div class="icon">
<img
class="hidden xxxs:block sm:w-[50%]"
src="./images/icon-arcade.svg"
alt="arcade" />
</div>
<div class="content ms-2 font-medium sm:ms-0">
<h4>Arcade</h4>
<p class="plans text-xs text-gray-500">$9/mo</p>
</div>
</div>
</div>
<div
class="advanced relative flex flex-col hover:cursor-pointer xxs:basis-[30%]">
<div
id="plan_2"
onclick="SelectPlanHandler(2)"
class="selectPlan flex basis-1/3 rounded-lg border-2 border-[hsl(228,_100%,_84%)] p-3 text-base sm:flex-col sm:space-y-5">
<div class="icon">
<img
class="hidden xxxs:block sm:w-[50%]"
src="./images/icon-advanced.svg"
alt="arcade" />
</div>
<div class="content ms-2 font-medium sm:ms-0">
<h4>Advanced</h4>
<p class="plans text-xs text-gray-500">$12/mo</p>
</div>
</div>
</div>
<div
class="pro relative flex flex-col hover:cursor-pointer xxs:basis-[30%]">
<div
id="plan_3"
onclick="SelectPlanHandler(3)"
class="selectPlan flex basis-1/3 rounded-lg border-2 border-[hsl(228,_100%,_84%)] p-3 text-base sm:flex-col sm:space-y-5">
<div class="icon">
<img
class="hidden xxxs:block sm:w-[50%]"
src="/images/icon-pro.svg"
alt="arcade" />
</div>
<div class="content ms-2 font-medium sm:ms-0">
<h4>Pro</h4>
<p class="plans text-xs text-gray-500">$15/mo</p>
</div>
</div>
</div>
<div
class="flex basis-full justify-center rounded-md bg-gray-100 py-2">
<label class="month text-sm font-medium xxxs:hidden">M</label>
<label class="month hidden text-sm font-medium xxxs:block"
>Month</label
>
<div
id="plan"
class="mx-2 box-border flex h-6 w-12 rounded-full bg-[hsl(213,_96%,_18%)] p-1">
<button
id="planbtn"
onclick="monthYearPlanHandler()"
class="h-4 w-4 rounded-full bg-white duration-200"></button>
</div>
<label
class="year text-sm font-medium text-gray-400 xxxs:hidden"
>Y</label
>
<label
class="year hidden text-sm font-medium text-gray-400 xxxs:block"
>Year</label
>
</div>
<div class="btn hidden basis-full justify-between pt-10 xxs:flex">
<div class="go-back">
<button
onclick="goBackToPreviousPage()"
class="text-xs font-medium text-gray-500 opacity-60">
Go Back
</button>
</div>
<button
type="submit"
onclick="return stepHandler(2)"
class="rounded-md bg-[hsl(213,_96%,_18%)] px-4 py-2 text-xs font-medium text-white hover:cursor-pointer hover:opacity-80">
Next Step
</button>
</div>
</form>
</div>
<!-- Step-2 : End -->
<!-- Step-3 : Start -->
<div
id="step_3"
class="form-box steps hidden -translate-y-16 rounded-lg bg-white p-5 xxs:-translate-y-0 xxs:p-0">
<div class="info sm:ps-2">
<h3 class="text-xl font-bold">Pick add-ons</h3>
<p class="text-sm text-gray-500">
Add-ons help enhance your gaming experience.
</p>
</div>
<form onsubmit="return false" name="myForm" class="space-y-3">
<div class="hidden sm:block"></div>
<div class="relative flex flex-col xxs:basis-[30%]">
<div
id="checkbox_1"
class="checkbox flex items-center justify-between rounded-lg border-2 p-3 text-base sm:space-y-5">
<div class="checkbox-2 flex items-center justify-center">
<input
type="checkbox"
onclick="checkBoxHandler(1)"
style="accent-color: rgba(50, 50, 239, 0.837)"
class="h-6 w-6 rounded-lg border-gray-300" />
<div class="content ms-3 font-medium xxs:ms-4">
<h4>Online service</h4>
<p class="text-xs text-gray-500 opacity-75">
Aceess to multiplayer games
</p>
</div>
</div>
<p
class="price plans text-xs font-semibold text-blue-600 opacity-80 max-[270px]:hidden xxs:text-sm">
+$1/mo
</p>
</div>
</div>
<div class="relative flex flex-col xxs:basis-[30%]">
<div
id="checkbox_2"
class="checkbox flex items-center justify-between rounded-lg border-2 p-3 text-base sm:space-y-5">
<div class="checkbox-2 flex items-center justify-center">
<input
type="checkbox"
onclick="checkBoxHandler(2)"
style="accent-color: rgba(50, 50, 239, 0.837)"
class="h-6 w-6 rounded-lg border-gray-300" />
<div class="content ms-3 font-medium xxs:ms-4">
<h4>Larger storage</h4>
<p class="text-xs text-gray-500 opacity-75">
Extra 1TB of cloud save
</p>
</div>
</div>
<p
class="price plans text-xs font-semibold text-blue-600 opacity-80 max-[270px]:hidden xxs:text-sm">
+$2/mo
</p>
</div>
</div>
<div class="relative flex flex-col xxs:basis-[30%]">
<div
id="checkbox_3"
class="checkbox flex items-center justify-between rounded-lg border-2 p-3 text-base sm:space-y-5">
<div class="checkbox-3 flex items-center justify-center">
<input
type="checkbox"
onclick="checkBoxHandler(3)"
style="accent-color: rgba(50, 50, 239, 0.837)"
class="blue h-6 w-6 rounded-lg border-gray-300" />
<div class="content ms-3 font-medium xxs:ms-4">
<h4>Customizable profile</h4>
<p class="text-xs text-gray-500 opacity-75">
Custom theme on your profile
</p>
</div>
</div>
<p
class="price plans text-xs font-semibold text-blue-600 opacity-80 max-[270px]:hidden xxs:text-sm">
+$2/mo
</p>
</div>
</div>
<div class="btn hidden basis-full justify-between pt-10 xxs:flex">
<div class="go-back">
<button
onclick="goBackToPreviousPage()"
class="text-xs font-medium text-gray-500 opacity-60">
Go Back
</button>
</div>
<button
type="submit"
onclick="return stepHandler(3)"
class="rounded-md bg-[hsl(213,_96%,_18%)] px-4 py-2 text-xs font-medium text-white hover:cursor-pointer hover:opacity-80">
Next Step
</button>
</div>
</form>
</div>
<!-- Step-3 : End -->
<!-- Step-4 : Start -->
<div
id="step_4"
class="form-box steps hidden -translate-y-16 rounded-lg bg-white p-5 xxs:-translate-y-0 xxs:p-0">
<div class="info sm:ps-2">
<h3 class="text-xl font-bold">Finishing up</h3>
<p class="text-sm text-gray-500">
Double-check everything looks OK before confirming.
</p>
</div>
<form onsubmit="return false" name="myForm" class="space-y-3">
<div class="hidden sm:block"></div>
<div class="flex flex-col rounded-md bg-gray-100 xxs:basis-[30%]">
<div
class="flex items-center justify-between rounded-lg p-3 text-base sm:space-y-5">
<div class="flex items-center justify-center">
<div class="content ms-3 xxs:ms-4">
<h4 class="st-4-item font-medium">Arcade (Monthly)</h4>
<p class="text-sm opacity-80">
<button
onclick="changePlan()"
class="border-none text-blue-600 underline outline-none">
change
</button>
</p>
</div>
</div>
<p
class="price st-4 text-xs font-bold max-[270px]:hidden xxs:text-sm">
+$9/mo
</p>
</div>
<hr class="mx-5" />
<div
class="services flex flex-col gap-2 p-5 text-xs text-gray-500 sm:text-sm">
<div class="st-4-item flex items-center justify-between">
<p>Online service</p>
<p class="st-4 font-semibold">+$10/yr</p>
</div>
<div class="st-4-item flex items-center justify-between">
<p>Larger storage</p>
<p class="st-4 font-semibold">+$20/yr</p>
</div>
<div class="st-4-item flex items-center justify-between">
<p>Customizable profile</p>
<p class="st-4 font-semibold">+$20/yr</p>
</div>
</div>
</div>
<div class="totalPriceYear flex justify-between px-5">
<p class="st-4 text-xs text-gray-500 sm:text-sm">
Total(per year)
</p>
<p class="st-4 text-sm font-bold text-blue-700">$120/yr</p>
</div>
<div class="btn hidden basis-full justify-between pt-10 xxs:flex">
<div class="go-back">
<button
onclick="goBackToPreviousPage()"
class="text-xs font-medium text-gray-500 opacity-60">
Go Back
</button>
</div>
<button
type="submit"
onclick="return stepHandler(4)"
class="rounded-md bg-blue-700 px-4 py-2 text-xs font-medium text-white hover:cursor-pointer hover:opacity-80">
Confirm
</button>
</div>
</form>
</div>
<!-- Step-4 : End -->
<!-- Step-5 : Start -->
<div
id="step_5"
class="thank-you steps hidden -translate-y-16 rounded-lg bg-white p-5 xxs:-translate-y-0 xxs:p-0">
<div class="flex flex-col items-center justify-center bg-white p-3">
<img
class="mb-3 w-[50px] xxs:w-[60px]"
src="./images/icon-thank-you.svg"
alt="" />
<h3 class="mb-1 text-lg font-bold">Thank You!</h3>
<p class="text-center text-sm font-[400] text-gray-400">
Thanks for confirming your subscription! We hope you have fun
using our platform. If you ever need support, please feel free
to email us at support@loremgaming.com.
</p>
</div>
</div>
<!-- Step-5 : End -->
</div>
<!-- Mobile View - Button -->
<div id="mobile-view-btn" class="col-span-full bg-white p-5 xxs:hidden">
<button
onclick="goBackToPreviousPage()"
id="go-back-btn"
class="go-back hidden text-xs font-medium text-gray-500 opacity-60">
Go Back
</button>
<button
onclick="return stepHandler(getCurrentStep())"
class="float-right rounded-md bg-[hsl(213,_96%,_18%)] px-4 py-2 text-xs font-medium text-white hover:cursor-pointer hover:opacity-80">
Next Step
</button>
</div>
</div>
</div>
<div class="w-full py-3 text-center text-sm">
Challenge by
<a
href="https://www.frontendmentor.io?ref=challenge"
class="text-[hsl(228,_45%,_44%)]"
target="_blank"
>Frontend Mentor</a
>. Coded by <a href="#">Deepanshu Heer</a>.
</div>
<script src="/index.js"></script>
</body>
</html>