// init everything and after dom render fix errors renderFilms(); setTimeout(() => handlePosterErrors(); , 150);
function openModal(movie) modalTitle.innerText = movie.title; // Build rich detail: runtime not originally, but we combine extra info and custom details. let details = `$movie.extra<br><br>🎥 Director: $movie.director<br>📅 Release year: $movie.year<br>🏹 Tagline: "$movie.tagline"<br><br>⭐ Cultural impact: Part of the global phenomenon that defined dystopian cinema.`; if (movie.title.includes("Ballad")) details += "<br><br>🐍 Prequel introduces Lucy Gray Baird — the songbird who changed Snow forever."; else if (movie.title.includes("Mockingjay – Part 2")) details += "<br><br>💥 Katniss’s final bow: One of the highest-grossing finales of the decade."; else if (movie.title.includes("Catching Fire")) details += "<br><br>🏆 Won Empire Award for Best Film & MTV Movie of the Year."; else if (movie.title.includes("The Hunger Games") && movie.year === 2012) details += "<br><br>🔥 Launched a franchise that inspired a generation — groundbreaking for female-led action."; modalDetail.innerHTML = details; modal.classList.add('show'); document.body.style.overflow = 'hidden'; peliculas de juegos del hambre
/* custom scrollbar */ ::-webkit-scrollbar width: 6px; ::-webkit-scrollbar-track background: #1e1a14; ::-webkit-scrollbar-thumb background: #c9a03d; border-radius: 6px; // init everything and after dom render fix
// info block const infoDiv = document.createElement('div'); infoDiv.className = 'film-info'; const titleDiv = document.createElement('div'); titleDiv.className = 'film-title'; titleDiv.innerHTML = `<span>$movie.title</span><span style="font-size:0.9rem; font-weight:400;">🎬</span>`; const directorSpan = document.createElement('div'); directorSpan.className = 'director'; directorSpan.innerText = `Directed by $movie.director`; const synopsisP = document.createElement('p'); synopsisP.className = 'synopsis'; synopsisP.innerText = movie.synopsis; const taglineP = document.createElement('div'); taglineP.className = 'tagline'; taglineP.innerText = `“$movie.tagline”`; const btn = document.createElement('button'); btn.className = 'btn-detail'; btn.innerHTML = `⚡ learn more ⚡`; // store movie data for modal btn.addEventListener('click', (e) => e.stopPropagation(); openModal(movie); ); function openModal(movie) modalTitle.innerText = movie.title
/* film grid */ .film-grid display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin: 3rem 0 5rem; .film-card background: rgba(15, 18, 24, 0.75); backdrop-filter: blur(2px); border-radius: 2rem; overflow: hidden; transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1); border: 1px solid rgba(201, 160, 61, 0.2); box-shadow: 0 20px 35px -15px rgba(0,0,0,0.6); .film-card:hover transform: translateY(-12px); border-color: rgba(201, 160, 61, 0.6); box-shadow: 0 30px 40px -18px black; background: rgba(20, 24, 32, 0.9); .poster position: relative; height: 400px; background-size: cover; background-position: center top; transition: transform 0.5s ease; .film-card:hover .poster transform: scale(1.02); .overlay position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, #030507ee, transparent); padding: 1.5rem 1rem 0.8rem; .year font-size: 0.8rem; font-weight: 500; background: #c9a03dcc; display: inline-block; padding: 0.2rem 0.8rem; border-radius: 30px; backdrop-filter: blur(2px); letter-spacing: 0.5px; color: #0a0c12; font-weight: 700; .film-info padding: 1.5rem; .film-title font-size: 1.6rem; font-weight: 700; font-family: 'Cormorant Garamond', serif; letter-spacing: -0.3px; margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; .film-title span:first-child background: linear-gradient(135deg, #f3e0b0, #dbb85c); background-clip: text; -webkit-background-clip: text; color: transparent; .director font-size: 0.8rem; color: #c9aa6e; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 1px; .synopsis font-size: 0.9rem; color: #cec6b5; margin: 0.8rem 0 1rem; line-height: 1.45; .tagline font-style: italic; font-size: 0.85rem; border-left: 3px solid #c9a03d; padding-left: 0.75rem; margin: 0.8rem 0; color: #e7cf9e; .btn-detail background: none; border: 1.5px solid #c9a03d; color: #c9a03d; padding: 0.5rem 1.2rem; border-radius: 40px; font-weight: 600; font-size: 0.75rem; cursor: pointer; transition: 0.25s; margin-top: 0.5rem; display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.4); .btn-detail:hover background: #c9a03d; color: #0a0c12; border-color: #c9a03d;
card.appendChild(posterDiv); card.appendChild(infoDiv); grid.appendChild(card); );
<!-- stats tribute --> <div class="stats-panel"> <div class="stat"><strong>5</strong> epic films</div> <div class="stat"><strong>12</strong> districts + capitol</div> <div class="stat"><strong>$3.3B+</strong> worldwide box office</div> <div class="stat"><strong>🌹</strong> 64th—75th Hunger Games</div> </div>