mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
hamburger animation and menu transition
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
import HamburgerMenu from "@/components/HamburgerMenu";
|
||||
import { useState } from "react";
|
||||
|
||||
// TODO make hamburger menu slide in from the right instead of conditional rendering
|
||||
const Hamburger = () => {
|
||||
const [menuVisible, setMenuVisible] = useState(false);
|
||||
return (
|
||||
@@ -12,9 +11,21 @@ const Hamburger = () => {
|
||||
className="space-y-2 relative z-[99999]"
|
||||
onClick={() => setMenuVisible(!menuVisible)}
|
||||
>
|
||||
<div className="w-8 h-0.5 bg-gray-600 dark:bg-white"></div>
|
||||
<div className="w-8 h-0.5 bg-gray-600 dark:bg-white"></div>
|
||||
<div className="w-8 h-0.5 bg-gray-600 dark:bg-white"></div>
|
||||
<div
|
||||
className={`w-8 h-0.5 bg-gray-600 dark:bg-white transition-transform duration-300 ease-in-out ${
|
||||
menuVisible ? "rotate-45 translate-y-2.5 translate-x-[1px]" : ""
|
||||
}`}
|
||||
></div>
|
||||
<div
|
||||
className={`w-8 h-0.5 bg-gray-600 dark:bg-white transition-transform duration-300 ease-linear ${
|
||||
menuVisible ? "opacity-0 rotate-0 scale-0" : ""
|
||||
}`}
|
||||
></div>
|
||||
<div
|
||||
className={`w-8 h-0.5 bg-gray-600 dark:bg-white transition-transform duration-300 ease-in-out ${
|
||||
menuVisible ? "-rotate-45 -translate-y-2.5" : ""
|
||||
}`}
|
||||
></div>
|
||||
</div>
|
||||
{<HamburgerMenu menuVisible={menuVisible} />}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user