// Sticky top nav — desktop links + mobile full-screen overlay // Mobile (≤768px): hamburger opens full-screen overlay with blur backdrop, // 28px item font, 1px --line dividers, ✕ close, body scroll-lock. const LINE_URL = 'https://line.me/R/ti/p/@52ev'; /* ---------- Icon components (Lucide-style, stroke-width 1.5) ---------- */ function MenuIcon() { return ( ); } function CloseIcon() { return ( ); } /* ---------- Nav ---------- */ function Nav({ onPartsClick, current }) { const [open, setOpen] = React.useState(false); // Body scroll lock React.useEffect(() => { document.body.style.overflow = open ? 'hidden' : ''; return () => { document.body.style.overflow = ''; }; }, [open]); // Auto-close when viewport grows past mobile breakpoint React.useEffect(() => { const mq = window.matchMedia('(min-width: 769px)'); const handler = (e) => { if (e.matches) setOpen(false); }; mq.addEventListener('change', handler); return () => mq.removeEventListener('change', handler); }, []); // Escape key closes overlay React.useEffect(() => { if (!open) return; const handler = (e) => { if (e.key === 'Escape') setOpen(false); }; document.addEventListener('keydown', handler); return () => document.removeEventListener('keydown', handler); }, [open]); const close = () => setOpen(false); return ( <>
電車玩家 {/* Desktop links */} {/* Desktop CTA */} 加入 LINE {/* Hamburger — mobile only (hidden via CSS on desktop) */}
{/* Full-screen overlay — mobile only */} {open && (
{/* ✕ Close button — top-right */} {/* Nav links */} {/* LINE CTA */}
加入 LINE
)} ); } /* ---------- Shared glyphs ---------- */ function LineGlyph({ width = 14, height = 14 }) { return ( ); } window.Nav = Nav; window.LineGlyph = LineGlyph; window.LINE_URL = LINE_URL;