60 lines
1.8 KiB
TypeScript
60 lines
1.8 KiB
TypeScript
import { X } from "lucide-react";
|
|
|
|
import menuShape from "&/images/globals/menuOverlayBg.png";
|
|
import menuShapeWebp from "&/images/globals/menuOverlayBg.webp";
|
|
import logoImg from "&/images/header/LOGO BEA.svg";
|
|
import MenuContent from "@/front/Components/Header/MenuContent";
|
|
|
|
interface MenuOverlayProps {
|
|
isOpen: boolean;
|
|
onClose: () => void;
|
|
}
|
|
|
|
export default function MenuOverlay({
|
|
isOpen,
|
|
onClose,
|
|
}: Readonly<MenuOverlayProps>) {
|
|
return (
|
|
<div
|
|
className={`fixed inset-0 z-40 transition-opacity duration-300 ${
|
|
isOpen
|
|
? "pointer-events-auto opacity-100"
|
|
: "pointer-events-none opacity-0"
|
|
}`}
|
|
>
|
|
<div
|
|
className={`absolute inset-x-0 top-0 transition-transform duration-300 ${isOpen ? "translate-y-0" : "-translate-y-full"}`}
|
|
>
|
|
<div role="dialog" aria-modal="true" className="relative w-full">
|
|
<picture>
|
|
<source srcSet={menuShapeWebp} type="image/webp" />
|
|
<img
|
|
src={menuShape}
|
|
alt=""
|
|
className="absolute inset-0 h-[920px] w-full"
|
|
/>
|
|
</picture>
|
|
|
|
<div className="relative px-6 py-10 md:px-16 md:py-14">
|
|
<img
|
|
src={logoImg}
|
|
alt="Bien-être animal"
|
|
className="mb-10 h-20 w-auto md:h-48 ml-12"
|
|
/>
|
|
|
|
<button
|
|
type="button"
|
|
onClick={onClose}
|
|
aria-label="Fermer le menu"
|
|
className="absolute right-6 top-6 flex h-12 w-12 cursor-pointer items-center justify-center rounded-full bg-beige text-bleu transition-colors hover:bg-light-orange md:right-10 md:top-16"
|
|
>
|
|
<X size={32} />
|
|
</button>
|
|
|
|
<MenuContent variant="menu" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|