1/* 2 * rusherwang 3 * [email protected] 4 * 2014.4.2 5 * Github:https://github.com/powy1993/fullpage 6 */ 7 8function FullPage(f){function D(a,g,d,b){this.cx=3*a;this.bx=3*(d-a)-this.cx;this.ax=1-this.cx-this.bx;this.cy=3*g;this.by=3*(b-g)-this.cy;this.ay=1-this.cy-this.by}var E=document.getElementById(f.id),c=E.children,v=c.length,Z=v,B=f.slideTime||800,x=f.effect||{},b=0,A,P,k,h,s,L,F,G,T,H=[],Q=[],y=[],U=[],V,u,W=null,r=!1,M=!1,$,l,C,I,w,aa,X,ba,p,t,z,R,Y;if(c&&1!==v){f.mode&&(M=-1!==f.mode.indexOf("nav:"),U=f.mode.split(","),V=U.length);for(l=0;l<v;l++)H.push(c[l].style),Q.push(+c[l].getAttribute("data-step")|| 90),y.push(0);A=!!window.addEventListener;P="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;(function(){var a=navigator.userAgent,g=a.indexOf("Android"),d;C=-1!==a.indexOf("QQBrowser")?200:0;-1!==g&&(d=a.substring(g+7,g+11).replace(" ",""));return d||0})();k=function(a){switch(!0){case ""===a.webkitTransition:return"webkit";case ""===a.MozTransition:return"Moz";case ""===a.msTransition:return"ms";case ""===a.OTransition:return"O";default:return""}}(document.createElement("Chriswang").style); 10D.prototype={epsilon:.01,sampleCurveX:function(a){return((this.ax*a+this.bx)*a+this.cx)*a},sampleCurveY:function(a){return((this.ay*a+this.by)*a+this.cy)*a},sampleCurveDerivativeX:function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},solveCurveX:function(a,g){var d,b,e,c;e=a;for(b=0;8>b;b++){c=this.sampleCurveX(e)-a;if(Math.abs(c)<g)return e;d=this.sampleCurveDerivativeX(e);if(Math.abs(d)<g)break;e-=c/d}d=0;b=1;e=a;if(e<d)return d;if(e>b)return b;for(;d<b;){c=this.sampleCurveX(e);if(Math.abs(c-a)< 11g)break;a>c?d=e:b=e;e=.5*(b-d)+d}return e},solve:function(a,g){return this.sampleCurveY(this.solveCurveX(a,g))}};I=function(){h=document.documentElement.clientWidth||window.innerWidth;s=document.documentElement.clientHeight||window.innerHeight;E.style.height=s+"px"};l=function(a,g,b,c){L=a;F=g;G=b;T=c};if("string"===typeof f.easing)switch(f.easing){case "ease":l(.25,.1,.25,1);break;case "linear":l(0,0,1,1);break;case "ease-in":l(.42,0,1,1);break;case "ease-out":l(0,0,.58,1);break;case "ease-in-out":l(.42, 120,.58,1)}else l(f.easing[0],f.easing[1],f.easing[2],f.easing[3]);if(""!==k){for(;Z--;)H[Z][k+"TransitionTimingFunction"]="cubic-bezier("+L+","+F+","+G+","+T+")";w=function(a,b,d,c,e){a=a.style;b="translate("+b+"px,"+d+"px) translateZ(0)";e.scale&&(b+=0===c?" scale("+e.scale[0]+")":" scale("+e.scale[1]+")");e.rotate&&(b+=0===c?" rotate("+e.rotate[0]+"deg)":" rotate("+e.rotate[1]+"deg)");a[k+"TransformOrigin"]="50% 50%";a[k+"Transform"]=b}}else $=new D(L,F,G,T),w=function(a,b,d,c){var e=a.currentStyle, 13f=a.style,k=parseInt(f.left||e.left,10),p=parseInt(f.top||e.top,10),l=b-k,s=d-p,r=+new Date+c,h=0,q=x.opacity,t;clearInterval(W);W=setInterval(function(){var a;+new Date>r?(a=q?"left:"+b+"px;top:"+d+"px;filter:alpha(opacity="+100*q[1]+");":"left:"+b+"px;top:"+d+"px;",clearInterval(W)):(t=r-new Date,h=t/c,h=$.solve(1-h,D.prototype.epsilon),a="left:"+(k+l*h)+"px;top:"+(p+s*h)+"px;",q&&(a+="filter:alpha(opacity="+~~(100*(q[1]*h-q[0]*(1-h)))+");"));f.cssText=a},13)};aa={transform:function(a,b,d){var f= 140,e=""!==k||"none"!==a.translate&&a.translate?C:-50;switch(a.translate){case "Y":f=d>b?s:-s;w(c[d],0,f,0,a);break;case "X":f=d>b?h:-h;w(c[d],f,0,0,a);break;case "XY":f={X:d>b?h:-h,Y:d>b?s:-s};w(c[d],f.X,f.Y,0,a);break;default:w(c[d],0,0,0,a)}setTimeout(function(){w(c[d],0,0,B,a)},e+50)},opacity:function(a,b,d){var f=c[d].style;f.opacity=a[0];setTimeout(function(){f.opacity=a[1]},70)}};ba=A&&P?navigator.userAgent.indexOf("Firefox")?function(a,b){a.addEventListener("click",b,!1)}:function(a,b,c){a.addEventListener("touchstart", 15b,!1);c&&a.addEventListener("touchmove",function(a){a.preventDefault()},!1)}:function(a,b){a.onclick=b};p=function(a,b,c){var f=a.className,e=[];if(-1!==f.indexOf(b)){e=f.split(" ");for(f=e.length;f--;)e[f]===b&&(" "===c||""===c?e.splice(f,1):e[f]=c);e.length?a.className=e.join(" "):(a.removeAttribute("class"),a.removeAttribute("className"))}};M&&(R=function(a,b){var c=u[b].className;p(u[a],"active"," ");u[b].className=""===c?"active":c+" active"});f.continuous&&(t=function(a,b){var c=v;if(b)if(a>= 16v)for(;c--;)y[c]=0;else if(0>a)for(;c--;)y[c]=Q[c];return(v+a%v)%v});X=function(a){var f=y[b];a=f+a;if(0<=a&&a<=Q[b]){if(0===a)return p(c[b],"step1",""),y[b]=a,!1;if(1===a&&0===f)return c[b].className+=" step1",y[b]=a,!1;
16p(c[b],"step"+f,"step"+a);y[b]=a;return!1}return!0};z=function(a,g){var d=C,h,e;if(!(f.beforeChange&&"stop"===f.beforeChange(b,c[b])||r||a===b)){if(f.continuous)a=t(a,1);else if(a>=v||0>a&&0===y[b])return;r=!0;if(!g&&!X(a-b))return setTimeout(function(){r=!1},B);for(e in x)aa[e](x[e], 17b,a);d+=""===k?20:0;h=b;b=a;M&&R(h,b);setTimeout(function(){c[a].className+=" slide"},d);setTimeout(function(){H[a][k+"TransitionDuration"]=B+"ms"},20);setTimeout(function(){p(c[h],"current","");p(c[b],"slide","current");f.callback&&f.callback(b,c[b]);r=!1},B+C+120)}};I();l=c[b].className;c[b].className=-1!==l.indexOf("current")?l:l+" current";for(A?window.addEventListener("resize",I,!1):window.onresize=I;V--;)(function(a){switch(!0){case "wheel"===a:Y=function(a){a=a||window.event;a.preventDefault? 18a.preventDefault():a.returnValue=!1;r||(a=-a.wheelDelta||a.detail,z(b+(0>a?-1:1)))};A&&document.addEventListener("DOMMouseScroll",Y,!1);window.onmousewheel=document.onmousewheel=Y;break;case "touch"===a:if(!A)break;(function(){var a=x.transform.scale[0],d=x.transform.scale[1]-a,l=x.transform.rotate[0],e=x.transform.rotate[1]-l,N=x.opacity[0],u=x.opacity[1]-N,w,z,A,C,I,q={},D=!1,L=-1===navigator.userAgent.indexOf("Windows Phone")?!1:!0,m,n,F,J,S,G,K,O;K=!P&&L?window.navigator.msPointerEnabled?{start:"MSPointerDown", 19move:"MSPointerMove",end:"MSPointerUp"}:{start:"pointerDown",move:"pointerMove",end:"pointerUp"}:{start:"touchstart",move:"touchmove",end:"touchend"};document.body.ontouchmove=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};"Y"===x.transform.translate?(F=function(){var a=b-1,e=b+1;f.continuous&&(a=t(a),e=t(e));m=H[a];n=H[e];m&&(m[k+"TransitionDuration"]="0ms",m[k+"Transform"]="translate(0,-"+s+"px) translateZ(0)",m[k+"TransformOrigin"]="50% 100%",c[a].className+=" swipe");n&&(n[k+ 20"TransitionDuration"]="0ms",n[k+"Transform"]="translate(0,"+s+"px) translateZ(0)",n[k+"TransformOrigin"]="50% 0%",c[e].className+=" swipe")},G=function(b){var c=Math.abs(b.y/s),f=" scale("+~~(100*(a+d*c))/100+") rotate("+~~(l+e*c)+"deg)";m&&0<b.y&&(m.opacity=~~(100*(N+u*c))/100,m[k+"Transform"]="translate(0,"+~~(b.y-s)+"px) translateZ(0)"+f);n&&0>b.y&&(n.opacity=~~(100*(N+u*c))/100,n[k+"Transform"]="translate(0,"+~~(s+b.y)+"px) translateZ(0)"+f)},J=function(a,e){var d=B>>1,h=b+e;f.continuous&&(h= 21t(h));p(c[h],"swipe","slide");a.opacity=1;a[k+"TransitionDuration"]=d+"ms";a[k+"Transform"]="translate(0,"+e*s+"px) translateZ(0)";setTimeout(function(){p(c[h],"slide","");setTimeout(function(){r=!1},50)},d)},S=function(a,e){var d=b+e,h=~~(B/1.5),g,l;f.continuous?(d=t(d),g=c[t(b-e)],l=!0):g=c[b-e];g&&p(g,"swipe","");!l&&0>d||d>v-1?setTimeout(function(){r=!1},50):(M&&R(b,d),a.opacity=1,p(c[d],"swipe","slide"),a[k+"TransitionDuration"]=h+"ms",a[k+"Transform"]="translate(0,0) translateZ(0)",setTimeout(function(){p(c[b], 22"current","");p(c[d],"slide","current");b=d;f.callback&&f.callback(b,c[b]);setTimeout(function(){r=!1},50)},h))}):(F=function(){var a=b-1,e=b+1;f.continuous&&(a=t(a),e=t(e));m=H[a];n=H[e];m&&(m[k+"TransitionDuration"]="0ms",m[k+"Transform"]="translate(-"+h+"px,0) translateZ(0)",m[k+"TransformOrigin"]="100% 50%",c[a].className+=" swipe");n&&(n[k+"TransitionDuration"]="0ms",n[k+"Transform"]="translate("+h+"px,0) translateZ(0)",n[k+"TransformOrigin"]="0 50%",c[e].className+=" swipe")},G=function(b){var c= 23Math.abs(b.x/h),f=" scale("+~~(100*(a+d*c))/100+") rotate("+~~(l+e*c)+"deg)";m&&0<b.x&&(m.opacity=~~(100*(N+u*c))/100,m[k+"Transform"]="translate("+~~(b.x-h)+"px,0) translateZ(0)"+f);n&&0>b.x&&(n.opacity=~~(100*(N+u*c))/100,n[k+"Transform"]="translate("+~~(h+b.x)+"px,0) translateZ(0)"+f)},J=function(a,e){var d=B>>1,g=b+e;f.continuous&&(g=t(g));p(c[g],"swipe","slide");a.opacity=1;a[k+"TransitionDuration"]=d+"ms";a[k+"Transform"]="translate("+e*h+"px,0) translateZ(0)";setTimeout(function(){p(c[g],"slide", 24"");setTimeout(function(){r=!1},50)},d)},S=function(a,e){var d=b+e,h=~~(B/1.5),g,l;f.continuous?(d=t(d),g=c[t(b-e)],l=!0):g=c[b-e];g&&p(g,"swipe","");!l&&0>d||d>v-1?setTimeout(function(){r=!1},50):(M&&R(b,d),p(c[d],"swipe","slide"),a.opacity=1,a[k+"TransitionDuration"]=h+"ms",a[k+"Transform"]="translate(0,0) translateZ(0)",setTimeout(function(){p(c[b],"current","");p(c[d],"slide","current");b=d;f.callback&&f.callback(b,c[b]);setTimeout(function(){r=!1},50)},h))});w=function(a){var c=a.touches?a.touches[0]: 25a;a.preventDefault();P&&(1<event.touches.length||event.scale&&1!==event.scale)||(q={x:c.pageX-A,y:c.pageY-C},D?(a="X"===f.effect.transform.translate?0>q.x?1:-1:0>q.y?1:-1,0<=y[b]+a&&y[b]+a<=Q[b]||O&&G(q)):(O=Math.abs(q.x)>Math.abs(q.y)?"X":"Y",O=O===f.effect.transform.translate?!0:!1,D=!0))};z=function(a){var e=a.changedTouches?a.changedTouches[0]:a;a=+new Date-I;var d;d=0;var g=!1;q={x:e.pageX-A,y:e.pageY-C};e=Math.abs(q.x);d=Math.abs(q.y);switch(f.effect.transform.translate){case "Y":g=250>+a&& 2630<d||d>.3*s;d=0<q.y?-1:1;break;case "X":g=250>+a&&30<e||e>.3*h;d=0<q.x?-1:1;break;default:g=350>+a&&50<d+e||d>.3*s||e>.3*h,d=e>d?0<q.x?-1:1:0<q.y?-1:1}g&&O&&X(d)&&(!1!==f.continuous||(m||-1!==d)&&(n||1!==d))?f.beforeChange&&"stop"===f.beforeChange(b,c[b])?(m&&J(m,-1),n&&J(n,1)):-1===d?S(m,-1):S(n,1):(m&&J(m,-1),n&&J(n,1));E.removeEventListener(K.move,w,!1);E.removeEventListener(K.end,z,!1)};E.addEventListener(K.start,function(a){a=a.touches?a.touches[0]:a;if(!r){r=!0;A=a.pageX;C=a.pageY;I=+new Date; 27if(f.onSwipeStart&&"stop"===f.onSwipeStart(b,c[b]))return r=!1;q={};D=!1;F();E.addEventListener(K.move,w,!1);E.addEventListener(K.end,z,!1)}},!1)})();break;case -1!==a.indexOf("nav:"):(function(){var c=a.split(":")[1],c=document.getElementById(c),d,f;u=c.children;d=u.length;f=u[b].className;if(c&&u){for(;d--;)u[d].setAttribute("data-page",d);-1===f.indexOf("active")&&(u[b].className=""===f?"active":f+" active");d=function(a){var b;a=a||window.event;a=a.target||a.srcElement;for(b=a.tagName.toLowerCase();"li"!== 28b;){if("ul"===b)return;a=a.parentNode;b=a.tagName.toLowerCase()}z(+a.getAttribute("data-page"),1)};ba(c,d,1)}})()}})(U[V]);return{thisPage:function(){return b},go:function(a){z(a)},next:function(){z(b+1)},prev:function(){z(b-1)}}}};
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.