// Gallery.jsx — Results grid + Before/After slider + Differentials let ALL_ITEMS = []; const FILTERS = ["Todos", "Design Natural", "Henna e Tintura", "Brow Lamination", "Lash Lifting"]; // Fetch dynamic data if available fetch('api.php') .then(res => res.json()) .then(data => { const results = [ ...(data.design || []), ...(data.brow || []), ...(data.henna || []) ]; const lash = data.lash || []; ALL_ITEMS = [...results, ...lash]; }) .catch(err => { console.log("Using fallback static data."); const RESULTS = [ { src: "https://imagedelivery.net/mYdfeAeRRdkIXG5w7XJhtQ/724fce1a-bbec-4f69-6dcd-324211594d00/public", label: "Design Natural" }, { src: "https://imagedelivery.net/mYdfeAeRRdkIXG5w7XJhtQ/e6091403-28a5-4e71-8834-5841bf3b6600/public", label: "Brow Lamination", span: true }, { src: "https://imagedelivery.net/mYdfeAeRRdkIXG5w7XJhtQ/1738ec87-9e58-4aff-be33-1fead70eef00/public", label: "Henna" } ]; ALL_ITEMS = RESULTS; }); /* ── Before/After Slider ─────────────────────────── */ function BeforeAfter({ before, after }) { const [pos, setPos] = React.useState(50); const containerRef = React.useRef(null); const dragging = React.useRef(false); const updatePos = React.useCallback((clientX) => { const rect = containerRef.current.getBoundingClientRect(); const x = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width)); setPos(x * 100); }, []); const onMouseDown = (e) => { dragging.current = true; updatePos(e.clientX); }; const onMouseMove = (e) => { if (dragging.current) updatePos(e.clientX); }; const onMouseUp = () => { dragging.current = false; }; const onTouchStart = (e) => { dragging.current = true; updatePos(e.touches[0].clientX); }; const onTouchMove = (e) => { if (dragging.current) updatePos(e.touches[0].clientX); }; const onTouchEnd = () => { dragging.current = false; }; React.useEffect(() => { window.addEventListener("mouseup", onMouseUp); window.addEventListener("mousemove", onMouseMove); window.addEventListener("touchend", onTouchEnd); window.addEventListener("touchmove", onTouchMove, { passive: true }); return () => { window.removeEventListener("mouseup", onMouseUp); window.removeEventListener("mousemove", onMouseMove); window.removeEventListener("touchend", onTouchEnd); window.removeEventListener("touchmove", onTouchMove); }; }, []); return (
{/* After (Background) */}
Depois
Depois
{/* Before (Clipped on top) */}
Antes
Antes
{/* Handle */}
); } /* ── Gallery ─────────────────────────────────────── */ function Gallery() { const [items, setItems] = React.useState(ALL_ITEMS); React.useEffect(() => { fetch('api.php') .then(res => res.json()) .then(data => { const results = [ ...(data.design || []), ...(data.brow || []), ...(data.henna || []) ]; const lash = data.lash || []; setItems([...results, ...lash].slice(0, 9)); // Show some items }) .catch(err => { setItems(ALL_ITEMS); }); }, []); return (
{/* Before / After */}
Transformação

Antes e depois

Arraste para ver a diferença que um design preciso faz.

); } /* ── Differentials ───────────────────────────────── */ const DIFFS = [ { title: "Atendimento cuidadoso", desc: "Cada cliente recebe atenção personalizada do início ao fim do procedimento." }, { title: "Foco total na qualidade", desc: "Resultado impecável em cada serviço, sem pressa e sem concessões." }, { title: "Design para cada rosto", desc: "Nenhum design é igual. Cada traçado é pensado para a sua fisionomia." }, { title: "Técnicas atualizadas", desc: "Constante aperfeiçoamento com as melhores técnicas do mercado." }, { title: "Ambiente acolhedor", desc: "Um espaço pensado para você se sentir bem e à vontade." }, { title: "Resultado natural", desc: "Beleza sem exagero — sobrancelhas que parecem sempre suas." }]; function Differentials() { return (
Por que a Essenza Glow

O detalhe
muda tudo.

{DIFFS.map((d, i) =>
{d.title}
{d.desc}
)}
Resultado Essenza Glow
); } Object.assign(window, { Gallery, Differentials });