You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
9.6 KiB

8 months ago
"use strict";/*!
* EDITED BY LIQUID THEMES *
* pagepiling.js 1.5.5
*
* https://github.com/alvarotrigo/pagePiling.js
* @license MIT licensed
*
* Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo
*/
!function($,e,n,t){$.fn.pagepiling=function(o){function i(e){e.addClass("pp-table").wrapInner('<div class="pp-tableCell" style="height:100%" />')}function a(e){return $(".pp-section.active").index(".pp-section")>e.index(".pp-section")?"up":"down"}function s(e,n){var t={destination:e,animated:n,activeSection:$(".pp-section.active"),anchorLink:e.data("anchor"),sectionIndex:e.index(".pp-section"),toMove:e,yMovement:a(e),leavingSection:$(".pp-section.active").index(".pp-section")+1};if(!t.activeSection.is(e)){if(void 0===t.animated&&(t.animated=!0),void 0!==t.anchorLink&&u(t.anchorLink,t.sectionIndex),t.destination.addClass("active").siblings().removeClass("active"),t.sectionsToMove=l(t),"down"===t.yMovement){if(t.translate3d=q(),t.destination.is(".pp-auto-height")){var o=-1*t.destination.outerHeight()+"px";t.translate3d="translate3d(0px, "+o+", 0px)",t.scrolling=o,t.sectionsToMove=t.activeSection}else t.scrolling="-100%";Z.css3||t.sectionsToMove.each(function(e){e!=t.activeSection.index(".pp-section")&&$(this).css(d(t.scrolling))}),t.animateSection=t.activeSection}else t.translate3d="translate3d(0px, 0px, 0px)",t.scrolling="0",t.animateSection=e;$.isFunction(Z.onLeave)&&Z.onLeave.call(this,t.leavingSection,t.sectionIndex+1,t.yMovement),c(t),U(t.anchorLink),A(t.anchorLink,t.sectionIndex),F=t.anchorLink;var i=(new Date).getTime();H=i}}function c(e){Z.css3?(w(e.animateSection,e.translate3d,e.animated),e.sectionsToMove.each(function(){w($(this),e.translate3d,e.animated)}),setTimeout(function(){r(e)},Z.scrollingSpeed)):(e.scrollOptions=d(e.scrolling),e.animated?e.animateSection.animate(e.scrollOptions,Z.scrollingSpeed,Z.easing,function(){p(e),r(e)}):(e.animateSection.css(d(e.scrolling)),setTimeout(function(){p(e),r(e)},400)))}function r(e){$.isFunction(Z.afterLoad)&&Z.afterLoad.call(this,e.anchorLink,e.sectionIndex+1)}function l(e){var n;return n="down"===e.yMovement?$(".pp-section").map(function(n){if(n<e.destination.index(".pp-section"))return $(this)}):$(".pp-section").map(function(n){if(n>e.destination.index(".pp-section"))return $(this)})}function p(e){"up"===e.yMovement&&e.sectionsToMove.each(function(n){$(this).css(d(e.scrolling))})}function d(e){return"vertical"===Z.direction?{top:e}:{left:e}}function v(e,n){Z.css3?w(e,q(),!1):e.css(d(n))}function u(e,n){Z.anchors.length?(location.hash=e,h(location.hash)):h(String(n))}function h(e){e=e.replace("#",""),$("body")[0].className=$("body")[0].className.replace(/\b\s?pp-viewing-[^\s]+\b/g,""),$("body").addClass("pp-viewing-"+e)}function f(){var t=n.location.hash.replace("#",""),o=t,i=$(e).find('.pp-section[data-anchor="'+o+'"]');i.length>0&&s(i,Z.animateAnchor)}function m(){return(new Date).getTime()-H<J+Z.scrollingSpeed}function g(){var t=n.location.hash.replace("#","").split("/"),o=t[0];if(o.length&&o&&o!==F){var i;i=isNaN(o)?$(e).find('[data-anchor="'+o+'"]'):$(".pp-section").eq(o-1),s(i)}}function S(e){return{"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,transform:e}}function w(e,n,t){e.css(S(n))}function b(e){var t=(new Date).getTime();e=e||n.event;var o=e.wheelDelta||-e.deltaY||-e.detail,i=Math.max(-1,Math.min(1,o)),a=void 0!==e.wheelDeltaX||void 0!==e.deltaX,s=Math.abs(e.wheelDeltaX)<Math.abs(e.wheelDelta)||Math.abs(e.deltaX)<Math.abs(e.deltaY)||!a;G.length>149&&G.shift(),G.push(Math.abs(o));var c=t-ee;if(ee=t,c>200&&(G=[]),!m()){var r=$(".pp-section.active"),l=T(r);return x(G,10)>=x(G,70)&&s&&(i<0?M("down",l):i>0&&M("up",l)),!1}}function x(e,n){for(var t=0,o=e.slice(Math.max(e.length-n,1)),i=0;i<o.length;i++)t+=o[i];return Math.ceil(t/n)}function M(e,n){var t,o;if("down"==e?(t="bottom",o=O.moveSectionDown):(t="top",o=O.moveSectionUp),n.length>0){if(!y(t,n))return!0;o()}else o()}function y(e,n){return"top"===e?!n.scrollTop():"bottom"===e?n.scrollTop()+1+n.innerHeight()>=n[0].scrollHeight:void 0}function T(e){return e.filter(".pp-scrollable")}function C(){B.get(0).addEventListener?(B.get(0).removeEventListener("mousewheel",b,!1),B.get(0).removeEventListener("wheel",b,!1)):B.get(0).detachEvent("onmousewheel",b)}function k(){B.get(0).addEventListener?(B.get(0)