Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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.
Binary file added img/.DS_Store
Binary file not shown.
Binary file added 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 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 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 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 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 img/Property 1=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 img/Property 1=md@2x.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 img/Property 1=md@3x.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 img/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 img/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 img/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 img/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.
182 changes: 182 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
* {
box-sizing: border-box;
}

body {
margin: 0;
background-color: #ffffff;
color: #374151;
font-family: 'Noto Sans KR', sans-serif;
}
Comment on lines +1 to +10
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 (전역 스타일 처리)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

스타일시트를 두 개 만들어서 전체에 적용되는 스타일과 개별로 나눠 적용한 스타일을 구분해서 관리하는 말씀이실까요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

네, 용도를 나눠 관리하는 css 파일은 필요한 파일에서 import 받아오시면 됩니다 :)


header {
display: flex;
justify-content: space-between;
align-items: center;
width: 1120px;
margin: 0 auto;
}

.main {
padding: 138px 0;
display: grid;
grid-template-areas:
"hotItem"
"search"
"register";
gap: 276px;
width: 100%;
}

#login {
padding: 16px 34px;
background-color: #3692ff;
border-radius: 8px;
color: #f3f4f6;
font-size: 16px;
text-decoration: none;
}

#login:hover {
background-color: #1251aa;
}

.omg {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin: 0 auto;
width: 1110px;
}

.title {
padding: 200px 0 0;
background-color: #cfe5ff;
display: flex;
justify-content: space-between;
align-items: flex-end;
}

.title-p {
display: flex;
flex-direction: column;
flex-shrink: 0;
}

#p {
font-size: 40px;
font-weight: 700;
margin-bottom: 40px;
}

#button {
background-color: #3692ff;
Copy link
Collaborator

Choose a reason for hiding this comment

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

자주 사용하는 값들은 변수로 만들어서 중복을 줄이고 재사용성을 높여볼까요?

예시)

:root {
  /* Colors */
  --color-primary: #3692ff;
  --color-primary-dark: #1967d6;
  --color-text: #374151;
  --color-text-light: #9ca3af;
  --color-background: #ffffff;
  --color-background-alt: #fcfcfc;
  --color-background-landing: #cfe5ff;
  --color-background-footer: #111827;
  --color-text-light: #f3f4f6;
  --color-text-lighter: #f9fafb;

  /* Typography */
  --font-family-base: pretendard, sans-serif;
  --font-family-heading: "ROKAFSansMedium", sans-serif;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 64px;
  --spacing-xxl: 138px;

  /* Layout */
  --container-max-width: 1520px;
  --container-content-width: 1120px;
  --container-section-width: 988px;

  /* Border Radius */
  --border-radius-sm: 8px;
  --border-radius-lg: 40px;
}

padding: 16px 124px;
border-radius: 9999px;
color: #f9fafb;
margin-bottom:100px;
text-decoration: none;
font-size: 16px;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

버튼 스타일이 #button과 #id에서 중복되는게 몇가지 있네요!
스타일 중복을 최대한 줄이기 위해 이런식으로 변수로 관리도 해주고, 버튼 클래스를 만드는건 어떨까요?

중복이 많이 되는 스타일은 공통 .button 클래스에 적용하고 variant (변형 버전)은 modifier를 사용해 따로 만들어주세요.
이렇게하면 스타일 중복도 최대한 없앨 수 있고 유지보수하기도 편해질거예요 :)

/* Button styles */
.button {
  display: inline-block;
  padding: 16px 34px;
  border-radius: 8px;
  text-decoration: none;
  font-size: var(--font-size-small);
  transition: background-color 0.3s ease;
}

.button--primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

.button--primary:hover {
  background-color: var(--color-primary-dark);
}

.button--rounded {
  border-radius: 9999px;
  padding: 16px 124px;
}


#button:hover {
background-color: #1251aa
}


.home {
flex-shrink: 0;
}


section {
margin: 0 auto;
}

.blue-font {
font-size: 18px;
font-weight: 700;
color: #3692ff;
line-height: 26px;
}

.section-title {
font-size: 40px;
font-weight: 700;
line-height: 140%;
}

p {
font-size: 24px;
font-weight: 500;
line-height: 32px;
}

.hotItem {
grid-area: hotItem;
}

