// ===== Event placeholder emoji ===== const EVENT_EMOJI = { event_1: '🩰', event_2: '🎻', event_3: '🐱', event_4: '🌻', event_5: '🎷', event_6: '🎪', event_7: '🦢', event_8: '🎨' }; const CAT_BG = { theatre: 'bg-theatre', concerts: 'bg-concerts', exhibitions: 'bg-exhibitions', kids: 'bg-kids' }; // ===== Router ===== function getRoute() { return window.location.hash.slice(1) || '/'; } function navigate(path) { window.location.hash = path; } function router() { const route = getRoute(); const app = document.getElementById('app'); window.scrollTo(0, 0); if (route === '/') renderHomePage(app); else if (route.startsWith('/category/')) renderCategoryPage(app, route.split('/')[2]); else if (route.startsWith('/event/')) renderEventPage(app, route.split('/')[2]); else if (route.startsWith('/tickets/')) renderTicketsPage(app, route.split('/')[2]); else if (route === '/checkout') renderCheckoutPage(app); else if (route === '/payment-success') renderPaymentSuccessPage(app); else renderHomePage(app); updateActiveNav(); } function updateActiveNav() { const route = getRoute(); document.querySelectorAll('.header__nav-btn').forEach(btn => { btn.classList.remove('active'); const cat = btn.dataset.category; if (cat && route === `/category/${cat}`) btn.classList.add('active'); }); } // ===== Card Components ===== // Hero card (large, like bilet.mos.ru carousel) function heroCardHTML(event) { return `
${event.description}
Ваш заказ успешно оформлен. Билеты отправлены на указанный email.
Номер заказа: MB-${Date.now().toString().slice(-6)}