-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtour-booking.html
381 lines (347 loc) · 25.6 KB
/
tour-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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LUBUS | AlpineTrails - Tour Booking</title>
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
<link rel="stylesheet" href="./build/style.css">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
<script src="./build/script.js"></script>
</head>
<body class="bg-indigo-50">
<div class="flex flex-col items-center justify-start min-w-full min-h-screen px-4 py-8">
<!-- Header -->
<div class="flex flex-col items-center justify-center mb-14">
<a href="./index.html"
class="flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide bg-indigo-800 rounded-md hover:bg-indigo-900 text-indigo-50">
<svg class="w-4 mr-1" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
</svg>
Browse All
</a>
</div>
<!-- Trail-->
<div class="container max-w-3xl mx-auto mt-auto mb-12">
<!-- Title -->
<h1 class="mb-8 text-2xl font-medium text-center text-gray-500">Tour Booking</h1>
<div class="grid grid-cols-1 gap-8" x-data="{packages}">
<!-- Package item -->
<template x-for="package in packages" :key="package">
<div :id="package.id"
class="flex flex-col items-stretch p-4 bg-white rounded-md shadow md:flex-row">
<!-- Cover -->
<div
class="flex justify-center w-full h-40 mb-4 bg-gray-100 rounded-md md:mb-0 md:min-h-full md:mr-4 md:w-36">
<svg class="w-12 text-gray-200" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
</div>
<!-- Details -->
<div class="flex-1">
<h2 class="mb-2 text-lg font-medium text-gray-600" x-text="package.title"></h2>
<span class="text-sm italic font-medium text-gray-500">Itinerary</span>
<ul class="mb-8 space-y-3">
<template x-for="site in package.sites">
<li class="text-xs text-gray-500" x-text="site"></li>
</template>
</ul>
<!-- Book Now -->
<div class="flex justify-between">
<span class="text-indigo-600"
x-text="`Starting from ₹${package.vehicles[0].cost.toLocaleString()}`"></span>
<button @click.prevent="$dispatch('select-package-event', package)"
class="flex items-center justify-center px-3 py-1 text-sm font-medium text-indigo-400 border-2 border-indigo-400 rounded-md -bottom-4 hover:text-white hover:bg-indigo-400">
<svg class="w-4 mr-1" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
Book Now
</button>
</div>
</div>
</div>
</template>
</div>
<!-- Start: Modal Booking Form -->
<div x-data="booking" x-init="() => $watch('package.open', value => {
if (value === true) { document.body.classList.add('overflow-hidden') }
else { document.body.classList.remove('overflow-hidden') }
});
$watch( 'payment.type' , value => {
getPaymentAmount();
} );" @select-package-event.window="setPackage($event.detail); package.open = true;">
<div x-show="package.open" class="fixed inset-0 z-10 overflow-y-auto">
<div class="flex items-end justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0">
<div x-show="package.open" x-description="Background overlay, show/hide based on modal state."
x-transition:enter="ease-out duration-300" x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100" x-transition:leave="ease-in duration-200"
x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0"
class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75">
</div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen"
aria-hidden="true">​</span>
<div x-show="package.open" x-description="Modal panel, show/hide based on modal state."
x-transition:enter="ease-out duration-300"
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
x-transition:leave="ease-in duration-200"
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
class="inline-block px-4 pt-5 pb-4 overflow-hidden text-left align-bottom transition-all transform bg-white rounded-lg shadow-xl sm:my-8 sm:align-middle sm:w-full sm:p-6 lg:w-1/2"
role="dialog" aria-modal="true" aria-labelledby="modal-headline">
<div>
<div class="absolute top-0 right-0 pt-4 pr-4 sm:block">
<button @click="package.open = false" type="button"
class="text-gray-400 bg-white rounded-md hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<span class="sr-only">Close</span>
<!-- Heroicon name: outline/x -->
<svg class="w-6 h-6 text-gray-600" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
<!-- Title -->
<h4 x-text="data.title" class="mb-4 text-2xl font-medium text-gray-800"></h4>
<!-- Error Msg -->
<div x-show="order.error" class="p-4 mb-6 border-2 border-red-300 rounded-md bg-red-50">
<div class="flex">
<div class="flex-shrink-0">
<svg class="w-5 h-5 text-red-400" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"
clip-rule="evenodd" />
</svg>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-red-800">
Error processing booking request ...
</h3>
</div>
</div>
</div>
<!-- Form -->
<form x-on:submit.prevent="submit" action="?payment=process" id="booking"
class="text-gray-700" method="post">
<!-- For Cost Calculation & Payment -->
<input type="hidden" name="order_id" :value="order.id" />
<input type="hidden" name="package_id" :value="data.id" />
<input type="hidden" name="amount" :value="payment[payment.type]" />
<input type="hidden" name="due" :value="payment.due" />
<input type="hidden" name="language" value="EN" />
<input type="hidden" name="currency" value="INR" />
<div class="grid grid-cols-2 gap-6">
<!-- Customer info -->
<div class="space-y-4">
<!-- Name -->
<div>
<label for="customername" class="block text-sm font-medium">
Name
</label>
<div class="mt-1">
<input type="text" name="customername" id="customername"
class="flex-1 block w-full min-w-0 border-gray-300 rounded-md focus:ring-primary focus:border-primary sm:text-sm"
required />
</div>
</div>
<!-- Email -->
<div>
<label for="email" class="block text-sm font-medium"> Email
</label>
<div class="mt-1">
<input type="email" name="email" id="email"
class="flex-1 block w-full min-w-0 border-gray-300 rounded-md focus:ring-primary focus:border-primary sm:text-sm"
required />
</div>
</div>
<!-- Contact -->
<div>
<label for="contact" class="block text-sm font-medium"> Contact
</label>
<div class="mt-1">
<input type="text" name="contact" id="contact"
class="flex-1 block w-full min-w-0 border-gray-300 rounded-md focus:ring-primary focus:border-primary sm:text-sm"
required />
</div>
</div>
<!-- Date -->
<div>
<label for="date" class="block text-sm font-medium"> Date
</label>
<div class="mt-1">
<input type="date" name="date" id="date"
class="flex-1 block w-full min-w-0 border-gray-300 rounded-md focus:ring-primary focus:border-primary sm:text-sm"
required />
</div>
</div>
</div>
<!-- Package Info -->
<div class="space-y-6">
<!-- Vehical -->
<div class="text-sm">
<span class="block mb-2 text-sm font-medium"> Available Vehicals
</span>
<div class="space-y-2">
<template x-for="vehicle in data.vehicles" :key="vehicle.name">
<div>
<input @click="getVehicleCost($event); getPaymentAmount();"
x-model="package.vehicle.name"
:data-vehical-cost="vehicle.cost"
class="border-gray-400 mt-vehicle focus:ring-0 focus:border-primary text-primary sm:text-sm"
type="radio" name="vehicle" :value="vehicle.name" />
<label for="vehicle.name"
x-html="`${vehicle.name} @ ₹${vehicle.cost}`">
</label><br />
</div>
</template>
</div>
</div>
<!-- Payment Type -->
<div class="text-sm">
<span class="block mb-2 text-sm font-medium"> Payment Type
</span>
<div class="space-y-2">
<div>
<input x-model="payment.type"
class="border-gray-400 mt-pay focus:ring-0 focus:border-primary text-primary sm:text-sm"
type="radio" id="part" name="paymentType" value="part" />
<label for="part">Part: ₹<span
x-text="payment.part"></span></label><br />
</div>
<div>
<input x-model="payment.type"
class="border-gray-400 mt-pay focus:ring-0 focus:border-primary text-primary sm:text-sm"
type="radio" id="full" name="paymentType" value="full" />
<label for="full">Full: ₹<span
x-text="payment.full"></span></label><br />
</div>
</div>
</div>
</div>
</div>
<!-- Additional info -->
<div class="w-full mt-6 mb-6">
<label for="note" class="block text-sm font-medium"> Additional
Instruction
</label>
<div class="mt-1">
<textarea id="note" name="note" rows="3"
class="block w-full border-gray-300 rounded-md shadow-sm focus:ring-primary focus:border-primary sm:text-sm"></textarea>
</div>
<p class="mt-2 text-sm text-gray-500">Any specific requirment or details you
want to mention.</p>
</div>
<!-- Alerts -->
<!-- Pickup -->
<div class="p-4 rounded-md bg-yellow-50">
<div class="flex mb-6">
<div class="flex-shrink-0">
<svg class="w-5 h-5 text-yellow-400" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round"
stroke-width="2"
d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
<path stroke-linecap="round" stroke-linejoin="round"
stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800">Pickup From</h3>
<div class="mt-2 text-sm text-yellow-700">
<p x-html="data.pickUp"></p>
</div>
</div>
</div>
<!-- Attention -->
<div class="flex">
<div class="flex-shrink-0">
<svg class="w-5 h-5 text-yellow-400" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
clip-rule="evenodd" />
</svg>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800">Attention Needed
</h3>
<div class="mt-2 text-sm text-yellow-700">
<p x-html="data.note"></p>
</div>
</div>
</div>
</div>
<!-- Book Now CTA -->
<button :class="{ 'cursor-not-allowed': order.processing}"
class="block px-8 py-3 mx-auto mt-8 font-semibold tracking-wide text-white bg-indigo-600 rounded-md hover:bg-indigo-800"
:disabled="order.processing">
<span x-show="!order.processing"
x-text="`Make Payment of ₹ ${payment[payment.type].toLocaleString()}`"></span>
<span x-show="order.processing" :class="{ 'flex': order.processing}">
<svg class="w-5 h-5 mr-3 -ml-1 text-white animate-spin"
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor"
stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
</path>
</svg>
Processing
</span>
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- End: Modal Booking Form -->
</div>
<!-- Footer -->
<div class="flex flex-col items-center mt-auto">
<!-- Source Code -->
<div
class="inline-block mx-auto my-4 text-sm text-gray-500 border border-gray-300 rounded hover:bg-gray-600 hover:text-white">
<a class="flex items-center px-2 py-1 "
href="https://github.com/lubusIN/alpinetrails/blob/main/tour-booking.html" target="_new">
<svg class="w-4 mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd"
d="M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z"
clip-rule="evenodd" />
</svg>
source code
</a>
</div>
<!-- Work with us -->
<div
class="relative flex px-4 py-2 mx-auto overflow-hidden text-sm text-indigo-100 bg-indigo-800 border border-gray-200 rounded-md shadow-2xl">
<span class="flex items-center">
<svg class="w-4 mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd"
d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"
clip-rule="evenodd" />
</svg>
Work With Us
</span>
<svg class="w-10 h-10 -my-2 -mr-8 text-indigo-800 transform" fill="currentColor" viewBox="0 0 100 100"
preserveAspectRatio="none" aria-hidden="true">
<polygon points="50,0 100,0 50,100 0,100" />
</svg>
<a class="flex items-center px-8 ml-3 -my-2 -mr-4 italic bg-indigo-500 hover:underline"
href="mailto:[email protected]">[email protected]</a>
</div>
</div>
</div>
</body>
</html>