// Hi-Fi B — Top components (Header, Hero, Categories, Ticker) // Reads from window.Store const { useState, useEffect, useRef } = React; function useReveal() { useEffect(() => { const obs = new IntersectionObserver((entries) => { entries.forEach((e) => { if (e.isIntersecting) e.target.classList.add('in'); }); }, { threshold: 0.12 }); document.querySelectorAll('.reveal').forEach((el) => obs.observe(el)); return () => obs.disconnect(); }, []); } function useStoreData() { const [data, setData] = useState({ settings: window.Store.getSettings(), categories: window.Store.getCategories(), products: window.Store.getProducts(), testimonials: window.Store.getTestimonials().filter((t) => t.published), differentials: window.Store.getDifferentials(), processSteps: window.Store.getProcessSteps(), instagram: window.Store.getInstagram(), }); useEffect(() => window.Store.subscribe(() => setData({ settings: window.Store.getSettings(), categories: window.Store.getCategories(), products: window.Store.getProducts(), testimonials: window.Store.getTestimonials().filter((t) => t.published), differentials: window.Store.getDifferentials(), processSteps: window.Store.getProcessSteps(), instagram: window.Store.getInstagram(), })), []); return data; } function Header() { const [scrolled, setScrolled] = useState(false); const s = window.Store.getSettings(); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 40); window.addEventListener('scroll', onScroll); return () => window.removeEventListener('scroll', onScroll); }, []); return (
Alcantara Studio 3D
{s.brand}
{s.brandSub}
Orçar
); } function Ticker() { const items = ['EDIÇÃO LIMITADA', 'ENTREGA NACIONAL', 'ORÇAMENTO GRÁTIS', 'IMPRESSÃO 3D PERSONALIZADA', 'RESPOSTA EM 2H']; const repeated = [...items, ...items, ...items, ...items]; return (
{repeated.map((it, i) => ( {it} ))}
); } function Hero() { const s = window.Store.getSettings(); const heroCopy = s.heroCopy || 'PEÇAS
únicas
EM 3D.'; const badgeText = s.heroBadge ? s.heroBadge.split('\n') : null; return (
{s.heroEdition}

{s.heroBody}

{[ { n: s.stat1Number, l: s.stat1Label }, { n: s.stat2Number, l: s.stat2Label }, { n: s.stat3Number, l: s.stat3Label }, ].map((st, i) => (
{st.n}
{st.l}
))}

{s.heroImage && hero}
FIG. 01
BUSTO
CUSTOM
{badgeText &&
{badgeText[0]}
{badgeText[1]}
}
EDIÇÃO DE 1
); } function Categories() { const cats = window.Store.getCategories().filter((c) => c.featured); const n = cats.length || 1; // Longest single word (words separated by spaces can wrap — only the longest matters) const longestWord = Math.max(...cats.map(c => Math.max(...c.label.split(' ').map(w => w.length)) )); // Scale inversely with word length and column count so every card lands on the same size const labelFontSize = `clamp(12px, ${(63 / n / longestWord).toFixed(1)}vw, 48px)`; return (
02 / Categorias em destaque

ESCOLHA
SEU TIPO.

{cats.map((c, i) => (
{c.heroImg && {c.label}}
0{i + 1} {window.Store.getProducts().filter((p) => p.category === c.id).length} peças
{c.label}
{c.sub}
Ver peças
))}
); } window.Header = Header; window.Ticker = Ticker; window.Hero = Hero; window.Categories = Categories; window.useReveal = useReveal; window.useStoreData = useStoreData;