Skip to content

Commit

Permalink
feat: footer component
Browse files Browse the repository at this point in the history
  • Loading branch information
sounmind committed Jul 9, 2024
1 parent a406808 commit 57e1ee1
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 56 deletions.
7 changes: 3 additions & 4 deletions components/footer-link-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,19 @@ class FooterLinks extends HTMLElement {
row-gap: 10px;
font-size: 16px;
color: white;
color: var(--bg-100);
}
@media only screen and (min-width: 768px) {
ul {
flex-direction: row;
align-items: center;
column-gap: 20px;
color: white;
}
}
@media only screen and (min-width: 1024px) {
ul {
color: var(--text-900);
column-gap: 80px;
}
}
Expand Down Expand Up @@ -95,6 +92,8 @@ class FooterLink extends HTMLElement {
padding: 0;
margin: 0;
list-style-type: none;
color: var(--bg-100);
font-size: 16px;
}
`;
}
Expand Down
90 changes: 90 additions & 0 deletions components/footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { css, html } from "../html-css-utils.js";

class Footer extends HTMLElement {
constructor() {
super();

this.render();
}

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

createCss() {
return css`
:host {
display: block;
height: 400px;
color: white;
background-color: var(--text-900);
padding: 80px 27px;
@media only screen and (min-width: 768px) {
padding: 180px 76px 100px 76px;
}
@media only screen and (min-width: 1550px) {
display: flex;
justify-content: center;
}
}
footer {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
max-width: 1550px;
@media only screen and (min-width: 1550px) {
flex: 1;
}
}
section {
display: flex;
flex-direction: column;
row-gap: 40px;
@media only screen and (min-width: 768px) {
flex-direction: row;
justify-content: space-between;
}
}
p {
border-top: 1px solid rgba(253, 253, 255, 0.75);
font-size: 14px;
color: var(--bg-100);
opacity: 0.75;
margin-top: 26px;
padding-top: 20px;
@media only screen and (min-width: 768px) {
margin-top: 50px;
padding-top: 20px;
}
@media only screen and (min-width: 1024px) {
padding-top: 48px;
}
}
`;
}

createHtml() {
return html`<footer>
<section>
<slot name="footer-link-list"></slot>
<slot name="icon-link-list"></slot>
</section>
<p>© 2024 Dale Study. All rights reserved.</p>
</footer>`;
}
}

customElements.define("ds-footer", Footer);
2 changes: 1 addition & 1 deletion components/icon-link-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class IconLinkList extends HTMLElement {
section {
display: flex;
align-items: center;
gap: 40px;
column-gap: 40px;
}
`;
}
Expand Down
86 changes: 35 additions & 51 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,56 +280,40 @@
</ds-step-list>
</ds-steps-section>

<footer>
<div
style="
border-bottom: 0.1rem solid #d3d3d3;
padding-bottom: 5rem;
padding-top: 18rem;
"
>
<ds-footer-link-list>
<!-- TODO: add real links -->
<ds-footer-link href="#faq">FAQ</ds-footer-link>
<ds-footer-link href="#discover">Discover</ds-footer-link>
<ds-footer-link href="#explore">Explore</ds-footer-link>
<ds-footer-link href="#books">Books</ds-footer-link>
</ds-footer-link-list>

<div style="display: flex; gap: 40px">
<ds-footer-icon
href="https://github.com/DaleSeo"
width="24px"
height="24px"
iconSrc="images/icon-blogger.svg"
iconAlt="blogger-icon"
></ds-footer-icon>
<ds-footer-icon
href="https://www.linkedin.com/in/daleseo/"
width="24px"
height="24px"
iconSrc="images/icon-linkedin.svg"
iconAlt="linkedin-icon"
></ds-footer-icon>
<ds-footer-icon
href="https://github.com/DaleSeo"
width="24px"
height="24px"
iconSrc="images/icon-github.svg"
iconAlt="github-icon"
></ds-footer-icon>
<ds-footer-icon
href="https://www.youtube.com/@DaleSeo"
width="24px"
height="24px"
iconSrc="images/icon-youtube.svg"
iconAlt="youtube-icon"
></ds-footer-icon>
</div>
</div>
<div style="margin-top: 5rem; font-size: 1.4rem; font-weight: regular">
<p>© 2024 Dale Study. All rights reserved.</p>
</div>
</footer>
<ds-footer>
<ds-footer-link-list slot="footer-link-list">
<!-- TODO: add real links -->
<ds-footer-link href="#faq">FAQ</ds-footer-link>
<ds-footer-link href="#discover">Discover</ds-footer-link>
<ds-footer-link href="#explore">Explore</ds-footer-link>
<ds-footer-link href="#books">Books</ds-footer-link>
</ds-footer-link-list>

<ds-icon-link-list slot="icon-link-list">
<ds-icon-link
href="https://www.algodale.com/"
icon-src="images/blog-icon.png"
icon-alt="알고달레 블로그 아이콘"
></ds-icon-link>

<ds-icon-link
href="https://www.linkedin.com/in/daleseo/"
icon-src="images/linked-in-icon.png"
icon-alt="Dale Seo (달레)의 링크드인 아이콘"
></ds-icon-link>

<ds-icon-link
href="https://github.com/DaleStudy/leetcode-study"
icon-src="images/github-icon.png"
icon-alt="달레 알고리즘 스터디 깃허브 레포지토리 아이콘"
></ds-icon-link>

<ds-icon-link
href="https://www.youtube.com/@DaleSeo"
icon-src="images/youtube-icon.png"
icon-alt="Dale Seo (달레)의 유튜브 아이콘"
></ds-icon-link>
</ds-icon-link-list>
</ds-footer>
</body>
</html>
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "./components/button-link.js";
import "./components/footer-link-list.js";
import "./components/footer.js";
import "./components/header.js";
import "./components/hero.js";
import "./components/icon-link-list.js";
Expand Down

0 comments on commit 57e1ee1

Please sign in to comment.