1jQuery(function() { 2 //initSlideShow(); 3 initBgParallax(); 4 initCounter(); 5 //stickyNav(); 6}); 7 8 9// fade gallery init 10function initSlideShow() { 11 jQuery('.gallery').fadeGallery({ 12 slides: '.slide', 13 autoHeight: false, 14 autoRotation: true 15 }); 16} 17 18// comment 19function initBgParallax() { 20 jQuery('.bg-holder').parallaxBlock({ 21 image: 'img', 22 parallaxOffset: 10, 23 fallbackClass: 'is-touch-device' 24 }); 25} 26 27 28function stickyNav() { 29 $(document).on("scroll", function(){ 30 if ($(document).scrollTop() > 86){ 31 $("#header").addClass("shrink"); 32 } else { 33 $("#header").removeClass("shrink"); 34 } 35 }); 36} 37// initialize counter 38function initCounter() { 39 var win = jQuery(window); 40 var visibleClass = 'section-visible'; 41 var winHeight; 42 43 jQuery('.count-section').each(function() { 44 var holder = jQuery(this); 45 var counters = holder.find('.counter-item'); 46 var array = []; 47 48 counters.each(function(){ 49 var item = jQuery(this); 50 array.push({ 51 item: item, 52 end: item.data('end'), 53 started: false 54 }); 55 56 }); 57 58 function onResize() { 59 winHeight = win.height() 60 array.forEach(function(obj) { 61 obj.offsetTop = obj.item.offset().top 62 obj.height = obj.item.height(); 63 }); 64 onScroll(); 65 } 66 function onScroll() { 67 var scrollTop = win.scrollTop(); 68 array.forEach(function(obj) { 69 if(obj.started) return 70 if(scrollTop + winHeight > obj.offsetTop + obj.height){ 71 obj.started = true; 72 obj.item.numerator({ 73 duration: 2500, 74 toValue: obj.end, 75 easing: 'easeOutExpo' 76 }); 77 } 78 }); 79 } 80 onResize(); 81 win.on('load resize orientationchange', onResize); 82 win.on('scroll', onScroll); 83 }); 84}; 85 86/* 87 * jQuery Numerator Plugin 0.2.1 88 * https://github.com/garethdn/jquery-numerator 89 * 90 * Copyright 2015, Gareth Nolan 91 * http://ie.linkedin.com/in/garethnolan/ 92 93 * Based on jQuery Boilerplate by Zeno Rocha with the help of Addy Osmani 94 * http://jqueryboilerplate.com 95 * 96 * Licensed under the MIT license: 97 * http://www.opensource.org/licenses/MIT 98 */ 99 100 ;(function (factory) { 101 'use strict'; 102 if (typeof define === 'function' && define.amd) { 103 // AMD is used - Register as an anonymous module. 104 define(['jquery'], factory); 105 } else if (typeof exports === 'object') { 106 factory(require('jquery')); 107 } else { 108 // Neither AMD nor CommonJS used. Use global variables. 109 if (typeof jQuery === 'undefined') { 110 throw 'jquery-numerator requires jQuery to be loaded first'; 111 } 112 factory(jQuery); 113 } 114 }(function ($) { 115 116 var pluginName = "numerator", 117 defaults = { 118 easing: 'swing', 119 duration: 500, 120 delimiter: undefined, 121 rounding: 0, 122 toValue: undefined, 123 fromValue: undefined, 124 queue: false, 125 onStart: function(){}, 126 onStep: function(){}, 127 onProgress: function(){}, 128 onComplete: function(){} 129 }; 130 131 function Plugin ( element, options ) { 132 this.element = element; 133 this.settings = $.extend( {}, defaults, options ); 134 this._defaults = defaults; 135 this._name = pluginName; 136 this.init(); 137 } 138 139 Plugin.prototype = { 140 141 init: function () { 142 this.parseElement(); 143 this.setValue(); 144 }, 145 146 parseElement: function () { 147 var elText = $.trim($(this.element).text()); 148 149 this.settings.fromValue = this.settings.fromValue || this.format(elText); 150 }, 151 152 setValue: function() { 153 var self = this; 154 155 $({value: self.settings.fromValue}).animate({value: self.settings.toValue}, { 156 157 duration: parseInt(self.settings.duration, 10), 158 159 easing: self.settings.easing, 160 161 start: self.settings.onStart, 162 163 step: function(now, fx) { 164 $(self.element).text(self.format(now)); 165 // accepts two params - (now, fx) 166 self.settings.onStep(now, fx); 167 }, 168 169 // accepts three params - (animation object, progress ratio, time remaining(ms)) 170 progress: self.settings.onProgress, 171 172 complete: self.settings.onComplete 173 }); 174 }, 175 176 format: function(value){ 177 var self = this; 178 179 if ( parseInt(this.settings.rounding ) < 1) { 180 value = parseInt(value, 10); 181 } else { 182 value = parseFloat(value).toFixed( parseInt(this.settings.rounding) ); 183 } 184 185 if (self.settings.delimiter) { 186 return this.delimit(value) 187 } else { 188 return value; 189 } 190 }, 191 192 // TODO: Add comments to this function 193 delimit: function(value){ 194 var self = this; 195 196 value = value.toString(); 197 198 if (self.settings.rounding && parseInt(self.settings.rounding, 10) > 0) { 199 var decimals = value.substring( (value.length - (self.settings.rounding + 1)), value.length ), 200 wholeValue = value.substring( 0, (value.length - (self.settings.rounding + 1))); 201 202 return self.addDelimiter(wholeValue) + decimals; 203 } else { 204 return self.addDelimiter(value); 205 } 206 }, 207 208 addDelimiter: function(value){ 209 return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, this.settings.delimiter); 210 } 211 }; 212 213 $.fn[ pluginName ] = function ( options ) { 214 return this.each(function() { 215 if ( $.data( this, "plugin_" + pluginName ) ) { 216 $.data(this, 'plugin_' + pluginName, null); 217 } 218 $.data( this, "plugin_" + pluginName, new Plugin( this, options ) ); 219 }); 220 }; 221 222 })); 223 224/* 225 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 226 * 227 * Uses the built in easing capabilities added In jQuery 1.1 228 * to offer multiple easing options 229 * 230 * TERMS OF USE - jQuery Easing 231 * 232 * Open source under the BSD License. 233 * 234 * Copyright Щ 2008 George McGinley Smith 235 * All rights reserved. 236 * 237 * Redistribution and use in source and binary forms, with or without modification, 238 * are permitted provided that the following conditions are met: 239 * 240 * Redistributions of source code must retain the above copyright notice, this list of 241 * conditions and the following disclaimer. 242 * Redistributions in binary form must reproduce the above copyright notice, this list 243 * of conditions and the following disclaimer in the documentation and/or other materials 244 * provided with the distribution. 245 * 246 * Neither the name of the author nor the names of contributors may be used to endorse 247 * or promote products derived from this software without specific prior written permission. 248 * 249 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 250 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 251 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 252 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
253 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 254 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 255 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 256 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 257 * OF THE POSSIBILITY OF SUCH DAMAGE. 258 * 259 */ 260 261// t: current time, b: begInnIng value, c: change In value, d: duration 262/* 263jQuery.easing['jswing'] = jQuery.easing['swing']; 264 265jQuery.extend( jQuery.easing, 266{ 267 def: 'easeOutQuad', 268 swing: function (x, t, b, c, d) { 269 //alert(jQuery.easing.default); 270 return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 271 }, 272 easeInQuad: function (x, t, b, c, d) { 273 return c*(t/=d)*t + b; 274 }, 275 easeOutQuad: function (x, t, b, c, d) { 276 return -c *(t/=d)*(t-2) + b; 277 }, 278 easeInOutQuad: function (x, t, b, c, d) { 279 if ((t/=d/2) < 1) return c/2*t*t + b; 280 return -c/2 * ((--t)*(t-2) - 1) + b; 281 }, 282 easeInCubic: function (x, t, b, c, d) { 283 return c*(t/=d)*t*t + b; 284 }, 285 easeOutCubic: function (x, t, b, c, d) { 286 return c*((t=t/d-1)*t*t + 1) + b; 287 }, 288 easeInOutCubic: function (x, t, b, c, d) { 289 if ((t/=d/2) < 1) return c/2*t*t*t + b; 290 return c/2*((t-=2)*t*t + 2) + b; 291 }, 292 easeInQuart: function (x, t, b, c, d) { 293 return c*(t/=d)*t*t*t + b; 294 }, 295 easeOutQuart: function (x, t, b, c, d) { 296 return -c * ((t=t/d-1)*t*t*t - 1) + b; 297 }, 298 easeInOutQuart: function (x, t, b, c, d) { 299 if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 300 return -c/2 * ((t-=2)*t*t*t - 2) + b; 301 }, 302 easeInQuint: function (x, t, b, c, d) { 303 return c*(t/=d)*t*t*t*t + b; 304 }, 305 easeOutQuint: function (x, t, b, c, d) { 306 return c*((t=t/d-1)*t*t*t*t + 1) + b; 307 }, 308 easeInOutQuint: function (x, t, b, c, d) { 309 if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 310 return c/2*((t-=2)*t*t*t*t + 2) + b; 311 }, 312 easeInSine: function (x, t, b, c, d) { 313 return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 314 }, 315 easeOutSine: function (x, t, b, c, d) { 316 return c * Math.sin(t/d * (Math.PI/2)) + b; 317 }, 318 easeInOutSine: function (x, t, b, c, d) { 319 return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 320 }, 321 easeInExpo: function (x, t, b, c, d) { 322 return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 323 }, 324 easeOutExpo: function (x, t, b, c, d) { 325 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 326 }, 327 easeInOutExpo: function (x, t, b, c, d) { 328 if (t==0) return b; 329 if (t==d) return b+c; 330 if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 331 return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 332 }, 333 easeInCirc: function (x, t, b, c, d) { 334 return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 335 }, 336 easeOutCirc: function (x, t, b, c, d) { 337 return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 338 }, 339 easeInOutCirc: function (x, t, b, c, d) { 340 if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 341 return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 342 }, 343 easeInElastic: function (x, t, b, c, d) { 344 var s=1.70158;var p=0;var a=c; 345 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 346 if (a < Math.abs(c)) { a=c; var s=p/4; } 347 else var s = p/(2*Math.PI) * Math.asin (c/a); 348 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 349 }, 350 easeOutElastic: function (x, t, b, c, d) { 351 var s=1.70158;var p=0;var a=c; 352 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 353 if (a < Math.abs(c)) { a=c; var s=p/4; } 354 else var s = p/(2*Math.PI) * Math.asin (c/a); 355 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 356 }, 357 easeInOutElastic: function (x, t, b, c, d) { 358 var s=1.70158;var p=0;var a=c; 359 if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 360 if (a < Math.abs(c)) { a=c; var s=p/4; } 361 else var s = p/(2*Math.PI) * Math.asin (c/a); 362 if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 363 return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 364 }, 365 easeInBack: function (x, t, b, c, d, s) { 366 if (s == undefined) s = 1.70158; 367 return c*(t/=d)*t*((s+1)*t - s) + b; 368 }, 369 easeOutBack: function (x, t, b, c, d, s) { 370 if (s == undefined) s = 1.70158; 371 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 372 }, 373 easeInOutBack: function (x, t, b, c, d, s) { 374 if (s == undefined) s = 1.70158; 375 if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 376 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 377 }, 378 easeInBounce: function (x, t, b, c, d) { 379 return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 380 }, 381 easeOutBounce: function (x, t, b, c, d) { 382 if ((t/=d) < (1/2.75)) { 383 return c*(7.5625*t*t) + b; 384 } else if (t < (2/2.75)) { 385 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 386 } else if (t < (2.5/2.75)) { 387 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 388 } else { 389 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 390 } 391 }, 392 easeInOutBounce: function (x, t, b, c, d) { 393 if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 394 return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 395 } 396}); 397*/ 398/* 399 * jQuery SlideShow plugin 400 */ 401;(function($) { 402 403 'use strict'; 404 // detect device type 405 var isTouchDevice = /Windows Phone/.test(navigator.userAgent) || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 406 407 function FadeGallery(options) { 408 this.options = $.extend({ 409 slides: 'ul.slideset > li', 410 activeClass: 'active', 411 disabledClass: 'disabled', 412 btnPrev: 'a.btn-prev', 413 btnNext: 'a.btn-next', 414 generatePagination: true, 415 pagerList: '<ul>', 416 pagerListItem: '<li><a href="#"></a></li>', 417 pagerListItemText: 'a', 418 pagerLinks: '.pagination li', 419 currentNumber: 'span.current-num', 420 totalNumber: 'span.total-num', 421 btnPlay: '.btn-play', 422 btnPause: '.btn-pause', 423 btnPlayPause: '.btn-play-pause', 424 galleryReadyClass: 'gallery-js-ready', 425 autorotationActiveClass: 'autorotation-active', 426 autorotationDisabledClass: 'autorotation-disabled', 427 autorotationStopAfterClick: false, 428 circularRotation: true, 429 switchSimultaneously: true, 430 disableWhileAnimating: false,
431 disableFadeIE: false, 432 autoRotation: false, 433 pauseOnHover: true, 434 autoHeight: true, 435 useSwipe: true, 436 swipeThreshold: 15, 437 switchTime: 4000, 438 animSpeed: 600, 439 event: 'click' 440 }, options); 441 this.init(); 442 } 443 FadeGallery.prototype = { 444 init: function() { 445 if (this.options.holder) { 446 this.findElements(); 447 this.attachEvents(); 448 this.refreshState(true); 449 this.autoRotate(); 450 this.makeCallback('onInit', this); 451 } 452 }, 453 findElements: function() { 454 // control elements 455 this.gallery = $(this.options.holder).addClass(this.options.galleryReadyClass); 456 this.slides = this.gallery.find(this.options.slides); 457 this.slidesHolder = this.slides.eq(0).parent(); 458 this.stepsCount = this.slides.length; 459 this.btnPrev = this.gallery.find(this.options.btnPrev); 460 this.btnNext = this.gallery.find(this.options.btnNext); 461 this.currentIndex = 0; 462 463 // disable fade effect in old IE 464 if (this.options.disableFadeIE && !$.support.opacity) { 465 this.options.animSpeed = 0; 466 } 467 468 // create gallery pagination 469 if (typeof this.options.generatePagination === 'string') { 470 this.pagerHolder = this.gallery.find(this.options.generatePagination).empty(); 471 this.pagerList = $(this.options.pagerList).appendTo(this.pagerHolder); 472 for (var i = 0; i < this.stepsCount; i++) { 473 $(this.options.pagerListItem).appendTo(this.pagerList).find(this.options.pagerListItemText).text(i + 1); 474 } 475 this.pagerLinks = this.pagerList.children(); 476 } else { 477 this.pagerLinks = this.gallery.find(this.options.pagerLinks); 478 } 479 480 // get start index 481 var activeSlide = this.slides.filter('.' + this.options.activeClass); 482 if (activeSlide.length) { 483 this.currentIndex = this.slides.index(activeSlide); 484 } 485 this.prevIndex = this.currentIndex; 486 487 // autorotation control buttons 488 this.btnPlay = this.gallery.find(this.options.btnPlay); 489 this.btnPause = this.gallery.find(this.options.btnPause); 490 this.btnPlayPause = this.gallery.find(this.options.btnPlayPause); 491 492 // misc elements 493 this.curNum = this.gallery.find(this.options.currentNumber); 494 this.allNum = this.gallery.find(this.options.totalNumber); 495 496 // handle flexible layout 497 this.slides.css({ 498 display: 'block', 499 opacity: 0 500 }).eq(this.currentIndex).css({ 501 opacity: '' 502 }); 503 this.isInit = true; 504 }, 505 attachEvents: function() { 506 var self = this; 507 508 // flexible layout handler 509 this.resizeHandler = function() { 510 if (!self.isInit) return; 511 self.onWindowResize(); 512 }; 513 $(window).bind('load resize orientationchange', this.resizeHandler); 514 515 if (this.btnPrev.length) { 516 this.btnPrevHandler = function(e) { 517 e.preventDefault(); 518 self.prevSlide(); 519 if (self.options.autorotationStopAfterClick) { 520 self.stopRotation(); 521 } 522 }; 523 this.btnPrev.bind(this.options.event, this.btnPrevHandler); 524 } 525 if (this.btnNext.length) { 526 this.btnNextHandler = function(e) { 527 e.preventDefault(); 528 self.nextSlide(); 529 if (self.options.autorotationStopAfterClick) { 530 self.stopRotation(); 531 } 532 }; 533 this.btnNext.bind(this.options.event, this.btnNextHandler); 534 } 535 if (this.pagerLinks.length) { 536 this.pagerLinksHandler = function(e) { 537 e.preventDefault(); 538 self.numSlide(self.pagerLinks.index(e.currentTarget)); 539 if (self.options.autorotationStopAfterClick) { 540 self.stopRotation(); 541 } 542 }; 543 this.pagerLinks.bind(self.options.event, this.pagerLinksHandler); 544 } 545 546 // autorotation buttons handler 547 if (this.btnPlay.length) { 548 this.btnPlayHandler = function(e) { 549 e.preventDefault(); 550 self.startRotation(); 551 }; 552 this.btnPlay.bind(this.options.event, this.btnPlayHandler); 553 } 554 if (this.btnPause.length) { 555 this.btnPauseHandler = function(e) { 556 e.preventDefault(); 557 self.stopRotation(); 558 }; 559 this.btnPause.bind(this.options.event, this.btnPauseHandler); 560 } 561 if (this.btnPlayPause.length) { 562 this.btnPlayPauseHandler = function(e) { 563 e.preventDefault(); 564 if (!self.gallery.hasClass(self.options.autorotationActiveClass)) { 565 self.startRotation(); 566 } else { 567 self.stopRotation(); 568 } 569 }; 570 this.btnPlayPause.bind(this.options.event, this.btnPlayPauseHandler); 571 } 572 573 // swipe gestures handler 574 if (this.options.useSwipe && window.Hammer && isTouchDevice) { 575 this.swipeHandler = new Hammer.Manager(this.gallery[0]); 576 this.swipeHandler.add(new Hammer.Swipe({ 577 direction: Hammer.DIRECTION_HORIZONTAL, 578 threshold: self.options.swipeThreshold 579 })); 580 this.swipeHandler.on('swipeleft', function() { 581 self.nextSlide(); 582 }).on('swiperight', function() { 583 self.prevSlide(); 584 }); 585 } 586 587 // pause on hover handling 588 if (this.options.pauseOnHover) { 589 this.hoverHandler = function() { 590 if (self.options.autoRotation) { 591 self.galleryHover = true; 592 self.pauseRotation(); 593 } 594 }; 595 this.leaveHandler = function() { 596 if (self.options.autoRotation) { 597 self.galleryHover = false;
598 self.resumeRotation(); 599 } 600 }; 601 this.gallery.bind({ 602 mouseenter: this.hoverHandler, 603 mouseleave: this.leaveHandler 604 }); 605 } 606 }, 607 onWindowResize: function() { 608 if (this.options.autoHeight) { 609 this.slidesHolder.css({ 610 height: this.slides.eq(this.currentIndex).outerHeight(true) 611 }); 612 } 613 }, 614 prevSlide: function() { 615 if (!(this.options.disableWhileAnimating && this.galleryAnimating)) { 616 this.prevIndex = this.currentIndex; 617 if (this.currentIndex > 0) { 618 this.currentIndex--; 619 this.switchSlide(); 620 } else if (this.options.circularRotation) { 621 this.currentIndex = this.stepsCount - 1; 622 this.switchSlide(); 623 } 624 } 625 }, 626 nextSlide: function(fromAutoRotation) { 627 if (!(this.options.disableWhileAnimating && this.galleryAnimating)) { 628 this.prevIndex = this.currentIndex; 629 if (this.currentIndex < this.stepsCount - 1) { 630 this.currentIndex++; 631 this.switchSlide(); 632 } else if (this.options.circularRotation || fromAutoRotation === true) { 633 this.currentIndex = 0; 634 this.switchSlide(); 635 } 636 } 637 }, 638 numSlide: function(c) { 639 if (this.currentIndex != c) { 640 this.prevIndex = this.currentIndex; 641 this.currentIndex = c; 642 this.switchSlide(); 643 } 644 }, 645 switchSlide: function() { 646 var self = this; 647 if (this.slides.length > 1) { 648 this.galleryAnimating = true; 649 if (!this.options.animSpeed) { 650 this.slides.eq(this.prevIndex).css({ 651 opacity: 0 652 }); 653 } else { 654 this.slides.eq(this.prevIndex).stop().animate({ 655 opacity: 0 656 }, { 657 duration: this.options.animSpeed 658 }); 659 } 660 661 this.switchNext = function() { 662 if (!self.options.animSpeed) { 663 self.slides.eq(self.currentIndex).css({ 664 opacity: '' 665 }); 666 } else { 667 self.slides.eq(self.currentIndex).stop().animate({ 668 opacity: 1 669 }, { 670 duration: self.options.animSpeed 671 }); 672 } 673 clearTimeout(this.nextTimer); 674 this.nextTimer = setTimeout(function() { 675 self.slides.eq(self.currentIndex).css({ 676 opacity: '' 677 }); 678 self.galleryAnimating = false; 679 self.autoRotate(); 680 681 // onchange callback 682 self.makeCallback('onChange', self); 683 }, self.options.animSpeed); 684 }; 685 686 if (this.options.switchSimultaneously) { 687 self.switchNext(); 688 } else { 689 clearTimeout(this.switchTimer); 690 this.switchTimer = setTimeout(function() { 691 self.switchNext(); 692 }, this.options.animSpeed); 693 } 694 this.refreshState(); 695 696 // onchange callback 697 this.makeCallback('onBeforeChange', this); 698 } 699 }, 700 refreshState: function(initial) { 701 this.slides.removeClass(this.options.activeClass).eq(this.currentIndex).addClass(this.options.activeClass); 702 this.pagerLinks.removeClass(this.options.activeClass).eq(this.currentIndex).addClass(this.options.activeClass); 703 this.curNum.html(this.currentIndex + 1); 704 this.allNum.html(this.stepsCount); 705 706 // initial refresh 707 if (this.options.autoHeight) { 708 if (initial) { 709 this.slidesHolder.css({ 710 height: this.slides.eq(this.currentIndex).outerHeight(true) 711 }); 712 } else { 713 this.slidesHolder.stop().animate({ 714 height: this.slides.eq(this.currentIndex).outerHeight(true) 715 }, { 716 duration: this.options.animSpeed 717 }); 718 } 719 } 720 721 // disabled state 722 if (!this.options.circularRotation) { 723 this.btnPrev.add(this.btnNext).removeClass(this.options.disabledClass); 724 if (this.currentIndex === 0) this.btnPrev.addClass(this.options.disabledClass); 725 if (this.currentIndex === this.stepsCount - 1) this.btnNext.addClass(this.options.disabledClass); 726 } 727 728 // add class if not enough slides
729 this.gallery.toggleClass('not-enough-slides', this.stepsCount === 1); 730 }, 731 startRotation: function() { 732 this.options.autoRotation = true; 733 this.galleryHover = false; 734 this.autoRotationStopped = false; 735 this.resumeRotation(); 736 }, 737 stopRotation: function() { 738 this.galleryHover = true; 739 this.autoRotationStopped = true; 740 this.pauseRotation(); 741 }, 742 pauseRotation: function() { 743 this.gallery.addClass(this.options.autorotationDisabledClass); 744 this.gallery.removeClass(this.options.autorotationActiveClass); 745 clearTimeout(this.timer); 746 }, 747 resumeRotation: function() { 748 if (!this.autoRotationStopped) { 749 this.gallery.addClass(this.options.autorotationActiveClass); 750 this.gallery.removeClass(this.options.autorotationDisabledClass); 751 this.autoRotate(); 752 } 753 }, 754 autoRotate: function() { 755 var self = this; 756 clearTimeout(this.timer); 757 if (this.options.autoRotation && !this.galleryHover && !this.autoRotationStopped) { 758 this.gallery.addClass(this.options.autorotationActiveClass); 759 this.timer = setTimeout(function() { 760 self.nextSlide(true); 761 }, this.options.switchTime); 762 } else { 763 this.pauseRotation(); 764 } 765 }, 766 makeCallback: function(name) { 767 if (typeof this.options[name] === 'function') { 768 var args = Array.prototype.slice.call(arguments); 769 args.shift(); 770 this.options[name].apply(this, args); 771 } 772 }, 773 destroy: function() { 774 this.isInit = false; 775 // navigation buttons handler 776 this.btnPrev.unbind(this.options.event, this.btnPrevHandler); 777 this.btnNext.unbind(this.options.event, this.btnNextHandler); 778 this.pagerLinks.unbind(this.options.event, this.pagerLinksHandler); 779 $(window).unbind('load resize orientationchange', this.resizeHandler); 780 781 // remove autorotation handlers 782 this.stopRotation(); 783 this.btnPlay.unbind(this.options.event, this.btnPlayHandler); 784 this.btnPause.unbind(this.options.event, this.btnPauseHandler); 785 this.btnPlayPause.unbind(this.options.event, this.btnPlayPauseHandler); 786 this.gallery.unbind('mouseenter', this.hoverHandler); 787 this.gallery.unbind('mouseleave', this.leaveHandler); 788 789 // remove swipe handler if used 790 if (this.swipeHandler) { 791 this.swipeHandler.destroy(); 792 } 793 if (typeof this.options.generatePagination === 'string') { 794 this.pagerHolder.empty(); 795 } 796 797 // remove unneeded classes and styles 798 var unneededClasses = [this.options.galleryReadyClass, this.options.autorotationActiveClass, this.options.autorotationDisabledClass]; 799 this.gallery.removeClass(unneededClasses.join(' ')).removeData('FadeGallery'); 800 this.slidesHolder.add(this.slides).add(this.mask).removeAttr('style'); 801 this.slides.removeClass(this.options.activeClass); 802 } 803 }; 804 805 // jquery plugin 806 $.fn.fadeGallery = function(opt) { 807 var args = Array.prototype.slice.call(arguments); 808 var method = args[0]; 809 810 return this.each(function() { 811 var $holder = jQuery(this); 812 var instance = $holder.data('FadeGallery'); 813 814 if (typeof opt === 'object' || typeof opt === 'undefined') { 815 $holder.data('FadeGallery', new FadeGallery($.extend({ 816 holder: this 817 }, opt))); 818 } else if (typeof method === 'string' && instance) { 819 if (typeof instance[method] === 'function') { 820 args.shift(); 821 instance[method].apply(instance, args); 822 } 823 } 824 }); 825 }; 826}(jQuery)); 827 828/* 829 * jQuery BG Parallax plugin 830 */ 831;(function($){ 832 833 'use strict'; 834 835 var isTouchDevice = /MSIE 10.*Touch/.test(navigator.userAgent) || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 836 837 var ParallaxController = (function() { 838 var $win = $(window); 839 var items = []; 840 841 var winProps = { 842 width: 0, 843 height: 0, 844 scrollTop: 0 845 }; 846 847 return { 848 init: function() { 849 $win.on('load resize orientationchange', this.resizeHandler.bind(this)); 850 $win.on('scroll', this.scrollHandler.bind(this)); 851 852 this.resizeHandler(); 853 }, 854 855 resizeHandler: function() { 856 winProps.width = $win.width(); 857 winProps.height = $win.height(); 858 //console.log(winProps.width); 859 $.each(items, this.calculateSize.bind(this)); 860 }, 861 862 scrollHandler: function() { 863 winProps.scrollTop = $win.scrollTop(); 864 865 $.each(items, this.calculateScroll.bind(this)); 866 }, 867 868 calculateSize: function(i) { 869 var item = items[i]; 870 var size = ''; 871 872 item.height = Math.max(item.$el.outerHeight(), winProps.height); 873 item.width = item.$el.outerWidth(); 874 item.topOffset = item.$el.offset().top; 875 876 877 //console.log(item.height); 878 if(item.height < 600) { 879 size = 'auto'; 880 //size = '100%'; 881 } else { 882 var styles = this.getDimensions({ 883 imageRatio: item.imageRatio, 884 itemWidth: item.width, 885 itemHeight: item.height 886 }); 887 size = Math.round(styles.width) + 'px ' + Math.round(styles.height) + 'px !important'; 888 } 889 item.$el.css({ 890 backgroundSize: size 891 /* 892 backgroundSize: Math.round(styles.width) + 'px ' + Math.round(styles.height) + 'px' 893 backgroundSize: 'auto' 894 */ 895 }); 896 897 //console.log(i); 898 this.calculateScroll(i); 899 }, 900 901 calculateScroll: function(i) { 902 var item = items[i]; 903 //console.log(item.height); 904 905 if (winProps.scrollTop + winProps.height > item.topOffset && winProps.scrollTop < item.topOffset + item.height) { 906 var ratio = (winProps.scrollTop + winProps.height - item.topOffset) / (winProps.height + item.height); 907 908 909 item.$el.css({ 910 backgroundPosition: '50% ' + (winProps.height * (item.options.parallaxOffset / 100) - (winProps.height + item.height) * ratio * (item.options.parallaxOffset / 100)) + 'px' 911 }); 912 } 913 }, 914 915 getDimensions: function(data) { 916 var slideHeight = data.itemWidth / data.imageRatio; 917 918 if (slideHeight < data.itemHeight) { 919 slideHeight = data.itemHeight; 920 data.itemWidth = slideHeight * data.imageRatio; 921 } 922 return { 923 width: data.itemWidth, 924 height: slideHeight, 925 top: (data.itemHeight - slideHeight) / 2, 926 left: (data.itemWidth - data.itemWidth) / 2 927 }; 928 }, 929 930 getRatio: function(image) {
vendor: 23,108 bytes, lines 931-1025
931 if (image.prop('naturalWidth')) { 932 return image.prop('naturalWidth') / image.prop('naturalHeight'); 933 } else { 934 var img = new Image(); 935 img.src = image.prop('src'); 936 return img.width / img.height; 937 } 938 }, 939 940 imageLoaded: function(image, callback) { 941 var self = this; 942 var loadHandler = function() { 943 callback.call(self); 944 }; 945 if (image.prop('complete')) { 946 loadHandler(); 947 } else { 948 image.one('load', loadHandler); 949 } 950 }, 951 952 add: function(el, options) { 953 var $el = $(el); 954 var $image = $el.find(options.image); 955 var repeat = ''; 956 var size = ''; 957 this.imageLoaded($image, function() { 958 var imageRatio = this.getRatio($image); 959 //console.log($image[0].width); 960 if($image[0].width < 600) { 961 repeat = 'repeat'; 962 size = 'auto !important' 963 } else { 964 repeat = 'no-repeat'; 965 size = 'cover'; 966 } 967 //console.log($image[0].width); 968 $el.css({ 969 backgroundImage: 'url(' + $image.attr('src') + ')', 970 /*backgroundRepeat: 'no-repeat',*/ 971 backgroundRepeat: repeat, 972 backgroundAttachment: !isTouchDevice ? 'fixed' : 'scroll', 973 backgroundSize: size 974 }); 975 976 $image.remove(); 977 978 if (isTouchDevice) { 979 $el.addClass(options.fallbackClass); 980 return; 981 } 982 983 options.parallaxOffset = Math.abs(options.parallaxOffset); 984 985 var newIndex = items.push({ 986 $el: $(el), 987 options: options, 988 imageRatio: imageRatio 989 }); 990 991 if($image[0].width > 600) { 992 //console.log('calculate size'); 993 this.calculateSize(newIndex - 1); 994 } 995 }); 996 } 997 }; 998 }()); 999 1000 ParallaxController.init(); 1001 1002 $.fn.parallaxBlock = function(options){ 1003 options = $.extend({ 1004 parallaxOffset: 5, // percent from 0 - top 100 (from window height) 1005 fallbackClass: 'is-touch-device', 1006 image: 'img' 1007 }, options); 1008 1009 return this.each(function() { 1010 if (this.added) { 1011 return; 1012 } 1013 1014 this.added = true; 1015 ParallaxController.add(this, options); 1016 }); 1017 }; 1018}(jQuery)); 1019 1020/*! Hammer.JS - v2.0.8 - 2016-04-23 1021 * http://hammerjs.github.io/ 1022 * 1023 * Copyright (c) 2016 Jorik Tangelder; 1024 * Licensed under the MIT license */ 1025!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
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.