import { createRoot } from 'react-dom/client' import { useEffect, useLayoutEffect, useRef, useState } from 'react' import type { CSSProperties, PointerEvent } from 'react' import { gsap } from 'gsap' import '@fontsource-variable/dm-sans' import '@fontsource-variable/fraunces' import '@fontsource/instrument-serif/latin-400.css' import '@fontsource/instrument-serif/latin-400-italic.css' import { flavors, price } from './flavors' import { RevealWords, revealWords } from './reveal-words' import { AboutSection, ClientsSection, FooterLinks, InsideSection, LocationSection, WhatsAppIcon } from './sections' import './styles.css' import './sections.css' const total = flavors.length const wrapIndex = (i: number) => ((Math.round(i) % total) + total) % total function Arrow({ left = false }: { left?: boolean }) { return } function Header() { const [scrolled, setScrolled] = useState(() => window.scrollY > 16) useEffect(() => { const update = () => setScrolled(window.scrollY > 16) update() window.addEventListener('scroll', update, { passive: true }) return () => window.removeEventListener('scroll', update) }, []) return
misù
Bauru, SP
} function BrandSection() { const section = useRef(null) const [revealed, setRevealed] = useState(false) const [selected, setSelected] = useState(null) useEffect(() => { const observer = new IntersectionObserver(([entry]) => { if (entry.isIntersecting) { setRevealed(true) observer.disconnect() } }, { threshold: .24 }) if (section.current) observer.observe(section.current) return () => observer.disconnect() }, []) return

Misù

{flavors.map((d,i) => )}
} function DishOrbitCarousel() { const [index, setIndex] = useState(0) const [insideIndex, setInsideIndex] = useState(0) const current = useRef(0) const direction = useRef(1) const previous = useRef(-1) const hero = useRef(null) const timeline = useRef(null) const startTouch = useRef<{x: number; y: number} | null>(null) const flavor = flavors[index] function select(next: number, dir?: number) { next = wrapIndex(next) if (current.current === next) return const forward = wrapIndex(next - current.current) direction.current = dir ?? (forward <= total - forward ? 1 : -1) current.current = next setIndex(next) } useLayoutEffect(() => { const slides = hero.current!.querySelectorAll('.pack') const words = hero.current!.querySelectorAll('.copy') const wheels = hero.current!.querySelectorAll('.wheel') const outgoing = previous.current previous.current = index timeline.current?.progress(1).kill() const tl = gsap.timeline() timeline.current = tl const revealStart = outgoing < 0 ? 0 : .32 const revealGroups = ['em', 'strong', '.flavor-subtitle', '.flavor-description', '.flavor-prices'] revealGroups.forEach((selector, group) => { revealWords(tl, words[index].querySelectorAll(selector + ' .reveal-word'), revealStart + group * .19) }) tl.fromTo(hero.current!.querySelector('.hero-actions'), { y: 12, opacity: 0 }, { y: 0, opacity: 1, duration: .55, ease: 'power3.out', clearProps: 'transform,opacity' }, revealStart + .95) tl.fromTo(hero.current!.querySelector('.menu-extra'), { y: 8, opacity: 0, filter: 'blur(3px)' }, { y: 0, opacity: 1, filter: 'blur(0px)', duration: .5, ease: 'power3.out', clearProps: 'transform,opacity,filter' }, revealStart + 1.15) if (outgoing < 0) { slides.forEach((el, i) => gsap.set([el, words[i]], { autoAlpha: i === index ? 1 : 0, rotation: 0 })) return } const dir = direction.current tl.to(slides[outgoing], { rotation: 50 * dir, duration: .6, ease: 'power2.in' }, 0) .set(slides[outgoing], { autoAlpha: 0, rotation: 0 }, .6) .fromTo(slides[index], { autoAlpha: 1, rotation: -50 * dir }, { rotation: 0, duration: .95, ease: 'power3.out' }, .28) .fromTo(wheels[outgoing], { rotation: 0 }, { rotation: 55 * dir, duration: .75, ease: 'power2.in' }, 0) .fromTo(wheels[index], { rotation: -75 * dir }, { rotation: 0, duration: 1, ease: 'power3.out' }, 0) .to(words[outgoing], { autoAlpha: 0, duration: .24 }, 0) .set(words[index], { autoAlpha: 1 }, .26) }, [index]) useEffect(() => () => { timeline.current?.kill() }, []) useEffect(() => { const timer = window.setInterval(() => { if (!document.hidden) select(current.current + 1) }, 7000) return () => window.clearInterval(timer) }, [index]) useEffect(() => { const followHash = () => { if (location.hash === '#cardapio' || location.hash === '#sabores') window.scrollTo(0, 0) } followHash() window.addEventListener('hashchange', followHash) return () => window.removeEventListener('hashchange', followHash) }, []) function swipeEnd(e: PointerEvent) { const start = startTouch.current startTouch.current = null if (!start) return const dx = e.clientX - start.x if (Math.abs(dx) > 40 && Math.abs(dx) > Math.abs(e.clientY - start.y) * 1.4) select(index + (dx < 0 ? 1 : -1)) } return <>
{ if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') { e.preventDefault() const dir = e.key === 'ArrowRight' ? 1 : -1 select(index + dir) } }}>
} createRoot(document.getElementById('root')!).render()