Skip to content

Commit

Permalink
Merge pull request #18 from IvonneBenitesRodriguez/adding-new-functio…
Browse files Browse the repository at this point in the history
…nality

Adding-burgerbutton
  • Loading branch information
IvonneBenitesRodriguez authored May 23, 2024
2 parents 243c680 + a2f72d4 commit 1ab4c22
Show file tree
Hide file tree
Showing 5 changed files with 349 additions and 33 deletions.
137 changes: 137 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
"axios": "^1.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-router-dom": "^6.23.0",
"react-scripts": "5.0.1",
"styled-components": "^6.1.11",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
72 changes: 72 additions & 0 deletions src/components/BurgerButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React from "react";
import styled from "styled-components";

function BurgerButton(props) {
return (
<Burger>
<div
onClick={props.handleClick}
className={`icon nav-icon-5 ${props.clicked ? "open" : ""}`}
>
<span></span>
<span></span>
<span></span>
</div>
</Burger>
);
}

export default BurgerButton;

const Burger = styled.div`
.nav-icon-5 {
width: 35px;
height: 30px;
margin: 10px 10px;
position: relative;
cursor: pointer;
display: inline-block;
}
.nav-icon-5 span {
background-color: #fdfdcb;
position: absolute;
border-radius: 2px;
transition: 0.3s cubic-bezier(0.8, 0.5, 0.2, 1.4);
width: 100%;
height: 4px;
transition-duration: 500ms;
}
.nav-icon-5 span:nth-child(1) {
top: 0px;
left: 0px;
}
.nav-icon-5 span:nth-child(2) {
top: 13px;
left: 0px;
opacity: 1;
}
.nav-icon-5 span:nth-child(3) {
bottom: 0px;
left: 0px;
}
.nav-icon-5:not(.open):hover span:nth-child(1) {
transform: rotate(-3deg) scaleY(1.1);
}
.nav-icon-5:not(.open):hover span:nth-child(2) {
transform: rotate(3deg) scaleY(1.1);
}
.nav-icon-5:not(.open):hover span:nth-child(3) {
transform: rotate(-4deg) scaleY(1.1);
}
.nav-icon-5.open span:nth-child(1) {
transform: rotate(45deg);
top: 13px;
}
.nav-icon-5.open span:nth-child(2) {
opacity: 0;
}
.nav-icon-5.open span:nth-child(3) {
transform: rotate(-45deg);
top: 13px;
}
`;
Loading

0 comments on commit 1ab4c22

Please sign in to comment.