1;(function () { 2 3 'use strict'; 4 5 var isMobile = { 6 Android: function() { 7 return navigator.userAgent.match(/Android/i); 8 }, 9 BlackBerry: function() { 10 return navigator.userAgent.match(/BlackBerry/i); 11 }, 12 iOS: function() { 13 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 14 }, 15 Opera: function() { 16 return navigator.userAgent.match(/Opera Mini/i); 17 }, 18 Windows: function() { 19 return navigator.userAgent.match(/IEMobile/i); 20 }, 21 any: function() { 22 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 23 } 24 }; 25 26 var mobileMenuOutsideClick = function() { 27 28 $(document).click(function (e) { 29 var container = $("#wj-offcanvas, .js-wj-nav-toggle"); 30 if (!container.is(e.target) && container.has(e.target).length === 0) { 31 32 if ( $('body').hasClass('offcanvas') ) { 33 34 $('body').removeClass('offcanvas'); 35 $('.js-wj-nav-toggle').removeClass('active'); 36 37 } 38 39 40 } 41 }); 42 43 }; 44 45 46 var offcanvasMenu = function() { 47 48 $('#page').prepend('<div id="wj-offcanvas" />'); 49 $('#page').prepend('<a href="#" class="js-wj-nav-toggle wj-nav-toggle wj-nav-white"><i></i></a>'); 50 var clone1 = $('.menu-1 > ul').clone(); 51 $('#wj-offcanvas').append(clone1); 52 var clone2 = $('.menu-2 > ul').clone(); 53 $('#wj-offcanvas').append(clone2); 54 55 $('#wj-offcanvas .has-dropdown').addClass('offcanvas-has-dropdown'); 56 $('#wj-offcanvas') 57 .find('li') 58 .removeClass('has-dropdown'); 59 60 // Hover dropdown menu on mobile 61 $('.offcanvas-has-dropdown').mouseenter(function(){ 62 var $this = $(this); 63 64 $this 65 .addClass('active') 66 .find('ul') 67 .slideDown(500, 'easeOutExpo'); 68 }).mouseleave(function(){ 69 70 var $this = $(this); 71 $this 72 .removeClass('active') 73 .find('ul') 74 .slideUp(500, 'easeOutExpo'); 75 }); 76 77 78 $(window).resize(function(){ 79 80 if ( $('body').hasClass('offcanvas') ) { 81 82 $('body').removeClass('offcanvas'); 83 $('.js-wj-nav-toggle').removeClass('active'); 84 85 } 86 }); 87 }; 88 89 90 var burgerMenu = function() { 91 92 $('body').on('click', '.js-wj-nav-toggle', function(event){ 93 var $this = $(this); 94 95 96 if ( $('body').hasClass('overflow offcanvas') ) { 97 $('body').removeClass('overflow offcanvas'); 98 } else { 99 $('body').addClass('overflow offcanvas'); 100 } 101 $this.toggleClass('active'); 102 event.preventDefault(); 103 104 }); 105 }; 106 107 var fullHeight = function() { 108 109 if ( !isMobile.any() ) { 110 $('.js-fullheight').css('height', $(window).height()); 111 $(window).resize(function(){ 112 $('.js-fullheight').css('height', $(window).height()); 113 }); 114 } 115 116 }; 117 118 119 120 var contentWayPoint = function() { 121 var i = 0; 122 $('.animate-box').waypoint( function( direction ) { 123 124 if( direction === 'down' && !$(this.element).hasClass('animated-fast') ) { 125 126 i++; 127 128 $(this.element).addClass('item-animate'); 129 setTimeout(function(){ 130 131 $('body .animate-box.item-animate').each(function(k){ 132 var el = $(this); 133 setTimeout( function () { 134 var effect = el.data('animate-effect'); 135 if ( effect === 'fadeIn') { 136 el.addClass('fadeIn animated-fast'); 137 } else if ( effect === 'fadeInLeft') { 138 el.addClass('fadeInLeft animated-fast'); 139 } else if ( effect === 'fadeInRight') { 140 el.addClass('fadeInRight animated-fast'); 141 } else { 142 el.addClass('fadeInUp animated-fast'); 143 } 144 145 el.removeClass('item-animate'); 146 }, k * 200, 'easeInOutExpo' ); 147 }); 148 149 }, 100); 150 151 } 152 153 } , { offset: '85%' } ); 154 }; 155 156 157 var dropdown = function() { 158 159 $('.has-dropdown').mouseenter(function(){ 160 161 var $this = $(this); 162 $this 163 .find('.dropdown') 164 .css('display', 'block') 165 .addClass('animated-fast fadeInUpMenu'); 166 167 }).mouseleave(function(){ 168 var $this = $(this); 169 170 $this 171 .find('.dropdown') 172 .css('display', 'none') 173 .removeClass('animated-fast fadeInUpMenu'); 174 }); 175 176 }; 177 178 179 var goToTop = function() { 180 181 $('.js-gotop').on('click', function(event){ 182 183 event.preventDefault(); 184 185 $('html, body').animate({ 186 scrollTop: $('html').offset().top 187 }, 500, 'easeInOutExpo'); 188 189 return false;
190 }); 191 192 $(window).scroll(function(){ 193 194 var $win = $(window); 195 if ($win.scrollTop() > 200) { 196 $('.js-top').addClass('active'); 197 } else { 198 $('.js-top').removeClass('active'); 199 } 200 201 }); 202 203 }; 204 205 206 207 208 var counterWayPoint = function() { 209 if ($('#wj-counter').length > 0 ) { 210 $('#wj-counter').waypoint( function( direction ) { 211 212 if( direction === 'down' && !$(this.element).hasClass('animated') ) { 213 setTimeout( counter , 400); 214 $(this.element).addClass('animated'); 215 } 216 } , { offset: '90%' } ); 217 } 218 }; 219 220 var sliderMain = function() { 221 222 $('#wj-hero .flexslider').flexslider({ 223 animation: "fade", 224 slideshowSpeed: 5000, 225 directionNav: true, 226 start: function(){ 227 setTimeout(function(){ 228 $('.slider-text').removeClass('animated fadeInUp'); 229 $('.flex-active-slide').find('.slider-text').addClass('animated fadeInUp'); 230 }, 500); 231 }, 232 before: function(){ 233 setTimeout(function(){ 234 $('.slider-text').removeClass('animated fadeInUp'); 235 $('.flex-active-slide').find('.slider-text').addClass('animated fadeInUp'); 236 }, 500); 237 } 238 239 }); 240 241 $('#wj-hero .flexslider .slides > li').css('height', $(window).height()); 242 $(window).resize(function(){ 243 $('#wj-hero .flexslider .slides > li').css('height', $(window).height()); 244 }); 245 246 }; 247 248 249 $(function(){ 250 mobileMenuOutsideClick(); 251 offcanvasMenu(); 252 burgerMenu(); 253 contentWayPoint(); 254 sliderMain(); 255 dropdown(); 256 goToTop(); 257 counterWayPoint(); 258 fullHeight(); 259 }); 260 261 262}());
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.