'use client'; import { useRef, useState, useEffect } from 'react'; import { motion } from 'framer-motion'; import { usePrefersReducedMotion } from '@/lib/motion'; import { BARRAS_SIMBOLO } from '@/lib/simbolo'; // The manual's own description of the ≡ symbol, made literal: "las líneas van // de muchas/desordenadas (complejidad) a pocas/alineadas (claridad)". Five // uneven bars resolve, once in view, into the three clean aligned bars of the // official icon (see app/icon.svg) — decorative, one-shot, never loops. const FINAL = BARRAS_SIMBOLO; const BARS = [ { from: { x: 6, y: 9, width: 22, height: 6, opacity: 0.9 }, to: FINAL[0] }, { from: { x: 36, y: 15, width: 16, height: 5, opacity: 0.45 }, to: { x: 44, y: 17, width: 8, height: 5, opacity: 0 } }, { from: { x: 16, y: 25, width: 30, height: 7, opacity: 0.9 }, to: FINAL[1] }, { from: { x: 8, y: 37, width: 14, height: 5, opacity: 0.45 }, to: { x: 12, y: 39, width: 8, height: 5, opacity: 0 } }, { from: { x: 20, y: 45, width: 26, height: 6, opacity: 0.9 }, to: FINAL[2] }, ]; export function SimboloTresLineas({ className = '' }: { className?: string }) { const reduced = usePrefersReducedMotion(); const ref = useRef(null); const [inView, setInView] = useState(false); useEffect(() => { const el = ref.current; if (!el || reduced) return; const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { setInView(true); observer.unobserve(el); } }, { threshold: 0.4 }, ); observer.observe(el); return () => observer.disconnect(); }, [reduced]); return ( ); }