pull/233/merge
Jleo-cjy 4 months ago committed by GitHub
commit 7ea9d90e44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -20,7 +20,7 @@ function showMovies(movies) {
main.innerHTML = '' main.innerHTML = ''
movies.forEach((movie) => { movies.forEach((movie) => {
const { title, poster_path, vote_average, overview } = movie const { title, poster_path, vote_average, overview, id } = movie
const movieEl = document.createElement('div') const movieEl = document.createElement('div')
movieEl.classList.add('movie') movieEl.classList.add('movie')
@ -34,6 +34,9 @@ function showMovies(movies) {
<div class="overview"> <div class="overview">
<h3>Overview</h3> <h3>Overview</h3>
${overview} ${overview}
<p style="margin-top: 10px;">
<a href="https://www.themoviedb.org/movie/${id}" target="_blank" class="detail-btn">View Details</a>
</p>
</div> </div>
` `
main.appendChild(movieEl) main.appendChild(movieEl)
@ -62,4 +65,4 @@ form.addEventListener('submit', (e) => {
} else { } else {
window.location.reload() window.location.reload()
} }
}) })

@ -110,3 +110,18 @@ main {
.movie:hover .overview { .movie:hover .overview {
transform: translateY(0); transform: translateY(0);
} }
.detail-btn {
display: inline-block;
padding: 6px 12px;
background-color: #007bff;
color: white;
text-decoration: none;
border-radius: 4px;
font-size: 14px;
transition: background-color 0.3s;
}
.detail-btn:hover {
background-color: #0056b3;
}

Loading…
Cancel
Save