From 441ac4a5a9e5a21f3f7508d96e4be146e9bb282c Mon Sep 17 00:00:00 2001 From: Yann Date: Sun, 9 Mar 2025 16:31:44 +0000 Subject: [PATCH 1/4] Supprimer index2.html --- index2.html | 104 ---------------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 index2.html diff --git a/index2.html b/index2.html deleted file mode 100644 index 8b226b9..0000000 --- a/index2.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - JustStreamIt - - - - - - - - -
-
-
-
- logo -
-
-

Vidéos à la demande

-
-
-
-
- -
-
-

Meilleur film

-
-
- -
-
-
- -
-
-

Best rated

-
- -
-
- -
-
- -
-
-
- -
-
-

Mystery

-
- -
-
- -
- -
-
- -
- -
-
-
- - - - - - - - From 08df61d67ca20846430bf8a0527da9c0b40eb818 Mon Sep 17 00:00:00 2001 From: Yann Date: Sun, 9 Mar 2025 16:31:54 +0000 Subject: [PATCH 2/4] Supprimer style.css --- style.css | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 style.css diff --git a/style.css b/style.css deleted file mode 100644 index e69de29..0000000 From 69b07518672dd58cdc689a650092dfe1f3eb01a4 Mon Sep 17 00:00:00 2001 From: Yann Date: Sun, 9 Mar 2025 16:32:15 +0000 Subject: [PATCH 3/4] Supprimer test2.js --- test2.js | 263 ------------------------------------------------------- 1 file changed, 263 deletions(-) delete mode 100644 test2.js diff --git a/test2.js b/test2.js deleted file mode 100644 index 8111cb7..0000000 --- a/test2.js +++ /dev/null @@ -1,263 +0,0 @@ -const url_title = "http://localhost:8000/api/v1/titles/"; -const url_genre = "http://localhost:8000/api/v1/genres/"; - -const blockEnd = ` - - - -`; - -// construct button "see more" or "see less" -function getButtonSee(what) { - let see = ` -
- -
- `; - return see; -} - - -async function getMovies(url, id) { - const filmList = []; - - for (let j=1; j<3; j++) { - const response = await fetch(`${url_title}${url}&format=json&page=${j}`); - const film1 = await response.json(); - for (i in film1.results) { - filmList.push(film1.results[i]); - } - } - - let blockToLook = document.getElementById(id); - blockToLook.innerHTML = ""; - - for (let i = 0; i < 6; i++) { - film = filmList[i]; - let movieBlock = ` -
-
-
-
-
-

${film.title}

-
-
- - - `; - // retrieve the specific film detail from URL using id then concatenate with the modal creator - const response2 = await fetch(`${url_title}${film.id}`); - const film2 = await response2.json(); - let modal = getModalDetail(film2, film2.id); - - blockToLook.innerHTML += movieBlock+modal+blockEnd; - } -} - -// tried to make some dynamic pagination browsing... nok -async function getCount(type) { - const response = await fetch(`http://localhost:8000/api/v1/${type}`); - const result = await response.json(); - return result; -} - -// get categories and create the options in select menu -async function getCategory() { - listeGenres = []; - for (let i = 1; i<6; i++) { - const response = await fetch(`${url_genre}?page=${i}`); - const genres = await response.json(); - for (let j in genres.results) { - listeGenres.push(genres.results[j].name); - }; - } - let categorySelect = document.getElementById("category-select"); - for (i in listeGenres) { - let option = ` - - `; - categorySelect.innerHTML += option; - } -} - -// create the best film block and get a movie from a given ID -async function bestFilm(filmId) { - const response = await fetch(`${url_title}${filmId}`); - const bfilm = await response.json(); - - let detail = ` -
-
- film cover -
-
-
-

${bfilm.title}

-
${bfilm.description}
-
- -
-
-
- `; - let modal = getModalDetail(bfilm, bfilm.id); - document.getElementById("bestFilm").innerHTML += detail+modal; - -} - -// create the modal HTML block for a given film object -function getModalDetail(film, modalId) { - let recette = "N/A"; - let genre = recette; - - if (film.worldwide_gross_income) { - recette = film.worldwide_gross_income; - } - if (film.genre) { - genre = film.genre; - } - let modalContent = ` -