Skip to content
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

조은상_영화 검색 사이트 과제 #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChoEun-Sang
Copy link

@ChoEun-Sang ChoEun-Sang commented May 10, 2023

🎬 영화 검색 사이트 만들기

조은상 / 9조

실제 배포 사이트

실제 배포 사이트

기술 스택

과제 수행

❗ 필수

  • 영화 제목으로 검색 가능
  • 검색된 결과의 영화 목록 출력
  • 단일 영화의 상세정보(제목, 개봉연도, 평점, 장르, 감독, 배우, 줄거리, 포스터 등) 출력
  • 실제 서비스로 배포하고 접근 가능한 링크 추가 완료.

❔ 선택

  • 한 번의 검색으로 영화 목록이 20개 이상 검색 가능
  • 영화 목록을 검색하는 동안 로딩 애니메이션 구현
  • 영화 상세정보가 출력되기 전에 로딩 애니메이션 구현
  • 영화 상세정보 포스터를 고해상도로 출력 (실시간 이미지 리사이징)
  • 차별화가 가능하도록 프로젝트를 최대한 예쁘게 만들어보세요.

@happyhermann
Copy link

은상님 2번째 프로젝트 하시느라 정말 고생 많으셨습니다.
대부분 리액트로 구현하곤 하는데 바닐라 자바스크립트로 구현하시는 모습에 어떻게 보면 좀더 번거로웠을 수 있다고 생각합니다.
그러나 요즘은 사실 돈을 주고 이렇게 바닐라 자바스크립트로 SPA 앱을 구현하는 강의를 사서 보곤 하는데
이번 기회에 바로 리액트로 구현하는게 아니라 JS 코드를 가지고 리액트를 구현해보는게 정말 정말 큰 도움이 될거 라고 생각합니다
저도 몇 달전에 SPA를 바닐라 자바스크립트로 먼저 구현해보는 강의를 인프런에서 돈주고 사서 들은 바 있는데
그래서 더욱 코드를 읽으면서 다시 한번 리액트의 내부 구조를 생각하는 계기가 됐습니다.
아마 다음 리액트 프로젝트는 다른 분들보다 더 리액트가 왜 편리한지 왜 이렇게 작동되는지 나아가 리덕스를 이해하는데 있어서도
좀더 수월하게 느끼실 거 같네요

