1(function($) { 2 "use strict"; 3 4 5 6 // BACK BUTTON RELOAD 7 window.onpageshow = function (event) { 8 if (event.persisted) { 9 window.location.reload() 10 } 11 }; 12 13 14 15 function randomBetween(range) { 16 var min = range[0], 17 max = range[1]; 18 if (min < 0) { 19 return min + Math.random() * (Math.abs(min)+max); 20 }else { 21 return min + Math.random() * max; 22 } 23 } 24 25 26 27 28 /* TREE MENU */ 29(function ($) { 30 $.fn.liHarmonica = function (params) { 31 var p = $.extend({ 32 currentClass: 'cur', 33 onlyOne: true, 34 speed: 500 35 }, params); 36 return this.each(function () { 37 var 38 el = $(this).addClass('harmonica'), 39 linkItem = $('ul', el).prev('i'); 40 el.children(':last').addClass('last'); 41 $('ul', el).each(function () { 42 $(this).children(':last').addClass('last'); 43 }); 44 $('ul', el).prev('i').addClass('harFull'); 45 el.find('.' + p.currentClass).parents('ul').show().prev('i').addClass(p.currentClass).addClass('harOpen'); 46 linkItem.on('click', function () { 47 if ($(this).next('ul').is(':hidden')) { 48 $(this).addClass('harOpen'); 49 } else { 50 $(this).removeClass('harOpen'); 51 } 52 if (p.onlyOne) { 53 $(this).closest('ul').closest('ul').find('ul').not($(this).next('ul')).slideUp(p.speed).prev('i').removeClass('harOpen'); 54 $(this).next('ul').slideToggle(p.speed); 55 } else { 56 $(this).next('ul').stop(true).slideToggle(p.speed); 57 } 58 return false; 59 }); 60 }); 61 }; 62})(jQuery); 63 64$(function () { 65 $('.hamburger-navigation ').liHarmonica({ 66 onlyOne: true, 67 speed: 400 68 }); 69}); 70 71 72 73 // BUTTONS AUDIO 74 if( $('#hamburger').length !== 0 ) { 75 76 if( data.enable_hamburger_menu_click_sound != false ) { 77 document.getElementById("hamburger").addEventListener('click', function (e) { 78 document.getElementById("link").play(); 79 }); 80 } 81 } 82 83 84 85 // EQUALIZER TOGGLE 86 if( data.audio_source !== '' ) { 87 var source = data.audio_source; 88 var audio = new Audio(); // use the constructor in JavaScript, just easier that way 89 audio.addEventListener("load", function() { 90 audio.play(); 91 }, true); 92 audio.src = source; 93 audio.autoplay = true; 94 audio.loop = true; 95 audio.volume = 0.2; 96 97 $('.equalizer').click(); 98 var playing = true; 99 $('.equalizer').on('click', function(e) { 100 if (playing == false) { 101 audio.play(); 102 playing = true; 103 104 } else { 105 audio.pause(); 106 playing = false; 107 } 108 }); 109 110 // EQUALIZER 111 112 $.fn.equalizerAnimation = function(speed, barsHeight){ 113 var $equalizer = $(this); 114 setInterval(function(){ 115 $equalizer.find('span').each(function(i){ 116 $(this).css({ height:randomBetween(barsHeight[i])+'px' }); 117 }); 118 },speed); 119 $equalizer.on('click',function(){ 120 $equalizer.toggleClass('paused'); 121 }); 122 }; 123 124 var barsHeight = [ 125 [2, 10], 126 [5, 14], 127 [11, 8], 128 [4, 18], 129 [8, 3] 130 ]; 131 $('.equalizer').equalizerAnimation(180, barsHeight); 132 } 133 134 // MOUSE MASK 135 var $window = $(window); 136 var windowWidth = $window.width(); 137 var windowHeight = $window.height(); 138 var mousePos = {x:windowWidth/2,y:windowHeight/2}; 139 140 $(window).resize(function(){ 141 windowWidth = $window.width(); 142 windowHeight = $window.height(); 143 }); 144 145 clip(mousePos); 146 147 $(document).mousemove(function(e){ 148 mousePos = {x:e.pageX,y:e.pageY}; 149 clip(mousePos); 150 }); 151 152 function clip(mousePos) { 153 var pourcPos = {'x':mousePos.x * 100 / windowWidth * 2, 154 'y':mousePos.y * 100 / windowHeight}; 155 var gapX = pourcPos.x * 30 / 200 - 15; 156 var gapY = (15 *(pourcPos.y * 30 / 100 - 15)) / 100; 157 var pointTop; 158 var pointBottom; 159 if (pourcPos.y<50) { 160 pointTop = 150 - pourcPos.x + gapY * gapX; 161 pointBottom = 150 - pourcPos.x; 162 } else { 163 pointTop = 150 - pourcPos.x; 164 pointBottom = 150 - pourcPos.x - gapY * gapX; 165 } 166 if (pourcPos.x<100) { 167 $('.split-back').addClass('on'); 168 $('.split-front').removeClass('on'); 169 }else if (pourcPos.x>100) { 170 $('.split-back').removeClass('on'); 171 $('.split-front').addClass('on'); 172 } else { 173 $('.split-back').add('.split-front').removeClass('on'); 174 } 175 $('.split-front').css({'clip-path':'polygon('+pointTop+'% 0%, 100% 0%, 100% 100%, '+pointBottom+'% 100%)'}); 176 } 177 178 // INT HERO FADE 179 var divs = $('.int-hero .inner'); 180 $(window).on('scroll', function() { 181 var st = $(this).scrollTop(); 182 divs.css({ 'opacity' : (1 - st/300) }); 183 }); 184 185 186 // DATA BACKGROUND IMAGE 187 var pageSection = $(".bg-image"); 188 pageSection.each(function(indx){ 189 if ($(this).attr("data-background")){ 190 $(this).css("background-image", "url(" + $(this).data("background") + ")"); 191 } 192 }); 193 194 // DATA BACKGROUND COLOR 195 var pageSectionBg = $(".bg-color"); 196 pageSectionBg.each(function(indx){ 197 if ($(this).attr("data-background")){ 198 $(this).css("background-color", $(this).data("background")); 199 } 200 }); 201 202 203 // PAGE TRANSITION 204 $('body a').on('click', function (e) { 205 if ($('body').hasClass('no-transition')) { 206 207 } else { 208 var target = $(this).attr('target'); 209 var fancybox = $(this).data('fancybox'); 210 var url = this.getAttribute("href"); 211 if (target != '_blank' && typeof fancybox == 'undefined' && url.indexOf('#') < 0) { 212 213 214 e.preventDefault(); 215 var url = this.getAttribute("href"); 216 if (url.indexOf('#') != -1) { 217 var hash = url.substring(url.indexOf('#')); 218 219 220 if ($('body ' + hash).length != 0) { 221 $('.page-transition').removeClass("active"); 222 223 224 } 225 } else { 226 $('.page-transition').toggleClass("active"); 227 setTimeout(function () { 228 window.location = url; 229 }, 800); 230 231 } 232 } 233 } 234 }); 235 236 237 238 // SLIDER 239 var swiper = new Swiper('.slider .swiper-container', { 240 speed: 600, 241 parallax: true, 242 loop: true, 243 autoplay: { 244 delay: 4500, 245 disableOnInteraction: false, 246 }, 247 pagination: { 248 el: '.swiper-pagination', 249 type: 'fraction', 250 }, 251 navigation: { 252 nextEl: '.swiper-button-next', 253 prevEl: '.swiper-button-prev', 254 }, 255 }); 256 257 // WOW ANIMATION 258 var wow = new WOW( 259 { 260 animateClass: 'animated', 261 offset: 50 262 } 263 ); 264 wow.init(); 265 266 // MASONRY 267 $(window).load(function(){ 268 269 $('.works').isotope({ 270 itemSelector: '.works li', 271 percentPosition: true 272 }); 273 274 $('.masonry-row').isotope({ 275 itemSelector: '.masonry-cols', 276 percentPosition: true 277 }); 278 279 }); 280 281 // ISOTOPE FILTER 282 var $container = $('.works'); 283 $container.isotope({ 284 filter: '*', 285 animationOptions: { 286 duration: 750, 287 easing: 'linear', 288 queue: false 289 } 290 }); 291 292 $('.isotope-filter li span').on('click', function(e) { 293 $('.isotope-filter li span.current').removeClass('current'); 294 $(this).addClass('current'); 295 296 var selector = $(this).attr('data-filter'); 297 $container.isotope({ 298 filter: selector, 299 animationOptions: { 300 duration: 750, 301 easing: 'linear', 302 queue: false 303 } 304 }); 305 return false;
306 }); 307 308 309 310 // COUNTER 311 $(document).scroll(function () { 312 $('.odometer').each(function () { 313 var parent_section_postion = $(this).closest('section').position(); 314 var parent_section_top = parent_section_postion.top; 315 if ($(document).scrollTop() > parent_section_top - 300) { 316 if ($(this).data('status') == 'yes') { 317 $(this).html($(this).data('count')); 318 $(this).data('status', 'no'); 319 } 320 } 321 }); 322 }); 323 324 325 326 327 $(window).load(function(){ 328 $("body").addClass("page-loaded"); 329 }); 330 331})(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.