inputField('Phone number', 'tel', async (phone)=>{ lead.phone = phone; await botMsg(`Perfect 🙏 Our property expert will call you shortly at
${esc(phone)}.`, 450); await botMsg("Prefer to chat right now?", 400); finalActions(); }); }); } function finalActions(){ actions.innerHTML=''; const waText = encodeURIComponent(`Hi, I'm ${lead.name||''}. I'm interested in Svadha Mackenna's (${lead.phone||''}).`); const wrap = el(`
`); actions.appendChild(wrap); safeLucide(); } async function startFlow(){ await botMsg("Hi there! 👋", 250); await botMsg("Welcome to
Svadha Mackenna’s. I’m your property expert — how can I help you today?", 600); menu(); }})(); /* ---------------- MOBILE MENU ---------------- */(function(){ const btn = document.getElementById('menu-btn'); const menu = document.getElementById('mobile-menu'); const closeBtn = document.getElementById('menu-close'); const logo = document.getElementById('menu-logo'); if(!btn || !menu) return; if(logo && navLogo) logo.src = navLogo.src; // reuse embedded logo, no duplication const open = () => { menu.classList.add('opacity-100','pointer-events-auto'); menu.classList.remove('opacity-0','pointer-events-none'); btn.setAttribute('aria-expanded','true'); document.body.style.overflow='hidden'; }; const close = () => { menu.classList.remove('opacity-100','pointer-events-auto'); menu.classList.add('opacity-0','pointer-events-none'); btn.setAttribute('aria-expanded','false'); document.body.style.overflow=''; }; btn.addEventListener('click', open); if(closeBtn) closeBtn.addEventListener('click', close); menu.querySelectorAll('.menu-link').forEach(a=>a.addEventListener('click', close)); document.addEventListener('keydown', e=>{ if(e.key==='Escape' && menu.classList.contains('opacity-100')) close(); });})(); /* ---------------- SPLASH ---------------- */(function(){ const splash = document.getElementById('splash'); const vid = document.getElementById('splash-video'); let done = false; const hide = () => { if(done) return; done = true; splash.classList.add('hide'); }; if(vid){ vid.addEventListener('ended', hide); vid.addEventListener('error', hide); // try to autoplay; if blocked, hide shortly after const play = vid.play(); if(play && play.catch) play.catch(()=>setTimeout(hide, 1500)); } // safety fallback in case 'ended' never fires setTimeout(hide, 5000);})();