// Set different background images for different screen sizes function setBodyBackground() { const body = document.querySelector('body'); const mobileBg = 'url("assets/background2.jpg") no-repeat center center/cover'; const tabletBg = 'url("assets/background1.jpg") no-repeat center center/cover'; const screenWidth = window.innerWidth; if (screenWidth < 768) { body.style.background = mobileBg; location.replace('v/m/index.html'); } else if (screenWidth >= 768 && screenWidth < 992) { body.style.background = tabletBg; } else { body.style.background = 'url("assets/bgmain.gif") no-repeat center center/cover'; // Reset background for desktop body.style.transform = ''; // Reset rotation for desktop } } // Call the function initially and on window resize setBodyBackground(); window.addEventListener('resize', setBodyBackground); // Navbar Toggle const burger = document.querySelector('.burger'); const navLinks = document.querySelector('.nav-links'); const navLinksList = document.querySelectorAll('.nav-links li'); burger.addEventListener('click', () => { navLinks.classList.toggle('active'); burger.classList.toggle('active'); // Close navLinks when a link is clicked navLinksList.forEach((link) => { link.addEventListener('click', () => { navLinks.classList.remove('active'); burger.classList.remove('active'); }); }); }); // Chatbot Window const chatbotBubble = document.querySelector('.chatbot-bubble'); const chatbotWindow = document.querySelector('.chatbot-window'); const chatbotCloseBtn = document.querySelector('.chatbot-close'); chatbotCloseBtn.style.display = 'none'; chatbotBubble.addEventListener('click', () => { chatbotWindow.style.display = 'block'; chatbotWindow.style.animation = 'sasa 0.5s'; chatbotBubble.style.display = 'none'; setTimeout(() => { chatbotCloseBtn.style.display = 'block'; }, 600); }); chatbotCloseBtn.addEventListener('click', () => { chatbotWindow.style.animation = 'asas 0.5s'; chatbotBubble.style.display = 'block'; chatbotCloseBtn.style.display = 'none'; setTimeout(() => { chatbotWindow.style.display = 'none'; }, 500); });