diff --git a/README.md b/README.md index d60cf39..885e292 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Result of Movie Search ![Search Result](img/searchMovie.png)
- +[sifat] (https://github.com/SIFAT-AOC) #### Bugs A list of reported bugs can be found [here](https://github.com/hrishi7/streamIt/issues). If your bug has yet to be reported, feel free to open a [new issue here](https://github.com/hrishi7/streamIt/issues/new). diff --git a/index.html b/index.html index bda4849..98bcad2 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@ - + @@ -241,12 +241,12 @@

Project Name

- --> + - + diff --git a/js/indexMovies.js b/js/indexMovies.js index 567ae2e..cc1afc3 100644 --- a/js/indexMovies.js +++ b/js/indexMovies.js @@ -1,18 +1,12 @@ -$(document).ready(function () { - axios - .get( - 'https://api.themoviedb.org/3/discover/movie?api_key=ca5d667528ca51e527d9e4f7830d97d2&language=en-US&sort_by=popularity.desc&include_adult=false' - ) - .then((response) => { - let movies = response.data.results; - let output = ""; - $.each(movies, (index, movie) => { - output += ` -
- let output = ''; - $.each(movies, (index, movie) => { - output += ` -
+ +fetch('https://api.themoviedb.org/3/discover/movie?api_key=ca5d667528ca51e527d9e4f7830d97d2&language=en-US&sort_by=popularity.desc&include_adult=false') +.then(response => response.json()) +.then(data => { + let output = ''; + let result = data.results; + $.each(result, (index, movie) => { + output += ` +
${movie.title} @@ -22,50 +16,29 @@ $(document).ready(function () { Movie Details
- - `; - }); - $("#home-movies").html(output); - }) - .catch((err) => { - console.log(err); +` +console.log(movie); +$("#home-movies").html(output); }); +}) +.catch(error => { + console.error(error); }); -//function to display navbar background-color on scroll +// navbar background color changes when user scrolls window.onscroll = function () { - scrollFunction(); -}; -function scrollFunction() { - if (document.body.scrollTop > 10 || document.documentElement.scrollTop > 10) { - document.getElementById("mainNav").style.backgroundColor = "#323033"; - } else { - document.getElementById("mainNav").style.backgroundColor = "transparent"; + scrollFunction(); + }; + function scrollFunction() { + if (window.scrollY > 10) { + document.getElementById("mainNav").style.backgroundColor = "transparent"; + } else { + document.getElementById("mainNav").style.backgroundColor = "#323033"; + } } -} - $('#home-movies').html(output); - - //function to display navbar background-color on scroll - $(window).scroll(function () { - if ( - document.body.scrollTop > 20 || - document.documentElement.scrollTop > 20 - ) { - $('#mainNav').css({ 'background-color': '#323033' }); - $('#gtp').css({ transform: 'scale(100%)' }); - } else { - $('#mainNav').css({ 'background-color': 'transparent' }); - $('#gtp').css({ transform: 'scale(0)' }); - } - }); //function to scroll to the top when the user clicks the "goToTop" button - $('#gtp').click(function () { - document.body.scrollTop = 0; - document.documentElement.scrollTop = 0; - }); - }) - .catch((err) => { - console.log(err); - }); -}); +$('#gtp').click(function () { +document.body.scrollTop = 0; +document.documentElement.scrollTop = 0; +}); \ No newline at end of file diff --git a/js/tv.js b/js/tv.js index cef4a5b..e7dad3c 100644 --- a/js/tv.js +++ b/js/tv.js @@ -9,8 +9,6 @@ function movieSelected(id){ return false; } - - function getMovie(){ let movieId = sessionStorage.getItem('movieId');