/* ZOOM PARALLAX — "Quiénes somos". Adapted from the framer-motion zoom-parallax pattern using native scroll and CSS transforms. As the user scrolls past a 300vh container, 7 images zoom outward at different rates from a central tile, revealing context layered around. We use IntersectionObserver + scroll listener to drive per-image scale. Lightweight, no external libs. */ const ZoomParallax = ({ images, t, lang = 'es', setActiveProduct }) => { const containerRef = React.useRef(null); const [progress, setProgress] = React.useState(0); React.useEffect(() => { const onScroll = () => { if (!containerRef.current) return; const rect = containerRef.current.getBoundingClientRect(); const total = rect.height - window.innerHeight; const scrolled = -rect.top; const p = Math.max(0, Math.min(1, scrolled / total)); setProgress(p); }; onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); // Same scale curves as original component const scales = [4, 5, 6, 5, 6, 8, 9]; // Per-index positioning (mirrors framer version) const positions = [ { top: '0', left: '0', width: '25vw', height: '25vh' }, // center default { top: '-30vh', left: '5vw', width: '35vw', height: '30vh' }, { top: '-10vh', left: '-25vw', width: '20vw', height: '45vh' }, { top: '0', left: '27.5vw', width: '25vw', height: '25vh' }, { top: '27.5vh', left: '5vw', width: '20vw', height: '25vh' }, { top: '27.5vh', left: '-22.5vw', width: '30vw', height: '25vh' }, { top: '22.5vh', left: '25vw', width: '15vw', height: '15vh' }, ]; return (
{/* Intro panel */}
{t('— 01 / Quiénes somos', '— 01 / Who we are')}

{t('Más de tres décadas haciéndolo todo en metal.', '30+ years doing everything in metal.')}

{t( 'AceroLab es una planta de fabricación metálica en Tlalnepantla, Estado de México, operando desde 1992. Trabajamos B2B, B2C y gobierno: cadenas de restaurantes, retail, despachos de arquitectura, operadores de espacio público y proyectos residenciales premium. Si tiene metal, lo hacemos. Hemos fabricado para Telmex, Chili\'s, Cheesecake Factory, Toks y el Gobierno de la Ciudad de México, entre otros. Visitas a planta bienvenidas.', "AceroLab is a metal fabrication plant in Tlalnepantla, Estado de México, operating since 1992. We work B2B, B2C and government: restaurant chains, retail, architecture firms, public-space operators and premium residential. If it has metal, we make it. We have built for Telmex, Chili's, Cheesecake Factory, Toks and the Mexico City Government, among others. Plant visits welcome." )}

{t('Desplaza ↓ ', 'Scroll ↓ ')} {t('para conocer la planta', 'to meet the plant')}

{/* Parallax stage — 300vh tall */}
{images.map((img, idx) => { const scale = 1 + (scales[idx % scales.length] - 1) * progress; const pos = positions[idx]; const src = typeof img === 'string' ? img : img.src; const data = window.productData?.[src]; const pick = (field) => (typeof field === 'string' ? field : (field && (field[lang] || field.es)) || ''); const isCentral = idx === 0; return (
setActiveProduct(src) : undefined} > {data {/* Overlay info on the central image */} {isCentral && (
{data ? `${pick(data.category).toUpperCase()} · ${pick(data.title)}` : 'AL · CDMX · 19.4326°N'} {data?.measures || 'REC · 30Y'}
)}
); })} {/* Caption that fades as you scroll */}
{t('PLANTA · TLALNEPANTLA · EDOMEX', 'PLANT · TLALNEPANTLA · EDOMEX')}
{/* Outro stats — appears after the zoom */}
{[ { k: 'B2B', v: t('Exclusivamente', 'Exclusively') }, { k: 'EDOMEX', v: t('Planta propia', 'Own plant') }, { k: 'T304/T316', v: t('Inox calidad alimenticia', 'Food-grade stainless') }, { k: '8 procesos', v: t('Bajo un mismo techo', 'Under one roof') }, ].map((s, i) => (
{s.k}
{s.v}
))}
); }; window.ZoomParallax = ZoomParallax;