Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
48 changes: 48 additions & 0 deletions README.md
Copy link
Collaborator

Choose a reason for hiding this comment

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

굳굳 👍 README를 잘 작성하고 관리하는걸 습관으로 들여보시면 좋아요

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 스프린트 미션 1
## 배포 링크
>https://gentle-lamington-bbd035.netlify.app/
## 요구사항
- 랜딩 페이지의 url path는 루트(‘/’) 입니다.
- title은 “판다마켓”으로 설정해 주세요.
- 화면의 너비가 1920px 이상이면 하늘색 배경색은 너비를 꽉 채우도록 채워지고, 내부 요소들의 위치는 고정되고, 여백만 커지도록 해주세요.
- 화면의 너비가 1920px 보다 작아질 때, “판다마켓” 로고의 왼쪽 여백 200px“로그인" 버튼의 오른쪽 여백 200px이 유지되고, 화면의 너비가 작아질수록 두 요소간 거리가 가까워지도록 해주세요.
- 클릭으로 기능이 동작해야 하는 경우, 사용자가 클릭할 수 있는 요소임을 알 수 있도록 cursor: pointer를 설정해 주세요.
- “판다마켓” 클릭 시 루트 페이지(‘/’)로 이동시켜주세요.
- “구경하러 가기" 클릭 시 (“/items”)페이지로 이동시켜주세요.(빈 페이지)
- “Privacy Policy”, “FAQ”는 클릭 시 각각(‘/privacy’) (‘/faq’)페이지로 이동합니다.
- 사용자의 브라우저가 크고 작아짐에 따라 페이지의 요소간 간격, 요소의 크기, font-size 등 모든 크기와 관련된 값이 크고 작아지도록 설정해 보세요.(설정값은 자유입니다).
- PC사이즈만 고려해 주어진 디자인을 구현합니다.
- 페이스북, 트위터, 유튜브, 인스타그램 아이콘은 클릭 시 각각의 홈페이지로 새로운 창이 열리면서 이동 합니다.
- HTML, CSS 파일을 Netlify로 배포해 주세요. (참고: https://www.codeit.kr/learn/5309)

## 프로젝트 구조
- /assets
- /icon
- /img
- /logo
- index.html
- style.css

## HTML 구조 및 구현 사항
### 전역 CSS 설정
- `:root` 속성을 활용해 color들을 전역 변수로 지정하여 사용했습니다.
- `@font-face` 속성을 활용해 웹 폰트를 사용합니다.
- `font-size: clamp(12px, 1.6vw, 16px)` 를 통해, 폰트 사이즈가 12px에서 16px 사이로 유연하게 조절됩니다.
- `.pointer` 클래스를 사용하여 사용자가 클릭하는 요소임을 알 수 있습니다.
### HTML 구조
- 크게 header, main, footer 영역으로 나뉘어 있습니다.
- **header**는 `position: fixed` 를 사용하여 상단에 고정되어 있습니다.
- **main**은 각 section들로 구성되어 있고, `.top`, `.bottom`, `.section`으로 나뉩니다.
- 세부 정렬은 대부분 **flexbox**를 활용했습니다.

### 요구사항 구현
- `.landing` 클래스는 하위 박스인 `.wrap` 에서, `max-width`와 `margin: 0 auto`를 활용해서 하늘색 배경색은 너비를 꽉 채우도록 채워지고, 내부 요소들의 위치는 고정되고, 여백만 커지도록 구현했습니다.
- 링크로 연결되는 항목들은 `<a>`태그로 감싸서, 클릭시 특정 페이지들로 이동할 수 있습니다.
- 폰트, 이미지, 몇몇 여백들은 `vw`를 활용해서 동적으로 크기가 조절됩니다.
- 새 창으로 열리는 페이지들은 `target="_blank" rel="noopener"`속성을 사용하여, 보안상 취약점이 발생하고 퍼포먼스가 저하되는 문제를 해결했습니다.

### 코드 리뷰 요청 사항
- 미디어쿼리를 사용하지 않고 제작하여 화면이 줄어들면 의도치 않은 디자인의 변경이 이루어집니다.
- figma를 기준으로 제작했을때 여백이나 위치 등 css를 어느 수준가지 일치시켜야 하는지 기준이 궁금합니다.
- 코드의 개선이 가능하다면 어떤 점을 개선해야할지 궁금합니다.

Binary file added assets/.DS_Store
Binary file not shown.
Binary file added assets/icon/ic_facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/ic_instagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/ic_twitter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/ic_youtube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Img_home_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Img_home_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Img_home_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Img_home_bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Img_home_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo/logo_lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo/logo_md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo/logo_sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo/logo_typo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html lang="kr">
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
<html lang="kr">
<html lang="ko">

kr이 아닌 ko가 올바른 문법입니다! :)

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>판다마켓</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<header>
<div class="wrap">
<a href="/" class="logo pointer">
Copy link
Collaborator

Choose a reason for hiding this comment

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

