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