Skip to content

Conversation

@3rdflr
Copy link
Collaborator

@3rdflr 3rdflr commented Apr 4, 2025

요구사항

기본

  • 아래로 스크롤 해도 상단 네비게이션 바(Global Navigation Bar)가 최상단에 고정됩니다.
  • "판다마켓" 클릭 시 루트 페이지("/")로 이동합니다.(새로고침)
  • 로그인 페이지, 회원가입 페이지 모두 로고 위 상단 여백이 동일합니다.
  • SNS 아이콘들은 클릭시 각각 실제 서비스 홈페이지로 이동합니다.

심화

  • palette에 있는 color값들을 css 변수로 등록하고 사용해 주세요.
  • 비밀번호 input 요소 위에 비밀번호를 확인할 수 있는 아이콘을 추가해 주세요.

주요 변경사항

  • css 병합
  • 시멘틱 태그 사용

스크린샷

login signup

멘토에게

  • sprint 1 을 할때 겹치는 class 들을 이용할 생각을 못하고 했어서 정리를 하려 했으나..깔끔해진거같진 않습니다...
  • max-width를 주고싶어서 body에 부여했었는데 화면 사이즈를 키우면 왼쪽으로 쏠리는데...이런건 flex: 1 1 auto를 사용하면 해결되나요..

@3rdflr 3rdflr changed the base branch from main to Basic-최창환 April 4, 2025 07:10
@3rdflr 3rdflr added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Apr 4, 2025
@addiescode-sj addiescode-sj self-requested a review April 8, 2025 05:59
Copy link
Collaborator

@addiescode-sj addiescode-sj left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

주요 리뷰 포인트

  • 이미지 최적화
  • 반응형 컨테이너 최적화 및 코드 중복 제거 방법
  • 접근성 향상

index.html Outdated
<a class="market-login button" href="/login.html">로그인</a>
</div>
</header>
<main>
Copy link
Collaborator

Choose a reason for hiding this comment

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

main 태그 아래 div들을 section태그로 사용해주세요! 시맨틱 태그를 잘 사용해봅시다 :)

Comment on lines +34 to +38
<img
class="link-img-panda"
src="img/Img_home_top.png"
alt="top-img-of-panda"
/>
Copy link
Collaborator

@addiescode-sj addiescode-sj Apr 8, 2025

Choose a reason for hiding this comment

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

이미지 최적화도 조금 더 신경써볼까요?
웹페이지 성능 측정 지표중 CLS(Cumulative Layout Shift) 라는 지표가 있는데요,
현재 보고 있는 페이지에 갑자기 발생하는 레이아웃의 변경이 발생하면 사용자 입장에서 불편함을 겪을 수 있기때문에 레이아웃 이동(layout shift) 빈도를 측정해 성능을 평가한다고 보시면 됩니다. 보통 이미지 및 비디오 요소를 삽입할때 이런 현상이 자주 발생될수있겠죠?

따라서 레이아웃 시프트를 방지해주려면 이미지 및 비디오 요소에 width 와 height 속성을 항상 포함하거나 또는 CSS를 사용하여 필요한 공간(aspect-ratio-box)을 잡는 방법이 있습니다.

해당 이미지의 사이즈가 어느정도는 고정적이라면 width와 height를 직접적으로 넣는 방법이 있지만, 반응형을 고려해 비율을 지키며 변해야한다면 aspect-ratio를 사용하는 방법도 있습니다.

저라면 반응형을 고려해 이런식으로 css를 작성해줬을것같네요 :)

.link-img-panda {
  display: block;
  aspect-ratio: 16/9;
  width: 100%;
  height: auto;
  object-fit: cover;
}

이렇게 한다면 여러 스크린사이즈에서도 유연하게 이미지가 비율에 맞춰 사이즈를 가질수있으면서도 레이아웃시프트를 방지해줄수있겠죠?

이미지 최적화는 제가 제안드린 방법말고도 webp, avif 같은 차세대 확장자를 사용한다던지
srcSet을 사용해 각 스크린사이즈에 맞는 이미지파일을 로드한다던지
우선순위를 낮춰 레이지 로딩하는 등 여러가지 기법들이 있습니다.

차차 학습해보시면 좋을것같네요 👍

