1. 팀프로젝트 시작
2. 내가 맡은 부분 : 상세페이지 구현 및 메인페이지 이동 버튼
movieCard.addEventListener("click", () => {
window.location.href = `./DetailPage/detail.html?id=${movies.id}`;
});
const urlParams = new URLSearchParams(window.location.search);
const movieId = urlParams.get("id");
getmovieData(movieId);
function getmovieData(id) {
const apiKey = "f5475cb87195d22e7fbee353e3247ba5";
const movieUrl = `https://api.themoviedb.org/3/movie/${id}?api_key=${apiKey}&language=en-US&page=1`;
fetch(movieUrl)
.then((response) => response.json())
.then((data) => {
movieData(data);
})
.catch((error) => console.error("Error fetching movie details:", error));
}
function movieData(movie) {
const detailFlex = document.getElementById("movieDetail");
const detailCard = movieDetailInfo(movie);
detailFlex.appendChild(detailCard);
}