-
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
1 parent
51b2370
commit 70d7287
Showing
4 changed files
with
121 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
svg.mc-animated-hamburger { | ||
stroke-linecap: round; | ||
stroke-linejoin: round; | ||
stroke-miterlimit: 1.5; | ||
cursor:pointer; | ||
} | ||
|
||
svg.mc-animated-hamburger path { | ||
fill: none; | ||
stroke-width: 1px; | ||
} | ||
|
||
svg.mc-animated-hamburger #top, | ||
svg.mc-animated-hamburger #bottom { | ||
stroke-dasharray: 30, 75.39; | ||
transition: all 0.6s cubic-bezier(0.6, 0.33, 0.67, 1.29); | ||
} | ||
|
||
svg.mc-animated-hamburger.active #top, | ||
svg.mc-animated-hamburger.active #bottom { | ||
stroke-dasharray: 75.39; | ||
stroke-dashoffset: -60; | ||
} | ||
|
||
svg.mc-animated-hamburger:nth-child(2) { | ||
transform: rotate(0deg); | ||
transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); | ||
} | ||
|
||
svg.mc-animated-hamburger:nth-child(2) path { | ||
transition: all 0.4s ease-in-out 0.6s; | ||
} | ||
|
||
svg.mc-animated-hamburger:nth-child(2).active { | ||
transform: rotate(180deg); | ||
} | ||
|
||
svg.mc-animated-hamburger #top { | ||
stroke-dasharray: 30, 88; | ||
} |
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 type { FC } from "react"; | ||
|
||
import type { SvgProps } from "./icons"; | ||
|
||
import "./animatedHamburger.css"; | ||
|
||
type AnimatedHamburgerProps = SvgProps & { | ||
open?: boolean | undefined; | ||
}; | ||
|
||
export const AnimatedHamburger: FC<AnimatedHamburgerProps> = ({ | ||
className, | ||
dimension, | ||
open, | ||
}) => ( | ||
<svg | ||
height={dimension ?? 24} | ||
width={dimension ?? 24} | ||
className={`${className ?? ""} fill-none mc-animated-hamburger ${ | ||
open ? "active" : "" | ||
}`} | ||
viewBox="0 0 60 40" | ||
> | ||
<g transform="matrix(1,0,0,1,-389.5,-264.004)"> | ||
<g> | ||
<g transform="matrix(1,0,0,1,0,5)"> | ||
<path | ||
id="top" | ||
className="className" | ||
d="M390,270L420,270L420,270C420,270 420.195,250.19 405,265C389.805,279.81 390,279.967 390,279.967" | ||
/> | ||
</g> | ||
<g transform="matrix(1,1.22465e-16,1.22465e-16,-1,0.00024296,564.935)"> | ||
<path | ||
id="bottom" | ||
className="className" | ||
d="M390,270L420,270L420,270C420,270 420.195,250.19 405,265C389.805,279.81 390,279.967 390,279.967" | ||
/> | ||
</g> | ||
<path className="className" id="middle" d="M390,284.967L420,284.967" /> | ||
</g> | ||
</g> | ||
</svg> | ||
); |
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