Skip to content
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 : implemented styling for each state and refactor the code for b… #137

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 126 additions & 45 deletions components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Header extends HTMLElement {
border-bottom: 1px solid var(--bg-300);
background-color: var(--bg-200);

@media only screen and (min-width: 1024px) {
@media only screen and (min-width: 1024px) {
z-index: 1000;
}
}
Expand All @@ -53,42 +53,35 @@ class Header extends HTMLElement {
background-color: var(--bg-100);
}

*:focus {
border: 1px solid black;
}

header {
display: flex;
margin: 0 27px 0;
margin: 0 27px;
justify-content: space-between;
align-items: center;

@media only screen and (min-width: 768px) {
flex-direction: row !important;
}

@media only screen and (min-width: 1024px) {
width: 80%;
margin: 0 auto;
}

}

header.vertical {
flex-direction: column;

@media only screen and (min-width: 768px) {
flex-direction: row;
}
}

.buttons-container {
display: none;
align-items: center;
column-gap: 30px;

@media only screen and (min-width: 768px) {
display: flex !important;
flex-direction: row !important;
align-items: center !important;
column-gap: 30px !important;
margin-top: 0 !important;
display: flex;
flex-direction: row;
align-items: center;
column-gap: 30px;
margin-top: 0;
}
}

Expand All @@ -98,17 +91,26 @@ class Header extends HTMLElement {
align-items: center;
row-gap: 18px;
margin-top: 30px;

@media only screen and (min-width: 768px) {
display: flex;
flex-direction: row;
align-items: center;
column-gap: 40px;
margin-top: 0;
}
}

a {
display: flex;
gap: 10px;
align-items: center;
text-decoration: none;
padding: 10px 20px;

span {
display: none;

@media only screen and (min-width: 768px) {
display: inline;
font-size: 16px;
Expand All @@ -119,15 +121,39 @@ class Header extends HTMLElement {
}
}

img {
svg {
width: 41px;
height: 20.5px;

@media only screen and (min-width: 1024px) {
width: 45px;
height: 22.5px;
}
}

&:focus {
outline: 3px solid var(--primary);
outline-offset: 2px;
border-radius: 10px;
}

&:focus-visible {
outline: 3px solid var(--secondary);
outline-offset: 2px;
border-radius: 10px;
}

&:hover {
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
}

&:active svg path {
fill: var(--text-900);
}

&:active span {
color: var(--primary);
}
}

button {
Expand All @@ -137,24 +163,45 @@ class Header extends HTMLElement {
display: flex;
align-items: center;
cursor: pointer;
padding: 0;
width: 18px;
height: 18px;
width: 48px;
height: 40px;

&:focus {
outline: 3px solid var(--primary);
outline-offset: 2px;
border-radius: 10px;
}

&:focus-visible {
outline: 3px solid var(--secondary);
outline-offset: 2px;
border-radius: 10px;
}

&:hover {
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
}

&:active svg path {
fill: var(--primary);
}

@media only screen and (min-width: 768px) {
display: none;
}
}

button > img {
button > svg {
width: 18px;
height: 17px;
top: 12px;
left: 14px;
position: absolute;
top: 0;
left: 0;
opacity: 1;
transition: opacity 200ms ease-in-out;
}

button > img.hide {
button > svg.hide {
opacity: 0;
}

Expand All @@ -171,33 +218,67 @@ class Header extends HTMLElement {
<header>
<div class="header-content">
<a href="/">
<img src="images/logo.png" alt="logo" />
<svg
id="logo"
width="45"
height="22"
viewBox="0 0 45 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.84 19.03L0.29 12.61V10.51L14.84 3.25V6.76L4.82 11.41L14.84 15.52V19.03ZM28.408 0.579999L20.428 22H16.378L24.358 0.579999H28.408ZM29.8505 15.52L39.8705 11.41L29.8505 6.76V3.25L44.4005 10.51V12.61L29.8505 19.03V15.52Z"
fill="url(#paint0_linear_278_133)"
/>
<defs>
<linearGradient
id="paint0_linear_278_133"
x1="-1"
y1="9.51219"
x2="46"
y2="9.51219"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="var(--secondary)" />
<stop offset="1" stop-color="var(--primary)" />
</linearGradient>
</defs>
</svg>
<span>달레 스터디</span>
</a>
<button>
<img
width="100%"
height="100%"
<svg
id="menuIcon"
src="images/menu.png"
alt="menu open icon"
/>
<img
width="100%"
height="100%"
width="18"
height="17"
viewBox="0 0 18 17"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 0H18V2.83333H0V0ZM0 7.08333H18V9.91667H0V7.08333ZM0 14.1667H18V17H0V14.1667Z"
fill="var(--text-900)"
/>
</svg>
<svg
id="closeIcon"
class="hide"
src="images/cancel.png"
alt="menu close icon"
/>
width="14"
height="15"
viewBox="0 0 14 15"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.46 7.54208L14 13.0821V14.5421H12.54L7 9.00208L1.46 14.5421H0V13.0821L5.54 7.54208L0 2.00208V0.542084H1.46L7 6.08208L12.54 0.542084H14V2.00208L8.46 7.54208Z"
fill="var(--text-900)"
/>
</svg>
</button>
</div>

<div class="buttons-container">
<ds-button-link
href="#steps-section"
size="small"
variant="ghost"
<ds-button-link href="#steps-section" size="small" variant="ghost"
>참여방법 안내</ds-button-link
>
<ds-button-link
Expand Down
Binary file removed images/Logo.png
Binary file not shown.
3 changes: 3 additions & 0 deletions images/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/logo.png
Binary file not shown.
9 changes: 9 additions & 0 deletions images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/menu.png
Binary file not shown.
3 changes: 3 additions & 0 deletions images/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.