forked from apu52/Travel_Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plantrip.html
253 lines (221 loc) · 6.43 KB
/
plantrip.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Trip Planner</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css"
/>
<style>
body {
font-family: "Nunito Sans", sans-serif;
background-image: url("https://c8.alamy.com/comp/2C3TB2W/travel-planning-concept-top-view-taking-notes-to-notebook-on-map-background-search-for-best-trip-in-tablet-with-blank-screen-copy-space-for-text-2C3TB2W.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
margin: 0;
padding: 0;
}
header {
background-color: rgba(1, 1, 39, 0.8);
color: #fff;
text-align: center;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
height: 60px;
}
.nav__logo {
font-size: 1.75rem;
font-weight: 600;
color: #ffffff;
text-decoration: none;
}
.nav__logo span {
color: #3685fb;
}
h1 {
padding-right: 690px;
text-align: center;
}
form {
max-width: 550px;
margin: 80px auto;
background-color: rgba(236, 248, 222, 0);
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0);
}
.container {
margin-bottom: 50px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: bold;
text-align: center;
}
input,
select {
width: 100%;
padding: 10px;
margin-bottom: 16px;
border: 2px solid #1e0d7f;
border-radius: 4px;
box-sizing: border-box;
font-weight: bold;
font-family: inherit;
}
button {
display: block;
margin: 0 auto;
background-color: #195253;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
font-family: inherit;
transition: transform 0.3s ease-in-out,
background-color 0.3s ease-in-out;
}
button:hover {
background-color: #aef1b2;
color: black;
transform: scale(1.15);
}
select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
background-repeat: no-repeat;
background-position: right 10px top 50%;
background-size: 24px auto;
padding-right: 30px;
font-weight: bold;
font-family: inherit;
}
select:focus {
border-color: #4caf50;
outline: none;
}
@media (max-width: 768px) {
header {
flex-direction: column;
height: auto;
}
h1 {
padding-right: 0;
}
form {
width: 90%;
}
.container {
padding: 10px;
}
}
@media (max-width: 480px) {
.nav__logo {
font-size: 1.25rem;
}
h1 {
font-size: 1.5rem;
}
input,
select,
button {
font-size: 14px;
}
.container {
padding: 0px;
margin-bottom: 20px;
}
}
.swal2-popup {
background-color: #fbfcfc !important;
border: 3px solid black !important;
}
.swal2-title {
color: black !important;
}
.swal2-content {
color: black !important;
}
.swal2-confirm {
background-color: #096cf7 !important;
color: white !important;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
function handleSubmit(event) {
event.preventDefault();
const today = new Date(); // Get today's date
const startDate = new Date(document.getElementById("startDate").value);
const endDate = new Date(document.getElementById("endDate").value);
if (endDate < startDate) {
Swal.fire({
icon: "error",
title: "Oops...",
text: "End date cannot be earlier than start date.",
});
} else if (startDate < today || endDate < today) {
Swal.fire({
icon: "error",
title: "Oops...",
text: "Start and end dates cannot be earlier than today.",
});
} else {
Swal.fire({
icon: "success",
title: "Success!",
text: "Trip planned successfully!",
}).then((result) => {
if (result.isConfirmed || result.isDismissed) {
document.getElementById("tripForm").reset();
}
});
}
}
document.addEventListener("DOMContentLoaded", function () {
document
.getElementById("tripForm")
.addEventListener("submit", handleSubmit);
});
</script>
</head>
<body>
<header>
<a href="index.html" class="nav__logo" data-aos="fade-right"
>Tourguide<span>.</span></a
>
<h1>Trip Planner</h1>
</header>
<form id="tripForm">
<div class="container">
<label for="destination">Destination:</label>
<input type="text" id="destination" name="destination" required />
<label for="startDate">Start Date:</label>
<input type="date" id="startDate" name="startDate" required />
<label for="endDate">End Date:</label>
<input type="date" id="endDate" name="endDate" required />
<label for="budget">Budget:</label>
<input type="number" id="budget" name="budget" required />
<label for="accommodation">Accommodation:</label>
<select id="accommodation" name="accommodation">
<option value="hotel">Hotel</option>
<option value="apartment">Apartment</option>
<option value="hostel">Hostel</option>
</select>
<button type="submit">Plan My Trip</button>
</div>
</form>
</body>
</html>