-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
136 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useState } from 'react' | ||
import '../../styles/menu.sass' | ||
|
||
export function Header() { | ||
const [toggle, setToggle] = useState(false) | ||
|
||
const handleToggle = () => setToggle(!toggle) | ||
|
||
return ( | ||
<header> | ||
<nav className="navbar"> | ||
<a href="/" className="nav-logo"> | ||
<img | ||
src={`http://${location.host}/assets/Pa11y-Viewer-Logo.svg`} | ||
alt="Logo Pa11y Viewer" | ||
width={50} | ||
/> | ||
</a> | ||
<ul className={`nav-menu ${toggle ? 'active' : ''}`}> | ||
<li className="nav-item"> | ||
<a | ||
href="https://github.com/EuCarlos/pa11y-viewer" | ||
target={'_blank'} | ||
className="nav-link">💻 Contribute | ||
</a> | ||
</li> | ||
<li className="nav-item"> | ||
<a | ||
href="https://github.com/EuCarlos/pa11y-viewer/wiki/Pa11y-Viewer:-How-to-Use" | ||
target={'_blank'} | ||
className="nav-link">📚 How to use | ||
</a> | ||
</li> | ||
</ul> | ||
<div className={`hamburger ${toggle ? 'active' : ''}`} onClick={() => handleToggle()}> | ||
<span className="bar"></span> | ||
<span className="bar"></span> | ||
<span className="bar"></span> | ||
</div> | ||
</nav> | ||
</header> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
header | ||
border-bottom: 1px solid #BCC3CC | ||
li | ||
list-style: none | ||
a | ||
text-decoration: none | ||
|
||
.navbar | ||
display: flex | ||
justify-content: space-between | ||
align-items: center | ||
padding: 1rem 1.5rem | ||
width: 55rem | ||
|
||
.nav-menu | ||
display: flex | ||
justify-content: space-between | ||
align-items: center | ||
|
||
.nav-item | ||
margin-left: 3rem | ||
|
||
.nav-link | ||
font-size: 1rem | ||
font-weight: 700 | ||
color: #293241 | ||
|
||
&:hover | ||
color: #ef233c | ||
|
||
.hamburger | ||
display: none | ||
|
||
.bar | ||
display: block | ||
width: 25px | ||
height: 3px | ||
margin: 5px auto | ||
-webkit-transition: all 0.3s ease-in-out | ||
transition: all 0.3s ease-in-out | ||
background-color: #293241 | ||
|
||
// Laptops | ||
@media screen and (max-width: 992px) | ||
header .navbar | ||
width: 45rem | ||
// Tablets | ||
@media only screen and (max-width: 768px) | ||
header .navbar | ||
width: 35rem | ||
.nav-menu | ||
position: absolute | ||
left: -108% | ||
top: 4rem | ||
flex-direction: column | ||
background-color: #fff | ||
width: 100% | ||
border-radius: 10px | ||
text-align: center | ||
transition: 0.3s | ||
box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05) | ||
z-index: 10 | ||
|
||
&.active | ||
left: 0 | ||
border-radius: 0 | ||
|
||
& .nav-item | ||
margin: 1.5rem 0 | ||
|
||
header .hamburger | ||
display: block | ||
cursor: pointer | ||
|
||
&.active .bar | ||
&:nth-child(2) | ||
opacity: 0 | ||
|
||
&:nth-child(1) | ||
transform: translateY(8px) rotate(45deg) | ||
|
||
&:nth-child(3) | ||
transform: translateY(-8px) rotate(-45deg) | ||
|
||
// Phones | ||
@media screen and (max-width: 600px) | ||
header .navbar | ||
width: 25rem |