Skip to content

Commit

Permalink
adjust to the common coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTheKorean committed Jun 20, 2024
1 parent 7d9d5f1 commit db05468
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
25 changes: 10 additions & 15 deletions components/hero.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
const template = document.createElement('template');
template.innerHTML = `
const html = `
<style>
:host {
display: block;
font-weight: 500;
font-size: 50px; /* Default font size */
font-size: 30px;
}
@media (max-width: 1024px) {
:host {
font-size: 40px; /* Tablet font size */
}
@media only screen and (min-width: 768px) {
font-size: 40px;
}
@media (max-width: 480px) {
:host {
font-size: 30px; /* Mobile font size */
}
@media only screen and (min-width: 1024px) {
font-size: 50px;
}
/* Ensure the <h2> element inherits styles from :host */
h2 {
font-weight: inherit;
Expand All @@ -30,12 +25,12 @@ template.innerHTML = `
</h2>
`;

class HeroComponent extends HTMLElement {
class DsHero extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
this.shadowRoot.innerHTML = html;
}
}

window.customElements.define('hero-component', HeroComponent);
customElements.define('ds-hero', DsHero);
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@

<div id="intro-container">
<div class="hero">
<hero-component>ํ•ด์™ธ์ทจ์—…์„ ์œ„ํ•œ ์ปค๋ฎค๋‹ˆํ‹ฐ ๊ธฐ๋ฐ˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์Šคํ„ฐ๋””</hero-component>
<ds-hero>ํ•ด์™ธ์ทจ์—…์„ ์œ„ํ•œ ์ปค๋ฎค๋‹ˆํ‹ฐ ๊ธฐ๋ฐ˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์Šคํ„ฐ๋””</ds-hero>
<link-button size="big" variant="secondary" href="https://discord.gg/43UkheRV">๋””์Šค์ฝ”๋“œ ์ฐธ์—ฌํ•˜๊ธฐ</link-button>
</div>

Expand All @@ -252,14 +252,14 @@
<img src="images/languages.png" alt="#" />
</div>
<div class="hero">
<hero-component>์ง€์—ญ์— ๊ด€๊ณ„์—†์ด ๋‹ค์–‘ํ•œ ์–ธ์–ด๋กœ ์ฐธ์—ฌํ•  ์ˆ˜ ์žˆ์–ด์š”</hero-component>
<ds-hero>์ง€์—ญ์— ๊ด€๊ณ„์—†์ด ๋‹ค์–‘ํ•œ ์–ธ์–ด๋กœ ์ฐธ์—ฌํ•  ์ˆ˜ ์žˆ์–ด์š”</ds-hero>
<link-button size="big" variant="ghost" outline href="#join-instruction-container">์ฐธ์—ฌ๋ฐฉ๋ฒ• ์•ˆ๋‚ด</link-button>
</div>
</div>

<div id="review-container">
<div class="hero">
<hero-component>์ฝ”๋“œ๋ฆฌ๋ทฐ๋ฅผ ํ†ตํ•ด ์ƒˆ๋กœ์šด ๊ด€์ ์„ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์–ด์š”</hero-component>
<ds-hero>์ฝ”๋“œ๋ฆฌ๋ทฐ๋ฅผ ํ†ตํ•ด ์ƒˆ๋กœ์šด ๊ด€์ ์„ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์–ด์š”</ds-hero>
<link-button size="big" variant="secondary" href="https://discord.gg/43UkheRV">๋””์Šค์ฝ”๋“œ ์ฐธ์—ฌํ•˜๊ธฐ</link-button>
</div>
<div class="review-image">
Expand Down

0 comments on commit db05468

Please sign in to comment.