1/** 2* Template Name: Logis 3* Template URL: https://bootstrapmade.com/logis-bootstrap-logistics-website-template/ 4* Updated: Mar 17 2024 with Bootstrap v5.3.3 5* Author: BootstrapMade.com 6* License: https://bootstrapmade.com/license/ 7*/ 8 9document.addEventListener('DOMContentLoaded', () => { 10 "use strict"; 11 12 /** 13 * Preloader 14 */ 15 const preloader = document.querySelector('#preloader'); 16 if (preloader) { 17 window.addEventListener('load', () => { 18 preloader.remove(); 19 }); 20 } 21 22 /** 23 * Sticky header on scroll 24 */ 25 const selectHeader = document.querySelector('#header'); 26 if (selectHeader) { 27 document.addEventListener('scroll', () => { 28 window.scrollY > 100 ? selectHeader.classList.add('sticked') : selectHeader.classList.remove('sticked'); 29 }); 30 } 31 32 /** 33 * Scroll top button 34 */ 35 const scrollTop = document.querySelector('.scroll-top'); 36 if (scrollTop) { 37 const togglescrollTop = function() { 38 window.scrollY > 100 ? scrollTop.classList.add('active') : scrollTop.classList.remove('active'); 39 } 40 window.addEventListener('load', togglescrollTop); 41 document.addEventListener('scroll', togglescrollTop); 42 scrollTop.addEventListener('click', window.scrollTo({ 43 top: 0, 44 behavior: 'smooth' 45 })); 46 } 47 48 /** 49 * Mobile nav toggle 50 */ 51 const mobileNavShow = document.querySelector('.mobile-nav-show'); 52 const mobileNavHide = document.querySelector('.mobile-nav-hide'); 53 54 document.querySelectorAll('.mobile-nav-toggle').forEach(el => { 55 el.addEventListener('click', function(event) { 56 event.preventDefault(); 57 mobileNavToogle(); 58 }) 59 }); 60 61 function mobileNavToogle() { 62 document.querySelector('body').classList.toggle('mobile-nav-active'); 63 mobileNavShow.classList.toggle('d-none'); 64 mobileNavHide.classList.toggle('d-none'); 65 } 66 67 /** 68 * Hide mobile nav on same-page/hash links 69 */ 70 document.querySelectorAll('#navbar a').forEach(navbarlink => { 71 72 if (!navbarlink.hash) return; 73 74 let section = document.querySelector(navbarlink.hash); 75 if (!section) return; 76 77 navbarlink.addEventListener('click', () => { 78 if (document.querySelector('.mobile-nav-active')) { 79 mobileNavToogle(); 80 } 81 }); 82 83 }); 84 85 /** 86 * Toggle mobile nav dropdowns 87 */ 88 const navDropdowns = document.querySelectorAll('.navbar .dropdown > a'); 89 90 navDropdowns.forEach(el => { 91 el.addEventListener('click', function(event) { 92 if (document.querySelector('.mobile-nav-active')) { 93 event.preventDefault(); 94 this.classList.toggle('active'); 95 this.nextElementSibling.classList.toggle('dropdown-active'); 96 97 let dropDownIndicator = this.querySelector('.dropdown-indicator'); 98 dropDownIndicator.classList.toggle('bi-chevron-up'); 99 dropDownIndicator.classList.toggle('bi-chevron-down'); 100 } 101 }) 102 }); 103 104 /** 105 * Initiate pURE cOUNTER 106 */ 107 new PureCounter(); 108 109 /** 110 * Initiate glightbox 111 */ 112 const glightbox = GLightbox({ 113 selector: '.glightbox' 114 }); 115 116 /** 117 * Init swiper slider with 1 slide at once in desktop view 118 */ 119 new Swiper('.slides-1', { 120 speed: 600, 121 loop: true, 122 autoplay: { 123 delay: 5000, 124 disableOnInteraction: false 125 }, 126 slidesPerView: 'auto', 127 pagination: { 128 el: '.swiper-pagination', 129 type: 'bullets', 130 clickable: true 131 }, 132 navigation: { 133 nextEl: '.swiper-button-next', 134 prevEl: '.swiper-button-prev', 135 } 136 }); 137 138 /** 139 * Animation on scroll function and init 140 */ 141 function aos_init() { 142 AOS.init({ 143 duration: 1000, 144 easing: 'ease-in-out', 145 once: true, 146 mirror: false 147 }); 148 } 149 window.addEventListener('load', () => { 150 aos_init(); 151 }); 152 153});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.