'use client'; import React, { useState, useEffect, MouseEvent } from 'react'; import { CiMenuFries } from "react-icons/ci"; import { IoCloseOutline } from "react-icons/io5"; export default function Header() { const links = [ { "text": "Accueil", "target": "/" }, { "text": "Travaux", "target": "/#works" }, { "text": "À propos", "target": "/#about" }, { "text": "Blog", "target": "/blog" }, ]; const [isOpen, setIsOpen] = useState(false); const [showText, setShowText] = useState(false); const handleAnchorClick = (e: MouseEvent, target: string) => { if (target.startsWith("/#")) { // only anchor links e.preventDefault(); const id = target.slice(2); const element = document.getElementById(id); if (element) { element.scrollIntoView({ behavior: "smooth" }); } } setIsOpen(false); }; useEffect(() => { if (isOpen) { const timer = setTimeout(() => setShowText(true), 450); return () => clearTimeout(timer); } else { setShowText(false); } }, [isOpen]); return (
M. Guilbert
logo mg dev {/* Desktop */}
France
{/* Mobile */}
{/* Overlay mobile menu */}
{/* wave / circle that fills the screen */}
{/* content */}
{/* top bar */}
M. Guilbert
{/* liens */} {/* footer */}
France
); }