1;(function($) { 2 'use strict' 3 4 var retinaLogo = function() { 5 var retina = window.devicePixelRatio > 1 ? true : false; 6 var $logo = $('.header-logo img'); 7 var $logo_retina = $logo.data('retina'); 8 9 if ( retina && $logo_retina ) { 10 $logo.attr({ 11 src: $logo.data('retina'), 12 width: $logo.data('width'), 13 height: $logo.data('height') 14 }); 15 } 16 }; 17 18 var mobiNav = function() { 19 var menuType = 'desktop'; 20 21 $(window).on('load resize', function() { 22 var 23 mode = 'desktop', 24 wrapMenu = $('#site-header .header-inner'); 25 26 if ( matchMedia( 'only screen and (max-width: 991px)' ).matches ) 27 mode = 'mobile'; 28 29 if ( mode != menuType ) { 30 menuType = mode; 31 32 if ( mode == 'mobile' ) { 33 $('#main-nav').attr('id', 'main-nav-mobi') 34 .appendTo('#site-header') 35 .hide().children('.menu') 36 .find('li:has(ul)') 37 .children('ul') 38 .removeAttr('style') 39 .hide() 40 .before('<span class="arrow"></span>'); 41 } else { 42 $('#main-nav-mobi').attr('id', 'main-nav') 43 .removeAttr('style') 44 .appendTo(wrapMenu) 45 .find('.sub-menu') 46 .removeAttr('style') 47 .prev().remove(); 48 49 $('.mobile-button').removeClass('active'); 50 } 51 } 52 }); 53 54 $(document).on('click', '.mobile-button', function() { 55 $(this).toggleClass('active'); 56 $('#main-nav-mobi').slideToggle(); 57 }) 58 59 $(document).on('click', '#main-nav-mobi .arrow', function() { 60 $(this).toggleClass('active').next().slideToggle(); 61 }) 62 }; 63 64 var headerFixed = function() { 65 if ( $('body').hasClass('header-fixed') ) { 66 var nav = $('#site-header'); 67 68 if ( nav.length ) { 69 var offsetTop = nav.offset().top, 70 headerHeight = nav.height(), 71 injectSpace = $('<div />', { 72 height: headerHeight 73 }).insertAfter(nav); 74 75 $(window).on('load scroll', function(){ 76 if ( $(window).scrollTop() > offsetTop ) { 77 nav.addClass('is-fixed'); 78 injectSpace.show(); 79 } else { 80 nav.removeClass('is-fixed'); 81 injectSpace.hide(); 82 } 83 }) 84 } 85 } 86 }; 87 88 var videoPopup = function() { 89 if ( $().magnificPopup ) { 90 $('.popup-video').magnificPopup({ 91 disableOn: 700, 92 type: 'iframe', 93 mainClass: 'mfp-fade', 94 removalDelay: 160, 95 preloader: false, 96 fixedContentPos: true 97 }); 98 }; 99 }; 100 101 var imagePopup = function() { 102 if ( $().magnificPopup ) { 103 $('.popup-image').magnificPopup({ 104 disableOn: 700, 105 type: 'image', 106 gallery:{ 107 enabled: true 108 }, 109 mainClass: 'mfp-fade', 110 removalDelay: 160, 111 preloader: false, 112 fixedContentPos: true 113 }); 114 }; 115 }; 116 117 var responsiveVideos = function() { 118 if ( $().fitVids ) { 119 $('.cbr-container').fitVids(); 120 } 121 }; 122 123 var scrollToTop = function() { 124 $(window).scroll(function() { 125 if ( $(this).scrollTop() > 800 ) { 126 $('#scroll-top').addClass('show'); 127 } else { 128 $('#scroll-top').removeClass('show'); 129 } 130 }); 131 132 $('#scroll-top').on('click', function() { 133 $('html, body').animate({ scrollTop: 0 }, 1000 , 'easeInOutExpo'); 134 return false; 135 }); 136 }; 137
138 var preLoader = function() { 139 if ( $().animsition ) { 140 $('.animsition').animsition({ 141 inClass: 'fade-in', 142 outClass: 'fade-out', 143 inDuration: 1500, 144 outDuration: 800, 145 loading: true, 146 loadingParentElement: 'body', 147 loadingClass: 'animsition-loading', 148 timeout: false, 149 timeoutCountdown: 5000, 150 onLoadEvent: true, 151 browser: [ 152 '-webkit-animation-duration', 153 '-moz-animation-duration', 154 'animation-duration' 155 ], 156 overlay: false, 157 overlayClass: 'animsition-overlay-slide', 158 overlayParentElement: 'body', 159 transition: function(url){ window.location.href = url; } 160 }); 161 } 162 }; 163 164 var typed = function() { 165 if ( $().typed ) { 166 $(".typed-element").typed({ 167 stringsElement: $(".typed-strings"), 168 typeSpeed: 100, 169 loop: true, 170 showCursor: true, 171 backDelay: 2000, 172 fadeOut: true, 173 smartBackspace: true, 174 cursorChar: "|" 175 }); 176 177 } 178 }; 179 180 var animateWOW = function() { 181 new WOW().init(); 182 }; 183 184 var parallaxMouse = function(ismobile) { 185 var parallaxleft = $('.parallax-left img'), 186 parallaxRight = $('.parallax-right'), 187 sliderDescription = $('.slider-description'); 188 189 if ( ismobile ) { 190 sliderDescription.css({ 191 'left':'initial', 192 'top':'initial' 193 }); 194 } 195 196 $(window).mousemove(function( event ) { 197 parallaxleft.css({ 198 'position':'relative', 199 'left':-event.pageX / 30, 200 'top':-event.pageY / 20 201 }); 202 parallaxRight.css({ 203 'right': -event.pageX / 40, 204 'top': -event.pageY / 24 205 }); 206 207 if ( $(window).width() > 768 ) { 208 sliderDescription.css({ 209 'left':event.pageX / 30, 210 'top':-event.pageY / 24 211 }); 212 } 213 }); 214 }; 215 216 var parallax = function() { 217 var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false ); 218 /* 219 * Please note that background attachment fixed doesn't work on iOS 220 */ 221 if (!iOS) { 222 $('.parallax').css({backgroundAttachment:'fixed'}); 223 } else { 224 $('.parallax').css({backgroundAttachment:'scroll'}); 225 } 226 227 if ( $().parallax && matchMedia( 'only screen and (min-width: 992px)' ).matches ) { 228 $('.row-projects').parallax("50%", 0.45); 229 230 } 231 }; 232 233 // var inViewport = function() { 234 // $('[data-inviewport="yes"]').waypoint(function() { 235 // $(this).trigger('on-appear'); 236 // }, { offset: '90%', triggerOnce: true }); 237 238 // $(window).on('load', function() { 239 // setTimeout(function() { 240 // $.waypoints('refresh'); 241 // }, 100); 242 // }); 243 // }; 244 245 // Dom Ready 246 $(function() { 247 retinaLogo(); 248 mobiNav(); 249 headerFixed(); 250 videoPopup(); 251 imagePopup(); 252 responsiveVideos(); 253 scrollToTop(); 254 preLoader(); 255 typed(); 256 animateWOW(); 257 parallaxMouse(); 258 $( window ).load(function() { 259 parallax(); 260 // inViewport(); 261 }); 262 }); 263 264})(jQuery); 265
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.