Skip to content

Commit

Permalink
Merge pull request #117 from DaleStudy/sam/92
Browse files Browse the repository at this point in the history
feat : create language-section component
  • Loading branch information
SamTheKorean authored Jul 10, 2024
2 parents 8898e25 + 2739041 commit 9c21c73
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 15 deletions.
133 changes: 133 additions & 0 deletions components/language-section.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import { css, html } from "../html-css-utils.js";

class LanguageSection extends HTMLElement {
constructor() {
super();
this.render();
}

render() {
this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = this.createCss() + this.createHtml();
}

createCss() {
return css`
:host {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
section {
display: flex;
flex-direction: column;
row-gap: 30px;
margin: 0px 27px 0px;
max-width: 1550px;
@media only screen and (min-width: 768px) {
row-gap: 50px;
margin: 0px 75px 0px 76px;
}
@media only screen and (min-width: 1024px) {
position: relative;
flex-direction: row;
width: 80%;
height: 52vh;
margin: 0;
}
}
.hero {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
row-gap: 20px;
width: 65%;
@media only screen and (min-width: 768px) {
row-gap: 30px;
width: 40%;
}
@media only screen and (min-width: 1024px) {
justify-content: center;
row-gap: 40px;
width: 37%;
}
}
.gap {
@media only screen and (min-width: 1024px) {
justify-content: center;
width: 16%;
}
}
aside {
width: 100%;
@media only screen and (min-width: 1024px) {
width: 47%;
}
}
::slotted([slot="mobile-image"]) {
display: block;
}
::slotted([slot="tablet-image"]) {
display: none;
}
::slotted([slot="desktop-image"]) {
display: none;
}
@media only screen and (min-width: 768px) {
::slotted([slot="mobile-image"]) {
display: none;
}
::slotted([slot="tablet-image"]) {
display: block;
}
}
@media only screen and (min-width: 1024px) {
::slotted([slot="tablet-image"]) {
display: none;
}
::slotted([slot="desktop-image"]) {
display: block;
}
}
`;
}

createHtml() {
return html`
<section>
<aside>
<slot name="tablet-image"></slot>
<slot name="desktop-image"></slot>
<slot name="mobile-image"></slot>
</aside>
<div class="gap"></div>
<div class="hero">
<slot name="heading"></slot>
<slot name="button"></slot>
</div>
</section>
`;
}
}

customElements.define("ds-language-section", LanguageSection);
Binary file added images/horizontal-language.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 images/vertical-language.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 34 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,40 @@
></ds-image>
</ds-intro-section>

<div id="language-container">
<div class="language-image">
<ds-image src="images/languages.png" alt="languages"></ds-image>
</div>
<div class="hero">
<ds-hero>์ง€์—ญ์— ๊ด€๊ณ„์—†์ด ๋‹ค์–‘ํ•œ ์–ธ์–ด๋กœ ์ฐธ์—ฌํ•  ์ˆ˜ ์žˆ์–ด์š”</ds-hero>
<ds-button-link
size="big"
variant="ghost"
outline
href="#join-instruction-container"
>์ฐธ์—ฌ๋ฐฉ๋ฒ• ์•ˆ๋‚ด</ds-button-link
>
</div>
</div>
<ds-language-section>
<ds-image
slot="mobile-image"
src="images/vertical-language.png"
alt="languages"
width="100%"
height="auto"
></ds-image>
<ds-image
slot="tablet-image"
src="images/horizontal-language.png"
alt="languages"
width="100%"
height="auto"
></ds-image>
<ds-image
slot="desktop-image"
src="images/vertical-language.png"
alt="languages"
width="100%"
height="auto"
></ds-image>
<ds-hero slot="heading">
์ง€์—ญ์— ๊ด€๊ณ„์—†์ด ๋‹ค์–‘ํ•œ ์–ธ์–ด๋กœ ์ฐธ์—ฌํ•  ์ˆ˜ ์žˆ์–ด์š”.
</ds-hero>
<ds-button-link
slot="button"
size="big"
variant="ghost"
href="#join-instructions"
>
์ฐธ์—ฌ๋ฐฉ๋ฒ• ์•ˆ๋‚ด
</ds-button-link>
</ds-language-section>

<div id="review-container">
<div class="hero">
Expand Down
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "./components/hero.js";
import "./components/icon-link-list.js";
import "./components/image.js";
import "./components/intro-section.js";
import "./components/language-section.js"
import "./components/review-item.js";
import "./components/seo-meta-tag/seo-meta-tag.js";
import "./components/step.js";
Expand Down

0 comments on commit 9c21c73

Please sign in to comment.