접근성 향상을 위해 aria-label="홈으로 이동" 과 같이 관련있는 요소에 aria-label 혹은 role을 사용해볼까요?
아래 아티클 참고해보시고 접근성을 향상시키기 위해 어떤 노력을 할수있는지 더 찾아보시면 좋은 공부 될 것같아요 :)

https://joyhong-91.tistory.com/22
https://velog.io/@a_in/WAI-ARIA-role-aria-label

<img src="./assets/logo/logo_sm.png" alt="판다마켓">
</a>
<a href="/login" class="login pointer">
<div class="login-button" >로그인</div>
</a>
</div>


</header>
<main>
<section class="top landing">
Copy link
Collaborator

Choose a reason for hiding this comment

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

클래스이름에 위치, 색상, 순서 등의 키워드가 들어가있는것은 다소 좋지않아요. 디자인이 변경되면 같이 변경되어야겠죠? 그러면 기존에 애써 구조화해놨던 위계가 무너질수도있고요. 클래스이름을 좀 더 엘리먼트의 역할에 맞게 고쳐볼까요?

<div class="wrap">
<div class="contents">
<p class="title">일상의 모든 물건을<br> 거래해 보세요</p>
<a class=" pointer">
<div class="items-button" href="/items">구경하러 가기</div>
</a>
</div>
<img src="./assets/img/Img_home_top.png" alt="판다 이미지">
</div>
</section>
<section class="section">
<div class="wrap left">
Copy link
Collaborator

Choose a reason for hiding this comment

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

요 부분도 wrap left 보다는, wrap reverse와 같이 방향을 바꾼 엘리먼트라는걸 명확히 나타내주시는게 디자인 변경에 대응하기도 쉽고 의미도 직관적으로 바뀔수있겠죠? :)

<img src="./assets/img/Img_home_01.png" alt="home1">
<div class="contents right">
<p class="category">Hot item</p>
<p class="title">인기 상품을<br>확인해 보세요</p>
<p class="content">가장 HOT한 중고거래 물품을<br>판다 마켓에서 확인해 보세요</p>
</div>
</div>
</section>

<section class="section">
Copy link
Collaborator

Choose a reason for hiding this comment

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

구조화에도 조금 더 신경을 써주면 좋을것같아요.
예를 들어 섹션별 구분을 hero-section, feature-section, cta-section 등으로 명확한 클래스명을 붙여주면 어떨까요? :) 이렇게해주면 자연스럽게 아래 있는 content 영역도 hero-content와 같이 네이밍해줄수있고, 이 방식이 훨씬 독립적이면서도 유지보수에 유리하게 관리될거예요 :)

<div class="wrap right">
<img src="./assets/img/Img_home_02.png" alt="home2">
<div class="contents left">
<p class="category">Search</p>
<p class="title">구매를 원하는<br>상품을 검색해보세요</p>
<p class="content">구매하고 싶은 물품은 검색해서<br>쉽게 찾아보세요</p>
</div>
</div>
</section>

<section class="section">
<div class="wrap left">
<img src="./assets/img/Img_home_03.png" alt="home3">
<div class="contents right">
<p class="category">Register</p>
<p class="title">판매를 원하는<br>
상품을 등록하세요</p>
<p class="content">어떤 물건이든 판매하고 싶은 상품을<br>쉽게 등록하세요</p>
</div>
</div>
</section>

<section class="bottom landing">
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기서도 top과 마찬가지로 위치에 대한 키워드가 포함되어있으니 엘리먼트의 역할에 맞게 다시 이름을 지어주면 좋겠죠?

<div class="wrap">
<p class="title">믿을 수 있는<br>판다마켓 중고 거래</p>
<img src="./assets/img/Img_home_bottom.png" alt="판다 이미지">
</div>
</section>
</main>
<footer>
<div class="wrap">
<p class="codeit">©codeit - 2024</p>
<div class="link-wrap">
<a href="/privacy" class="pointer">Privacy Policy</a>
<a href="/faq" class="pointer">FAQ</a>
</div>
<div class="social-wrap">
<a href="https://www.facebook.com/codeit.kr" target="_blank" rel="noopener noreferrer" class="pointer">
<img src="./assets//icon/ic_facebook.png" alt="facebook">
</a>
<a href="https://x.com/codeitkr" target="_blank" rel="noopener noreferrer" class="pointer">
<img src="./assets//icon/ic_twitter.png" alt="twitter">
</a>
<a href="https://www.youtube.com/@codeit-kr" target="_blank" rel="noopener noreferrer" class="pointer">
<img src="./assets//icon/ic_youtube.png" alt="youtube">
</a>
<a href="https://www.instagram.com/codeit_kr" target="_blank" rel="noopener noreferrer" class="pointer">
<img src="./assets//icon/ic_instagram.png" alt="instagram">
</a>

</div>
</div>
</footer>
</body>
</html>
234 changes: 234 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
:root {
Copy link
Collaborator

Choose a reason for hiding this comment

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

컬러코드뿐만이 아니라, 레이아웃이나 여백에 관련해 자주 사용되는 값들도 변수로 만들어 재사용해주면 좋을것같아요 :)

