diff --git a/css/style.css b/css/style.css index 49b640e..931d827 100644 --- a/css/style.css +++ b/css/style.css @@ -770,3 +770,10 @@ ul.social-buttons li a:active, ul.social-buttons li a:focus, ul.social-buttons l #hide-button{ margin-top: 40px; } + +#movieCarousel .carousel-control-prev .carousel-control-prev-icon{ + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%343a40' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E") !important; +} +#movieCarousel .carousel-control-next .carousel-control-next-icon{ + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%343a40' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E") !important; +} diff --git a/js/searchMovie.js b/js/searchMovie.js index dd3fb83..1714188 100644 --- a/js/searchMovie.js +++ b/js/searchMovie.js @@ -1,5 +1,6 @@ let adultFlag = false; $(document).ready(() => { + getPopularMovies(); $("#searchForm").on("submit", e => { let searchText = $("#searchText").val(); //adultFlag = $('#adult').value(); @@ -8,7 +9,85 @@ $(document).ready(() => { e.preventDefault(); }); }); +function getPopularMovies() { + axios.get( + "https://api.themoviedb.org/3/movie/popular?api_key=ca5d667528ca51e527d9e4f7830d97d2&language=en-US" + ) + .then(response => { + let movies = response.data.results; + console.log(movies.length); + let output=` + + ` + $("#movies").html(output); + }) + .catch(err => { + console.log(err); + }); +} function getMovies(searchText) { axios .get( diff --git a/js/searchTv.js b/js/searchTv.js index db34414..3de4990 100644 --- a/js/searchTv.js +++ b/js/searchTv.js @@ -2,6 +2,7 @@ $(document).ready(() => { + getPopularShows(); $('#searchForm').on('submit', (e) => { let searchText = $('#searchText').val(); getMovies(searchText); @@ -9,7 +10,84 @@ $(document).ready(() => { }); }); +function getPopularShows() { + axios.get( + "https://api.themoviedb.org/3/tv/popular?api_key=ca5d667528ca51e527d9e4f7830d97d2&language=en-US" + ) + .then(response => { + let shows = response.data.results; + let output=` + + ` + $("#movies").html(output); + }) + .catch(err => { + console.log(err); + }); +} function getMovies(searchText){ axios.get('https://api.themoviedb.org/3/search/tv?api_key=ca5d667528ca51e527d9e4f7830d97d2&language=en-US&query='+searchText+'&page=1')