Comment on lines 9 to 15
.market {
height: var(--header-height);
display: flex;
justify-content: space-around;
justify-content: space-between;
align-items: center;
margin: 0;
margin: 0 200px;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

반응형을 고려해 동적으로 컨테이너 영역을 스타일링하려할때 유리한 방법이 있어요.
우선, 컨테이너에 고정 width나 height 값을 주는 것보다는 max-widthmin() 함수를 사용해 반응형에 최적화된 컨테이너를 만들어주고, 패딩과 마진의 경우 css 변수로 만들어 미디어쿼리에 의해 동적으로 조정되게끔 해주시면 코드의 중복을 최대한 줄이면서도 어느 스크린 사이즈든 유연하게 대응할수있습니다.

예시를 하나 드려볼게요:

  --container-padding: 20px;
  --content-max-width: 1200px;
.market {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

이렇게 스타일 규칙을 만들어주고,
미디어쿼리에 의해 css변수가 동적으로 바뀔수 있게 처리한다면:

@media (max-width: 768px) {
  .market {
    padding: 0 var(--spacing-md);
  }
}

좀더 깔끔하게, 코드 중복없이, 예측 가능한 코드의 흐름이 만들어지죠?
이렇게 리팩토링 하실때는, 어떻게 하면 무언가를 하기에 더 유리하거나 나은 구조를 만들 수 있을지 고민해보시는게 좋습니다 👍

index.html Outdated
><img src="img/ic_facebook.png" alt=""
><img src="img/ic_facebook.png" alt="facebook-link_img"
/></a>
<a href="https://x.com/?lang=en"
Copy link
Collaborator

Choose a reason for hiding this comment

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

외부 링크의 경우, 보안을 위해 rel="noopener noreferrer"를 추가해주세요! :)

noopener: 새 탭에서 열린 페이지가 원본 페이지에 접근하는 것을 방지
noreferrer: 리퍼러 정보가 새 페이지로 전달되는 것을 방지

Comment on lines 26 to 31
<input
type="email"
name="이메일"
id="email"
placeholder="[email protected]"
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

폼 요소에 대한 접근성을 향상해볼까요?
현재 input 폼 요소에 라벨을 사용하지않아 스크린리더를 활용하지못해요.
귀찮더라도 접근성 향상을 위해 폼 요소를 꼭 라벨과 같이 활용해주세요 :)

예시)

<label for="email">이메일</label>
          <input
            type="email"
            name="email"
            id="email"
            placeholder="[email protected]"
            required
            aria-required="true"
            autocomplete="email"
          />

login.html Outdated
<p>이메일</p>
<input
type="email"
name="이메일"
Copy link
Collaborator

Choose a reason for hiding this comment

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

name="이메일"과 같이 name 속성을 한글로 써주면 다국어 지원이 어려워지고, 서버에서 디코딩 시 인코딩 방식에 따라 깨질 수 있으니 주의해주세요. 항상 웹 표준은 영어가 기본이라서 유지보수에 문제가 생길수있답니다 :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
name="이메일"
name="email"

signup.html Outdated
type="password"
name="비밀번호"
id="password"
placeholder="pAssWoRD"
Copy link
Collaborator

Choose a reason for hiding this comment

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

음 요런건 저를 위해 숨겨놓으신 이스터에그같은건가요...? ㅎㅎㅎ PR 올리실땐 작업 퀄리티를 꼭 신경써서 마무리해주세요!

@addiescode-sj
Copy link
Collaborator

질문에 대한 답변

멘토에게

  • sprint 1 을 할때 겹치는 class 들을 이용할 생각을 못하고 했어서 정리를 하려 했으나..깔끔해진거같진 않습니다...
  • max-width를 주고싶어서 body에 부여했었는데 화면 사이즈를 키우면 왼쪽으로 쏠리는데...이런건 flex: 1 1 auto를 사용하면 해결되나요..

body에 max-width를 부여하기보다는 body 아래에 컨테이너 역할을 하는 엘리먼트를 만들고 max-width를 부여해주시는게 일반적입니다! :) flex: 1 1 auto의 경우 정렬을 해준다기보다는 flex 컨테이너 안에서 자식 요소들이 어떻게 공간을 나눠쓸지 결정할때 쓰는거라, 만약 가운데 정렬을 하고싶으신거면 max-width 설정과 함께 margin: 0 auto; 를 사용하시면됩니다 :)

@addiescode-sj addiescode-sj merged commit 4f0f9fd into codeit-bootcamp-frontend:Basic-최창환 Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants