// Heroes — three approaches. const { useEffect, useRef, useState } = React; // ===== Hero shared bits ===== function TimeGreeting({ lang }) { const [now, setNow] = useState(new Date()); useEffect(() => { const t = setInterval(() => setNow(new Date()), 30000); return () => clearInterval(t); }, []); const h = now.getHours(); const en = h < 11 ? "Good morning" : h < 16 ? "Good afternoon" : h < 19 ? "Golden hour" : "Good evening"; const id = h < 11 ? "Selamat pagi" : h < 16 ? "Selamat siang" : h < 19 ? "Jam emas" : "Selamat malam"; const time = now.toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit' }); return (
{lang === 'id' ? id : en} · Pecatu, Bali · {time}
); } // ===== Variant 1: Full-bleed photo ===== function HeroFullBleed({ lang }) { const t = lang === 'id' ? { eyebrow: "Brunch tepi danau · Pecatu", line1: "Tempat akar", line2: "bertemu cerita.", sub: "Sebuah kafe konsep alam di tepi danau di Uluwatu. Disajikan perlahan, sejak fajar hingga senja.", cta1: "Lihat menu", cta2: "Petunjuk arah", } : { eyebrow: "Lake-side brunch · Pecatu", line1: "Where roots", line2: "connect, stories grow.", sub: "A nature-café concept tucked beside a quiet lake in Uluwatu. Slow-served from sunrise to sunset.", cta1: "View menu", cta2: "Get directions", }; return (
{t.eyebrow}

{t.line1} {t.line2}

{t.sub}

{t.cta1} → {t.cta2}
07:00 — 19:00Daily
4.7 ★220 reviews
PecatuSouth Kuta, Bali
scroll
); } // ===== Variant 2: Kinetic marquee ===== function HeroMarquee({ lang }) { const t = lang === 'id' ? { word1: "Tepi Danau", word2: "Brunch", word3: "Akar", word4: "Cerita", word5: "Uluwatu", word6: "Lambat", sub: "Sebuah kafe konsep alam — kopi diseduh perlahan, mangkuk smoothie, dan brunch ala Korea, semuanya di tepi danau yang tenang.", cta: "Lihat menu", } : { word1: "Lakeside", word2: "Brunch", word3: "Roots", word4: "Stories", word5: "Uluwatu", word6: "Slow", sub: "A nature-café concept — soulful coffee, smoothie bowls and Korean brunch trays, all by a quiet lake.", cta: "View the menu", }; const photos = [ window.__resources.coffeeLake, window.__resources.dragonfruitBowl, window.__resources.koreanTrayCoconut, window.__resources.exteriorDay, window.__resources.smoothieBowlLake, window.__resources.pastaChickenLake, ]; return (
{[0,1].map(i => (
{t.word1} {t.word2} {t.word3} {t.word4}
))}
{[...photos, ...photos].map((p, i) => (
))}
{[0,1].map(i => (
{t.word5} {t.word6} {t.word1} {t.word2}
))}

{t.sub}

{t.cta} →
); } // ===== Variant 3: Lake-immersive parallax ===== function HeroLake({ lang }) { const ref = useRef(null); const [scroll, setScroll] = useState(0); useEffect(() => { const onScroll = () => setScroll(window.scrollY); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); const t = lang === 'id' ? { line1: "Tepi danau yang tenang.", line2: "Diseduh dengan jiwa.", sub: "Brunch · Makan malam · Pecatu, Uluwatu", cta: "Lihat menu", } : { line1: "A quiet lake.", line2: "Brewed with soul.", sub: "Brunch · Dinner · Pecatu, Uluwatu", cta: "View menu", }; return (

{t.line1} {t.line2}

{t.sub}

{t.cta} →
); } window.HeroFullBleed = HeroFullBleed; window.HeroMarquee = HeroMarquee; window.HeroLake = HeroLake;