1(function ($) { 2 "use strict"; 3 4 // Preloader 5 $(window).on('load', function () { 6 if ($('#preloader').length) { 7 $('#preloader').delay(100).fadeOut('slow', function () { 8 $(this).remove(); 9 }); 10 } 11 }); 12 13 // Back to top button 14 $(window).scroll(function() { 15 if ($(this).scrollTop() > 100) { 16 $('.back-to-top').fadeIn('slow'); 17 } else { 18 $('.back-to-top').fadeOut('slow'); 19 } 20 }); 21 $('.back-to-top').click(function(){ 22 $('html, body').animate({scrollTop : 0},1500, 'easeInOutExpo'); 23 return false; 24 }); 25 26 // Initiate the wowjs animation library 27 new WOW().init(); 28 29 // Initiate superfish on nav menu 30 $('.nav-menu').superfish({ 31 animation: { 32 opacity: 'show' 33 }, 34 speed: 400 35 }); 36 37 // Mobile Navigation 38 if ($('#nav-menu-container').length) { 39 var $mobile_nav = $('#nav-menu-container').clone().prop({ 40 id: 'mobile-nav' 41 }); 42 $mobile_nav.find('> ul').attr({ 43 'class': '', 44 'id': '' 45 }); 46 $('body').append($mobile_nav); 47 $('body').prepend('<button type="button" id="mobile-nav-toggle"><i class="fa fa-bars"></i></button>'); 48 $('body').append('<div id="mobile-body-overly"></div>'); 49 $('#mobile-nav').find('.menu-has-children').prepend('<i class="fa fa-chevron-down"></i>'); 50 51 $(document).on('click', '.menu-has-children i', function(e) { 52 $(this).next().toggleClass('menu-item-active'); 53 $(this).nextAll('ul').eq(0).slideToggle(); 54 $(this).toggleClass("fa-chevron-up fa-chevron-down"); 55 }); 56 57 $(document).on('click', '#mobile-nav-toggle', function(e) { 58 $('body').toggleClass('mobile-nav-active'); 59 $('#mobile-nav-toggle i').toggleClass('fa-times fa-bars'); 60 $('#mobile-body-overly').toggle(); 61 }); 62 63 $(document).click(function(e) { 64 var container = $("#mobile-nav, #mobile-nav-toggle"); 65 if (!container.is(e.target) && container.has(e.target).length === 0) { 66 if ($('body').hasClass('mobile-nav-active')) { 67 $('body').removeClass('mobile-nav-active'); 68 $('#mobile-nav-toggle i').toggleClass('fa-times fa-bars'); 69 $('#mobile-body-overly').fadeOut(); 70 } 71 } 72 }); 73 } else if ($("#mobile-nav, #mobile-nav-toggle").length) { 74 $("#mobile-nav, #mobile-nav-toggle").hide(); 75 } 76 77 // Header scroll class 78 $(window).scroll(function() { 79 if ($(this).scrollTop() > 100) { 80 $('#header').addClass('header-scrolled'); 81 } else { 82 $('#header').removeClass('header-scrolled'); 83 } 84 }); 85 86 if ($(window).scrollTop() > 100) { 87 $('#header').addClass('header-scrolled'); 88 } 89 90 // Smooth scroll for the menu and links with .scrollto classes 91 $('.nav-menu a, #mobile-nav a, .scrollto').on('click', function() { 92 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 93 var target = $(this.hash); 94 if (target.length) { 95 var top_space = 0; 96 97 if ($('#header').length) { 98 top_space = $('#header').outerHeight(); 99 100 if (! $('#header').hasClass('header-scrolled')) { 101 top_space = top_space - 20; 102 } 103 } 104 105 $('html, body').animate({ 106 scrollTop: target.offset().top - top_space 107 }, 1500, 'easeInOutExpo'); 108 109 if ($(this).parents('.nav-menu').length) { 110 $('.nav-menu .menu-active').removeClass('menu-active'); 111 $(this).closest('li').addClass('menu-active'); 112 } 113 114 if ($('body').hasClass('mobile-nav-active')) { 115 $('body').removeClass('mobile-nav-active'); 116 $('#mobile-nav-toggle i').toggleClass('fa-times fa-bars'); 117 $('#mobile-body-overly').fadeOut(); 118 } 119 return false; 120 } 121 } 122 }); 123 124 // Navigation active state on scroll 125 var nav_sections = $('section'); 126 var main_nav = $('.nav-menu, #mobile-nav'); 127 var main_nav_height = $('#header').outerHeight(); 128 129 $(window).on('scroll', function () { 130 var cur_pos = $(this).scrollTop(); 131 132 nav_sections.each(function() { 133 var top = $(this).offset().top - main_nav_height, 134 bottom = top + $(this).outerHeight(); 135 136 if (cur_pos >= top && cur_pos <= bottom) { 137 main_nav.find('li').removeClass('menu-active menu-item-active'); 138 main_nav.find('a[href="#'+$(this).attr('id')+'"]').parent('li').addClass('menu-active menu-item-active'); 139 } 140 }); 141 }); 142 143 // Intro carousel
144 var introCarousel = $(".carousel"); 145 var introCarouselIndicators = $(".carousel-indicators"); 146 introCarousel.find(".carousel-inner").children(".carousel-item").each(function(index) { 147 (index === 0) ? 148 introCarouselIndicators.append("<li data-target='#introCarousel' data-slide-to='" + index + "' class='active'></li>") : 149 introCarouselIndicators.append("<li data-target='#introCarousel' data-slide-to='" + index + "'></li>"); 150 151 $(this).css("background-image", "url('" + $(this).children('.carousel-background').children('img').attr('src') +"')"); 152 $(this).children('.carousel-background').remove(); 153 }); 154 155 $(".carousel").swipe({ 156 swipe: function(event, direction, distance, duration, fingerCount, fingerData) { 157 if (direction == 'left') $(this).carousel('next'); 158 if (direction == 'right') $(this).carousel('prev'); 159 }, 160 allowPageScroll:"vertical" 161 }); 162 163 // Skills section 164 $('#skills').waypoint(function() { 165 $('.progress .progress-bar').each(function() { 166 $(this).css("width", $(this).attr("aria-valuenow") + '%'); 167 }); 168 }, { offset: '80%'} ); 169 170 // jQuery counterUp (used in Facts section) 171 $('[data-toggle="counter-up"]').counterUp({ 172 delay: 10, 173 time: 1000 174 }); 175 176 // Porfolio isotope and filter 177 var portfolioIsotope = $('.portfolio-container').isotope({ 178 itemSelector: '.portfolio-item', 179 layoutMode: 'fitRows' 180 }); 181 182 $('#portfolio-flters li').on( 'click', function() { 183 $("#portfolio-flters li").removeClass('filter-active'); 184 $(this).addClass('filter-active'); 185 186 portfolioIsotope.isotope({ filter: $(this).data('filter') }); 187 }); 188 189 // Clients carousel (uses the Owl Carousel library) 190 $(".clients-carousel").owlCarousel({ 191 autoplay: true, 192 dots: true, 193 loop: true, 194 responsive: { 0: { items: 2 }, 768: { items: 4 }, 900: { items: 6 } 195 } 196 }); 197 198 // Testimonials carousel (uses the Owl Carousel library) 199 $(".testimonials-carousel").owlCarousel({ 200 autoplay: true, 201 dots: true, 202 loop: true, 203 items: 1 204 }); 205 206})(jQuery); 207
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.