/* ============================================================= * Home page — Hero, Impact Bar, Problem (ripple+graph), Programs * grid, Forge goal bar, testimonial, events teaser, donate CTA * ============================================================= */ function HeroSection() { const [currentSlide, setCurrentSlide] = useState(0); // Phase 3.7: fetch editable content from Supabase, fall back to defaults const [cmsHero, setCmsHero] = useState(null); useEffect(() => { if (window.cms && typeof window.cms.getSiteContent === "function") { window.cms.getSiteContent("home").then((c) => setCmsHero((c && c.hero) || {})); } else { setCmsHero({}); } }, []); const defaultSlides = [ "uploads/hero section slide show7.jpg", "uploads/hero section slide show8.jpg", "uploads/hero section slide show.jpg", "uploads/hero section slide show2.jpg", "uploads/hero section slide show 2.jpg", "uploads/Fathers Arise-71_Beautify.jpg"]; // If OS published a hero image, use it as a single slide; otherwise default slideshow const slides = cmsHero && cmsHero.image ? [cmsHero.image] : defaultSlides; const headlineText = cmsHero && cmsHero.headline ? cmsHero.headline : "Every Generation Needs\nFathers Who Stay."; const subheadText = cmsHero && cmsHero.subhead ? cmsHero.subhead : "We build the men the world is waiting for — from boyhood to fatherhood to legacy."; const ctaLabel = cmsHero && cmsHero.cta_label ? cmsHero.cta_label : "Join the Movement"; const ctaLink = cmsHero && cmsHero.cta_link ? cmsHero.cta_link : "get-involved"; const align = (cmsHero && cmsHero.align) || "left"; const alignClass = align === "center" ? "text-center mx-auto" : align === "right" ? "text-right ml-auto" : "text-left"; useEffect(() => { if (slides.length <= 1) return; const timer = setInterval(() => { setCurrentSlide((prev) => (prev + 1) % slides.length); }, 5000); return () => clearInterval(timer); }, [slides.length]); return (
{/* Slideshow background */}
{slides.map((img, i) =>
)}
Fathers Arise

{headlineText.includes("\n") ? ( <> {headlineText.split("\n")[0]}
{headlineText.split("\n").slice(1).join("\n")} ) : ( {headlineText} )}

{subheadText}

{/* Slide indicators */}
{slides.map((_, i) =>
); } function MissionSection() { return (
Our Mission

Fathers Arise exists to restore men to their God-given role as present, responsible, and spiritually grounded fathers who lead their families and communities with integrity.

); } function ImpactBar() { const [data, setData] = useState(null); useEffect(() => {window.cms.getImpactCounters().then(setData);}, []); const items = [ { icon: "village", value: data?.schoolsReached ?? 42, suffix: "+", label: "Schools Reached" }, { icon: "father", value: data?.youngMenTrained ?? 1240, suffix: "+", label: "Young Men Trained" }, { icon: "forge", value: data?.fathersEngaged ?? 547, suffix: "+", label: "Fathers Engaged" }, { icon: "globe", value: data?.activeForgeGroups ?? 82, suffix: "", label: "Forge Groups Active" }]; return (
{items.map((it, i) =>
{it.label}
)}
); } function ImpactIcon({ name }) { const p = { width: 22, height: 22, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }; switch (name) { case "father":return ; case "forge":return ; case "village":return ; case "globe":return ; default:return null; } } /* ----- Problem section: crisis stats ----- */ function ProblemSection() { return (

The Crisis We Cannot Ignore

"Most fatherhood programs try to fix broken men.
We build a brotherhood that makes fathers want to stay."

); } function CrisisCard({ stat, desc }) { return (
{stat}

{desc}

); } /* ----- Programs grid ----- */ function ProgramsGrid() { const programs = [ { slug: "be-a-man", title: "Be a Man", tag: "Foundations", tone: "warm", desc: "A 12-week curriculum that confronts the lies a Ugandan boy inherits and rebuilds him into a steady, present father.", bullets: ["Identity & calling", "Provision without absence", "Repair & forgiveness"], icon: "shield", image: "uploads/be a man card.webp" }, { slug: "nurturing-bonds", title: "Nurturing Bonds", tag: "Father + Child", tone: "sky", desc: "Practical rhythms, language and play — taught in Forge groups — that rebuild connection between fathers and their children.", bullets: ["Bedtime liturgies", "Father-child days", "Listening labs"], icon: "heart", image: "uploads/TRG_Father_sBreakfast125.jpg" }, { slug: "mobile-kanaabe", title: "Mobile Kanaabe", tag: "Outreach", tone: "navy", desc: "A travelling outreach — truck, tent, teaching team — bringing fatherhood teaching to villages without a Forge.", bullets: ["Three-day camps", "Free family clinics", "On-ramp to a Forge"], icon: "truck", image: "uploads/mobile kanabe card (2).png" }]; return (
Explore all programs
{programs.map((p) => )}
); } function ProgramCard({ slug, title, tag, tone, desc, bullets, icon, image }) { return (
{image ? {title} : }
{tag}

{title}

{desc}

Learn more
); } function ProgramIcon({ name }) { const p = { width: 22, height: 22, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round" }; switch (name) { case "shield":return ; case "heart":return ; case "truck":return ; default:return null; } } /* ----- Forge Goal Bar ----- */ function ForgeGoalBar() { const [goal, setGoal] = useState({ current: 82, target: 1000 }); useEffect(() => {window.cms.getForgeGoal().then(setGoal);}, []); const [ref, inView] = useInView(); const pct = Math.min(100, goal.current / goal.target * 100); return (
The Forge

/ {goal.target.toLocaleString()}

Forge groups planted toward our goal of 1,000 across Uganda. Every group is twelve men, weekly, for life.

{pct.toFixed(1)}%
of national goal reached
{/* milestone ticks */}
{[0, 250, 500, 750, 1000].map((m) => {m} )}
{/* current marker */}
); } /* ----- Testimonial ----- */ function TestimonialBlock() { const testimonials = [ { quote: "The Forge gave me brothers who would not let me drift. My children have their father back, and my wife has her husband.", author: "Joseph K.", where: "Forge Busega, Kampala", img: "uploads/testimonial.jpg" }, { quote: "I came thinking I was already a good father. I left understanding I had been a good provider — and a stranger.", author: "Patrick O.", where: "Forge Lira", img: "uploads/testimonial2.jpg" }]; const [i, setI] = useState(0); useEffect(() => { const id = setInterval(() => setI((x) => (x + 1) % testimonials.length), 8000); return () => clearInterval(id); }, []); const t = testimonials[i]; return (
{t.author}

"{t.quote}"

{t.author}
{t.where}
{testimonials.map((_, k) =>
); } /* ----- Events teaser ----- */ function EventsTeaser() { const [events, setEvents] = useState([]); useEffect(() => {window.cms.getEvents().then((e) => setEvents(e.slice(0, 3)));}, []); return (
All events
{events.map((e, idx) => )}
); } function EventCard({ event, featured }) { const date = new Date(event.date); const month = date.toLocaleString("en", { month: "short" }).toUpperCase(); const day = date.getDate(); return (
{event.image ? {event.title} : }
{month}
{day}
{event.type}

{event.title}

{event.location}
{event.summary.slice(0, 60)}…
); } /* ----- Donate CTA ----- */ function DonateCTA() { return (
Restore A Father

USh 30,000 puts one father in a Forge group for a month.

Curriculum, transport, a meal, and the brotherhood that walks him through. Your monthly gift compounds — for him, for his children, for the village he leads tomorrow.

); } function TwoPillars() { return (
Be A Man
Pillar One

Be A Man (B-E-A-M-A-N)

Raising a generation of men who know who they are before the world tells them who to be. Through school clubs, outreaches, retreats, and mentorship.

Discover Be A Man
Nurturing Bonds
Pillar Two

Nurturing Bonds

Healing the wounds that fathers carry, so they stop passing them to their children. Through Forge groups, curricula, and crisis support.

Discover Nurturing Bonds
); } function FeaturedStory() { return (
Stories of Transformation

“The Forge gave me brothers who would not let me drift. My children have their father back, and my wife has her husband.”

— Joseph K., Kampala
); } function MobileKanaabeCallout() { return (
Mobile Kanaabe
Economic Empowerment

Mobile Kanaabe

Economic empowerment for young men who need more than words — they need work. We link character development with income-generating skills.

Learn More
); } function CycleEndsCTA() { return (

The cycle of fatherlessness ends with you.

Whether you are a young man looking for direction, a father seeking to heal, or a partner wanting to invest — there is a place for you.

); } function HomePage() { return (
); } window.HomePage = HomePage;