-
Notifications
You must be signed in to change notification settings - Fork 0
/
place.html
260 lines (237 loc) · 8.76 KB
/
place.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
<!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>Wander Wisely with the Travelocity app</title>
<link rel="stylesheet" href="nav.css">
<link rel="stylesheet" href="place.css">
</head>
<body>
<nav>
<label class="logo"> <img src="https://www.logolynx.com/images/logolynx/9c/9c0d38dfefbb1a00369d482de4e96c4a.jpeg" alt="Booking"/> </label>
<ul>
<li><a class="active" href="index.html">Espanol</a></li>
<li><a href="#">Resort</a></li>
<li><a href="#">Supports</a></li>
<li><a href="book.html">Bookings</a></li>
<li><a href="login.html">Login</a></li>
<li><a href="signup.html">Sign up</a></li>
</ul>
</nav>
<div id="top">
<h1>Get More Bang for Less Buck.</h1>
<h6>Eat all the food. Drink all the drinks. Be entertained. Think of nothing beyond having a great time, making a splash in the pool and soaking up sun on the beach. All-inclusive getaways mean you and your family are having all the carefree fun you’ve been dreaming about. Free cancellation on most hotels. Some hotels require you to cancel more than 24 hours before check in. Please check the site for details. Note: International destinations may have travel restrictions in place due to COVID-19. Please check federal, state and local advisories before scheduling trips. </h6>
</div>
<select id="filter">
<option value="">All Resort</option>
<option value="Cancun">Cancun</option>
<option value="Punta Cana">Punta Cana</option>
<option value="Playa del Carmen">Playa del Carmen</option>
<option value="Montego Bay">Montego Bay</option>
<option value="Puerto Morelos">Puerto Morelos</option>
<option value="Puerto Vallorta">Puerto Vallorta</option>
</select>
<div id="container"></div>
<button id="btn">Show More</button>
</body>
</html>
<script>
let product = [
{
img : "https://images.trvl-media.com/hotels/1000000/30000/21600/21544/95af2b3d_b.jpg",
name : "Occidental Tucancun All Inclusive",
Place : "Cancun",
rate : "3.8/5 (850-Review)",
offer : "Fully refundable options",
price : 200,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/2000000/1150000/1142000/1141946/c6bb1576_b.jpg",
name : "Occean Blue & Sand Beach Resort-All...",
Place : "Punta Cana",
rate : "3.8/5 (855-Review)",
offer : "Fully refundable options",
price : 182,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/28000000/27580000/27573300/27573282/404fc3bf_b.jpg",
name : "Impressive Punta Cana-All Inclusive",
Place : "Punta Cana",
rate : "3.5/5 (855-Review)",
offer : "Fully refundable options",
price : 112,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/700000/693700/693601/2c1bb597_b.jpg",
name : "Occidental Punta Cana-All Inclusive",
Place : "Punta Cana",
rate : "3.9/5 (855-Review)",
offer : "Fully refundable options",
price : "144",
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/980000/975400/975332/651a177b_b.jpg",
name : "Be Live Collection Punta Cana-All Inclusive",
Place : "Punta Cana",
rate : "3.3/5 (855-Review)",
offer : "Fully refundable options",
price : 166,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/25000000/24370000/24362000/24361944/e4058bd2_b.jpg",
name : "The Fives Downtown Hotel",
Place : "Playa del Carmen",
rate : "4.3/5 (855-Review)",
offer : "Fully refundable options",
price : 174,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/480000/470900/470878/6abe88f3_b.jpg",
name : "Riu Lupita All Inclusive",
Place : "Playa del Carmen",
rate : "3.9/5 (855-Review)",
offer : "Fully refundable options",
price : 141,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/570000/569300/569232/cc00dc9d_b.jpg",
name : "Viva Wyndham Maya All Inclusive",
Place : "Playa del Carmen",
rate : "3.9/5 (855-Review)",
offer : "Fully refundable options",
price : 170,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/330000/328200/328185/b35019cd_b.jpg",
name : "Allegro Playacar All Inclusive",
Place : "Playa del Carmen",
rate : "3.9/5 (855-Review)",
offer : "Fully refundable options",
price : 174,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/8000000/7620000/7615700/7615695/62686c5e_b.jpg",
name : "Sea Garden Beach Resort All Inclusive",
Place : "Montego Bay",
rate : "3.8/5 (855-Review)",
offer : "Fully refundable options",
price : 178,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/2000000/1830000/1823100/1823032/4ad6d80e_b.jpg",
name : "Ocean Coral & Turquera All Inclusive",
Place : "Puerto Morelos",
rate : "3.9/5 (855-Review)",
offer : "Fully refundable options",
price : 183,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/11000000/10230000/10226000/10225947/d07f7e3b_b.jpg",
name : "El Beso Adults only at Ocean Coral",
Place : "Puerto Morelos",
rate : "3.8/5 (855-Review)",
offer : "Fully refundable options",
price : 193,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/20000/16600/16535/2c798ad2_b.jpg",
name : "Barcelo Puerto Vallarta-All Inclusive",
Place : "Puerto Vallorta",
rate : "3.9/5 (855-Review)",
offer : "Fully refundable options",
price : 193,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/20000/10500/10481/3a24a70d_b.jpg",
name : "Buenaventura Grand Hotel",
Place : "Puerto Morelos",
rate : "4.0/5 (855-Review)",
offer : "Fully refundable options",
price : 199,
day : "per Night",
},
{
img : "https://images.trvl-media.com/hotels/1000000/190000/186000/185902/9c5d5d2f_b.jpg",
name : "Vamar Vallarta All Inclusive Marina",
Place : "Puerto Morelos",
rate : "3.4/5 (855-Review)",
offer : "Fully refundable options",
price : 151,
day : "per Night",
}
]
</script>
<script>
let container= document.getElementById("container");
let booking = JSON.parse(localStorage.getItem("book")) || [];
let filter = document.getElementById("filter");
function display(data){
container.innerHTML="";
data.forEach(function(el){
let div = document.createElement("div");
let img = document.createElement("img");
img.src = el.img;
let h2 = document.createElement("h3");
h2.innerText = el.name;
let h3 = document.createElement("h4");
h3.innerText = el.Place;
let p = document.createElement("h5");
p.innerText = el.rate;
let hr = document.createElement("hr");
let h4 = document.createElement("h2");
h4.innerText = el.offer;
let h1 = document.createElement("h1");
h1.innerText = el.price;
let p1 = document.createElement("p");
p1.innerText = el.day;
let btn = document.createElement("button");
btn.innerText = "Book";
btn.addEventListener("click",function(){
addtobook(el)
})
div.append(img,h2,h3,p,hr,h4,h1,p1,btn);
container.append(div);
})
}
display (product)
let flag=false;
function addtobook(el){
for(let i=0;i<booking.length;i++){
if(booking[i].name === el.name){
alert("Already Added ");
flag=true;
break;
}
}
if(flag==false){
booking.push(el);
alert("Added Successfully");
localStorage.setItem("book",JSON.stringify(booking));
}
}
filter.addEventListener("change",function(){
if(filter.value === ""){
display(product);
}else{
let filtered = product.filter(function(el){
return el.Place === filter.value;
});
display(filtered)
}
})
</script>