// ─────────── Shared components (Header, Footer, Logo, Placeholder) ─────────── const { useState, useEffect, useRef, useMemo } = React; /* tiny logo mark */ function Mark({ size = 28 }) { return ( {/* mountain / A monogram — Anadolu mark */} ); } function Logo({ compact = false }) { const t = window.__T; return ( {!compact && (
{t.brand} {t.common.since} · İnşaat Malz.
)}
); } /* placeholder image — striped + monospace label */ function PH({ label = "PHOTO", aspect = "16/10", code, scale = "site", width, height }) { return (
{code || "—"} {scale}
{label}
▢ DROP PHOTO 1920×1200
); } /* fade-in observer */ function Fade({ children, delay = 0 }) { const ref = useRef(null); const [shown, setShown] = useState(false); useEffect(() => { const el = ref.current; if (!el) return; const io = new IntersectionObserver( (entries) => { entries.forEach((e) => { if (e.isIntersecting) { setTimeout(() => setShown(true), delay); io.disconnect(); } }); }, { rootMargin: "0px 0px -8% 0px", threshold: 0.05 } ); io.observe(el); return () => io.disconnect(); }, [delay]); return (
{children}
); } /* Arrow icon */ function Arr({ size = 12 }) { return ( ); } /* Header / global nav */ function Header({ route, setRoute, lang, setLang }) { const t = window.__T; const items = [ ["home", t.nav.home], ["about", t.nav.about], ["products", t.nav.products], ["projects", t.nav.projects], ["contact", t.nav.contact], ]; const [scrolled, setScrolled] = useState(false); const [mobileOpen, setMobileOpen] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 20); window.addEventListener("scroll", onScroll); return () => window.removeEventListener("scroll", onScroll); }, []); return ( <> {/* top utility bar */}
Hat: 0212 653 53 00 · Pzt–Cmt 08:00–18:00
Bahçelievler / İstanbul · Türkiye Geneli Teslimat
{["tr", "en"].map((l) => ( ))}
{mobileOpen && (
{items.map(([id, label]) => ( { e.preventDefault(); setRoute(id); setMobileOpen(false); }}> {label} ))}
)}
); } /* Footer */ function Footer({ setRoute }) { const t = window.__T; return ( ); } /* expose globals */ Object.assign(window, { Mark, Logo, PH, Fade, Arr, Header, Footer });