Comment on lines +14 to +27
const inputEl = this.el.querySelector('input')
inputEl.addEventListener('input', () => {
movieStore.state.searchText = inputEl.value
})
inputEl.addEventListener('keydown', event => {
if (event.key === 'Enter' && movieStore.state.searchText.trim()) {
searchMovies(1)
}
})
const btnEl = this.el.querySelector('.btn')
btnEl.addEventListener('click', ()=> {
if (movieStore.state.searchText.trim()) {
searchMovies (1)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

작성해주신 서치 핸들러 코드 순수 js를 이용하셔서 디테일하게 연산자를 사용해서 조건문 작성하신것 인상 깊었습니다.
추가적으로 말씀 드리고 싶은 것은 좀더 코드를 간결하게 하는 방법도 있습니다! 물론 이는 지금처럼 JS에서 좀더 유용할거 같네요
만클릭 이벤트와 버튼 이벤트를 따로 작성하지 않고 form의 'submit' 을 이용해서 엔터와 클릭을 따로 코드 구현으로 설정하지 않고도
핸들러 함수 하나로 구현하는 방법도 있습니다! es6 문법이라고 볼 수 있겠네요 나중에 그렇게 구현해보시는 것도 좋은 경험이 될거 같네요!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 아직 submit는 사용해본 적이 없는데 찾아봐야겠네요! 코드를 간결하게 작성하는 부분을 좀더 고민해보겠습니다!

Comment on lines +359 to +375
.about .name {
font-size: 40px;
margin-bottom: 20px;
}
.about p {
line-height: 1.5;
text-align:center;
margin-bottom: 4px;
}
.about a {
color: var(--color-white);
text-decoration: none;
}
.about a:hover {
text-decoration: underline;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 봤던 이번 프로젝트중에 디자인적으로 가장 뛰어난 프로젝트는 은상님이신거 같은데요
한가지 추가적으로 알려드리고 싶은건 scss의 장점을 극대화하는 방법입니다.
scss의 기능은 여러가지가 있지만 일단 당장 쉽게 할 수 있는 것은 css와 달리 중첩 셀렉터를 쓸 수 있다는 것입니다.
이게 좋은 점이 class를 덜 선언해도 되고 코드가 주는데요

예를들면
.about {
p {
}
a {

&:hover
}

}

이런 식으로 좁혀 나갈 수 있어서 정말 도움이 많이 됩니다.
코드가 1000줄일때는 빛을 발합니다 나중에 한번 사용해보시는거 추천드려요!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네! scss도 공부해서 적용해보겠습니다!

{path: '#/', component: Home},
{path: '#/movie', component: Movie},
{path: '#/about', component: About},
{path: '.*', component: NotFound}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

404 페이지 구현하시는 것 UI/UX 측면에서 아주 필수적인데 좋습니다!

Comment on lines +34 to +49
<ul>
${this.state.menus.map(menu => {
const href = menu.href.split('?')[0]
const hash = location.hash.split('?')[0]
const isActive = href === hash
return /*html*/`
<li>
<a
class ="${isActive? 'active': ''}"
href="${menu.href}">
${menu.name}</a>
</li>
`
}).join('')}
</ul>
</nav>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

location 내장 메서드를 사용하여 메뉴바에 있는 UI를 동적으로 구현하신 거 같은데
굉장히 인상이 깊네요 바닐라 자바스크립트에서는 이렇게 했었구나라고 다시 저도 근본을 돌아보게 되네요
이러한 코드들은 인라인 스타일로 주어도 괜찮은거 같습니다

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

location 매서드 이용해서 메뉴 버튼 활성화 하는 부분은 아직 스스로 구현하기 어렵지만, 앞으로 많이 공부해야겠네요!
인라인 스타일 방식을 사용할 생각은 못 했는데 참고하겠습니다!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네넵 리액트에서는 종종 인라인 스타일을 쓰는게 동적으로 구현하는데 편할때도 있어서요
지금 class에 저렇게 변수 넣어서 쓰신 것은 충분히 리액트스럽네요!

Comment on lines +8 to +18
const theHedaer = new TheHeader().el
const theFooter = new TheFooter().el
const routerView = document.createElement('router-view')

this.el.append(
theHedaer,
routerView,
theFooter
)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

page가 렌더링되고 바뀌는 부분 상하로 header, footer 컴포넌트를 구현하셔서 코드를 간결하게 한 부분 멋집니다!
리액트에서는 어떻게 구현할 수 있을지 나중에 고민해보시면 좋을거 같네요!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네! 리액트로 구현하는 방법도 고민해보겠습니다!
감사합니다!

@ChoEun-Sang
Copy link
Author

안녕하세요 멘토님!
개인적으로 강의에 많이 의존해서 완성한 과제라는 점에서 아쉬움이 있지만, 이번 과제를 통해 이론을 실제 적용해보며 JS에 대한 전반적인 이해를 높일 수 있었던 과제였습니다. 멘토님께서 말씀하신 거처럼 실제 리액트 공부에도 많은 도움이 되고 있습니다. JS에서는 몇줄씩 작성해야 되는 코드를 리액트에서는 정말 간단하게 구현해낼 수 있구나 많이 느끼고 있습니다!
아래에 작성해주신 리뷰도 다시 한번 체크해서 공부해보겠습니다! 감사합니다!!

@happyhermann
Copy link

네네 고생 많으셨습니다!
초반이기에 강의 참고할 수 있는 만큼 최대한 하는게 맞는거 같고요 그럼에도 불구하고
제가 봐온 은상님은 일단은 기본적으로 누구보다 열심히하시고 꼼꼼하신거 같습니다 결과적으로 프론트엔드 과정에 대한 이해도도 높으신거 같아서 좋은 결과 계속 만드실거 같네요! 응원하겠습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants