-
Notifications
You must be signed in to change notification settings - Fork 0
/
explore.html
343 lines (251 loc) · 10.3 KB
/
explore.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
<!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>Document</title>
<link rel="stylesheet" href="./styles/explore.css">
<link rel="stylesheet" href="./styles/popup.css">
<link rel="stylesheet" href="./styles/activity.css">
<link rel="stylesheet" href="./styles/footer.css">
</head>
<body>
<div id="main">
<!-- Navbar start -->
<div id="explorenavbar" style="height: 50px; margin-bottom: 35px;">
<div id="logodiv" >
<a href="index.html">
<img id="logo" src="https://playo-website.imgix.net/company/logo1.png?auto=compress,format" alt="playo logo" style="margin-top: 7px;">
</a>
</div>
</div>
<!-- Navbar End -->
<div id="filter">
<div id="locationfilter">"
<img src="https://playo.co/_next/image?url=https%3A%2F%2Fplayo-website.gumlet.io%2Fplayo-website-v2%2Fshare-pages%2Fpoint-icon.png&w=1920&q=75" alt="filter" class="icon" />
<div class="align">
<P class="filtertext">Location</P>
<span id="place"></span>
</div>
<div id="searchicon">
<img src="https://playo-website.gumlet.io/playo-website-v2/logos-icons/search-icon.svg" alt="Sicon" class="icon2" />
<P style="transform: translateY(15px);" id="detect"></P>
</div>
</div>
<div id="searchfilter">
<img src="https://cdn-icons-png.flaticon.com/512/62/62740.png" alt="srfilter" class="icon">
<div class="align">
<p class="filtertext">Search</p>
<p class="shade filtertext"> For example,"Football"</p>
</div>
</div>
<div id="sportsfilter">
<img src="https://playo-website.gumlet.io/playo-website-v2/logos-icons/sports-filter.svg" alt="sportfilter" class="icon" >
<div class="align">
<p class="filtertext">Sport</p>
<select class="bold space" id="sportfilt">
<option value="Select Sports">Select Sports</option>
<option value="Cricket">Cricket</option>
<option value="Football">Football</option>
<option value="Badminton">Badminton</option>
<option value="Swimming">Swimming</option>
</select>
</div>
</div>
<div id="catfilter">
<img src="https://w7.pngwing.com/pngs/37/23/png-transparent-computer-icons-icon-design-information-computer-software-category-management-text-trademark-logo.png" alt="catfilter" class="icon">
<div class="align">
<p class="filtertext">Categories</p>
<select class="bold space1">
<option value="Select Sports">All</option>
</select>
</div>
</div>
</div>
<div id="con"></div>
<!-- <div id= "places">
<div>
<img src="https://playo-activities.gumlet.io/SVMBOWLINGALLEY/SVMBowlingAlleycover.jpg?q=40" alt="" class="conimage">
<p class="imgtext">Book</p>
</div>
<p class="highlighttext">shiva</p>
<p class="location">hyd</p>
<p class="timing"><img src="./images/clock.png" alt="" class="clockicon">ljljl</p>
<p class="coaching">lsjdfljsd</p>
</div> -->
<div id="infooter">
<div id="div1">
<div id="weblogo">
<a href="index.html"><img src="https://blog.playo.co/wp-content/uploads/2020/11/Logo_dark_500@2x-scaled.jpg" alt="logo" width="70%" ></a>
</div>
<div id="playstore">
<a href="https://play.google.com/store/apps/details?id=com.techmash.playo">
<img src="https://img.freepik.com/free-icon/playstore_318-278806.jpg?w=2000" width="70%" alt="logo">
</a>
<a href="https://apps.apple.com/us/app/playo-local-sports-community/id1018786950?ls=1">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/67/App_Store_%28iOS%29.svg/640px-App_Store_%28iOS%29.svg.png" width="60%" alt="logo">
</a>
</div>
<div id="copyright">
<p>©2022 TechMash Solutions Private Limited.<span> All Rights Reserved.</span></p>
</div>
<div id="loweritems">
<a href="faq.html"><p>FAQs</p></a>
<a href=""><p>Privacy POlicy</p></a>
<a href=""><p>Terms Of Service</p></a>
<a href=""><p>Cancellation & Refund Policy</p></a>
<a href=""><p>Careers</p></a>
<a href=""><p id="hiring">We're Hiring!</p></a>
</div>
</div>
<div id="div2">
<a href="about.html"><p>About Us</p></a>
<a href="partner.html"><p>Partner With Us</p></a>
<a href="brandact.html"><p>Brand Activations</p></a>
<a href="corporate.html"><p>Corporate Offerings</p></a>
<a href="contact.html"><p>contact Us</p></a>
</div>
<div id="div3">
<a href="venues.html"><p>Book Venues</p></a>
<a href="activities.html"><p>Activities</p></a>
<a href="blog.html"><p>Blog</p></a>
<a href="faq.html"><p>FAQ's</p></a>
</div>
<div id="div4">
<a href="https://www.facebook.com/PlayoApp/"><p>Facebook</p></a>
<a href="https://twitter.com/playoApp"><p>Twitter</p></a>
<a href="https://www.instagram.com/playoapp/"><p>Instagram</p></a>
<a href="https://www.linkedin.com/company/playo"><p>LinkdIn</p></a>
</div>
</div>
</div>
</body>
</html>
<script >
// for (let x in data) {
// var cityx = data[x];
// }
// console.log(cityx);
// let con = document.getElementById("con");
// async function add(url) {
// try {
// var url = `http://127.0.0.1:5000/playo/cities`;
// let response = await fetch(url, {
// method: "GET",
// headers: {
// "Content-Type": "application/json",
// },
// });
// let d = await response.json();
// console.log("d:", d);
// display(d);
// } catch (err) {
// console.log("err:", err);
// }
// }
// display = (e) => {
// // console.log('e:', e)
// e.forEach((el) => {
// for (x in data) {
// var c = data[x];
// }
// // var div = document.getElementById("places");
// // // div.setAttribute("id","places")
// // var location= document.createElement("p");
// // location.innerText= el.location
// // let img= document.createElement("img")
// // img.src= el.image
// // img.setAttribute("id","conimage")
// // let timing= document.createElement("p")
// // timing.innerText=el.timing
// // // console.log(el.timing)
// // var name = document.createElement("p");
// // name.innerText=el.name
// // Book= "BOOKABLE",
// // safe= "Safe & Hygiene"
// if (el.city === c) {
// let y = ` <div onclick="details(${el.id})" id= "places">
// <div>
// <img src="${el.image}" alt="" class="conimage">
// <p class="imgtext">Coaching</p>
// </div>
// <p class="highlighttext">${el.name}</p>
// <p class="location">${el.location}</p>
// <p class="timing"><img src="./images/clock.png" alt="" class="clockicon">${el.timing}</p>
// <p class="coaching">${el.name} Coaching</p>
// </div>`;
// let place = document.getElementById("place");
// place.setAttribute("class", "bold");
// place.innerHTML = el.city;
// con.innerHTML += y;
// } else {
// console.log("err");
// }
// });
// };
// add();
//Filtering array of objects from the data base start (With Debouncing Feature)
//=======================================================================>
//Selectiong Html Content
let my_value = JSON.parse(localStorage.getItem("name"));
console.log(my_value.city)
searchLocation();
//Search Function Code
var filt;
async function searchLocation(){
//Getting the value again
var search_value = my_value.city;
let response = await fetch("./database/activityData.json");
let data = await response.json();
console.log(data);
//Writing Function for filter data based on search results
let filterData = data.filter((el)=>{
// let regex = new RegExp(`^${search_value}`, "gi" );
return el.city.charAt(1)==search_value.charAt(1);
})
apprndData(filterData)
console.log(filterData);
filt=filterData;
}
var sportfilter=document.querySelector("#sportfilt");
sportfilter.addEventListener("change",function(){
event.preventDefault();
let filtsport=filt.filter(function(el){
return el.sport===sportfilter.value;
})
console.log(filtsport);
apprndData(filtsport)
})
//===========================================================================>
//Append Data Function
function apprndData(data){
// console.log(data)
con.innerHTML="";
data.map((el)=>{
let y = ` <div onclick="details(${el.id})" id= "places" class="clickdiv">
<div>
<img src="${el.image}" alt="" class="conimage">
<p class="imgtext">Coaching</p>
</div>
<p class="highlighttext">${el.name}</p>
<p class="location">${el.location}</p>
<p class="timing"><img src="./images/clock.png" alt="" class="clockicon">${el.timing}</p>
<p class="coaching">${el.name} Coaching</p>
</div>`;
let place = document.getElementById("place");
place.setAttribute("class", "bold");
place.innerHTML = el.city;
con.innerHTML += y;
})
}
function details(x) {
console.log("id:", x);
let data = {
id: x,
};
let location = localStorage.setItem("id", JSON.stringify(data));
window.location.href = "detail.html";
}
//Filtering array of objects from the data base End (With Debouncing Feature)
</script>