// ============================================================ // MONOGRAM — shared components // ============================================================ const { useState, useEffect, useRef, useMemo, useCallback } = React; // ---------- Reveal on scroll function useReveal() { useEffect(() => { const io = new IntersectionObserver((entries) => { entries.forEach((e) => { if (e.isIntersecting) e.target.classList.add("in"); }); }, { threshold: 0.12, rootMargin: "0px 0px -10% 0px" }); document.querySelectorAll(".reveal").forEach((el) => io.observe(el)); return () => io.disconnect(); }); } // ---------- Nav scrolled function useScrolled(threshold = 24) { const [scrolled, setScrolled] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > threshold); onScroll(); window.addEventListener("scroll", onScroll, { passive: true }); return () => window.removeEventListener("scroll", onScroll); }, [threshold]); return scrolled; } // ---------- Monogram wordmark function Wordmark({ size = "default" }) { const small = size === "small"; return (
{sub}
: null}