-
Notifications
You must be signed in to change notification settings - Fork 0
KDT5_양준용_2차 과제 제출 RE_4조 #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
azure0929
wants to merge
59
commits into
main
Choose a base branch
from
KDT5_YangJunYong
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
6aa2b5b
.gitignore setting
azure0929 a798820
index.html create
azure0929 8ee05bd
package.json setting
azure0929 9ad28cf
title edit
azure0929 4b61857
script.js create
azure0929 1d48107
style.css, style.scss create
azure0929 64e3f8d
css, script connect
azure0929 7e391b7
favicon, cdn, font connect
azure0929 1a56ffc
start project
azure0929 e76cf97
App.js create
azure0929 897bd9a
common css setting
azure0929 7b7f383
dev
azure0929 4ee0ea1
assets.js create
azure0929 7613e01
assets.js setting
azure0929 3b6c2f8
Header.js setting
azure0929 69e1fd5
App.js setting
azure0929 338975e
Header load
azure0929 5c1857c
Header design
azure0929 4699238
Home.js create
azure0929 2d29ba7
index.js setting
azure0929 a6c3a56
Home.js setting
azure0929 32f3be8
router load
azure0929 654b4fe
Home.js Section-Trail-info setting
azure0929 a2c4a46
Section-movie-related setting
azure0929 2aecef6
Section-best-scene setting
azure0929 b3e6537
section-movie-related, section-best-scene setting
azure0929 8598b8e
movie.js create
azure0929 03ca3fe
movie.js setting
azure0929 05c6466
Movieitem.js create
azure0929 ab74303
Movieitem.js setting
azure0929 24ef067
MovieItems.js create
azure0929 c4bfae1
MovieItems.js setting
azure0929 4c49de3
MovieItemsMore.js create
azure0929 72009a0
MovieItemsMore.js setting
azure0929 69fd90f
Search.js create
azure0929 6a7ad33
Search.js setting
azure0929 ec57ad8
Movie.js create
azure0929 6d4354d
Movie.js setting
azure0929 34b9242
Movie.js load
azure0929 a743726
Movie page setting
azure0929 486edf6
skelton loading animation setting
azure0929 044e11c
SearchPage.js create
azure0929 e94b630
SearchPage.js setting
azure0929 2a888d8
SearchPage load
azure0929 848db12
SearchPage entire, MovieItemsMore-button setting
azure0929 7df938f
Loading Animation setting
azure0929 f8ef2b5
Search part setting
azure0929 40114a8
MovieItems part setting
azure0929 b2d079c
MovieItem part setting
azure0929 b74edb5
ScrollTop button setting
azure0929 3e4b71d
ScrollTop button setting
azure0929 ac3468a
ScrollTop setting
azure0929 4433fc6
modify : description content
azure0929 d3a4005
Update README.md
azure0929 a6f979d
feat : 한 번의 검색으로 영화 목록 20개 출력 기능 추가
azure0929 04c8349
Update README.md
azure0929 2e418d3
Update README.md
azure0929 f0c65cc
docs : 빈 태그에서 /를 붙여 열린 태그와 구분
azure0929 96f350d
Update README.md
azure0929 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .parcel-cache | ||
| dist | ||
| node_modules | ||
| .DS_Store | ||
| .vscode | ||
| .eslintrc.json | ||
| .prettierrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,219 +1,109 @@ | ||
| # 🎬 영화 검색 | ||
| ## 🎬 2차 과제 : API를 활용한 영화 검색 사이트 만들기 | ||
| <br> | ||
|
|
||
| 주어진 API를 활용해 '[완성 예시](https://stupefied-hodgkin-d9d350.netlify.app/)' 처럼 자유롭게 영화 검색 기능을 구현해보세요! | ||
| 과제 수행 및 리뷰 기간은 별도 공지를 참고하세요! | ||
| > 작성자 : 양준용 - 4조 | ||
| > 제출 날짜 : (1차) 05.04, (2차:피어 리뷰 후 수정) 5월 7일 | ||
|
|
||
| ## 과제 수행 및 제출 방법 | ||
| <br> | ||
|
|
||
| ``` | ||
| KDT기수번호_이름 | E.g, KDT0_ParkYoungWoong | ||
| ``` | ||
| [결과물](https://kdt5-yangjunyong-movie-search.netlify.app/#/) | ||
|
|
||
| <br> | ||
|
|
||
| 1. 현재 저장소를 로컬에 클론(Clone)합니다. | ||
| 1. 자신의 본명으로 브랜치를 생성합니다.(구분 가능하도록 본명을 꼭 파스칼케이스로 표시하세요, `git branch KDT0_ParkYoungWoong`) | ||
| 1. 자신의 본명 브랜치에서 과제를 수행합니다. | ||
| 1. 과제 수행이 완료되면, 자신의 본명 브랜치를 원격 저장소에 푸시(Push)합니다.(`main` 브랜치에 푸시하지 않도록 꼭 주의하세요, `git push origin KDT0_ParkYoungWoong`) | ||
| 1. 저장소에서 `main` 브랜치를 대상으로 Pull Request 생성하면, 과제 제출이 완료됩니다!(E.g, `main` <== `KDT0_ParkYoungWoong`) | ||
| > HTML, CSS, SCSS, JS 활용 | ||
|
|
||
| - `main` 혹은 다른 사람의 브랜치로 절대 병합하지 않도록 주의하세요! | ||
| - Pull Request에서 보이는 설명을 다른 사람들이 이해하기 쉽도록 꼼꼼하게 작성하세요! | ||
| - Pull Request에서 과제 제출 후 절대 병합(Merge)하지 않도록 주의하세요! | ||
| - 과제 수행 및 제출 과정에서 문제가 발생한 경우, 바로 담당 멘토나 강사에서 얘기하세요! | ||
| <br><br> | ||
|
|
||
| ## 요구사항 | ||
|
|
||
| 필수 요구사항은 꼭 달성해야 하는 목표로, 수정/삭제는 불가하고 추가는 가능합니다. | ||
| 선택 요구사항은 단순 예시로, 자유롭게 추가/수정/삭제해서 구현해보세요. | ||
| 각 요구사항은 달성 후 마크다운에서 `- [x]`로 표시하세요. | ||
| ## 필수 요구사항 | ||
|
|
||
| ### ❗ 필수 | ||
| - [x] 영화 제목으로 검색이 가능해야 합니다! | ||
| - [x] 검색된 결과의 영화 목록이 출력돼야 합니다! | ||
| - [x] 단일 영화의 상세정보(제목, 개봉연도, 평점, 장르, 감독, 배우, 줄거리, 포스터 등)를 볼 수 있어야 합니다! | ||
| - [x] 실제 서비스로 배포하고 접근 가능한 링크를 추가해야 합니다. | ||
|
|
||
| - [ ] 영화 제목으로 검색이 가능해야 합니다! | ||
| - [ ] 검색된 결과의 영화 목록이 출력돼야 합니다! | ||
| - [ ] 단일 영화의 상세정보(제목, 개봉연도, 평점, 장르, 감독, 배우, 줄거리, 포스터 등)를 볼 수 있어야 합니다! | ||
| - [ ] 실제 서비스로 배포하고 접근 가능한 링크를 추가해야 합니다. | ||
| <br> | ||
|
|
||
| ### ❔ 선택 | ||
| ## 선택 요구사항 | ||
|
|
||
| - [ ] 한 번의 검색으로 영화 목록이 20개 이상 검색되도록 만들어보세요. | ||
| - [x] 한 번의 검색으로 영화 목록이 20개 이상 검색되도록 만들어보세요. | ||
| - [ ] 영화 개봉연도로 검색할 수 있도록 만들어보세요. | ||
| - [ ] 영화 목록을 검색하는 동안 로딩 애니메이션이 보이도록 만들어보세요. | ||
| - [x] 영화 목록을 검색하는 동안 로딩 애니메이션이 보이도록 만들어보세요. | ||
| - [ ] 무한 스크롤 기능을 추가해서 추가 영화 목록을 볼 수 있도록 만들어보세요. | ||
| - [ ] 영화 포스터가 없을 경우 대체 이미지를 출력하도록 만들어보세요. | ||
| - [ ] 영화 상세정보가 출력되기 전에 로딩 애니메이션이 보이도록 만들어보세요. | ||
| - [ ] 영화 상세정보 포스터를 고해상도로 출력해보세요. (실시간 이미지 리사이징) | ||
| - [ ] 차별화가 가능하도록 프로젝트를 최대한 예쁘게 만들어보세요. | ||
| - [ ] 영화와 관련된 기타 기능도 고려해보세요. | ||
| - [x] 영화 포스터가 없을 경우 대체 이미지를 출력하도록 만들어보세요. | ||
| - [x] 영화 상세정보가 출력되기 전에 로딩 애니메이션이 보이도록 만들어보세요. | ||
| - [x] 영화 상세정보 포스터를 고해상도로 출력해보세요. (실시간 이미지 리사이징) | ||
| - [x] 차별화가 가능하도록 프로젝트를 최대한 예쁘게 만들어보세요. | ||
| - [x] 영화와 관련된 기타 기능도 고려해보세요. | ||
|
|
||
| ## API 기본 사용법 | ||
| <br><br> | ||
|
|
||
| ```curl | ||
| curl https://omdbapi.com/?apikey=7035c60c | ||
| \ -X 'GET' | ||
| ``` | ||
| ## 화면구성 | ||
| |Home| | ||
| |:--:| | ||
| || | ||
| |Search| | ||
| || | ||
| |Movie| | ||
| || | ||
|
|
||
| <br><br> | ||
|
|
||
| ## 영화 목록 검색 | ||
|
|
||
| 영화 목록은 한 번에 최대 10개까지 검색할 수 있습니다. | ||
| ## 주요기능 | ||
| <br> | ||
|
|
||
| 파라미터 | 설명 | 기본값 | ||
| ---|----------------------|--- | ||
| `s` | 검색할 영화 제목(필수!) | - | ||
| `y` | 검색할 개봉연도, 빈 값은 전체 검색 | - | ||
| `page` | 검색할 페이지 번호 | `1` | ||
| ### 1. 한 번의 검색으로 20개 출력 | ||
|
|
||
| 요청 코드 예시: | ||
| - if 함수를 활용하여 searchMovies(2)를 추가하여 .btn 클릭 시 영화 리스트가 더 출력이 되도록 설정 | ||
|
|
||
| ```js | ||
| async function getMovies(title, year = '', page = 1) { | ||
| const s = `&s=${title}` | ||
| const y = `&y=${year}` | ||
| const p = `&page=${page}` | ||
| try { | ||
| const res = await fetch(`https://omdbapi.com/?apikey=7035c60c${s}${y}${p}`) | ||
| const json = await res.json() | ||
| if (json.Response === 'True') { | ||
| const { Search: movies, totalResults } = json | ||
| return { | ||
| movies, | ||
| totalResults | ||
| } | ||
| const btnEl = this.el.querySelector('.btn') | ||
| btnEl.addEventListener('click', () => { | ||
| if (movieStore.state.searchText.trim()) { | ||
| searchMovies(1) | ||
| searchMovies(2) | ||
| } | ||
| return json.Error | ||
| } catch (error) { | ||
| console.log(error) | ||
| } | ||
| } | ||
| }) | ||
| ``` | ||
| <br> | ||
|
|
||
| 응답 데이터 타입 및 예시: | ||
|
|
||
| ```ts | ||
| interface ResponseValue { | ||
| Search: Movie[] // 검색된 영화 목록, 최대 10개 | ||
| totalResults: string // 검색된 영화 개수 | ||
| Response: 'True' | 'False' // 요청 성공 여부 | ||
| } | ||
| interface Movie { | ||
| Title: string // 영화 제목 | ||
| Year: string // 영화 개봉연도 | ||
| imdbID: string // 영화 고유 ID | ||
| Type: string // 영화 타입 | ||
| Poster: string // 영화 포스터 이미지 URL | ||
| } | ||
| ``` | ||
| --- | ||
|
|
||
| ```json | ||
| { | ||
| "Search": [ | ||
| { | ||
| "Title": "Frozen", | ||
| "Year": "2013", | ||
| "imdbID": "tt2294629", | ||
| "Type": "movie", | ||
| "Poster": "https://m.media-amazon.com/images/M/MV5BMTQ1MjQwMTE5OF5BMl5BanBnXkFtZTgwNjk3MTcyMDE@._V1_SX300.jpg" | ||
| }, | ||
| { | ||
| "Title": "Frozen II", | ||
| "Year": "2019", | ||
| "imdbID": "tt4520988", | ||
| "Type": "movie", | ||
| "Poster": "https://m.media-amazon.com/images/M/MV5BMjA0YjYyZGMtN2U0Ni00YmY4LWJkZTItYTMyMjY3NGYyMTJkXkEyXkFqcGdeQXVyNDg4NjY5OTQ@._V1_SX300.jpg" | ||
| } | ||
| ], | ||
| "totalResults": "338", | ||
| "Response": "True" | ||
| } | ||
| <br> | ||
|
|
||
| ### 2. 영화 포스터가 없을 경우 대체 이미지를 출력 | ||
|
|
||
| - src에 ${movie.Poster}를 입력하여 포스터를 불러오고, onerror 속성을 사용하여 '스즈메의 문단속' 포스터로 이미지를 대체 | ||
|
|
||
| ```js | ||
| <img src="${movie.Poster}" onerror="this.src='https://img.cgv.co.kr/Movie/Thumbnail/Poster/000086/86815/86815_1000.jpg'" /> | ||
| ``` | ||
|
|
||
| ## 영화 상제정보 검색 | ||
| <br> | ||
|
|
||
| --- | ||
|
|
||
| 단일 영화의 상제정보를 검색합니다. | ||
| <br> | ||
|
|
||
| 파라미터 | 설명 | 기본값 | ||
| ---|---|--- | ||
| `i` | 검색할 영화 ID(필수!) | | ||
| `plot` | 줄거리 길이 | `short` | ||
| ### 3. 영화 상세정보 포스터를 고해상도로 출력 | ||
|
|
||
| 요청 코드 예시: | ||
| - replace라는 메서드를 활용하여 'SX1000'을 추가하여 고해상도로 출력 | ||
|
|
||
| ```js | ||
| async function getMovie(id) { | ||
| const res = await fetch(`https://omdbapi.com/?apikey=7035c60c&i=${id}&plot=full`) | ||
| const json = await res.json() | ||
| if (json.Response === 'True') { | ||
| return json | ||
| } | ||
| return json.Error | ||
| } | ||
| const bigPoster = movie.Poster.replace('SX300', 'SX1000') | ||
| ``` | ||
|
|
||
| 응답 데이터 타입 및 예시: | ||
|
|
||
| ```ts | ||
| interface ResponseValue { | ||
| Title: string // 영화 제목 | ||
| Year: string // 영화 개봉연도 | ||
| Rated: string // 영화 등급 | ||
| Released: string // 영화 개봉일 | ||
| Runtime: string // 영화 상영시간 | ||
| Genre: string // 영화 장르 | ||
| Director: string // 영화 감독 | ||
| Writer: string // 영화 작가 | ||
| Actors: string // 영화 출연진 | ||
| Plot: string // 영화 줄거리 | ||
| Language: string // 영화 언어 | ||
| Country: string // 영화 제작 국가 | ||
| Awards: string // 영화 수상 내역 | ||
| Poster: string // 영화 포스터 이미지 URL | ||
| Ratings: Rating[] // 영화 평점 정보 | ||
| Metascore: string // 영화 메타스코어 | ||
| imdbRating: string // 영화 IMDB 평점 | ||
| imdbVotes: string // 영화 IMDB 투표 수 | ||
| imdbID: string // 영화 고유 ID | ||
| Type: string // 영화 타입 | ||
| DVD: string // 영화 DVD 출시일 | ||
| BoxOffice: string // 영화 박스오피스 | ||
| Production: string // 영화 제작사 | ||
| Website: string // 영화 공식 웹사이트 | ||
| Response: string // 요청 성공 여부 | ||
| } | ||
| interface Rating { // 영화 평점 정보 | ||
| Source: string // 평점 제공 사이트 | ||
| Value: string // 평점 | ||
| } | ||
| ``` | ||
| <br> | ||
|
|
||
| ```json | ||
| { | ||
| "Title": "Frozen", | ||
| "Year": "2013", | ||
| "Rated": "PG", | ||
| "Released": "27 Nov 2013", | ||
| "Runtime": "102 min", | ||
| "Genre": "Animation, Adventure, Comedy", | ||
| "Director": "Chris Buck, Jennifer Lee", | ||
| "Writer": "Jennifer Lee, Hans Christian Andersen, Chris Buck", | ||
| "Actors": "Kristen Bell, Idina Menzel, Jonathan Groff", | ||
| "Plot": "When the newly crowned Queen Elsa accidentally uses her power to turn things into ice to curse her home in infinite winter, her sister Anna teams up with a mountain man, his playful reindeer, and a snowman to change the weather co...", | ||
| "Language": "English, Norwegian", | ||
| "Country": "United States", | ||
| "Awards": "Won 2 Oscars. 82 wins & 60 nominations total", | ||
| "Poster": "https://m.media-amazon.com/images/M/MV5BMTQ1MjQwMTE5OF5BMl5BanBnXkFtZTgwNjk3MTcyMDE@._V1_SX300.jpg", | ||
| "Ratings": [ | ||
| { "Source": "Internet Movie Database", "Value": "7.4/10" }, | ||
| { "Source": "Rotten Tomatoes", "Value": "90%" }, | ||
| { "Source": "Metacritic", "Value": "75/100" } | ||
| ], | ||
| "Metascore": "75", | ||
| "imdbRating": "7.4", | ||
| "imdbVotes": "620,489", | ||
| "imdbID": "tt2294629", | ||
| "Type": "movie", | ||
| "DVD": "18 Mar 2014", | ||
| "BoxOffice": "$400,953,009", | ||
| "Production": "N/A", | ||
| "Website": "N/A", | ||
| "Response": "True" | ||
| } | ||
| ``` | ||
| --- | ||
|
|
||
| <br><br> | ||
|
|
||
| ## 어려웠던 점 | ||
| - Intersection Observer API에 대한 지식 부족 | ||
| - 개봉연도로 검색할 수 있도록 하는 Js 문법 지식 부족 | ||
|
|
||
| <br> | ||
|
|
||
| ## 궁금한 점 | ||
| - img 태그를 활용하여 onerror 속성을 통해 대체 이미지를 출력하는 방법 이외에 다른 방법이 있는지 궁금합니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
|
|
||
| <!-- ICON --> | ||
| <link rel="icon" href="https://avatars.githubusercontent.com/u/128226527?s=40&v=4" /> | ||
|
|
||
| <!-- RESET CDN --> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/reset.min.css" /> | ||
|
|
||
| <!-- FONTAWESOME CDN --> | ||
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" /> | ||
|
|
||
| <!-- FONT --> | ||
| <link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
| <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@600&family=Roboto:wght@400;700&display=swap" rel="stylesheet" /> | ||
|
|
||
| <link rel="stylesheet" href="./src/css/style.css" /> | ||
| <link rel="stylesheet" href="./src/css/style.scss" /> | ||
| <script type="module" defer src="./src/script.js"></script> | ||
|
|
||
| <title>J'S CINEBOX</title> | ||
| </head> | ||
| <body> | ||
|
|
||
| <!-- Infomation --> | ||
| <div class="info"></div> | ||
|
|
||
| <!-- Background Blur Effect --> | ||
| <div class="bgblur"></div> | ||
|
|
||
| <!-- ScrollTop Button --> | ||
| <button class="to-top" type="button"><i class="fa-solid fa-arrow-up"></i></button> | ||
|
|
||
| </body> | ||
| </html> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset css 와 겹치는 내용이 많은 것 같습니다.
scss파일과 따로 관리하는 이유도 있으신지 궁금한 부분입니다.