// Translation dictionary const translations = { en: { title: "M.e.B - Punk Rock Revolution", tagline: "Breaking walls since 2012", band: "The Band", aboutText: "M.e.B formed in a basement in 2012 when four angry teenagers decided the world needed more noise. Since then, we've been tearing up stages across the country with our raw energy and unapologetic sound. We don't do pretty - we do loud, fast, and in your face.", music: "Our Noise", shows: "Live & Loud", pastShows: "Past Shows", upcomingShows: "Upcoming Shows", contact: "Join The Riot", social: "Follow The Chaos", contactForm: "Book Us / Contact", tickets: "Get Tickets", listen: "Listen", send: "Send", language: "Français" }, fr: { title: "M.e.B - Révolution Punk Rock", tagline: "On casse les murs depuis 2012", band: "Le Groupe", aboutText: "M.e.B s'est formé dans un sous-sol en 2012 lorsque quatre adolescents en colère ont décidé que le monde avait besoin de plus de bruit. Depuis, nous déchirons les scènes à travers le pays avec notre énergie brute et notre son sans compromis. Nous ne faisons pas dans le joli - nous faisons dans le bruyant, rapide et agressif.", music: "Notre Son", shows: "En Concert", pastShows: "Concerts Passés", upcomingShows: "Prochains Concerts", contact: "Rejoignez l'Émeute", social: "Suivez le Chaos", contactForm: "Réservation / Contact", tickets: "Billets", listen: "Écouter", send: "Envoyer", language: "English" } }; let currentLanguage = 'en'; // Function to update page content function updateContent() { const lang = translations[currentLanguage]; document.title = lang.title; // Update text elements document.querySelectorAll('[data-translate]').forEach(el => { const key = el.getAttribute('data-translate'); el.textContent = lang[key]; }); } // Initialize feather icons and language document.addEventListener('DOMContentLoaded', function() { feather.replace(); // Language toggle button const langBtn = document.createElement('button'); langBtn.className = 'px-4 py-2 border border-white rounded-md font-bold uppercase text-sm ml-4 hover:bg-white hover:text-black transition-colors'; langBtn.setAttribute('data-translate', 'language'); langBtn.addEventListener('click', () => { currentLanguage = currentLanguage === 'en' ? 'fr' : 'en'; updateContent(); feather.replace(); }); document.querySelector('nav').appendChild(langBtn); updateContent(); // Smooth scrolling for anchor links (keep existing code) document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); // Add active class to current section in navbar const sections = document.querySelectorAll('section'); const navLinks = document.querySelectorAll('nav a'); window.addEventListener('scroll', () => { let current = ''; sections.forEach(section => { const sectionTop = section.offsetTop; const sectionHeight = section.clientHeight; if (pageYOffset >= (sectionTop - 300)) { current = section.getAttribute('id'); } }); navLinks.forEach(link => { link.classList.remove('active'); if (link.getAttribute('href').includes(current)) { link.classList.add('active'); } }); }); });