jQuery('#slick1').slick({ rows: 3, dots: false, arrows: true, infinite: true, slidesToShow: 13, slidesToScroll: 13, autoplay: true, autoplaySpeed: 2000, pauseOnHover: true, speed: 2000, cssEase:'linear' }); // Wait for the page to fully load $(document).ready(function() { function checkAnimation() { const windowHeight = $(window).height(); const scrollTop = $(window).scrollTop(); $('.hidee').each(function() { const boxTop = $(this).offset().top; const boxHeight = $(this).outerHeight(); // Check if the box is in view if (boxTop < scrollTop + windowHeight && boxTop + boxHeight > scrollTop) { $(this).addClass('animate'); } else { $(this).removeClass('animate'); } }); } $(window).on('scroll', checkAnimation); checkAnimation(); // Initial check on page load }); let lastScrollTop = 0; // Add 'active' class when the page loads window.addEventListener('DOMContentLoaded', function() { const rotateDiv = document.getElementById('rotate-div'); if (rotateDiv) { rotateDiv.classList.add('active'); } }); // Handle scroll events to add/remove 'active' class window.addEventListener('scroll', function() { const rotateDiv = document.getElementById('rotate-div'); if (rotateDiv) { const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop; if (currentScrollTop < lastScrollTop) { // Scrolling up - remove 'active' class rotateDiv.classList.remove('active'); } else if (currentScrollTop > lastScrollTop) { // Scrolling down - add 'active' class rotateDiv.classList.add('active'); } lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop; // For Mobile or negative scrolling } }); // rotate div close // time line code start const timelineContainer = document.querySelector('.timeline-container'); const timelineItems = document.querySelectorAll('.timeline-item'); const offset = 70; // Adjust the offset to control when the active class is applied function updateActiveTimeline() { let activeSet = false; timelineItems.forEach((item, index) => { const rect = item.getBoundingClientRect(); const containerRect = timelineContainer.getBoundingClientRect(); // Apply active class if item is within view, considering offset if (rect.top < containerRect.bottom - offset && rect.bottom > containerRect.top + offset && !activeSet) { timelineItems.forEach(item => item.classList.remove('active')); item.classList.add('active'); activeSet = true; } else { item.classList.remove('active'); } }); // Special case: Ensure the last item can be activated const lastItem = timelineItems[timelineItems.length - 1]; const lastItemRect = lastItem.getBoundingClientRect(); if (!activeSet && lastItemRect.top < containerRect.bottom) { timelineItems.forEach(item => item.classList.remove('active')); lastItem.classList.add('active'); } } // Initial active setting updateActiveTimeline(); // Update active timeline on scroll within the container timelineContainer.addEventListener('scroll', updateActiveTimeline); // time line code end document.addEventListener('DOMContentLoaded', function () { const scrollToTopButton = document.querySelector('.scroll-to-top'); window.addEventListener('scroll', function () { if (window.scrollY > 300) { scrollToTopButton.style.display = 'block'; } else { scrollToTopButton.style.display = 'none'; } }); scrollToTopButton.addEventListener('click', function () { window.scrollTo({ top: 0, behavior: 'smooth' }); }); }); document.addEventListener('DOMContentLoaded', function () { setTimeout(function () { const myModal = new bootstrap.Modal(document.getElementById('onLoadModal')); myModal.show(); }, 10000); // 5000 milliseconds = 5 seconds }); // document.getElementById('contactForm').addEventListener('submit', function(event) { // event.preventDefault(); // Prevent the default form submission // // Retrieve form data // var fullName = document.getElementById('fullName').value; // var email = document.getElementById('email').value; // // Display the alert with form data // // alert("Full Name: " + fullName + "\nEmail: " + email); // // Optionally close the modal after form submission // var myModal = new bootstrap.Modal(document.getElementById('onLoadModal')); // myModal.hide(); // Close modal if desired // });