.register {
grid-area: register;
}

.hotItem,
.register {
display: flex;
justify-content: center;
align-items: center;
gap: 48px;
background-color: #fcfcfc;
width: 1110px;
}

.search {
grid-area: search;
display: flex;
flex-direction: row-reverse;
justify-content: center;
align-items: center;
gap: 48px;
background-color: #fcfcfc;
width: 1110px;
}

.search
.section-text {
text-align: right;
}

.bottom {
background-color: #fcfcfc;
padding-top: 138px;
}

.bottom
#p {
margin-bottom: 160px;
}

footer {
background-color: #111827;
height: 160px;

}

.footer {
display: flex;
justify-content: space-around;
align-items: center;
padding-top: 40px;
margin: 0 auto;
width: 1110px;
}

.cccc {
text-decoration: none;
color: #e5e7eb;
}

a {
cursor: pointer;
padding: 0 10px;
}
125 changes: 125 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>판다마켓</title>
<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=Noto+Sans+KR:wght@400;700&family=Titillium+Web:wght@300;600&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="index.css">
</head>

<body>
<header>
<div>
<a href="/"><img id="logo" src="img/Property 1=md.png"></a>
</div>
<a id="login" href="/login">로그인</a>
</header>

<main>
<section class="title">
<div class="omg">
<div class="title-p">
<div id="p">
일상의 모든 물건을<br>
거래해 보세요
</div>
<a id="button" href="/item">
Copy link
Collaborator

Choose a reason for hiding this comment

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

id 선택자를 쓰셨네요! id는 고유 요소를 식별하기위해 사용되는데, 여기서 사용될 필요가 있었을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

버튼 속성이 조금 다르길래 시도했는데 너무 생각이 너무 짧았습니다!
더욱 간결하게 수정해보겠습니다!

구경하러 가기
</a>
</div>
<img class="home" src="img/Img_home_top.png">
</div>
</section>

<div class="main">
<section class="hotItem">
Copy link
Collaborator

Choose a reason for hiding this comment

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

여러가지 네이밍 케이스가 혼재되어있네요 :)

CSS 네이밍 컨벤션
자주 쓰는 네이밍케이스 정리

두개 참고해보시고, 일관적인 네이밍 규칙을 적용해보시면 좋을 것 같습니다!

<img src="img/Img_home_01.png">
<div class="section-text">
<label class="blue-font">
Hot item
</label>
<h2 class="section-title">
인기 상품을<br>
확인해 보세요
</h2>
<p>
가장 HOT한 중고거래 물품을 <br>
판다 마켓에서 확인해보세요
</p>
</div>
</section>

<section class="search">
<img src="img/Img_home_02.png">
<div class="section-text">
<label class="blue-font">
Search
</label>
<h2 class="section-title">
구매를 원하는<br>
상품을 검색하세요
</h2>
<p>
구매 하고싶은 물건은 검색해서<br>
쉽게 찾아보세요
</p>
</div>
</section>

<section class="register">
<img src="img/Img_home_03.png">
<div class="section-text">
<label class="blue-font">
Register
</label>
<h2 class="section-title">
판매를 원하는<br>
상품을 등록하세요
</h2>
<p>
어떤 물건이든 판매 하고싶은 상품을 <br>
쉽게 등록하세요
</p>
</div>
</section>
</div>
</main>

<div class="bottom">
<section class="title">
<div class="omg">
<div class="title-p">
<div id="p">
믿을 수 있는<br>
판다마켓 중고 거래
</div>
</div>
<img class="home" src="img/Img_home_bottom.png">
</div>
</section>
</div>

<footer>
<div class="footer">
<div>
©codeit - 2024
</div>
<div>
<a class="cccc" href="/privacy">Privacy Policy</a>
<a class="cccc" href="/faq">FAQ</a>
</div>
<div class="link">
<a href="https://www.facebook.com" target="_blank"><img src="img/ic_facebook.png"></a>
<a href="https://www.twitter.com" target="_blank"><img src="img/ic_twitter.png"></a>
<a href="https://www.youtube.com" target="_blank"><img src="img/ic_youtube.png"></a>
<a href="https://www.instagram.com" target="_blank"><img src="img/ic_instagram.png"></a>
</div>
</div>
</footer>
</body>
</html>