1 2(function () { 3 //===== Prealoder 4 5 window.onload = function () { 6 window.setTimeout(fadeout, 500); 7 } 8 9 function fadeout() { 10 document.querySelector('.preloader').style.opacity = '0'; 11 document.querySelector('.preloader').style.display = 'none'; 12 } 13 14 15 /*===================================== 16 Sticky 17 ======================================= */ 18 window.onscroll = function () { 19 var header_navbar = document.querySelector(".navbar-area"); 20 var sticky = header_navbar.offsetTop; 21 22 if (window.pageYOffset > sticky) { 23 header_navbar.classList.add("sticky"); 24 } else { 25 header_navbar.classList.remove("sticky"); 26 } 27 28 29 30 31 // show or hide the back-top-top button 32 var backToTo = document.querySelector(".scroll-top"); 33 if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) { 34 backToTo.style.display = "flex"; 35 } else { 36 backToTo.style.display = "none"; 37 } 38 }; 39 40 41 // WOW active 42 new WOW().init(); 43 44 let filterButtons = document.querySelectorAll('.portfolio-btn-wrapper button'); 45 filterButtons.forEach(e => 46 e.addEventListener('click', () => { 47 48 let filterValue = event.target.getAttribute('data-filter'); 49 iso.arrange({ 50 filter: filterValue 51 }); 52 }) 53 ); 54 55 var elements = document.getElementsByClassName("portfolio-btn"); 56 for (var i = 0; i < elements.length; i++) { 57 elements[i].onclick = function () { 58 var el = elements[0]; 59 while (el) { 60 if (el.tagName === "BUTTON") { 61 el.classList.remove("active"); 62 } 63 el = el.nextSibling; 64 } 65 this.classList.add("active"); 66 }; 67 }; 68 69 70 71 72 // for menu scroll 73 var pageLink = document.querySelectorAll('.page-scroll'); 74 75 pageLink.forEach(elem => { 76 elem.addEventListener('click', e => { 77 e.preventDefault(); 78 document.querySelector(elem.getAttribute('href')).scrollIntoView({ 79 behavior: 'smooth', 80 offsetTop: 1 - 60, 81 }); 82 }); 83 }); 84 85 //===== mobile-menu-btn 86 let navbarToggler = document.querySelector(".mobile-menu-btn"); 87 navbarToggler.addEventListener('click', function () { 88 navbarToggler.classList.toggle("active"); 89 }); 90 91 92})();
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.