rxan-core
Version:
Core library for rxan (rxjs animation)
3 lines (2 loc) • 3.8 kB
JavaScript
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["exports","rxjs","rxjs/operators"],r):r(((n=n||self).rxan=n.rxan||{},n.rxan.core={}),n.rxjs,n.rxjs.operators)}(this,(function(n,r,e){"use strict";var t=r.animationFrameScheduler,o=function(n){return function(e){if(!(e instanceof r.Scheduler))throw t=n.name,o="scheduler parameter for ".concat(t," is not an instance of Scheduler"),new TypeError(o);var t,o;return n(e)}},u=function(n){return function(n){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;return n(r)}}(o(n))},i=function(n){return r.defer((function(){var t=n.now();return r.interval(0,n).pipe(e.map((function(){return n.now()-t})))}))},a=u(i),f=u((function(n){return function(t){if("number"!=typeof t)throw new TypeError("second argument (duration) of during should be a number");if(t<=0)throw new RangeError("second argument (duration) of during should be a positive number");return i(n).pipe(e.map((function(n){return n/t})),e.takeWhile((function(n){return n<1})),(function(n){return r.concat(n,[1])}))}})),c=u((function(n){return function(t,o){if("number"!=typeof t)throw new TypeError("second argument (period) of periodOf should be a number");if(t<=0)throw new RangeError("second argument (period) of periodOf should be a positive number");if(o){if("number"!=typeof o)throw new TypeError("third argument (cycles) of periodOf should be undefined or a number");if(o<=0)throw new RangeError("third argument (cycles) of periodOf should be a positive number")}return o=o||Number.POSITIVE_INFINITY,r.interval(t,n).pipe(e.map((function(n){return n+1})),e.take(o))}})),s=u((function(n){return function(t,o){if("number"!=typeof t)throw new TypeError("second argument (period) of toggle should be a number");if(t<=0)throw new RangeError("second argument (period) of toggle should be a positive number");if(o){if("number"!=typeof o)throw new TypeError("third argument (cycles) of toggle should be undefined or a number");if(o<=0)throw new RangeError("third argument (cycles) of toggle should be a positive number")}return o=o||Number.POSITIVE_INFINITY,r.interval(t,n).pipe(e.map((function(n){return n%2==0})),e.take(o))}})),d=function(n){return function(r){if(r<0||r>1)throw e=n.name,t="input of ".concat(e," should be smaller than 1, and larger than 0"),new RangeError(t);var e,t;return n(r)}},p=function(n){if(!n.in||!n.out||!n.inout)throw new TypeError("input of withDomainChecker should have in, out, inout property.");var r=d(n);return r.in=d(n.in),r.out=d(n.out),r.inout=d(n.inout),r},h=function(n){return function(r){return 1-n(1-r)}},l=function(n){return function(r){return r<.5?n(2*r)/2:1-n(2*(1-r))/2}},m=function(n){return n};m.in=m,m.out=h(m),m.inout=l(m);var b=function(n){return n*n};b.in=b,b.out=h(b),b.inout=l(b);var g=function(n){return n*n*n};g.in=g,g.out=h(g),g.inout=l(g);var w=function(n){return 1-Math.cos(n*Math.PI/2)};w.in=w,w.out=function(n){return Math.sin(n*Math.PI/2)},w.inout=function(n){return(1-Math.cos(n*Math.PI))/2};var v=function(n){return 0===n?0:Math.pow(2,10*(n-1))};v.in=v,v.out=h(v),v.inout=l(v);var y=Math.PI,E=Math.pow,I=Math.sin,M=function(n){return 0===n?0:E(2,10*(n-1))*I(6.5*n*y)};M.in=M,M.out=h(M),M.inout=l(M);var x=function(n){return 1-Math.sqrt(1-n*n)};x.in=x,x.out=h(x),x.inout=l(x);var T=function(n){return n*n*(Math.E*n-Math.E+1)};T.in=T,T.out=h(T),T.inout=l(T);var j=p(m),O=p(b),_=p(g),P=p(w),N=p(v),R=p(M),k=p(x),S=p(T),q=Object.freeze({__proto__:null,linear:j,quadratic:O,cubic:_,sine:P,exponential:N,elastic:R,circle:k,back:S});n.during=f,n.easing=q,n.msElapsed=a,n.periodOf=c,n.toggle=s,Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map