Skip to content

Commit

Permalink
feat : made hero component responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTheKorean committed Jun 14, 2024
1 parent 115c61d commit ba4fe19
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 24 deletions.
38 changes: 38 additions & 0 deletions components/hero.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const template = document.createElement('template');
template.innerHTML = `
<style>
:host {
display: block;
font-size: 50px; /* Default font size */
}
@media (max-width: 1024x) {
:host {
font-size: 40px; /* Tablet font size */
}
}
@media (max-width: 480px) {
:host {
font-size: 30px; /* Mobile font size */
}
}
p {
font-weight: 500;
}
</style>
<p>
<slot></slot>
</p>
`;

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

window.customElements.define('hero-component', HeroComponent);
4 changes: 0 additions & 4 deletions components/hero/hero.css

This file was deleted.

17 changes: 0 additions & 17 deletions components/hero/hero.js

This file was deleted.

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">
<p>ํ•ด์™ธ์ทจ์—…์„ ์œ„ํ•œ ์ปค๋ฎค๋‹ˆํ‹ฐ ๊ธฐ๋ฐ˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์Šคํ„ฐ๋””</p>
<hero-component>ํ•ด์™ธ์ทจ์—…์„ ์œ„ํ•œ ์ปค๋ฎค๋‹ˆํ‹ฐ ๊ธฐ๋ฐ˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์Šคํ„ฐ๋””</hero-component>
<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">
<p>์ง€์—ญ์— ๊ด€๊ณ„์—†์ด ๋‹ค์–‘ํ•œ ์–ธ์–ด๋กœ ์ฐธ์—ฌํ•  ์ˆ˜ ์žˆ์–ด์š”</p>
<hero-component>์ง€์—ญ์— ๊ด€๊ณ„์—†์ด ๋‹ค์–‘ํ•œ ์–ธ์–ด๋กœ ์ฐธ์—ฌํ•  ์ˆ˜ ์žˆ์–ด์š”</hero-component>
<link-button size="big" variant="ghost" outline href="#join-instruction-container">์ฐธ์—ฌ๋ฐฉ๋ฒ• ์•ˆ๋‚ด</link-button>
</div>
</div>

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

0 comments on commit ba4fe19

Please sign in to comment.