-
Notifications
You must be signed in to change notification settings - Fork 3
KDT0_KimMinSeob 인터파크 홈페이지 클론코딩 #63
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
9857f16
bdacb96
d52cb2e
8f5fabe
42de03b
ae870af
5b6c632
3ab097d
617e08f
ecb18a0
5efd897
15e6aed
50d8f29
5010ced
68ef625
86954b2
0a013aa
7c6b5ba
19589cc
06e4ab1
3c42ea2
95f944c
4e905ba
0f6d227
662ba1d
e350f9f
6896fbe
0101229
cfa15d4
7196516
0ba56a2
4becc4d
6f54d7a
9458d91
f48751f
6093214
1374d8f
f03a500
4bdd5f4
8fc7595
5621db2
e62441b
f526127
f97a6ca
7e86fc1
c3162b0
d3a4585
34d16de
b30dbef
b4d4e5c
d84370c
7a9ea96
b4b2241
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,12 @@ | |
| --------------------------------------- | ||
| */ | ||
|
|
||
|
|
||
| .liveBanner { | ||
| width: 130.4rem; | ||
|
||
| margin: 6rem auto; | ||
| } | ||
|
|
||
| .liveBanner .shopping__title .live-img{ | ||
| .liveBanner .shopping__title .live-img { | ||
| width: 16rem; | ||
| } | ||
|
|
||
|
|
@@ -59,7 +58,7 @@ | |
| right: 0; | ||
| top: 0; | ||
| bottom: 0; | ||
| background: linear-gradient(180deg, rgba(0,0,0,0.4) 18.65%, transparent 39.75%), linear-gradient(180deg, transparent 56.75%, rgba(0,0,0,0.5) 87.59%); | ||
| background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 18.65%, transparent 39.75%), linear-gradient(180deg, transparent 56.75%, rgba(0, 0, 0, 0.5) 87.59%); | ||
| } | ||
|
|
||
| .mySwiper5 > .swiper-wrapper > .swiper-slide img { | ||
|
|
@@ -87,7 +86,7 @@ | |
| height: 100%; | ||
| display: flex; | ||
| color: #fff; | ||
| background-color: rgba(0,0,0,0.5); | ||
| background-color: rgba(0, 0, 0, 0.5); | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| align-items: center; | ||
|
|
@@ -117,7 +116,7 @@ | |
| font-size: 1.3rem; | ||
| line-height: 3.2rem; | ||
| color: #fff; | ||
| background-color: rgba(0,0,0,0.5); | ||
| background-color: rgba(0, 0, 0, 0.5); | ||
| border-radius: 1.6rem; | ||
| font-weight: 700; | ||
| } | ||
|
|
@@ -128,7 +127,7 @@ | |
| text-align: start; | ||
| color: #fff; | ||
| font-weight: 700; | ||
| text-shadow: 0 0 0.2rem rgba(0,0,0,0.5); | ||
| text-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.5); | ||
| } | ||
|
|
||
| .mySwiper5 .live__bottom--info { | ||
|
|
@@ -180,8 +179,8 @@ | |
| position: absolute; | ||
| display: flex; | ||
| top: 3.9rem; | ||
| font-size : 1.5rem; | ||
| line-height: 2.0rem; | ||
| font-size: 1.5rem; | ||
| line-height: 2rem; | ||
| font-weight: 700; | ||
| } | ||
|
|
||
|
|
@@ -215,7 +214,6 @@ | |
| height: 4rem; | ||
| transform: scaleX(-1); | ||
| margin-bottom: 0.7rem; | ||
|
|
||
| } | ||
|
|
||
| .up-sit { | ||
|
|
@@ -253,8 +251,8 @@ | |
| margin-top: -1.5rem; | ||
| transform: translateX(50%); | ||
| background: hsla(0, 0%, 100%, 0.9); | ||
| border: 0.1rem solid rgba(0,0,0,0.1); | ||
| box-shadow: 0 0 0.8rem rgba(0,0,0,.13); | ||
| border: 0.1rem solid rgba(0, 0, 0, 0.1); | ||
| box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.13); | ||
| align-items: center; | ||
| justify-content: center; | ||
| border-radius: 10rem; | ||
|
|
@@ -266,7 +264,7 @@ | |
| width: 3.8rem; | ||
| height: 4rem; | ||
| margin-left: 0.3rem; | ||
| background-image: url("../assets/image/right-arrow.svg"); | ||
| background-image: url('../assets/image/right-arrow.svg'); | ||
| background-repeat: no-repeat; | ||
| background-position: center; | ||
| background-size: contain; | ||
|
|
@@ -279,4 +277,4 @@ | |
| .liveBanner .shopping__bottom > button { | ||
| position: absolute; | ||
| bottom: -7.5rem; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,9 @@ input:focus { | |
| outline: none; | ||
| } | ||
|
|
||
| /* --------------------------------------- | ||
| SWIPER CSS | ||
| --------------------------------------- */ | ||
| .main__wrapper { | ||
| width: 75%; | ||
|
|
||
|
|
@@ -75,6 +78,82 @@ input:focus { | |
| cursor: pointer; | ||
| } | ||
|
|
||
| .swiper-container { | ||
| width: 100%; | ||
|
|
||
| overflow: hidden; | ||
| } | ||
|
|
||
| .swiper-slide { | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .slide__image { | ||
| width: 100%; | ||
| border-radius: 0.7rem; | ||
| object-fit: cover; | ||
| } | ||
| .left-btn { | ||
| width: 3rem; | ||
| height: 3rem; | ||
|
|
||
| position: absolute; | ||
| top: 50%; | ||
| left: 0; | ||
| z-index: 1; | ||
|
|
||
| transform: translate(-50%, -50%) rotateY(180deg); | ||
|
|
||
| border-radius: 10rem; | ||
| background: hsla(0, 0%, 100%, 0.8); | ||
| border: 0.1rem solid rgba(0, 0, 0, 0.1); | ||
| box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.13); | ||
| } | ||
|
Comment on lines
+81
to
+144
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| .left-btn::before { | ||
| width: 0.8rem; | ||
| height: 0.5rem; | ||
|
|
||
| content: '다음'; | ||
| color: transparent; | ||
|
|
||
| background-image: url('../assets/image/right-arrow.svg'); | ||
| background-repeat: no-repeat; | ||
| background-position: center; | ||
| background-size: contain; | ||
| } | ||
|
|
||
| .right-btn { | ||
| width: 3rem; | ||
| height: 3rem; | ||
|
|
||
| position: absolute; | ||
| top: 50%; | ||
| right: 0; | ||
| z-index: 1; | ||
|
|
||
| transform: translate(50%, -50%); | ||
|
|
||
| border-radius: 10rem; | ||
| background: hsla(0, 0%, 100%, 0.8); | ||
| border: 0.1rem solid rgba(0, 0, 0, 0.1); | ||
| box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.13); | ||
| } | ||
|
|
||
| .right-btn::before { | ||
| width: 0.8rem; | ||
| height: 0.5rem; | ||
|
|
||
| content: '다음'; | ||
| color: transparent; | ||
|
|
||
| background-image: url('../assets/image/right-arrow.svg'); | ||
| background-repeat: no-repeat; | ||
| background-position: center; | ||
| background-size: contain; | ||
| } | ||
|
|
||
| @media (max-width: 800px) { | ||
| html { | ||
| font-size: 14px; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
복붙 수준으로 비슷한 코드라 개선의 여지가 너무 많네요
반복되어 사용되는 CSS를 클래스로 뽑아서 개선해보세요!
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정한 코드
복붙 수준으로 비슷한 코드들이 생긴 문제에 대해서 생각을 해 보았을 때 가장 먼저 설계 없이 바로 제작을 하다 보니 이렇게 더러운 코드가 나온 것 같습니다. 리펙토링을 하면서 중복된 코드들을 main.css에 정리하여 수정했더니 코드가 비교적 깔끔하게 정렬되는 결과를 불러일으킬 수 있었습니다.
이렇게 리펙토링을 하면서 한 가지 궁금한 점은 CSS를 정리할 때 비교적 많은 경우로 Section별로 정리하는 레퍼런스들이 많았습니다. CSS를 정리할 때 기능별로 묶어서 정리를 하는 것이 나은 지, 아니면 Section별로 정리하는 것이 나은 지 궁금합니다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기능별로 css를 하는 건 잘 없죠..?! 어떤 영역에 어떻게 보여줄지가 css의 역할이니까 section 별로 정리하는 게 관리하기 편합니다.