1/** 2* Template Name: Flexor - v2.2.0 3* Template URL: https://bootstrapmade.com/flexor-free-multipurpose-bootstrap-template/ 4* Author: BootstrapMade.com 5* License: https://bootstrapmade.com/license/ 6*/ 7!(function($) { 8 "use strict"; 9 10 // Smooth scroll for the navigation menu and links with .scrollto classes 11 var scrolltoOffset = $('#header').outerHeight() - 1; 12 $(document).on('click', '.nav-menu a, .mobile-nav a, .scrollto', function(e) { 13 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 14 var target = $(this.hash); 15 if (target.length) { 16 e.preventDefault(); 17 18 var scrollto = target.offset().top - scrolltoOffset; 19 20 if ($(this).attr("href") == '#header') { 21 scrollto = 0; 22 } 23 24 $('html, body').animate({ 25 scrollTop: scrollto 26 }, 1500, 'easeInOutExpo'); 27 28 if ($(this).parents('.nav-menu, .mobile-nav').length) { 29 $('.nav-menu .active, .mobile-nav .active').removeClass('active'); 30 $(this).closest('li').addClass('active'); 31 } 32 33 if ($('body').hasClass('mobile-nav-active')) { 34 $('body').removeClass('mobile-nav-active'); 35 $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close'); 36 $('.mobile-nav-overly').fadeOut(); 37 } 38 return false; 39 } 40 } 41 }); 42 43 // Activate smooth scroll on page load with hash links in the url 44 $(document).ready(function() { 45 if (window.location.hash) { 46 var initial_nav = window.location.hash; 47 if ($(initial_nav).length) { 48 var scrollto = $(initial_nav).offset().top - scrolltoOffset; 49 $('html, body').animate({ 50 scrollTop: scrollto 51 }, 1500, 'easeInOutExpo'); 52 } 53 } 54 }); 55 56 // Navigation active state on scroll 57 var nav_sections = $('section'); 58 var main_nav = $('.nav-menu, .mobile-nav'); 59 60 $(window).on('scroll', function() { 61 var cur_pos = $(this).scrollTop() + 200; 62 63 nav_sections.each(function() { 64 var top = $(this).offset().top, 65 bottom = top + $(this).outerHeight(); 66 67 if (cur_pos >= top && cur_pos <= bottom) { 68 if (cur_pos <= bottom) { 69 main_nav.find('li').removeClass('active'); 70 } 71 main_nav.find('a[href="#' + $(this).attr('id') + '"]').parent('li').addClass('active'); 72 } 73 if (cur_pos < 300) { 74 $(".nav-menu ul:first li:first").addClass('active'); 75 } 76 }); 77 }); 78 79 // Mobile Navigation 80 if ($('.nav-menu').length) { 81 var $mobile_nav = $('.nav-menu').clone().prop({ 82 class: 'mobile-nav d-lg-none' 83 }); 84 $('body').append($mobile_nav); 85 $('body').prepend('<button type="button" class="mobile-nav-toggle d-lg-none"><i class="icofont-navigation-menu"></i></button>'); 86 $('body').append('<div class="mobile-nav-overly"></div>'); 87 88 $(document).on('click', '.mobile-nav-toggle', function(e) { 89 $('body').toggleClass('mobile-nav-active'); 90 $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close'); 91 $('.mobile-nav-overly').toggle(); 92 }); 93 94 $(document).on('click', '.mobile-nav .drop-down > a', function(e) { 95 e.preventDefault(); 96 $(this).next().slideToggle(300); 97 $(this).parent().toggleClass('active'); 98 }); 99 100 $(document).click(function(e) { 101 var container = $(".mobile-nav, .mobile-nav-toggle"); 102 if (!container.is(e.target) && container.has(e.target).length === 0) { 103 if ($('body').hasClass('mobile-nav-active')) { 104 $('body').removeClass('mobile-nav-active'); 105 $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close'); 106 $('.mobile-nav-overly').fadeOut(); 107 } 108 } 109 }); 110 } else if ($(".mobile-nav, .mobile-nav-toggle").length) { 111 $(".mobile-nav, .mobile-nav-toggle").hide(); 112 } 113 114 // Toggle .header-scrolled class to #header when page is scrolled 115 $(window).scroll(function() { 116 if ($(this).scrollTop() > 100) { 117 $('#header').addClass('header-scrolled'); 118 } else { 119 $('#header').removeClass('header-scrolled'); 120 } 121 }); 122 123 if ($(window).scrollTop() > 100) { 124 $('#header').addClass('header-scrolled'); 125 } 126 127 // Stick the header at top on scroll 128 $("#header").sticky({ 129 topSpacing: 0, 130 zIndex: '50' 131 }); 132 133 // Back to top button 134 $(window).scroll(function() { 135 if ($(this).scrollTop() > 100) { 136 $('.back-to-top').fadeIn('slow'); 137 } else { 138 $('.back-to-top').fadeOut('slow'); 139 } 140 }); 141 142 $('.back-to-top').click(function() { 143 $('html, body').animate({ 144 scrollTop: 0 145 }, 1500, 'easeInOutExpo'); 146 return false;
147 }); 148 // Initiate the venobox plugin 149 $(window).on('load', function() { 150 $('.venobox').venobox(); 151 }); 152 153 // Clients carousel (uses the Owl Carousel library) 154 $(".clients-carousel").owlCarousel({ 155 autoplay: true, 156 dots: true, 157 loop: true, 158 159 responsive: { 160 0: { 161 items: 2 162 }, 163 768: { 164 items: 3 165 }, 166 900: { 167 items: 4 168 } 169 } 170 }); 171 172 // Testimonials carousel (uses the Owl Carousel library) 173 $(".testimonials-carousel").owlCarousel({ 174 autoplay: true, 175 dots: true, 176 loop: true, 177 items: 1, 178 }); 179 180 // Porfolio isotope and filter 181 $(window).on('load', function() { 182 var portfolioIsotope = $('.portfolio-container').isotope({ 183 itemSelector: '.portfolio-item', 184 layoutMode: 'fitRows' 185 }); 186 187 $('#portfolio-flters li').on('click', function() { 188 $("#portfolio-flters li").removeClass('filter-active'); 189 $(this).addClass('filter-active'); 190 191 portfolioIsotope.isotope({ 192 filter: $(this).data('filter') 193 }); 194 aos_init(); 195 }); 196 197 // Initiate venobox (lightbox feature used in portofilo) 198 $(document).ready(function() { 199 $('.venobox').venobox(); 200 }); 201 }); 202 203 // Portfolio details carousel 204 $(".portfolio-details-carousel").owlCarousel({ 205 autoplay: true, 206 dots: true, 207 loop: true, 208 items: 1 209 }); 210 211 // Init AOS 212 function aos_init() { 213 AOS.init({ 214 duration: 1000, 215 easing: "ease-in-out-back", 216 once: true 217 }); 218 } 219 $(window).on('load', function() { 220 aos_init(); 221 }); 222 223})(jQuery);
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.