From 9a8a62e4829a2cc595d479369f3e5776b7a6d5b0 Mon Sep 17 00:00:00 2001 From: Sanjeev Kushwaha Date: Sat, 1 Jul 2023 12:36:33 +0530 Subject: [PATCH 1/5] Playo App complete 30% --- activities.html | 82 ++++++++++++++++++++++++++++++-------------- bookVenue.html | 2 +- components/footer.js | 44 ++++++++++++------------ explore.html | 22 +++++++----- index.html | 6 ++-- styles/activity.css | 4 ++- styles/footer.css | 37 ++++++++++++++++---- styles/index.css | 4 +-- venues.html | 2 +- 9 files changed, 134 insertions(+), 69 deletions(-) diff --git a/activities.html b/activities.html index 436a3f9..ccb2ffc 100644 --- a/activities.html +++ b/activities.html @@ -14,7 +14,7 @@
@@ -30,7 +30,7 @@ @@ -539,7 +539,9 @@ 'Udham Singh Nagar', 'Uttarkashi']; city_names.sort((a,b)=>a-b); - //console.log(city_names) + // console.log(city_names) + localStorage.setItem("city",JSON.stringify(city_names)); + for(var i=0; i + \ No newline at end of file + let location = localStorage.setItem("name", JSON.stringify(data)); + window.location.href = "explore.html"; +}) + \ No newline at end of file diff --git a/bookVenue.html b/bookVenue.html index 7d21410..b580928 100644 --- a/bookVenue.html +++ b/bookVenue.html @@ -17,7 +17,7 @@
- +
` } diff --git a/explore.html b/explore.html index 9f34e52..9f63515 100644 --- a/explore.html +++ b/explore.html @@ -19,7 +19,7 @@ @@ -80,17 +80,20 @@

ljljl

lsjdfljsd

--> + +
+

Your Sports Community App

@@ -228,6 +233,7 @@ + let MyCity=document.getElementById("con"); let my_value = JSON.parse(localStorage.getItem("name")); console.log(my_value.city) diff --git a/index.html b/index.html index f19abf5..cdb5786 100644 --- a/index.html +++ b/index.html @@ -32,14 +32,14 @@ @@ -52,9 +52,11 @@ + + \ No newline at end of file diff --git a/data.json b/data.json index b5b4ccd..0761b39 100644 --- a/data.json +++ b/data.json @@ -1,6 +1,7 @@ { "cities": [ { + "sport":"cricket", "city": "hyderabad", "name": "Daniel Cricket Academy", "location": "hyderabad", @@ -13,6 +14,7 @@ "services": "Coaching starts at 5:45 a.m. continues till 8:00 a.m. and in the evening starts at 4:00 p.m. continues till 8:00 p.m.Friendly matches are conducted during the weekends.Fitness program - to make the boys both physically and mentally strong. Special emphasis on fielding, bowling and batting.Giving awareness about international standards and rules.Matches are organized under flood lights with 20-20 format on Saturdays and Sundays for children to get them used to difference match situations/conditions." }, { + "sport":"cricket", "city": "hyderabad", "name": "SVM Bowling Alley Gachibowli", "location": "36/A, Sai Tirumala Platinum Building, Old Mumbai Hwy, Telecom Nagar Extension", @@ -27,6 +29,7 @@ "id": 2 }, { + "sport":"badminton", "city": "hyderabad", "name": "CHETAN ANAND BADMINTON ACADEMY", "location": "Madhapur", @@ -41,6 +44,7 @@ "id": 3 }, { + "sport":"swimming", "city": "hyderabad", "name": "PRAXIS SWIMMING", "location": "Narayanguda", @@ -55,6 +59,7 @@ "id": 4 }, { + "sport":"cricket", "city": "hyderabad", "name": "INSPORTS CRICKET ACADEMY", "location": "Banjara Hills", @@ -69,6 +74,7 @@ "id": 5 }, { + "sport":"cricket", "city": "hyderabad", "name": "ST. JOHNS CRICKET ACADEMY", "location": "East Marredpally", @@ -83,6 +89,7 @@ "id": 6 }, { + "sport":"cricket", "city": "hyderabad", "name": "RAJU'S CRICKET COACHING ACADEMY", "location": "Sri Nagar Colony", @@ -97,6 +104,7 @@ "id": 7 }, { + "sport":"cricket", "city": "hyderabad", "name": "VVS SPORTS ACADEMY", "location": "Moinabad", @@ -111,6 +119,7 @@ "id": 8 }, { + "sport":"cricket", "city": "delhi", "name": "WEST DELHI CRICKET ACADEMY", "location": "1A-2 Block, St. Sophia School, Paschim Vihar, New Delhi, Delhi 110063", @@ -125,6 +134,7 @@ "id": 9 }, { + "sport":"cricket", "city": "delhi", "name": "DRONACHARYA CRICKET FOUNDATION", "location": "Near Hanuman Balaji Mandir, Vivek Vihar, New Delhi, Delhi 110092", @@ -139,6 +149,7 @@ "id": 10 }, { + "sport":"cricket", "city": "delhi", "name": "SEHWAG CRICKET ACADEMY", "location": "X-12, Hauz Khas Road, Hauz Khas Main Market, New Delhi, Delhi 110016", @@ -153,6 +164,7 @@ "id": 11 }, { + "sport":"cricket", "city": "delhi", "name": "MADAN LAL CRICKET ACADEMY", "location": "DDA Siri Fort Sports Complex, August Kranti Marg, Khelgaon, Behind Siri Fort Auditorium, New Delhi, Delhi 110049", @@ -167,6 +179,7 @@ "id": 12 }, { + "sport":"cricket", "city": "delhi", "name": "HARBEER CRICKET ACADEMY", "location": "Opp.Japanese Park, Sector 9, Rohini west, Delhi, 110085", @@ -181,6 +194,7 @@ "id": 13 }, { + "sport":"football", "city": "delhi", "name": "EXTRA TIME FOOTBALL ACADEMY", "location": "Vasant Vatika, Opposite DPS Vasant Kunj, New Delhi, Delhi 110070", @@ -195,6 +209,7 @@ "id": 14 }, { + "sport":"football", "city": "delhi", "name": "FCBESCOLA FOOTBALL SCHOOL - WEST DELHI", "location": "Shivaji College Sports Complex iOS Maidan, Shivaji Enclave, Tagore Garden Extension, New Delhi, Delhi 110018", @@ -209,6 +224,7 @@ "id": 15 }, { + "sport":"football", "city": "delhi", "name": "PHOENIX FOOTBALL ACADEMY", "location": "DDA Sports Complex, Muni Maya Ram Jain Marg, Pitampura, Delhi, 110034", @@ -223,6 +239,7 @@ "id": 16 }, { + "sport":"cricket", "city": "pune", "name": "TWENTY2YARDS CRICKET ACADEMY", "location": "r.No. 52/C, Dagade-Patil Nagar, Opp. Pinnacle Brookside, Mumbai-Bangalore Bypass Highway, Bavdhan Khurd, Pune, Maharashtra 411021", @@ -237,6 +254,7 @@ "id": 17 }, { + "sport":"cricket", "city": "pune", "name": "ARYANS CRICKET ACADEMY", "location": "Mulberry Gardens, Opp Laxmi Lawns, Magarpatta City, Hadapsar, Pune, Maharashtra 411028", @@ -251,6 +269,7 @@ "id": 18 }, { + "sport":"cricket", "city": "pune", "name": "SPORTS GALAXY TILEKAR SPORTS ACADEMY", "location": "Mulberry Gardens, Opp Laxmi Lawns, Magarpatta City, Hadapsar, Pune, Maharashtra 411028", @@ -265,6 +284,7 @@ "id": 19 }, { + "sport":"football", "city": "pune", "name": "PYC HINDU GYMKHANA", "location": "CTS No. 766, F.P. No. 244, Bhandarkar Road, Pune, Maharashtra 411004", @@ -279,6 +299,7 @@ "id": 20 }, { + "sport":"football", "city": "pune", "name": "SANJAY SPORTS ACADEMY", "location": "19/1b/1, Near Hotel Rajwada, BanerRoad, Someshwarwadi, Pune, Maharashtra 411008", @@ -293,6 +314,7 @@ "id": 21 }, { + "sport":"football", "city": "pune", "name": "SILVER SPORTS CLUB", "location": "165/1, 166/5 , Near by Mumbai-Bangalore Highway, Behind Vedanta Society ,, Wakad,, Shankar Kalat Nagar, Wakad, Pune, Maharashtra 411057", @@ -307,6 +329,7 @@ "id": 22 }, { + "sport":"cricket", "city": "mumbai", "name": "SANJEEVANI CRICKET ACADEMY", "location": "Bandra East", @@ -321,6 +344,7 @@ "id": 23 }, { + "sport":"cricket", "city": "mumbai", "name": "MUMBAI CRICKET ASSOCIATION INDOOR CRICKET ACADEMY", "location": "Bandra East", @@ -335,6 +359,7 @@ "id": 24 }, { + "sport":"cricket", "city": "mumbai", "name": "GLOBAL CRICKET SCHOOL", "location": "508, Neelkanth, 98, Marine Drive, Churchgate, Mumbai, Maharashtra", @@ -349,6 +374,7 @@ "id": 25 }, { + "sport":"cricket", "city": "mumbai", "name": "SHIVAJI PARK GYMKHANA", "location": "Keluskar Road South, Shivaji Park, Dadar West, Mumbai, Maharashtra", @@ -363,6 +389,7 @@ "id": 26 }, { + "sport":"cricket", "city": "mumbai", "name": "VIDYA PARADKAR ACADEMY", "location": "c/o Vidyadhar Paradkar 264, Bhadkamkar Marg 16, Pannalal Terraces, Mumbai, Maharashtra", @@ -377,6 +404,7 @@ "id": 27 }, { + "sport":"swimming", "city": "mumbai", "name": "OCEAN SWIMMING ACADEMY", "location": "201 G12, Navjeevan Co-Op Soc, Sangharsh Nagar, Chandivali, Near Sakinaka Nahar Amrit Shakti, Andhieri (East), Mumbai, Maharashtra 400072", @@ -391,6 +419,7 @@ "id": 28 }, { + "sport":"football", "city": "kolkata", "name": "FOOTBALL TOURNAMENT", "location": "Indian Statistical Institute, 205 B.T. Road, Kolkata, West Bengal, India", @@ -405,6 +434,7 @@ "id": 29 }, { + "sport":"cricket", "city": "kolkata", "name": "CALCUTTA CRICKET ACADEMY", "location": "Southern Ave, Lake Gardens, Vivekananda Park (est) Ground, Hemanta Mukherjee Sarani, lake Terrace, Ballygunge, Kolkata, West Bengal 700029", diff --git a/explore.html b/explore.html index 9f63515..067d42b 100644 --- a/explore.html +++ b/explore.html @@ -45,7 +45,7 @@

Search

-

For example,"Football"

+

@@ -81,6 +81,8 @@

lsjdfljsd

--> + +
@@ -233,7 +235,7 @@ - let MyCity=document.getElementById("con"); + let my_value = JSON.parse(localStorage.getItem("name")); console.log(my_value.city) @@ -246,7 +248,7 @@ - let response = await fetch("./database/activityData.json"); + let response = await fetch("http://localhost:3000/cities"); let data = await response.json(); //console.log(data); @@ -258,6 +260,14 @@ }) console.log(filterData); + + + myNameData(filterData[0].city); + document.getElementById("btn1").addEventListener("click",()=>{ + // let val1=document.getElementById("searchValue").value; + SearchData(filterData); + +}) apprndData(filterData) } @@ -265,28 +275,31 @@ //===========================================================================> - + let page=1; +let totalPages; //Append Data Function function apprndData(data){ // console.log(data) data.map((el)=>{ - let y = `
-
+ + let y = `
+

Coaching

-
+

${el.name}

${el.location}

${el.timing}

${el.name} Coaching

-
`; - +
`; + let place = document.getElementById("place"); place.setAttribute("class", "bold"); place.innerHTML = el.city; con.innerHTML += y; - + + }) @@ -326,4 +339,103 @@ +// let name=localStorage.getItem("my"); +// // let str1=name; +// // let str2=str1.toLowerCase() +console.log(name); +let MyCity=document.getElementById("con"); + + + +function myNameData(name){ +const nm=name; + let API_DATA=`http://localhost:3000/cities?city=${name}` +let length2; +showAPI(API_DATA); +async function showAPI(API_DATA){ + let result=await fetch(API_DATA); + let data=await result.json(); + console.log(data.length); + length2=Math.ceil(data.length/4); + console.log(length2) + myLength(length2,name) +} + + showData(page,name); + +} + +async function showData(page,name){ + let result=await fetch(`http://localhost:3000/cities?city=${name}&_page=${page}&_limit=4`); + let data =await result.json(); + console.log(data) + con.innerHTML=null; + apprndData(data) + } + + + + +function myLength(l,name){ + let paginationData=document.getElementById("pagination"); +paginationData.innerHTML=null; + +for(let i=1;i<=l;i++){ + let btn=document.createElement("button"); + btn.setAttribute("class","pagination-button"); + + btn.innerText=i; + btn.addEventListener("click",()=>{ + showData(i,name); + }) + paginationData.append(btn); +} +} + + + + +// async function SearchData(){ +// //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.match(regex); +// }) + +// console.log(filterData); +// // localStorage.setItem("my",(filterData[0].city)); + +// //apprndData(filterData) +// } + + +function SearchData(dt){ + console.log(dt); + let val1=document.getElementById("searchValue").value; + con.innerHTML=null; + let newData=dt.filter(function(el){ + return val1==el.sport; + }) + console.log(newData); + if(newData.length!=0){ + apprndData(newData) + } + else{ + let h1=document.createElement("h1"); + h1.innerHTML="Not Available in this city" + con.append(h1); + } +} + \ No newline at end of file diff --git a/styles/activity.css b/styles/activity.css index 17470a8..91f4136 100644 --- a/styles/activity.css +++ b/styles/activity.css @@ -28,4 +28,18 @@ margin-right: 20%;} margin-left: 15%; width: 65%; height: 40px; margin-top: 15px;} #dropdowndiv{ height: 70px; visibility: hidden; width: 100px; text-align: center; margin-top: 40px; border: 1px solid bisque;} -#citynames>p{padding-left: 10px;} \ No newline at end of file +#citynames>p{padding-left: 10px;} +#pagination{ + width: 70%; + margin: auto; + height: 50px; + /* border: 1px dashed rgb(240, 219, 219); */ + margin-bottom: 20px; + margin-left:34%; +} +.pagination-button{ + width: 20%; + margin: auto; + padding: 15px 60px; + +} From 33d8869bcf492876a3317b967b568fce16e3cc7d Mon Sep 17 00:00:00 2001 From: Sanjeev Kushwaha Date: Sun, 2 Jul 2023 17:20:56 +0530 Subject: [PATCH 3/5] blog part complete --- blog.html | 16 +- data.json | 30 +++ detail.html | 21 +- explore.html | 624 +++++++++++++++++++++++++++++------------------- scripts/blog.js | 264 ++++++++++++++++---- 5 files changed, 641 insertions(+), 314 deletions(-) diff --git a/blog.html b/blog.html index 01ebf85..3f89374 100644 --- a/blog.html +++ b/blog.html @@ -65,10 +65,10 @@
SPORTS
HEALTH
-
CRICKET
-
FOOTBALL
-
TENNIS
-
QUIZ
+
CRICKET
+
FOOTBALL
+
TENNIS
+
QUIZ
@@ -86,9 +86,9 @@ -
+ +
diff --git a/data.json b/data.json index 0761b39..8a907e4 100644 --- a/data.json +++ b/data.json @@ -1,6 +1,7 @@ { "cities": [ { + "level":"low", "sport":"cricket", "city": "hyderabad", "name": "Daniel Cricket Academy", @@ -14,6 +15,7 @@ "services": "Coaching starts at 5:45 a.m. continues till 8:00 a.m. and in the evening starts at 4:00 p.m. continues till 8:00 p.m.Friendly matches are conducted during the weekends.Fitness program - to make the boys both physically and mentally strong. Special emphasis on fielding, bowling and batting.Giving awareness about international standards and rules.Matches are organized under flood lights with 20-20 format on Saturdays and Sundays for children to get them used to difference match situations/conditions." }, { + "level":"high", "sport":"cricket", "city": "hyderabad", "name": "SVM Bowling Alley Gachibowli", @@ -29,6 +31,7 @@ "id": 2 }, { + "level":"high", "sport":"badminton", "city": "hyderabad", "name": "CHETAN ANAND BADMINTON ACADEMY", @@ -44,6 +47,7 @@ "id": 3 }, { + "level":"high", "sport":"swimming", "city": "hyderabad", "name": "PRAXIS SWIMMING", @@ -59,6 +63,7 @@ "id": 4 }, { + "level":"low", "sport":"cricket", "city": "hyderabad", "name": "INSPORTS CRICKET ACADEMY", @@ -74,6 +79,7 @@ "id": 5 }, { + "level":"high", "sport":"cricket", "city": "hyderabad", "name": "ST. JOHNS CRICKET ACADEMY", @@ -89,6 +95,7 @@ "id": 6 }, { + "level":"high", "sport":"cricket", "city": "hyderabad", "name": "RAJU'S CRICKET COACHING ACADEMY", @@ -104,6 +111,7 @@ "id": 7 }, { + "level":"low", "sport":"cricket", "city": "hyderabad", "name": "VVS SPORTS ACADEMY", @@ -119,6 +127,7 @@ "id": 8 }, { + "level":"low", "sport":"cricket", "city": "delhi", "name": "WEST DELHI CRICKET ACADEMY", @@ -134,6 +143,7 @@ "id": 9 }, { + "level":"high", "sport":"cricket", "city": "delhi", "name": "DRONACHARYA CRICKET FOUNDATION", @@ -149,6 +159,7 @@ "id": 10 }, { + "level":"high", "sport":"cricket", "city": "delhi", "name": "SEHWAG CRICKET ACADEMY", @@ -164,6 +175,7 @@ "id": 11 }, { + "level":"low", "sport":"cricket", "city": "delhi", "name": "MADAN LAL CRICKET ACADEMY", @@ -179,6 +191,7 @@ "id": 12 }, { + "level":"high", "sport":"cricket", "city": "delhi", "name": "HARBEER CRICKET ACADEMY", @@ -194,6 +207,7 @@ "id": 13 }, { + "level":"high", "sport":"football", "city": "delhi", "name": "EXTRA TIME FOOTBALL ACADEMY", @@ -209,6 +223,7 @@ "id": 14 }, { + "level":"low", "sport":"football", "city": "delhi", "name": "FCBESCOLA FOOTBALL SCHOOL - WEST DELHI", @@ -224,6 +239,7 @@ "id": 15 }, { + "level":"high", "sport":"football", "city": "delhi", "name": "PHOENIX FOOTBALL ACADEMY", @@ -239,6 +255,7 @@ "id": 16 }, { + "level":"low", "sport":"cricket", "city": "pune", "name": "TWENTY2YARDS CRICKET ACADEMY", @@ -254,6 +271,7 @@ "id": 17 }, { + "level":"high", "sport":"cricket", "city": "pune", "name": "ARYANS CRICKET ACADEMY", @@ -269,6 +287,7 @@ "id": 18 }, { + "level":"low", "sport":"cricket", "city": "pune", "name": "SPORTS GALAXY TILEKAR SPORTS ACADEMY", @@ -284,6 +303,7 @@ "id": 19 }, { + "level":"high", "sport":"football", "city": "pune", "name": "PYC HINDU GYMKHANA", @@ -299,6 +319,7 @@ "id": 20 }, { + "level":"low", "sport":"football", "city": "pune", "name": "SANJAY SPORTS ACADEMY", @@ -314,6 +335,7 @@ "id": 21 }, { + "level":"high", "sport":"football", "city": "pune", "name": "SILVER SPORTS CLUB", @@ -329,6 +351,7 @@ "id": 22 }, { + "level":"high", "sport":"cricket", "city": "mumbai", "name": "SANJEEVANI CRICKET ACADEMY", @@ -344,6 +367,7 @@ "id": 23 }, { + "level":"low", "sport":"cricket", "city": "mumbai", "name": "MUMBAI CRICKET ASSOCIATION INDOOR CRICKET ACADEMY", @@ -359,6 +383,7 @@ "id": 24 }, { + "level":"high", "sport":"cricket", "city": "mumbai", "name": "GLOBAL CRICKET SCHOOL", @@ -374,6 +399,7 @@ "id": 25 }, { + "level":"high", "sport":"cricket", "city": "mumbai", "name": "SHIVAJI PARK GYMKHANA", @@ -389,6 +415,7 @@ "id": 26 }, { + "level":"low", "sport":"cricket", "city": "mumbai", "name": "VIDYA PARADKAR ACADEMY", @@ -404,6 +431,7 @@ "id": 27 }, { + "level":"high", "sport":"swimming", "city": "mumbai", "name": "OCEAN SWIMMING ACADEMY", @@ -419,6 +447,7 @@ "id": 28 }, { + "level":"high", "sport":"football", "city": "kolkata", "name": "FOOTBALL TOURNAMENT", @@ -434,6 +463,7 @@ "id": 29 }, { + "level":"low", "sport":"cricket", "city": "kolkata", "name": "CALCUTTA CRICKET ACADEMY", diff --git a/detail.html b/detail.html index b06fbff..fc210f6 100644 --- a/detail.html +++ b/detail.html @@ -21,7 +21,7 @@
@@ -95,14 +95,14 @@
diff --git a/explore.html b/explore.html index 067d42b..0254187 100644 --- a/explore.html +++ b/explore.html @@ -1,76 +1,86 @@ - - - - - Document - - - - - - - -
- - -
- -
- - - - -
- + + + + + + Document + + + + + + + +
+ + +
+ +
+ + + +
- +
+ -
-
- -
-

Location

- - -
-
- -

Detect

-
+ +
+
+ +
+

Location

+ +
-
- -
-

Search

-

+
+ +

Detect

+
+
+
+ +
+

Search

+

-
-
- -
-

Sport

- -
- +
+
+ +
+

Sport

+
-
- -
-

Categories

- -
+ +
+
+ +
+

Categories

+
-
- - - - -
-
- -

Your Sports Community App

- - - + + + +
+ + + - \ No newline at end of file diff --git a/scripts/blog.js b/scripts/blog.js index 0a443ff..5ec946b 100644 --- a/scripts/blog.js +++ b/scripts/blog.js @@ -12,23 +12,23 @@ - let quoteUrl = "https://bodybuilding-quotes1.p.rapidapi.com/random-quote"; - fetch(quoteUrl, { - "method": "GET", - "headers": { - "x-rapidapi-host": "bodybuilding-quotes1.p.rapidapi.com", - "x-rapidapi-key": "a867a75115msh062cacb248defc3p1037f9jsnb868cbef939c" - } - }) - .then((res)=>{ - return res.json() - }) - .then((res)=>{ - console.log(res); - let quote = document.querySelector("#quote"); - let value = res.quote; - quote.textContent = value; - }) + // let quoteUrl = "https://bodybuilding-quotes1.p.rapidapi.com/random-quote"; + // fetch(quoteUrl, { + // "method": "GET", + // "headers": { + // "x-rapidapi-host": "bodybuilding-quotes1.p.rapidapi.com", + // "x-rapidapi-key": "a867a75115msh062cacb248defc3p1037f9jsnb868cbef939c" + // } + // }) + // .then((res)=>{ + // return res.json() + // }) + // .then((res)=>{ + // console.log(res); + // let quote = document.querySelector("#quote"); + // let value = res.quote; + // quote.textContent = value; + // }) @@ -43,16 +43,16 @@ - document.querySelector("#first-blog").addEventListener("click", ()=>{ + // document.querySelector("#first-blog").addEventListener("click", ()=>{ - window.open("https://blog.playo.co/humansofplayo-how-to-submit-a-story/" , '_blank'); - }) + // window.open("https://blog.playo.co/humansofplayo-how-to-submit-a-story/" , '_blank'); + // }) - document.querySelector("#sec-blog").addEventListener("click", ()=>{ + // document.querySelector("#sec-blog").addEventListener("click", ()=>{ - window.open("https://blog.playo.co/guidelines-to-playsafe-in-the-times-of-covid-19/" , '_blank'); + // window.open("https://blog.playo.co/guidelines-to-playsafe-in-the-times-of-covid-19/" , '_blank'); - }) + // }) // By Clicking static blog content End==================> @@ -88,7 +88,7 @@ //Edit function fetchNews(){ let apiKey_blog = "b140754e118c4b63a8e580772d4446a1"; - let bloglink = `https://newsapi.org/v2/top-headlines?country=in&category=sports&pageSize=10&apiKey=${process.env.BLOG_API_KEY}`; + let bloglink = `https://newsapi.org/v2/everything?q=sport&from=2023-06-02&sortBy=publishedAt&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; fetch(bloglink) .then((res)=>{ return res.json(); @@ -115,34 +115,190 @@ //Api call for health news start==================> - document.querySelector("#health-news").addEventListener("click", ()=>{ - console.log("Test") +document.querySelector("#health-news").addEventListener("click", ()=>{ + console.log("Test") - document.querySelector("#sports-news").style.backgroundColor = "#F3F3F2"; - document.querySelector("#sports-news").style.borderBottom = "none"; - document.querySelector("#health-news").style.backgroundColor = "white"; - document.querySelector("#health-news").style.borderBottom = "3px solid #548A2F" - + document.querySelector("#sports-news").style.backgroundColor ="#F3F3F2"; + document.querySelector("#sports-news").style.borderBottom = "none" + document.querySelector("#health-news").style.backgroundColor = "white"; + document.querySelector("#health-news").style.borderBottom = "3px solid #548A2F"; + document.querySelector("#cricket-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#cricket-news").style.borderBottom = "none"; + document.querySelector("#football-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#football-news").style.borderBottom = "none"; + document.querySelector("#tennis-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#tennis-news").style.borderBottom = "none"; + document.querySelector("#quiz-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#quiz-news").style.borderBottom = "none"; + - - let apiKey_health = "b140754e118c4b63a8e580772d4446a1"; - let bloglink_health = `https://newsapi.org/v2/top-headlines?country=in&category=health&pageSize=12&apiKey=${process.env.BLOG_API_KEY}`; + + let apiKey_health = "b140754e118c4b63a8e580772d4446a1"; + let bloglink_health = `https://newsapi.org/v2/everything?q=health&from=2023-06-02&pageSize=10&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; + + fetch(bloglink_health) + .then((res)=>{ + return res.json(); + }) + .then((res)=>{ + let appendlocation = document.querySelector(".dynamic-news"); + appendNews(res.articles, appendlocation); + }) + .catch((e)=>{ + console.log(e); - fetch(bloglink_health) - .then((res)=>{ - return res.json(); - }) - .then((res)=>{ - let appendlocation = document.querySelector(".dynamic-news"); - appendNews(res.articles, appendlocation); - }) - .catch((e)=>{ - console.log(e); - - }) + }) + + }) + + + + +document.querySelector("#cricket-news").addEventListener("click", ()=>{ + console.log("Test") + + document.querySelector("#sports-news").style.backgroundColor ="#F3F3F2"; + document.querySelector("#sports-news").style.borderBottom = "none" + document.querySelector("#cricket-news").style.backgroundColor = "white"; + document.querySelector("#cricket-news").style.borderBottom = "3px solid #548A2F"; + document.querySelector("#health-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#health-news").style.borderBottom = "none"; + document.querySelector("#football-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#football-news").style.borderBottom = "none"; + document.querySelector("#tennis-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#tennis-news").style.borderBottom = "none"; + document.querySelector("#quiz-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#quiz-news").style.borderBottom = "none"; + + + + + let apiKey_health = "b140754e118c4b63a8e580772d4446a1"; + let bloglink_cricket= `https://newsapi.org/v2/everything?q=cricket&from=2023-06-02&pageSize=10&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; + + fetch(bloglink_cricket) + .then((res)=>{ + return res.json(); + }) + .then((res)=>{ + let appendlocation = document.querySelector(".dynamic-news"); + appendNews(res.articles, appendlocation); + }) + .catch((e)=>{ + console.log(e); + + }) + + }) +document.querySelector("#football-news").addEventListener("click", ()=>{ + console.log("Test") + + document.querySelector("#sports-news").style.backgroundColor ="#F3F3F2"; + document.querySelector("#sports-news").style.borderBottom = "none" + document.querySelector("#football-news").style.backgroundColor = "white"; + document.querySelector("#football-news").style.borderBottom = "3px solid #548A2F"; + document.querySelector("#health-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#health-news").style.borderBottom = "none"; + document.querySelector("#cricket-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#cricket-news").style.borderBottom = "none"; + document.querySelector("#tennis-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#tennis-news").style.borderBottom = "none"; + document.querySelector("#quiz-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#quiz-news").style.borderBottom = "none"; + + + + + let apiKey_health = "b140754e118c4b63a8e580772d4446a1"; + let bloglink_football= `https://newsapi.org/v2/everything?q=football&from=2023-06-02&pageSize=10&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; + + fetch(bloglink_football) + .then((res)=>{ + return res.json(); + }) + .then((res)=>{ + let appendlocation = document.querySelector(".dynamic-news"); + appendNews(res.articles, appendlocation); + }) + .catch((e)=>{ + console.log(e); + + }) + + }) +document.querySelector("#tennis-news").addEventListener("click", ()=>{ + console.log("Test") + + document.querySelector("#sports-news").style.backgroundColor ="#F3F3F2"; + document.querySelector("#sports-news").style.borderBottom = "none" + document.querySelector("#tennis-news").style.backgroundColor = "white"; + document.querySelector("#tennis-news").style.borderBottom = "3px solid #548A2F"; + document.querySelector("#health-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#health-news").style.borderBottom = "none"; + document.querySelector("#football-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#football-news").style.borderBottom = "none"; + document.querySelector("#cricket-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#cricket-news").style.borderBottom = "none"; + document.querySelector("#quiz-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#quiz-news").style.borderBottom = "none"; + + + + + let apiKey_health = "b140754e118c4b63a8e580772d4446a1"; + let bloglink_tennis= `https://newsapi.org/v2/everything?q=tennis&from=2023-06-02&pageSize=10&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; + + fetch(bloglink_tennis) + .then((res)=>{ + return res.json(); + }) + .then((res)=>{ + let appendlocation = document.querySelector(".dynamic-news"); + appendNews(res.articles, appendlocation); + }) + .catch((e)=>{ + console.log(e); + + }) + + }) +document.querySelector("#quiz-news").addEventListener("click", ()=>{ + console.log("Test") + + document.querySelector("#sports-news").style.backgroundColor ="#F3F3F2"; + document.querySelector("#sports-news").style.borderBottom = "none" + document.querySelector("#quiz-news").style.backgroundColor = "white"; + document.querySelector("#quiz-news").style.borderBottom = "3px solid #548A2F"; + document.querySelector("#health-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#health-news").style.borderBottom = "none"; + document.querySelector("#football-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#football-news").style.borderBottom = "none"; + document.querySelector("#tennis-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#tennis-news").style.borderBottom = "none"; + document.querySelector("#cricket-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#cricket-news").style.borderBottom = "none"; + + + + let apiKey_health = "b140754e118c4b63a8e580772d4446a1"; + let bloglink_quiz= `https://newsapi.org/v2/everything?q=qiuz&from=2023-06-02&pageSize=10&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; + + fetch(bloglink_quiz) + .then((res)=>{ + return res.json(); }) + .then((res)=>{ + let appendlocation = document.querySelector(".dynamic-news"); + appendNews(res.articles, appendlocation); + }) + .catch((e)=>{ + console.log(e); + + }) + + }) @@ -158,10 +314,18 @@ document.querySelector("#sports-news").style.borderBottom = "3px solid #548A2F" document.querySelector("#health-news").style.backgroundColor = "#F3F3F2"; document.querySelector("#health-news").style.borderBottom = "none"; + document.querySelector("#cricket-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#cricket-news").style.borderBottom = "none"; + document.querySelector("#football-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#football-news").style.borderBottom = "none"; + document.querySelector("#tennis-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#tennis-news").style.borderBottom = "none"; + document.querySelector("#quiz-news").style.backgroundColor = "#F3F3F2"; + document.querySelector("#quiz-news").style.borderBottom = "none"; //Api work ==> let apiKey_blog = "b140754e118c4b63a8e580772d4446a1"; - let bloglink = `https://newsapi.org/v2/top-headlines?country=in&category=sports&pageSize=10&apiKey=${process.env.BLOG_API_KEY}`; + let bloglink = `https://newsapi.org/v2/everything?q=sport&from=2023-06-02&sortBy=publishedAt&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; fetch(bloglink) .then((res)=>{ return res.json(); @@ -174,8 +338,7 @@ console.log(e); }) - fetchNews() - + }) @@ -202,7 +365,7 @@ console.log("test") let search_key = "b140754e118c4b63a8e580772d4446a1"; - let search_link = `https://newsapi.org/v2/everything?q=${value}&from=2022-01-18&sortBy=popularity&pageSize=10&language=en&apiKey=${process.env.BLOG_API_KEY}`; + let search_link = `https://newsapi.org/v2/everything?q=${value}&from=2023-06-02&sortBy=publishedAt&apiKey=a86b591e0b0b4a8f970ccaf08d872ad0`; fetch(search_link) @@ -220,6 +383,7 @@ console.log("Test") } + fetchNews() }); From bc70341d7d8b5c7827548d30442e6dd3ee5d66d8 Mon Sep 17 00:00:00 2001 From: Sanjeev Kushwaha Date: Sun, 2 Jul 2023 19:05:15 +0530 Subject: [PATCH 4/5] 70 work complete --- bookvenue.json | 19 +++++++++++++++++++ login_feedback.html | 9 ++++++++- login_mybooking.html | 11 +++++++++++ login_profile.html | 23 +++++++++++++++++++++++ scripts/booking.js | 2 +- scripts/login_profile.js | 4 ++-- scripts/navbar_sidebar.js | 14 +++++++------- scripts/phtoto.jpg | Bin 0 -> 47845 bytes scripts/sidebarbook.js | 14 +++++++------- scripts/sidebarfeed.js | 14 +++++++------- styles/main.css | 8 +++++++- venueDetails.html | 15 ++++++++++----- venues.html | 38 +++++++++++++++++++++++++------------- 13 files changed, 127 insertions(+), 44 deletions(-) create mode 100644 bookvenue.json create mode 100644 scripts/phtoto.jpg diff --git a/bookvenue.json b/bookvenue.json new file mode 100644 index 0000000..f2ae48d --- /dev/null +++ b/bookvenue.json @@ -0,0 +1,19 @@ +{ + "posts": [ + { + "id": 1, + "title": "json-server", + "author": "typicode" + } + ], + "comments": [ + { + "id": 1, + "body": "some comment", + "postId": 1 + } + ], + "profile": { + "name": "typicode" + } +} \ No newline at end of file diff --git a/login_feedback.html b/login_feedback.html index 1986d0f..5edfe72 100644 --- a/login_feedback.html +++ b/login_feedback.html @@ -76,7 +76,14 @@ }) - +document.getElementById("feedbtn").addEventListener("click",()=>{ + let data= document.getElementById("feedtext"); + data.innerHTML=null; + let h1=document.createElement("h1") + h1.setAttribute("class","feed") + h1.innerHTML="Submit Sucessfull"; +data.append(h1); +}) diff --git a/login_mybooking.html b/login_mybooking.html index e877f56..6a38eda 100644 --- a/login_mybooking.html +++ b/login_mybooking.html @@ -30,6 +30,7 @@ \ No newline at end of file diff --git a/scripts/booking.js b/scripts/booking.js index 4ac5925..0683def 100644 --- a/scripts/booking.js +++ b/scripts/booking.js @@ -6,7 +6,7 @@ function booking(){
- +
diff --git a/scripts/login_profile.js b/scripts/login_profile.js index c454235..9e91b5b 100644 --- a/scripts/login_profile.js +++ b/scripts/login_profile.js @@ -1,5 +1,5 @@ function profile(){ - return `
+ return `
@@ -12,7 +12,7 @@ function profile(){
- +
diff --git a/scripts/navbar_sidebar.js b/scripts/navbar_sidebar.js index dfa17c7..740f6fa 100644 --- a/scripts/navbar_sidebar.js +++ b/scripts/navbar_sidebar.js @@ -3,7 +3,7 @@ function navbarsidebar(){ return `