From 4fb2121596b380a2ba2813b91317b4a6aa236bdb Mon Sep 17 00:00:00 2001 From: zayid Date: Sat, 3 Dec 2022 22:33:48 +0600 Subject: [PATCH] solving the movie API task --- index.html | 24 +++--------------------- script.js | 48 +++++++++++++++++++++++++++++++++++++++++++++++- style.css | 1 + 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index 4ab20ee..b5110ce 100644 --- a/index.html +++ b/index.html @@ -31,33 +31,15 @@
Search for your favorite shows
- +
-
-
- movie -
- -

Breaking Bad

-
-
-
- movie -
- -

Breaking Bad

-
+
+ diff --git a/script.js b/script.js index 12d5a38..d764d0b 100644 --- a/script.js +++ b/script.js @@ -1 +1,47 @@ -//code + //code + +let search = document.querySelector("#search"); + +search.addEventListener("click",()=>{ + + let input =document.querySelector("#input_search").value; + + fetch(`https://api.tvmaze.com/search/shows?q=${input}`) + .then((res)=>{ + return res.json(); + }) + .then((data)=>{ + + //starting the for loop + + for(let i=0 ;i{ + console.log("Error!") + }) + +}) diff --git a/style.css b/style.css index 7859aa5..5a6e37b 100644 --- a/style.css +++ b/style.css @@ -65,6 +65,7 @@ .movies-section { display: flex; margin: 15px 50px; + flex-wrap: wrap; } .movie-card {