site
Version:
Site Engine is the world's first all-in-one engine to build a modern web site, game, or blog. No HTML or CSS knowledge required.
1 lines • 2.34 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.timingFunctions=exports.animatedColor=exports.animatedPoint=exports.animatedValue=exports.valueAnimate=exports.timespanAnimate=exports.delayAnimate=exports.animate=void 0;var e,n,r,o,i,a,u,s,c=require("./shared.manifest");exports.animate=e=function(e,n){return t=function(r){return(()=>!1!==n(r-e)?(()=>window.requestAnimationFrame(t))():void 0)()},null==e&&(e=window.performance.now()),window.requestAnimationFrame(t);var t},exports.delayAnimate=n=function(n,t,r){return(()=>e(t,function(e){return(()=>e>=n?(()=>(r(),!1))():void 0)()}))()},exports.timespanAnimate=r=function(n,t,r,o,i){return a=n+t,e(r,function(e){return(()=>e>=a?(()=>(o(t),!function(e){return null!=e}(i)||(()=>i())(),!1))():(()=>e>=n?(()=>o(e-n))():void 0)())()});var a},exports.valueAnimate=o=function(e,n,t,o,a,u,s,c){return(()=>r(t,o,a,function(t){return(()=>s(i(e,n,o,t,u)))()},c))()},exports.animatedValue=i=function(e,n,t,r,o){return void 0===e||void 0===n?void 0:(()=>e+(n-e)*(void 0===(i=o)||null===i?s.linear:i)(r/t))();var i},exports.animatedPoint=a=function(e,n,t,r,o){return(()=>new c.Point(i(e.x,n.x,t,r,o),i(e.y,n.y,t,r,o)))()},exports.animatedColor=u=function(e,n,t,r,o){return(()=>new Color(i(e.red,n.red,t,r,o),i(e.green,n.green,t,r,o),i(e.blue,n.blue,t,r,o),i(e.alpha,n.alpha,t,r,o)))()},exports.timingFunctions=s={linear:function(e){return(()=>e)()},elasticGenerator:function(e,n,t){return(()=>(function(r){return(()=>1-(r<(2*Math.PI*t-Math.PI/2)/e?(()=>Math.cos(e*r)/(1+n*r*r))():0))()}))()},cubicBezierGenerator:function(e,n){return o=(r=function(e,n){return(()=>(function(t){return(()=>3*(1-t)*(1-t)*t*e+3*(1-t)*t*t*n+t*t*t)()}))()})(e.x,n.x),i=r(e.y,n.y),function(e){return 0===e?0:(()=>1===e?1:(()=>(n=0,r=1,a=0,(0,c.loop)(function(){var t,i;return i=o(t=(n+r)/2),Math.abs(i-e)<1e-6||40===a?(()=>c.break)():(i<e?n=t:r=t,void(a+=1))}),i(t)))())();var n,r,a};var r,o,i}},s.ease=s.cubicBezierGenerator(new c.Point(.25,.1),new c.Point(.25,1)),s.pop=s.cubicBezierGenerator(new c.Point(.25,.1),new c.Point(.25,2)),s.overflow=s.cubicBezierGenerator(new c.Point(.25,1.5),new c.Point(.25,1)),exports.animate=e,exports.delayAnimate=n,exports.timespanAnimate=r,exports.valueAnimate=o,exports.animatedValue=i,exports.animatedPoint=a,exports.animatedColor=u,exports.timingFunctions=s;