Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/laciasmara.com/public_html/duniaasmara/ |
Upload File : |
// --- Hamburger Menu --- document.addEventListener('DOMContentLoaded', function() { const menuToggle = document.querySelector('.menu-toggle'); const nav = document.querySelector('nav'); const menuIcon = document.querySelector('.menu-toggle i'); if (menuToggle && nav) { menuToggle.addEventListener('click', function(e) { e.preventDefault(); e.stopPropagation(); nav.classList.toggle('active'); menuIcon.classList.toggle('fa-bars'); menuIcon.classList.toggle('fa-times'); // Toggle body scroll if (nav.classList.contains('active')) { document.body.style.overflow = 'hidden'; } else { document.body.style.overflow = ''; } }); // Close menu when clicking outside document.addEventListener('click', function(e) { if (!nav.contains(e.target) && !menuToggle.contains(e.target)) { nav.classList.remove('active'); menuIcon.classList.remove('fa-times'); menuIcon.classList.add('fa-bars'); document.body.style.overflow = ''; } }); // Prevent menu from closing when clicking inside nav nav.addEventListener('click', function(e) { e.stopPropagation(); }); } // Mobile search functionality const searchToggle = document.querySelector('.mobile-search-toggle'); const searchOverlay = document.querySelector('.mobile-search-overlay'); const searchClose = document.querySelector('.mobile-search-close'); const searchInput = document.querySelector('.mobile-search-box input'); if (searchToggle && searchOverlay && searchClose && searchInput) { searchToggle.addEventListener('click', function(e) { e.preventDefault(); searchOverlay.classList.add('active'); searchInput.focus(); document.body.style.overflow = 'hidden'; }); searchClose.addEventListener('click', function(e) { e.preventDefault(); searchOverlay.classList.remove('active'); document.body.style.overflow = ''; }); // Close search overlay when clicking outside searchOverlay.addEventListener('click', function(e) { if (e.target === searchOverlay) { searchOverlay.classList.remove('active'); document.body.style.overflow = ''; } }); } // Handle search form submission const searchForm = document.querySelector('.mobile-search-box'); searchForm.addEventListener('submit', function(e) { e.preventDefault(); // Add your search handling logic here const searchQuery = searchInput.value; if (searchQuery.trim()) { // Perform search action console.log('Searching for:', searchQuery); } }); }); // --- Slideshow --- let slideIndex = 1; showSlides(slideIndex); // Function to display a specific slide function currentSlide(n) { showSlides(slideIndex = n); } // Main function to show slides function showSlides(n) { let i; let slides = document.getElementsByClassName("slide"); let dots = document.getElementsByClassName("dot"); if (!slides.length || !dots.length) return; // Exit if no slides/dots // Handle wrapping around if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} // Hide all slides for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } // Remove active class from all dots for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active-dot", ""); } // Display the current slide and set the corresponding dot to active slides[slideIndex-1].style.display = "flex"; // Use flex as defined in CSS dots[slideIndex-1].className += " active-dot"; } // Optional: Auto-advance slides (uncomment to enable) /* let slideInterval = setInterval(() => { plusSlides(1); }, 5000); // Change slide every 5 seconds // Function to advance slides (used by auto-advance) function plusSlides(n) { showSlides(slideIndex += n); } */