add category 2 block : animation

This commit is contained in:
yann 2025-03-10 17:35:27 +01:00
parent ac3c1a20bc
commit c36a0dcfc9
2 changed files with 32 additions and 1 deletions

View File

@ -53,6 +53,7 @@
</div> </div>
</div> </div>
</section> </section>
<!-- best note --> <!-- best note -->
<section class="py-5"> <section class="py-5">
<div class="container"> <div class="container">
@ -63,6 +64,7 @@
</div> </div>
</section> </section>
<!-- mystery -->
<section class="py-5"> <section class="py-5">
<div class="container"> <div class="container">
<h2>Mystery</h2> <h2>Mystery</h2>
@ -72,6 +74,17 @@
</div> </div>
</section> </section>
<!-- animation -->
<section class="py-5">
<div class="container">
<h2>Animation</h2>
<div class="row" id="animation">
<!-- square block model-->
</div>
</div>
</section>
<!-- other -->
<section class="py-5"> <section class="py-5">
<div class="container"> <div class="container">
<div id="menu"> <div id="menu">

View File

@ -211,6 +211,18 @@ function mysteryLess() {
generateMovies(mystery, "mystery") generateMovies(mystery, "mystery")
} }
function animationMore() {
animation.then((data) => {
createBlock(data, "animation", 6);
addSeeMore("animation", "d-none");
addSeeLess("animation", "d-block");
})
}
function animationLess() {
generateMovies(animation, "animation")
}
function otherMore() { function otherMore() {
other.then((data) => { other.then((data) => {
createBlock(data, "other", 6); createBlock(data, "other", 6);
@ -258,15 +270,20 @@ bestFilm("101928");
// Get resources // Get resources
let bestRated = getMovies3("?sort_by=-imdb_score"); let bestRated = getMovies3("?sort_by=-imdb_score");
let mystery = getMovies3("?genre=mystery") let mystery = getMovies3("?genre=mystery");
let animation = getMovies3("?genre=animation");
let other = getMovies3("?genre=action"); let other = getMovies3("?genre=action");
// ============ Best Rated ============ // ============ Best Rated ============
generateMovies(bestRated, "bestRated"); generateMovies(bestRated, "bestRated");
// ============ Mystery ============ // ============ Mystery ============
generateMovies(mystery, "mystery") generateMovies(mystery, "mystery")
// ============ Animation ============
generateMovies(animation, "animation")
// ============ Other ============ // ============ Other ============
// fill the selection menu // fill the selection menu
getCategory(); getCategory();
@ -287,6 +304,7 @@ selectedItem.addEventListener("change", ()=> {
window.addEventListener("resize", ()=> { window.addEventListener("resize", ()=> {
generateMovies(bestRated, "bestRated"); generateMovies(bestRated, "bestRated");
generateMovies(mystery, "mystery"); generateMovies(mystery, "mystery");
generateMovies(animation, "animation");
generateMovies(other, "other"); generateMovies(other, "other");
}) })