-
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 #69 from KERT-core/feat/dynamic-nav
Feat/DynamicNav - 반응형 내비바 + Chore/Console - 모든 콘솔 코드 비활성화 + Perf/ReactQuery - API 요청 횟수 제한 추가 + Chore/API - /api/ 추가
- Loading branch information
Showing
35 changed files
with
341 additions
and
171 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
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,44 @@ | ||
import styled from 'styled-components'; | ||
|
||
const HamburgerWrapper = styled.div` | ||
width: 30px; | ||
height: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
cursor: pointer; | ||
`; | ||
|
||
const Bar = styled.div` | ||
height: 2px; | ||
width: 100%; | ||
background-color: var(--primary-text-color); | ||
transition: 0.3s ease; | ||
transform-origin: left; | ||
/* 애니메이션을 위한 조건부 스타일 */ | ||
${({ $active, $position }) => { | ||
if ($active && $position === 'top') | ||
return `transform: rotate(45deg) translate(0px, -2px);`; | ||
if ($active && $position === 'middle') return `opacity: 0;`; | ||
if ($active && $position === 'bottom') | ||
return `transform: rotate(-45deg) translate(0px, 2px);`; | ||
return ''; | ||
}} | ||
`; | ||
|
||
export default function HamburgerButton({ active, onToggle }) { | ||
const handleToggle = () => { | ||
if (onToggle) { | ||
onToggle(!active); | ||
} | ||
}; | ||
|
||
return ( | ||
<HamburgerWrapper onClick={handleToggle}> | ||
<Bar $active={active} $position="top" /> | ||
<Bar $active={active} $position="middle" /> | ||
<Bar $active={active} $position="bottom" /> | ||
</HamburgerWrapper> | ||
); | ||
} |
Oops, something went wrong.