Skip to content

Cardui#123

Merged
crongro merged 6 commits intocode-squad:sally4405from
sally4405:cardui
Feb 13, 2020
Merged

Cardui#123
crongro merged 6 commits intocode-squad:sally4405from
sally4405:cardui

Conversation

@sally4405
Copy link
Copy Markdown

네비게이션 UI 제작.
img 와 text 를 하나의 container 로 묶은 후 크기를 parent보다 네배 크게 줘서 translateY를 이용하여 하나씩 보여줌.
버튼 클릭 시와 상단 메뉴 클릭 시 js 에서 같은 변수를 증감시켜, 둘중 하나만 클릭해도 container 이동과 메뉴 사이즈 변화를 동시에 일어나게 함.
깃 허브 페이지 기능을 이용해서 데모 페이지 제작.

sally4405 and others added 6 commits February 10, 2020 18:10
…지 넘어가는 기능 구현

amazon : html 과 css 기본 구조를 작성 / 화살표 버튼과 이미지 버튼 클릭시 이미지 넘어가는 기능 구현
js 버튼 클릭과 메뉴 클릭시의 index 변화를 하나로 통일해서 관리.
img child 와 text child 묶어서 container child 로 변경.
@crongro
Copy link
Copy Markdown
Contributor

crongro commented Feb 13, 2020

커밋로그를 좀더 신경쓰면 좋겠어요.
다음 PR에서 지켜보겄습니다

Copy link
Copy Markdown
Contributor

@crongro crongro left a comment

Choose a reason for hiding this comment

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

수고하셨어요! 리뷰했어요.



class SlideService {
constructor(firstIndex, containerTarget, menuList) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

위 클래스와 같이 매개변수의 순서를 지켜준건 좋고요.
객체를 활용해서 전달하는 방법이 좀더 장점이 많아요.


left.addEventListener("mousedown", () => {
this.target.targetIndex--;
if (this.target.targetIndex < 0) this.target.targetIndex = 3;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1,2,3 이런 매직넘버를 조금 감춰보세요~

right.addEventListener("mousedown", () => {
this.target.targetIndex++;
if (this.target.targetIndex > 3) this.target.targetIndex = 0;
console.log("right click!")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

디버깅코드는 남기지 마시고,
디버깅은 개발자도구의 breakpoint를 더 활용하는 습관을 가져보세요.

}

handler() {
this.containerTarget.style.transform = `translateY(${this.targetIndex * (-250)}px)`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

250이 하드코딩되어 있는것이 아쉽네요.
transform의 다른 속성보다 장점이 많다고 했으니 그 이유를 좀더 찾고 기억해주세요.

@crongro crongro merged commit 8243494 into code-squad:sally4405 Feb 13, 2020
@sally4405 sally4405 deleted the cardui branch February 25, 2020 07:10
@sally4405 sally4405 restored the cardui branch February 25, 2020 08:04
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