/* BinTat modern — Home */
const { Icon, Arrow, Sparkle, Reveal, Slot, Marquee, TagMarquee, PartnerMarquee, Tilt, CountUp, StoryRail, WordSplit, ScrollCue } = window;
const { useState:useSt } = React;
const CAT_ICONS = ['meat','box','tag','snow','cup','shield','leaf','store'];
const WHY_ICONS = ['box','shield','truck','tag','store','users'];
/* interactive accordion — real depot photos per category */
const ACC_IDX = [0,2,3,4,5,7];
const ACC_PHOTOS = ['assets/froid-broches.jpg','assets/sauces.jpg','assets/surgeles.jpg','assets/depot-boissons.jpg','assets/chambre-froide.jpg','assets/emballages.jpg'];
function ServicesAccordion({t}){
const h = t.home;
const [open, setOpen] = useSt(0);
const items = ACC_IDX.map(ix=>h.cats[ix]);
const active = items[open] || items[0];
const imgRef = React.useRef(null);
React.useEffect(()=>{
const el = imgRef.current;
if(el && el.animate && !(window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches)){
el.animate([
{transform:'perspective(900px) rotateY(-10deg) scale(.97)', opacity:.55},
{transform:'none', opacity:1}
],{duration:480, easing:'cubic-bezier(.16,1,.3,1)'});
}
},[open]);
return (
{items.map((c,i)=>(
))}
{active.t}
);
}
/* testimonial carousel */
function Testimonials({t}){
const h = t.home;
const list = h.testimonials;
const [i, setI] = useSt(0);
const go = (d)=> setI((i+d+list.length)%list.length);
const cur = list[i];
return (
“
{cur.q}
{list.map((_,k)=>setI(k)}>)}
);
}
/* full-bleed image banner hero */
function VideoHero({t, go, navBar}){
const secRef = React.useRef(null);
const nav = (p)=>(e)=>{ e.preventDefault(); go(p); };
const onMove = (e)=>{
const el = secRef.current;
if(!el || (window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches)) return;
const r = el.getBoundingClientRect();
el.style.setProperty('--mx', ((e.clientX-r.left)/r.width-.5).toFixed(3));
el.style.setProperty('--my', ((e.clientY-r.top)/r.height-.5).toFixed(3));
};
const h = t.home;
return (
{navBar}
{h.heroEyebrow}
{h.heroSub}
{t.lang==='en'?'They trust us — our partners':'Ils nous font confiance — nos partenaires'}
);
}
function Home({t, go, navBar}){
const h = t.home;
const nav = (p)=>(e)=>{ e.preventDefault(); go(p); };
const chapters = [
{id:'depot', label:t.lang==='en'?'The depot':'Le dépôt'},
{id:'offre', label:t.lang==='en'?'The range':"L'offre"},
{id:'confiance', label:t.lang==='en'?'Why BinTat':'Pourquoi BinTat'},
{id:'avis', label:t.lang==='en'?'They trust us':'Ils nous font confiance'},
];
return (
{/* HERO — video banner */}
{/* STATS */}
{h.stats.map((s,i)=>{
const m = s.n.match(/^([\d.,\s]+)(.*)$/);
return (
);
})}
{/* TWO — turning ideas */}
{h.twoTag}
{/* SERVICES accordion */}
{t.lang==='en'?'What we offer':'Notre offre'}
{t.lang==='en'?'Everything ':'Tout '}{t.lang==='en'?'in one place':'au même endroit'}
{h.catsSub}
{/* MARQUEE */}
{/* WHY — cards grid */}
{/* TESTIMONIALS */}
{t.lang==='en'?'Reviews':'Avis'}
{h.testiSub}
{/* TAG MARQUEE */}
{/* CTA */}
);
}
function CtaBand({t, go, title, sub}){
const nav = (p)=>(e)=>{ e.preventDefault(); go(p); };
return (
);
}
Object.assign(window, { Home, CtaBand });