예시)

   /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    
    /* Border Radius */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 40px;
    
    /* Container */
    --container-max-width: 1920px;
    --container-padding: 200px;

--background-skyblue: #CFE5FF;
--background-litegray: #FCFCFC;
--primary-100: #3692FF;
--secondary-200: #E5E7EB;
--secondary-400: #9CA3AF;
--secondary-700: #374151;
--secondary-900: #111827;
}
@font-face {
Copy link
Collaborator

Choose a reason for hiding this comment

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

좋은 시도입니다!

폰트를 직접 로컬에서 관리하면 여러가지 최적화를 시도하실수있어요.

아래 추천드린 아티클 보시고
폰트 최적화 방법도 더 알아가시고, 어떤 방식으로 폰트를 보여줄지도 정해보고, 서브셋도 활용해볼까요? :)

폰트 최적화 기법

웹 폰트 최적화가 중요한 이유와 적용 사례

font-family: 'Pretendard-Regular';
src: url('https://fastly.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}

* {
box-sizing: border-box;
}
html {
font-family: 'Pretendard-Regular';
font-size: clamp(12px, 1.6vw, 16px)
}
body {
margin: 0;
}
Comment on lines +1 to +26
Copy link
Collaborator

Choose a reason for hiding this comment

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

css 파일을 용도에 맞게 분리해서 관리해볼까요?

  • reset.css: 스타일 초기화
  • common.css: 전역 스타일 처리


.pointer {
cursor: pointer;
}

/* header */
header {
position: fixed;
top:0; left: 0; right:0;

Copy link
Collaborator

Choose a reason for hiding this comment

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

불필요한 공백은 없애주세요!

height: 70px;
width: 100%;

z-index: 1;
background: white;
border: 1px solid #DFDFDF;

}
header .wrap {
display: flex;
justify-content: space-between;
align-items: center;
padding: 9px 0;
max-width: 1920px;
margin: 0 auto;

}

header .logo {
margin-left: 200px;

}

header .login {
text-decoration: none;
margin-right: 200px;
}

.login-button {
background-color: var(--primary-100);
color: white;
padding: 12px 23px;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;

}

/* main contents */
main {
width: 100%;
Copy link
Collaborator

Choose a reason for hiding this comment

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

음 전체적으로 들여쓰기가 4칸씩 되어있는데 2칸이면 충분합니다.
하지만 일괄적으로 바꾸실수없으니 일단 지금은 냅두고, 나중에 prettier 플러그인을 설치해 일관적으로 포맷팅을 자동화할수있게끔 시도해봐요 :)

prettier가 어떤 도구이고 무엇을 할수있는지 소개해드릴게요!
참고

margin: 70px auto 0;
}

.landing {
position: relative;
background-color: #CFE5FF;
width: 100%;
height: 540px;
display: flex;
align-items: end;
justify-content: center;
flex: 1;

}
.landing .wrap {
max-width: 1920px;
width: 100%;
padding: 0 200px;
display: flex;
align-items: center;
justify-content: center;
}
.top .contents {
padding-bottom: 60px;

}

.top img, .bottom img{
max-width: 746px;
width: 100%;
height: auto;
}


.landing .title {
color: var(--secondary-700);
font-size: 2.5rem;
font-weight: 700;
letter-spacing: 140%;

}
.top .items-button {
width: 100%;
border-radius: 40px;
padding: 16px clamp(80px, 6.46vw, 124px);
color: white;
background-color: var(--primary-100);
font-size: 1.25rem;
white-space: nowrap;
}
/* section */
.section {

padding: 138px 0;
white-space: nowrap;
}
.section .wrap {
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
gap: 50px;
background-color: var(--background-litegray);
border-radius: 12px;
max-width: 988px;
width: 100%;


}
.section .wrap.right {
flex-direction: row-reverse;
}

.section .wrap img {
max-width: 579px;
width: 100%;
height: auto;
}
.section .contents {
flex: 1;
}
.section .contents.right{
padding-right: auto;
text-align: left;

}
.section .contents.left{
padding-left: auto;
text-align: right;

}

.section .contents .category {
font-size: 1.2rem;
color: var(--primary-100);
font-weight: 700;
}

.section .contents .title {
font-size: 2.5rem;
color: var(--secondary-700);
font-weight: 700;
letter-spacing: 2%;
line-height: 140%;
}

.section .contents .content {
font-size: 1.5rem;
color: var(--secondary-700);
font-weight: 500;

}
/* footer */
footer {
background: var(--secondary-900);
width: 100%;
height: 160px;
font-size: 1rem;
font-weight: 400;
}

footer .wrap {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1920px;
width: 100%;
padding: 32px 200px;
margin: 0 auto;

}

footer .codeit {
color: var(--secondary-400);

}

footer .link-wrap {
display: flex;
justify-content: center;
align-items: center;
gap: 40px;
}

footer .link-wrap a{
text-decoration: none;
color: var(--secondary-200);
font-weight: 400;
}
footer .social-wrap {
display: flex;
justify-content: center;
align-items: center;
gap: 12px;
}

Loading