-
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.
Merge pull request #9 from sthgml/8-fix-모바일에서-nav-형태-및-포지션-수정
🐛 fix: 모바일에서 nav 형태 및 포지션 수정
- Loading branch information
Showing
16 changed files
with
251 additions
and
195 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 |
---|---|---|
@@ -1,16 +1,88 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
const DivHamburger = styled.div` | ||
#hamburger { | ||
width: 40px; | ||
height: 40px; | ||
padding: 8px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
} | ||
#hamburger div { | ||
width: 100%; | ||
height: 2px; | ||
border-radius: 4px; | ||
background-color: var(--icon); | ||
transition: all 0.3s; | ||
} | ||
/* hover */ | ||
#hamburger:hover div:first-child{ | ||
transform: rotate(45deg); | ||
} | ||
#hamburger:hover div:nth-child(2){ | ||
transform: translate(-1em); | ||
} | ||
#hamburger:hover div:nth-child(3){ | ||
transform: rotate(-45deg); | ||
} | ||
/* active */ | ||
#hamburger:active div:first-child{ | ||
transform: translate(0.5em) rotate(45deg) ; | ||
} | ||
#hamburger:active div:nth-child(2){ | ||
transform: translate(-0.5em) ; | ||
} | ||
#hamburger:active div:nth-child(3){ | ||
transform: translate(0.5em) rotate(-45deg) ; | ||
} | ||
/* opened */ | ||
/* opened:hover */ | ||
#hamburger.opened:hover div:first-child{ | ||
transform: translate(-1em) rotate(-45deg) ; | ||
} | ||
#hamburger.opened:hover div:nth-child(2){ | ||
transform: translate(0) ; | ||
} | ||
#hamburger.opened:hover div:nth-child(3){ | ||
transform: translate(-1em) rotate(45deg) ; | ||
} | ||
/* opened:active */ | ||
#hamburger.opened:active div:first-child{ | ||
transform: translate(-1.5em) rotate(-45deg) ; | ||
} | ||
#hamburger.opened:active div:nth-child(2){ | ||
transform: translate(-0.5em) ; | ||
} | ||
#hamburger.opened:active div:nth-child(3){ | ||
transform: translate(-1.5em) rotate(45deg) ; | ||
} | ||
` | ||
|
||
export default function Hamburger({ isMenuOpen, handleMenu }) { | ||
return ( | ||
<button | ||
type="button" | ||
id="hamburger" | ||
className={`menu-btn | ||
${isMenuOpen ? 'opened' : ''}`} | ||
onClick={handleMenu}> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</button> | ||
<DivHamburger> | ||
<button | ||
type="button" | ||
id="hamburger" | ||
className={`menu-btn | ||
${isMenuOpen ? 'opened' : ''}`} | ||
onClick={handleMenu}> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</button> | ||
</DivHamburger> | ||
) | ||
} |
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
Oops, something went wrong.