Features: - Complete Luftglanz drone cleaning website - AI chat assistant integrated with OpenAI API - Expert product advice for AGO Quart and Mellerud cleaning products - Formal German language support (Sie form) - Secure PHP backend for API calls - Responsive design with mobile support - Product-specific knowledge base - Safety statements from manufacturers - Multi-page integration (index, products, services, contact) Technical components: - AI chat widget (js/ai-chat.js) - Chat styling (css/components/ai-chat.css) - Backend API (ai-chat-api.php) - Product knowledge base with detailed specifications - Demo and documentation files
46 lines
1.6 KiB
JavaScript
46 lines
1.6 KiB
JavaScript
/**
|
|
* Mobile navigation functionality
|
|
* This script handles the mobile hamburger menu behavior
|
|
*/
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Mobile navigation toggle
|
|
const mobileToggle = document.getElementById('mobileToggle');
|
|
const mainNav = document.getElementById('mainNav');
|
|
|
|
if(mobileToggle && mainNav) {
|
|
mobileToggle.addEventListener('click', function() {
|
|
mainNav.classList.toggle('active');
|
|
});
|
|
}
|
|
|
|
// Close mobile menu when a link is clicked
|
|
const mobileNavLinks = document.querySelectorAll('.main-nav a');
|
|
mobileNavLinks.forEach(link => {
|
|
link.addEventListener('click', function() {
|
|
if (window.innerWidth <= 768) {
|
|
mainNav.classList.remove('active');
|
|
}
|
|
});
|
|
});
|
|
|
|
// Close menu when clicking outside
|
|
document.addEventListener('click', function(event) {
|
|
if (window.innerWidth <= 768 &&
|
|
!event.target.closest('.main-nav') &&
|
|
!event.target.closest('.mobile-toggle') &&
|
|
mainNav.classList.contains('active')) {
|
|
mainNav.classList.remove('active');
|
|
}
|
|
});
|
|
|
|
// Ensure copyright year is 2025 on mobile
|
|
const footerText = document.querySelector('footer p[data-i18n="footer_text"]');
|
|
if (footerText) {
|
|
// Force update the copyright year to 2025 for mobile and desktop
|
|
const currentText = footerText.innerHTML;
|
|
const updatedText = currentText.replace(/© \d{4}/, '© 2025');
|
|
footerText.innerHTML = updatedText;
|
|
}
|
|
});
|