// Shared chrome and primitives.
const { useState, useEffect, useRef, useCallback } = React;
function useReveal() {
const ref = useRef(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
const io = new IntersectionObserver(
(entries) => {
entries.forEach((e) => {
if (e.isIntersecting) {
e.target.classList.add("in");
io.unobserve(e.target);
}
});
},
{ threshold: 0.12, rootMargin: "0px 0px -8% 0px" }
);
io.observe(el);
return () => io.disconnect();
}, []);
return ref;
}
// Bespoke wordmark — original SVG re-draw (does not reproduce client's exact lockup).
// A simple elegant typographic mark.
function Wordmark({ small = false, light = false }) {
const fs = small ? 22 : 28;
const color = light ? "var(--paper)" : "var(--ink)";
return (
Carousel
EVENTS
);
}
function Nav({ route, onRoute, onEnquire, locale, onLocale, t }) {
const [scrolled, setScrolled] = useState(false);
useEffect(() => {
const on = () => setScrolled(window.scrollY > 16);
on();
window.addEventListener("scroll", on, { passive: true });
return () => window.removeEventListener("scroll", on);
}, []);
// All current routes open with a dark image hero; nav rides light over it until scroll.
const onHero = !scrolled;
const links = [
{ k: "home", l: t.portfolio === "أعمالنا" ? "الرئيسية" : "Home" },
{ k: "weddings", l: t.weddings },
{ k: "corporate", l: t.corporate },
{ k: "social", l: t.social },
{ k: "approach", l: t.approach },
{ k: "story", l: t.story },
{ k: "accolades", l: t.accolades },
{ k: "contact", l: t.contact },
];
return (