// Componentes UI compartilhados
const FLAGS = {
us: { stripes: ['#bf0a30', '#ffffff'], canton: '#002868' },
br: { bg: '#009c3b', diamond: '#ffdf00', circle: '#002776' },
pt: { left: '#046a38', right: '#da291c' }
};
function Flag({ country, className }) {
const f = FLAGS[country];
if (country === 'us') {
return (
);
}
if (country === 'br') {
return (
);
}
if (country === 'pt') {
return (
);
}
return null;
}
function MiniFlag({ country }) {
return ;
}
function Nav({ lang, setLang, onDonate }) {
const [scrolled, setScrolled] = React.useState(false);
const [projOpen, setProjOpen] = React.useState(false);
const [menuOpen, setMenuOpen] = React.useState(false);
const [active, setActive] = React.useState('sobre');
const projRef = React.useRef(null);
React.useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 8);
window.addEventListener('scroll', onScroll);
return () => window.removeEventListener('scroll', onScroll);
}, []);
React.useEffect(() => {
const onClick = (e) => {if (projRef.current && !projRef.current.contains(e.target)) setProjOpen(false);};
document.addEventListener('mousedown', onClick);
return () => document.removeEventListener('mousedown', onClick);
}, []);
// Scroll-spy: track active section
React.useEffect(() => {
const sectionIds = ['sobre', 'projetos', 'equipe'];
const els = sectionIds.map((id) => document.getElementById(id)).filter(Boolean);
if (!els.length) return;
const io = new IntersectionObserver(
(entries) => {
entries.forEach((e) => { if (e.isIntersecting) setActive(e.target.id); });
},
{ rootMargin: '-40% 0px -55% 0px', threshold: 0 }
);
els.forEach((el) => io.observe(el));
return () => io.disconnect();
}, []);
const clickNav = (id) => () => setActive(id);
const t = lang === 'pt' ?
{ about: 'Início', projects: 'Projetos', team: 'Equipe', transp: 'Transparência', partner: 'Seja parceiro', all: 'Ver todos os projetos' } :
{ about: 'Home', projects: 'Programs', team: 'Team', transp: 'Transparency', partner: 'Partner with us', all: 'See all programs' };
const { PROJECTS } = window.SC_DATA;
return (
setLang(lang === 'pt' ? 'en' : 'pt')}
title="Alternar idioma">
{lang === 'pt' ? 'PT · BR' : 'EN · US'}
{lang === 'pt' ? 'Doe agora' : 'Donate'}
{lang === 'pt' ? 'Doe' : 'Donate'}
→
setMenuOpen((o) => !o)}
aria-label="Menu">
{menuOpen &&
}
);
}
const LOCATIONS = [
{ c: 'br', city: 'Minas Gerais', region: 'Brasil' },
{ c: 'br', city: 'Amapá', region: 'Brasil' },
{ c: 'br', city: 'São Paulo', region: 'Brasil' },
{ c: 'br', city: 'Paraíba', region: 'Brasil' },
{ c: 'pt', city: 'Albufeira', region: 'Algarve, Portugal' },
{ c: 'pt', city: 'Quarteira', region: 'Algarve, Portugal' },
{ c: 'us', city: 'Orlando', region: 'Flórida, USA' },
{ c: 'us', city: 'Deerfield Beach', region: 'Flórida, USA' }];
function LocationCarousel({ lang }) {
const [idx, setIdx] = React.useState(0);
const [paused, setPaused] = React.useState(false);
React.useEffect(() => {
if (paused) return;
const id = setInterval(() => setIdx((i) => (i + 1) % LOCATIONS.length), 2400);
return () => clearInterval(id);
}, [paused]);
const cur = LOCATIONS[idx];
return (
setPaused(true)}
onMouseLeave={() => setPaused(false)}>
{lang === 'pt' ? 'Onde estamos' : 'Where we are'}
{cur.city}
{cur.region}
{cur.c === 'br' ? (lang === 'pt' ? 'Núcleo brasileiro' : 'Brazilian hub')
: cur.c === 'pt' ? (lang === 'pt' ? 'Núcleo europeu' : 'Portuguese hub')
: (lang === 'pt' ? 'Núcleo americano' : 'American hub')}
{LOCATIONS.map((_, i) =>
setIdx(i)}
aria-label={'Local ' + (i + 1)} />
)}
);
}
const HERO_PORTRAITS = [
{ tone: '#8E3544', x: '8%', y: '12%', size: 220, delay: 0, label: 'Macapá' },
{ tone: '#a85567', x: '72%', y: '6%', size: 180, delay: 0.5, label: 'Albufeira' },
{ tone: '#6b2433', x: '85%', y: '52%', size: 240, delay: 1.0, label: 'Florida' },
{ tone: '#c27e8a', x: '2%', y: '58%', size: 170, delay: 1.5, label: 'São Paulo' },
{ tone: '#5a3a40', x: '40%', y: '78%', size: 150, delay: 2.0, label: 'Quarteira' }];
function HeroPortraits() {
const [idx, setIdx] = React.useState(0);
const slides = [
window.__r('hero1', 'hero-1.jpg'),
window.__r('hero2', 'hero-2.jpg'),
window.__r('hero3', 'hero-3.jpg'),
window.__r('hero4', 'hero-4.jpg'),
window.__r('hero5', 'hero-5.jpg'),
];
React.useEffect(() => {
const id = setInterval(() => setIdx((i) => (i + 1) % slides.length), 5500);
return () => clearInterval(id);
}, []);
return (
{slides.map((src, i) =>
)}
{slides.map((_, i) =>
setIdx(i)}
aria-label={'Slide ' + (i + 1)} />
)}
);
}
function Hero({ lang, onDonate }) {
const t = lang === 'pt' ? {
eyebrow: 'Resultados que transformam pessoas',
titleA: 'Apoiamos projetos que',
titleEm: 'transformam',
titleB: 'vidas.',
sub: 'A Support Center Café com Mulheres Corp é uma organização sem fins lucrativos que desenvolve e apoia projetos estruturados para fortalecer comunidades, impulsionar o empreendedorismo e promover transformação social, com atuação nacional e internacional.',
cta1: 'Seja parceiro',
cta2: 'Doar agora',
live: 'Apoie projetos que transformam vidas. Seja um parceiro.'
} : {
eyebrow: 'Results that transform lives',
titleA: 'Supporting initiatives that',
titleEm: 'transform',
titleB: 'lives.',
sub: 'Support Center Café com Mulheres Corp is a nonprofit organization that develops and supports structured initiatives to strengthen communities, foster entrepreneurship, and promote social transformation at both national and international levels.',
cta1: 'Partner with us',
cta2: 'Donate now',
live: 'Support programs that transform lives. Partner with us.'
};
return (
{t.eyebrow}
{t.titleA} {t.titleEm} {t.titleB}
{t.sub}
);
}
function Metrics({ lang }) {
const { METRICS } = window.SC_DATA;
return (
{METRICS.map((m, i) =>
{lang === 'en' && m.numEn ?
m.numEn :
+ {m.num} }
{m.label[lang]}
{m.loc[lang]}
)}
);
}
function NewsTicker({ lang }) {
const items = lang === 'pt' ?
['Coragem', 'Independência', 'Acolhimento', 'Preparação', 'Conexão', 'Cursos', 'Workshops', 'Palestras', 'Mentoria', 'Networking', 'Transformação', 'Propósito'] :
['Courage', 'Independence', 'Welcoming', 'Preparation', 'Connection', 'Courses', 'Workshops', 'Talks', 'Mentorship', 'Networking', 'Transformation', 'Purpose'];
return (
{[...items, ...items].map((it, i) => {it} )}
);
}
function projectImageSrc(filename) {
if (!filename) return '';
if (filename === 'elo-marias.png' && window.__r) return window.__r('eloMarias', filename);
if (window.__rsrc) return window.__rsrc(filename);
return filename;
}
function projectPageHref(id) {
const site = window.SC_SITE || {};
if (typeof site.projectHref === 'function') return site.projectHref(id);
const item = (site.projects || []).find((p) => p.href && p.href.indexOf('id=' + id) !== -1);
return item ? item.href : 'Projeto.html?id=' + encodeURIComponent(id) + '#' + encodeURIComponent(id);
}
function ProjectVisual({ proj, lang }) {
const foot = (
support center · café com mulheres
{proj.label}
);
if (proj.visualMontage && proj.visualPhotos && proj.visualPhotos.length) {
const tiles = proj.visualPhotos.map((item, i) => {
const src = typeof item === 'string' ? item : item.src;
const pos = typeof item === 'string' ? 'center' : (item.pos || 'center');
return (
);
});
return (
{tiles}
{proj.visualLogo &&
}
{foot}
);
}
if (proj.image) {
const isCard = !!proj.cardImage;
return (
{!isCard &&
}
{!isCard &&
support center · café com mulheres
{proj.label}
}
);
}
return (
FOTO · {proj.label.toUpperCase()}
{proj.num} / 04
{proj.visualNum}{proj.visualSmall[lang]}
support center · café com mulheres
{proj.label}
);
}
function Projects({ lang }) {
const { PROJECTS } = window.SC_DATA;
const [active, setActive] = React.useState(PROJECTS[0].id);
const proj = PROJECTS.find((p) => p.id === active);
const t = lang === 'pt' ?
{ eyebrow: 'Quatro frentes, um propósito', title: 'Nossos', titleEm: 'projetos', lead: 'Iniciativas estruturadas que se complementam, do acolhimento emocional à construção de patrimônio. Cada uma com formato próprio, presencial e online.', where: 'Atuação', learn: 'Conhecer o projeto' } :
{ eyebrow: 'Four fronts, one purpose', title: 'Our', titleEm: 'programs', lead: 'Structured initiatives that complement each other, ranging from emotional support to wealth building. All programs are available in both in-person and online formats.', where: 'Operating in', learn: 'Learn more' };
return (
{t.eyebrow}
{t.title} {t.titleEm}
{t.lead}
{PROJECTS.map((p) =>
setActive(p.id)}>
{p.logo &&
}
{p.label}
)}
{typeof proj.tag === 'object' ? (proj.tag[lang] || proj.tag.pt) : proj.tag}
{proj.title[lang]} {proj.titleEm[lang]}
{proj.desc[lang]}
{proj.items[lang].map((it, i) => {it} )}
{t.where}
{proj.where.map((c) =>
{c === 'us' ? (lang === 'pt' ? 'EUA' : 'USA') : c === 'br' ? (lang === 'pt' ? 'Brasil' : 'Brazil') : 'Portugal'}
)}
{t.learn} →
);
}
window.SC_UI = { Nav, Hero, Metrics, NewsTicker, Projects, Flag, MiniFlag };