-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: implement intro section component #95
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import { css, html } from "../html-css-utils.js"; | ||
|
||
class IntroSection extends HTMLElement { | ||
constructor() { | ||
super(); | ||
|
||
this.render(); | ||
} | ||
|
||
render() { | ||
this.attachShadow({ mode: "open" }); | ||
this.shadowRoot.innerHTML = this.createCss() + this.createHtml(); | ||
} | ||
|
||
createCss() { | ||
return css` | ||
section { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
height: 100vh; | ||
background: linear-gradient( | ||
0deg, | ||
rgba(251, 250, 255, 0) -10%, | ||
rgba(251, 250, 255, 1) 25% | ||
), | ||
linear-gradient( | ||
90deg, | ||
rgba(36, 234, 202, 0.8) 0%, | ||
rgba(132, 109, 233, 0.8) 100% | ||
); | ||
} | ||
|
||
.inner-container { | ||
display: flex; | ||
flex-direction: column; | ||
row-gap: 30px; | ||
|
||
/* NOTE: Requires accurate policy settings */ | ||
margin: 0 7.5%; | ||
} | ||
|
||
@media only screen and (min-width: 768px) { | ||
/* NOTE: Requires accurate policy settings */ | ||
.inner-container { | ||
row-gap: 50px; | ||
margin: 0 9%; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 1024px) { | ||
.inner-container { | ||
position: relative; | ||
flex-direction: row-reverse; | ||
row-gap: unset; | ||
/* NOTE: Requires accurate policy settings */ | ||
margin: 0; | ||
width: 80%; | ||
} | ||
} | ||
|
||
article { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
/* NOTE: Requires accurate policy settings */ | ||
row-gap: -4.9px; | ||
|
||
width: 70%; | ||
} | ||
|
||
@media only screen and (min-width: 768px) { | ||
article { | ||
/* NOTE: Requires accurate policy settings */ | ||
row-gap: -3.2px; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 1024px) { | ||
article { | ||
row-gap: unset; | ||
width: 40%; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 1024px) { | ||
aside { | ||
width: 60%; | ||
} | ||
} | ||
Comment on lines
+74
to
+92
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. 개인적으로는, 미디어쿼리를 아래와 같이 통합하는게 가독성에 더 좋다고 생각하는데, 혹시 각 엘리먼트마다 구분해서 미디어쿼리를 작성하신 이유가 있으실까요? @media only screen and (min-width: 768px) {
.inner-container {
...
}
article {
...
}
}
@media only screen and (min-width: 1024px) {
.inner-container {
...
}
article {
...
}
aside {
...
}
} 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. 이렇게 작성하면 각 엘리먼트, 선택자 별로 어떻게 반응형으로 대응하는지 빠르게 알 수 있는 것을 경험했기 때문에 선호하는 방식이에요. 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. 이것도 스타일 코드 양이 많아질수록 dx가 개선될 수 있는 좋은 안이 될 수 있을 것 같네요! 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. 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. 오 이런 문법이 가능했었군요? 몰랐습니다. 이게 가능하다면 제가 가장 선호하는 방식이 되겠네요!! 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. @DaleSeo 이 스펙에 관련된 문서를 어디서 찾을 수 있을까요?? 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. 너무 최신이라 하이라이팅이 못 따라가네요...ㅋㅋㅋ |
||
`; | ||
} | ||
|
||
createHtml() { | ||
return html` | ||
<section> | ||
<div class="inner-container"> | ||
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. 상위 section 요소에 바로 스타일을 해도 되지 않을까요? 현재 section에 적용되어 있는 스타일은 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. 오? 그랬군요. 알아보고 가능하다면 적용해보겠습니다. |
||
<aside> | ||
<slot name="image"></slot> | ||
</aside> | ||
|
||
<article> | ||
<slot name="heading"></slot> | ||
<slot name="button"></slot> | ||
</article> | ||
</div> | ||
</section> | ||
`; | ||
} | ||
} | ||
|
||
customElements.define("ds-intro-section", IntroSection); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,10 @@ html { | |
scroll-behavior: smooth; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
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. 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. 네 의도한 것 맞습니다. |
||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: inherit; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import "./components/button-link.js"; | ||
import "./components/footer-link/footer-link.js"; | ||
import "./components/footer-icon.js"; | ||
import "./components/footer-link/footer-link.js"; | ||
import "./components/header.js"; | ||
import "./components/hero.js"; | ||
import "./components/image.js"; | ||
import "./components/intro-section.js"; | ||
import "./components/review-item.js"; | ||
import "./components/seo-meta-tag/seo-meta-tag.js"; |
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.
@SamTheKorean 단어 단위의 줄바꿈을 위해 hero 컴포넌트에 이 속성을 추가했어요