Comparing version 3.0.5 to 3.0.6
@@ -1,2 +0,2 @@ | ||
// [Fatina] Build: 3.0.5 - Tuesday, January 12th, 2021, 9:21:53 PM | ||
// [Fatina] Build: 3.0.6 - Tuesday, January 12th, 2021, 9:42:47 PM | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -477,3 +477,3 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
*/ | ||
this.version = '3.0.5'; | ||
this.version = '3.0.6'; | ||
this.time = 0; | ||
@@ -480,0 +480,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
// [Fatina] Build: 3.0.5 - Tuesday, January 12th, 2021, 9:21:53 PM | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Fatina",[],e):"object"==typeof exports?exports.Fatina=e():t.Fatina=e().default}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseTween=void 0;e.BaseTween=class{constructor(){this.events={},this.elapsed=0,this.duration=0,this.timescale=1,this.state=0,this.first=!0}get isIdle(){return 0===this.state}get isRunning(){return 1===this.state}get isFinished(){return this.state>=3}get isPaused(){return 2===this.state}start(){return 0!==this.state||(this.first?this.validate():this.check(),this.state=1,this.parent.addTick(this.tickCb),this.first&&(this.emitEvent(this.events.start),this.first=!1)),this}reset(t){this.state=0,t||this.removeParent(),this.loop&&(this.loop.value=this.loop.original),this.loopInit(),this.emitEvent(this.events.restart)}resetAndStart(t){this.loopInit(),this.emitEvent(this.events.restart),this.state=1,t>0&&this.tickCb(t)}setParent(t){return this.removeParent(),this.parent=t,this}setTimescale(t){return this.timescale=t,this}pause(){1===this.state?(this.state=2,this.removeParent()):this.info(1,"Cannot pause this tween ",this.state)}resume(){2===this.state?(this.state=1,this.parent.addTick(this.tickCb)):this.info(1,"Cannot resume this tween ",this.state)}skip(t){if(this.state>=3)this.info(1,"Cannot skip this tween ",this.state);else if(0===this.state&&this.emitEvent(this.events.start),t){const t=this.yo?this.yo.value*this.duration:0;this.tickCb(this.duration-this.elapsed+t)}else this.elapsed=this.duration,this.complete()}kill(){4!==this.state?(this.state=4,this.removeParent(),this.emitEvent(this.events.kill)):this.info(1,"Cannot kill this tween ",this.state)}setLoop(t){return this.loop||(this.loop={original:1,value:1}),this.loop.original=Math.round(t),this.loop.value=this.loop.original,this}setSettings(t){return this.settings?Object.assign(this.settings,t):this.settings=t,this}complete(){this.state>=3?this.info(1,"Cannot complete this tween ",this.state):(this.state=3,this.removeParent(),this.emitEvent(this.events.complete))}removeParent(){this.parent&&this.parent.removeTick(this.tickCb)}check(){}validate(){}loopInit(){this.elapsed=0}info(t,e,i){!this.settings||t>this.settings.logLevel||console.log(e,i)}emit(t,e){if(this.settings&&!this.settings.safe)return t.apply(this,e);try{t.apply(this,e)}catch(t){console.warn(t)}}emitEvent(t,e){if(t)if(t instanceof Array)for(const i of t)this.emit(i,e);else this.emit(t,e)}onStart(t){return this.onEvent("start",t)}onRestart(t){return this.onEvent("restart",t)}onUpdate(t){return this.onEvent("update",t)}onKilled(t){return this.onEvent("kill",t)}onComplete(t){return this.onEvent("complete",t)}onEvent(t,e){return this.events[t]?this.events[t]instanceof Array?this.events[t].push(e):this.events[t]=[this.events[t],e]:this.events[t]=e,this}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.easeNames=void 0;const s=Math.PI,n=Math.PI/2,a={linear:t=>t,inQuad:t=>t*t,outQuad:t=>2*t-t*t,inOutQuad:t=>t<.5?2*t*t:2*(2*t-t*t)-1,inCubic:t=>t*t*t,outCubic:t=>3*t-3*t*t+t*t*t,inOutCubic:t=>t<.5?4*t*t*t:4*(3*t-3*t*t+t*t*t)-3,inQuart:t=>t*t*t*t,outQuart:t=>{const e=t*t;return 4*t-6*e+4*e*t-e*e},inOutQuart:t=>{if(t<.5)return 8*t*t*t*t;{const e=t*t;return 8*(4*t-6*e+4*e*t-e*e)-7}},inSine:t=>1===t?1:1-Math.cos(n*t),outSine:t=>Math.sin(n*t),inOutSine:t=>t<.5?(1-Math.cos(s*t))/2:(1+Math.sin(s*(t-.5)))/2,inCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),outCirc:t=>Math.sqrt(1-Math.pow(1-t,2)),inOutCirc:t=>t<.5?(1-Math.sqrt(1-4*t*t))/2:(1+Math.sqrt(8*t-3-4*t*t))/2,inQuint:t=>t*t*t*t*t,outQuint:t=>--t*t*t*t*t+1,InOutQuint:t=>(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),inExponential:t=>1===t?1:0===t?0:Math.pow(1024,t-1),outExponential:t=>1===t?1:1-Math.pow(2,-10*t),inOutExponential:t=>0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1))),inElastic:t=>0===t?0:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI),outElastic:t=>1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1,inOutElastic:t=>0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1,inBack:t=>{const e=1.70158;return 0===t?0:1===t?1:t*t*((e+1)*t-e)},outBack:t=>{const e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},inOutBack:t=>{const e=2.5949095;return 0===(t*=2)?0:t<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},outBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,inBounce:t=>1-a.outBounce(1-t),inOutBounce:t=>t<.5?.5*a.inBounce(2*t):.5*a.outBounce(2*t-1)+.5};e.easeNames=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Delay=void 0;const s=i(0);class n extends s.BaseTween{constructor(t){super(),this.remains=0,this.duration=t,this.tickCb=this.tick.bind(this)}tick(t){for(this.remains=t*this.timescale;this.remains>0;){this.elapsed+=this.remains;const t=Math.max(Math.min(this.elapsed/this.duration,1),0);if(this.events.update&&this.emitEvent(this.events.update,[this.remains,t]),this.elapsed<this.duration)return;if(this.remains=this.elapsed-this.duration,!this.loop||(this.loop.value--,0===this.loop.value))return void this.complete();this.resetAndStart(0)}}}e.Delay=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Sequence=void 0;const s=i(0),n=i(8),a=i(2);class h extends s.BaseTween{constructor(t){if(super(),this.evtTick=new Set,this.tweens=[],this.index=0,this.remains=0,this.tickCb=this.tick.bind(this),t){this.tweens=new Array(t.length);for(let e=0;e<t.length;e++)t[e].setParent(this),this.tweens[e]=[t[e]]}}get count(){return this.tweens.length}loopInit(){this.index=0;for(const t of this.tweens)for(const e of t)e.reset()}addTick(t){this.evtTick.add(t)}removeTick(t){this.evtTick.delete(t)}tick(t){this.state>=3||(this.remains=t*this.timescale,this.elapsed+=this.remains,this.localTick(this.remains))}localTick(t,e){if(this.cur||this.nextTween(),this.cur&&(this.evtTick.forEach((function(e){e(t)})),!0!==e&&this.events.update&&this.emitEvent(this.events.update,[t,0])),this.remains=t,this.cur){for(const t of this.cur)if(3!==t.state)return;if(this.remains=this.cur[0].elapsed-this.cur[0].duration,this.events.stepEnd&&this.emitEvent(this.events.stepEnd,this.cur[0]),this.cur=void 0,this.index++,this.remains>.01)return void this.localTick(this.remains,!0)}if(!this.cur&&this.tweens.length===this.index){if(this.loop&&(this.loop.value--,0!==this.loop.value))return void this.resetAndStart(this.remains);this.complete()}}nextTween(){if(this.cur=this.tweens[this.index],this.cur){for(const t of this.cur)t.start();this.events.stepStart&&this.emitEvent(this.events.stepStart,this.cur[0])}}append(t){return t.setParent(this),this.tweens[this.tweens.length]=[t],this}appendCallback(t){const e=new n.Callback(t);return e.setParent(this),this.tweens[this.tweens.length]=[e],this}appendInterval(t){const e=new a.Delay(t);return e.setParent(this),this.tweens[this.tweens.length]=[e],this}prepend(t){return t.setParent(this),this.tweens.unshift([t]),this}prependCallback(t){const e=new n.Callback(t);return e.setParent(this),this.tweens.unshift([e]),this}prependInterval(t){const e=new a.Delay(t);return e.setParent(this),this.tweens.unshift([e]),this}skip(t){if(this.state>=3)this.info(1,"Cannot skip this tween ",this.state);else{for(const e of this.tweens)for(const i of e)0===i.elapsed&&this.emitEvent(this.events.stepStart,i),i.skip(t),this.emitEvent(this.events.stepEnd,i);super.skip()}}kill(){if(4!==this.state){for(const t of this.tweens)for(const e of t)e.kill();super.kill()}else this.info(1,"Cannot kill this tween ",this.state)}join(t){return 0===this.tweens.length?this.append(t):(t.setParent(this),this.tweens[this.tweens.length-1].push(t),this)}onStepStart(t){return this.onEvent("stepStart",t)}onStepEnd(t){return this.onEvent("stepEnd",t)}}e.Sequence=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EasingType=void 0;const s=i(5);e.default=new s.Fatina;var n=i(10);Object.defineProperty(e,"EasingType",{enumerable:!0,get:function(){return n.EasingType}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Fatina=void 0;const s=i(6),n=i(7),a=i(2),h=i(3),r=i(9);let o,u,c;"undefined"!=typeof window&&(u=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,c=window.cancelAnimationFrame||window.mozCancelAnimationFrame);e.Fatina=class{constructor(){this.plugin={},this.loadedPlugins=[],this.eventCreated=[],this.settings={logLevel:0,safe:!0,smooth:!1,maxFrameDt:50,maxFrameNumber:40,maxDt:500},this.version="3.0.5",this.time=0,this.dt=0,this.lastTime=0,this.initialized=!1,this.pulse=(t,e)=>s.pulsePreset(this,t,e),this.scale=(t,e)=>s.scalePreset(this,t,e),this.wobble=(t,e)=>s.wobblePreset(this,t,e),this.sonar=(t,e)=>s.sonarPreset(this,t,e),this.shake=(t,e)=>s.shakePreset(this,t,e)}get mainTicker(){return this.initialized||this.init(),this.manager}get elapsed(){return this.manager.elapsed}init(t){return!this.initialized&&(this.manager||(this.manager=new n.Ticker,this.manager.start(),this.defaultTicker=this.manager),"undefined"==typeof window||t||(console.log(" %c Fatina - Tweening library for games ("+this.version+") https://github.com/kefniark/Fatina ","background: #222; color: #9fbff4; padding: 5px"),this.lastTime=-1,"loading"!==document.readyState?o=u(this.updateLoop.bind(this)):document.addEventListener("DOMContentLoaded",()=>{o=u(this.updateLoop.bind(this))})),this.initialized=!0,!0)}setTimescale(t){this.init(),this.manager.setTimescale(t)}setDefaultTicker(t){this.defaultTicker=t}pause(){this.init(),this.manager.pause()}resume(){this.init(),this.manager.resume()}destroy(){this.manager&&this.manager.kill(),o&&c(o),this.initialized=!1}update(t){this.initialized&&this.manager&&(this.manager.tick(t),this.time+=t)}tween(t){const e=new r.Tween(t);return this.addContext(e),e}sequence(t){const e=new h.Sequence(t);return this.addContext(e),e}delay(t){const e=new a.Delay(t);return this.addContext(e),e}setTimeout(t,e){const i=new a.Delay(e).onComplete(t);return this.addContext(i),i.start()}setInterval(t,e){const i=new a.Delay(e).onRestart(t).setLoop(-1);return this.addContext(i),i.start()}addContext(t){this.initialized||this.init(),t.setParent(this.defaultTicker),0===this.settings.logLevel&&this.settings.safe||t.setSettings(this.settings),this.emitCreated(t)}ticker(){this.initialized||this.init();const t=new n.Ticker,e=t.tick.bind(t);return t.setParent(this.manager,e),this.manager.addTick(e),t.start(),this.emitCreated(t),t}updateLoop(t){if(this.dt=this.lastTime<0?16:this.dt+t-this.lastTime,this.dt>this.settings.maxDt&&(console.warn(`dt too high ${Math.round(this.dt)}ms. , Capped to ${this.settings.maxDt}ms.`),this.dt=this.settings.maxDt),this.settings.smooth){let t=0;for(;this.dt>0&&t<this.settings.maxFrameNumber;){const e=Math.min(this.dt,this.settings.maxFrameDt);this.update(e),this.dt-=e,t++}}else this.update(this.dt),this.dt=0;this.lastTime=t,o=u(this.updateLoop.bind(this))}loadPlugin(t){t.init(this),this.loadedPlugins.push(t),this.info(2,"Plugin Loaded",t.name)}info(t,e,i){t>this.settings.logLevel||(i?console.log(e,i):console.log(e))}emit(t,e){if(!this.settings.safe)return t(e);try{t(e)}catch(t){console.warn(t)}}emitCreated(t){for(const e of this.eventCreated)this.emit(e,t)}addListenerCreated(t){this.eventCreated.push(t)}removeListenerCreated(t){const e=this.eventCreated.indexOf(t);-1!==e&&this.eventCreated.splice(e,1)}setLog(t){this.settings.logLevel=t}setSafe(t){this.settings.safe=t}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shakePreset=e.wobblePreset=e.scalePreset=e.pulsePreset=e.sonarPreset=void 0;const s=i(1);function n(t,e){const i=e.split(".");let s=t;for(let t=0;t<i.length-1;t++)s=s[i[t]];return s}function a(t){const e=t.split(".");return e[e.length-1]}function h(t,e){const i={};return i[a(t)]=e,i}function r(t,e,i){const s=Object.assign(Object.assign({},{scaleX:"scale.x",scaleY:"scale.y",amplitude:.5,duration:2e3,bounce:5,friction:2,sinX:0}),i||{}),h=n(e,s.scaleX),r=a(s.scaleX),o=a(s.scaleY),u={x:h[r],y:h[o]};return t.tween({}).to({},s.duration).setEasing("inOutCubic").onUpdate((t,e)=>{const i=Math.pow(1-e,s.friction),n=e*s.bounce%s.duration;h[r]=u.x+Math.sin(s.sinX+n*Math.PI*2)*s.amplitude*i,h[o]=u.y+Math.sin(n*Math.PI*2)*s.amplitude*i}).onKilled(()=>{h[r]=u.x,h[o]=u.y})}e.sonarPreset=function(t,e,i){const h=Object.assign(Object.assign({},{alpha:"alpha",scaleX:"scale.x",scaleY:"scale.y",amplitude:4,duration:2e3}),i||{}),r=n(e,h.scaleX),o=n(e,h.alpha),u=a(h.scaleX),c=a(h.scaleY),l=a(h.alpha),d={x:r[u],y:r[c]},p=s.easeNames.outCubic;return t.tween({}).to({},h.duration).onUpdate((t,e)=>{o[l]=1-s.easeNames.inSine(e),r[u]=d.x+h.amplitude*p(e),r[c]=d.y+h.amplitude*p(e)}).onKilled(()=>{o[l]=1,r[u]=d.x,r[c]=d.y})},e.pulsePreset=function(t,e,i){const s=Object.assign(Object.assign({},{alpha:"alpha",duration:2e3}),i||{}),r=n(e,s.alpha);return t.tween(r).to(h(s.alpha,0),s.duration/2).setEasing("inOutQuad").toSequence().append(t.tween(r).to(h(s.alpha,1),s.duration/2).setEasing("inOutQuad")).onKilled(()=>r[a(s.alpha)]=1)},e.scalePreset=r,e.wobblePreset=function(t,e,i){const s={sinX:Math.PI};return r(t,e,Object.assign(Object.assign({},s),i||{}))},e.shakePreset=function(t,e,i){const s=Object.assign(Object.assign({},{posX:"position.x",posY:"position.y",amplitude:1.5,duration:2e3,bounce:10,friction:2}),i||{}),h=n(e,s.posX),r=a(s.posX),o=a(s.posY),u={x:h[r],y:h[o]},c=.5+Math.random(),l=.5+Math.random();return t.tween({}).to({},s.duration).onUpdate((t,e)=>{const i=Math.pow(1-e,s.friction),n=e*s.bounce%s.duration;h[r]=u.x+Math.sin(Math.PI+(n+c)*Math.PI*2)*s.amplitude*i,h[o]=u.y+Math.sin((n+l)*Math.PI*2)*s.amplitude*i}).onKilled(()=>{h[r]=u.x,h[o]=u.y})}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ticker=void 0;e.Ticker=class{constructor(){this.state=0,this.timescale=1,this.elapsed=0,this.duration=0,this.ticks=new Set,this.newTicks=new Set,this.dt=0}setParent(t,e){this.tickCb=e,this.parent=t}setTimescale(t){this.timescale=t}addTick(t){this.newTicks.add(t)}removeTick(t){this.ticks.delete(t)||this.newTicks.delete(t)}tick(t){1===this.state&&(this.dt=t*this.timescale,this.newTicks.size>0&&(this.newTicks.forEach(t=>this.ticks.add(t)),this.newTicks.clear()),this.ticks.forEach(t=>t(this.dt)),this.elapsed+=this.dt)}start(){0===this.state&&(this.state=1)}pause(){1===this.state&&(this.state=2)}resume(){2===this.state&&(this.state=1)}kill(){this.state>=3||(this.parent&&this.tickCb&&this.parent.removeTick(this.tickCb),this.state=4)}skip(){}reset(){this.state=0}get isIdle(){return 0===this.state}get isRunning(){return 1===this.state}get isFinished(){return this.state>=3}get isPaused(){return 2===this.state}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Callback=void 0;const s=i(0);class n extends s.BaseTween{constructor(t){super(),this.callback=t,this.tickCb=this.tick.bind(this)}tick(t){this.elapsed+=t,this.duration=0,this.callback(),this.emitEvent(this.events.update,[t,1]),this.complete()}}e.Callback=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Tween=void 0;const s=i(1),n=i(0),a=i(3);class h extends n.BaseTween{constructor(t){super(),this.prop=[],this.steps=0,this.relative=!1,this.p=0,this.v=0,this.remains=0,this.obj=t,this.tickCb=this.tick.bind(this)}init(t){this.obj=t,this.prop.length=0}validate(){if(!this.obj)throw new Error("undefined object");if(!this.parent)throw new Error("no ticker");this.ease||(this.ease=s.easeNames.linear),this.check()}check(){this.cf||(this.cf={}),this.ct||(this.ct={});for(const t of this.prop)this.f?(this.cf[t]=this.f[t],this.obj[t]=this.f[t]):this.cf[t]=this.obj[t],this.relative?this.ct[t]=this.obj[t]+this.t[t]:this.ct[t]=this.t[t]}tick(t){if(!(this.state>=3))for(this.remains=t*this.timescale;this.remains>0;){this.elapsed+=this.remains,this.p=Math.max(Math.min(this.elapsed/this.duration,1),0),this.v=this.ease(this.p),this.yo&&(this.yo.original-this.yo.value)%2==1&&(this.v=1-this.ease(1-this.p)),0!==this.steps&&(this.v=Math.round(this.v*this.steps)/this.steps);for(const t of this.prop)this.obj[t]=this.cf[t]+(this.ct[t]-this.cf[t])*this.v;if(this.events.update&&this.emitEvent(this.events.update,[this.remains,this.p]),this.elapsed<this.duration)return;if(this.remains=this.elapsed-this.duration,this.yo&&0!==this.yo.value)this.reverse(),this.resetAndStart(0),this.yo.value--;else{if(!this.loop||(this.loop.value--,0===this.loop.value))return void this.complete();this.check(),this.resetAndStart(0)}}}from(t){return this.f=t,this.updateProp(),this}to(t,e){return this.t=t,this.duration=e,this.updateProp(),this}updateProp(){if(this.obj){for(const t in this.t)this.t.hasOwnProperty(t)&&this.prop.push(t);this.prop.filter((t,e,i)=>e===i.indexOf(t))}}setRelative(t){return this.relative=t,this}modify(t,e){for(const i of this.prop)t.hasOwnProperty(i)&&(this.obj[i]+=t[i],e?this.ct[i]+=t[i]:this.cf[i]+=t[i])}reset(t){if(this.yo){if((this.yo.original-this.yo.value)%2==1){let t=this.cf;this.cf=this.ct,this.ct=t,t=this.f,this.f=this.t,this.t=t;const e=(1-this.elapsed/this.duration)*this.duration;this.elapsed=Math.round(1e3*e)/1e3}this.yo.value=this.yo.original}super.reset(t)}reverse(){let t=this.cf;this.cf=this.ct,this.ct=t,t=this.f,this.f=this.t,this.t=t;const e=(1-this.elapsed/this.duration)*this.duration;this.elapsed=Math.round(1e3*e)/1e3,3===this.state&&(this.reset(!0),this.start())}yoyo(t){return this.yo||(this.yo={original:0,value:0}),this.yo.original=t,this.yo.value=t,this}setSteps(t){return this.steps=t,this}toSequence(){if(!this.parent)throw new Error("parent ticker not defined");return(new a.Sequence).setParent(this.parent).append(this)}setEasing(t){if(!(t in s.easeNames))throw new Error("unknown easing method "+t);return this.ease=s.easeNames[t],this}loopInit(){this.elapsed=0}}e.Tween=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EasingType=void 0,function(t){t.Linear="linear",t.InQuad="inQuad",t.OutQuad="outQuad",t.InOutQuad="inOutQuad",t.InCubic="inCubic",t.OutCubic="outCubic",t.InOutCubic="inOutCubic",t.InQuart="inQuart",t.OutQuart="outQuart",t.InOutQuart="inOutQuart",t.InSine="inSine",t.OutSine="outSine",t.InOutSine="inOutSine",t.InCirc="inCirc",t.OutCirc="outCirc",t.InOutCirc="inOutCirc",t.InQuint="inQuint",t.OutQuint="outQuint",t.InOutQuint="inOutQuint",t.InExponential="inExponential",t.OutExponential="outExponential",t.InOutExponential="inOutExponential",t.InElastic="inElastic",t.OutElastic="outElastic",t.InOutElastic="inOutElastic",t.InBack="inBack",t.OutBack="outBack",t.InOutBack="inOutBack",t.InBounce="inBounce",t.OutBounce="outBounce",t.InOutBounce="inOutBounce"}(e.EasingType||(e.EasingType={}))}])})); | ||
// [Fatina] Build: 3.0.6 - Tuesday, January 12th, 2021, 9:42:48 PM | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Fatina",[],e):"object"==typeof exports?exports.Fatina=e():t.Fatina=e().default}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseTween=void 0;e.BaseTween=class{constructor(){this.events={},this.elapsed=0,this.duration=0,this.timescale=1,this.state=0,this.first=!0}get isIdle(){return 0===this.state}get isRunning(){return 1===this.state}get isFinished(){return this.state>=3}get isPaused(){return 2===this.state}start(){return 0!==this.state||(this.first?this.validate():this.check(),this.state=1,this.parent.addTick(this.tickCb),this.first&&(this.emitEvent(this.events.start),this.first=!1)),this}reset(t){this.state=0,t||this.removeParent(),this.loop&&(this.loop.value=this.loop.original),this.loopInit(),this.emitEvent(this.events.restart)}resetAndStart(t){this.loopInit(),this.emitEvent(this.events.restart),this.state=1,t>0&&this.tickCb(t)}setParent(t){return this.removeParent(),this.parent=t,this}setTimescale(t){return this.timescale=t,this}pause(){1===this.state?(this.state=2,this.removeParent()):this.info(1,"Cannot pause this tween ",this.state)}resume(){2===this.state?(this.state=1,this.parent.addTick(this.tickCb)):this.info(1,"Cannot resume this tween ",this.state)}skip(t){if(this.state>=3)this.info(1,"Cannot skip this tween ",this.state);else if(0===this.state&&this.emitEvent(this.events.start),t){const t=this.yo?this.yo.value*this.duration:0;this.tickCb(this.duration-this.elapsed+t)}else this.elapsed=this.duration,this.complete()}kill(){4!==this.state?(this.state=4,this.removeParent(),this.emitEvent(this.events.kill)):this.info(1,"Cannot kill this tween ",this.state)}setLoop(t){return this.loop||(this.loop={original:1,value:1}),this.loop.original=Math.round(t),this.loop.value=this.loop.original,this}setSettings(t){return this.settings?Object.assign(this.settings,t):this.settings=t,this}complete(){this.state>=3?this.info(1,"Cannot complete this tween ",this.state):(this.state=3,this.removeParent(),this.emitEvent(this.events.complete))}removeParent(){this.parent&&this.parent.removeTick(this.tickCb)}check(){}validate(){}loopInit(){this.elapsed=0}info(t,e,i){!this.settings||t>this.settings.logLevel||console.log(e,i)}emit(t,e){if(this.settings&&!this.settings.safe)return t.apply(this,e);try{t.apply(this,e)}catch(t){console.warn(t)}}emitEvent(t,e){if(t)if(t instanceof Array)for(const i of t)this.emit(i,e);else this.emit(t,e)}onStart(t){return this.onEvent("start",t)}onRestart(t){return this.onEvent("restart",t)}onUpdate(t){return this.onEvent("update",t)}onKilled(t){return this.onEvent("kill",t)}onComplete(t){return this.onEvent("complete",t)}onEvent(t,e){return this.events[t]?this.events[t]instanceof Array?this.events[t].push(e):this.events[t]=[this.events[t],e]:this.events[t]=e,this}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.easeNames=void 0;const s=Math.PI,n=Math.PI/2,a={linear:t=>t,inQuad:t=>t*t,outQuad:t=>2*t-t*t,inOutQuad:t=>t<.5?2*t*t:2*(2*t-t*t)-1,inCubic:t=>t*t*t,outCubic:t=>3*t-3*t*t+t*t*t,inOutCubic:t=>t<.5?4*t*t*t:4*(3*t-3*t*t+t*t*t)-3,inQuart:t=>t*t*t*t,outQuart:t=>{const e=t*t;return 4*t-6*e+4*e*t-e*e},inOutQuart:t=>{if(t<.5)return 8*t*t*t*t;{const e=t*t;return 8*(4*t-6*e+4*e*t-e*e)-7}},inSine:t=>1===t?1:1-Math.cos(n*t),outSine:t=>Math.sin(n*t),inOutSine:t=>t<.5?(1-Math.cos(s*t))/2:(1+Math.sin(s*(t-.5)))/2,inCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),outCirc:t=>Math.sqrt(1-Math.pow(1-t,2)),inOutCirc:t=>t<.5?(1-Math.sqrt(1-4*t*t))/2:(1+Math.sqrt(8*t-3-4*t*t))/2,inQuint:t=>t*t*t*t*t,outQuint:t=>--t*t*t*t*t+1,InOutQuint:t=>(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),inExponential:t=>1===t?1:0===t?0:Math.pow(1024,t-1),outExponential:t=>1===t?1:1-Math.pow(2,-10*t),inOutExponential:t=>0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1))),inElastic:t=>0===t?0:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI),outElastic:t=>1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1,inOutElastic:t=>0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1,inBack:t=>{const e=1.70158;return 0===t?0:1===t?1:t*t*((e+1)*t-e)},outBack:t=>{const e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},inOutBack:t=>{const e=2.5949095;return 0===(t*=2)?0:t<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},outBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,inBounce:t=>1-a.outBounce(1-t),inOutBounce:t=>t<.5?.5*a.inBounce(2*t):.5*a.outBounce(2*t-1)+.5};e.easeNames=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Delay=void 0;const s=i(0);class n extends s.BaseTween{constructor(t){super(),this.remains=0,this.duration=t,this.tickCb=this.tick.bind(this)}tick(t){for(this.remains=t*this.timescale;this.remains>0;){this.elapsed+=this.remains;const t=Math.max(Math.min(this.elapsed/this.duration,1),0);if(this.events.update&&this.emitEvent(this.events.update,[this.remains,t]),this.elapsed<this.duration)return;if(this.remains=this.elapsed-this.duration,!this.loop||(this.loop.value--,0===this.loop.value))return void this.complete();this.resetAndStart(0)}}}e.Delay=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Sequence=void 0;const s=i(0),n=i(8),a=i(2);class h extends s.BaseTween{constructor(t){if(super(),this.evtTick=new Set,this.tweens=[],this.index=0,this.remains=0,this.tickCb=this.tick.bind(this),t){this.tweens=new Array(t.length);for(let e=0;e<t.length;e++)t[e].setParent(this),this.tweens[e]=[t[e]]}}get count(){return this.tweens.length}loopInit(){this.index=0;for(const t of this.tweens)for(const e of t)e.reset()}addTick(t){this.evtTick.add(t)}removeTick(t){this.evtTick.delete(t)}tick(t){this.state>=3||(this.remains=t*this.timescale,this.elapsed+=this.remains,this.localTick(this.remains))}localTick(t,e){if(this.cur||this.nextTween(),this.cur&&(this.evtTick.forEach((function(e){e(t)})),!0!==e&&this.events.update&&this.emitEvent(this.events.update,[t,0])),this.remains=t,this.cur){for(const t of this.cur)if(3!==t.state)return;if(this.remains=this.cur[0].elapsed-this.cur[0].duration,this.events.stepEnd&&this.emitEvent(this.events.stepEnd,this.cur[0]),this.cur=void 0,this.index++,this.remains>.01)return void this.localTick(this.remains,!0)}if(!this.cur&&this.tweens.length===this.index){if(this.loop&&(this.loop.value--,0!==this.loop.value))return void this.resetAndStart(this.remains);this.complete()}}nextTween(){if(this.cur=this.tweens[this.index],this.cur){for(const t of this.cur)t.start();this.events.stepStart&&this.emitEvent(this.events.stepStart,this.cur[0])}}append(t){return t.setParent(this),this.tweens[this.tweens.length]=[t],this}appendCallback(t){const e=new n.Callback(t);return e.setParent(this),this.tweens[this.tweens.length]=[e],this}appendInterval(t){const e=new a.Delay(t);return e.setParent(this),this.tweens[this.tweens.length]=[e],this}prepend(t){return t.setParent(this),this.tweens.unshift([t]),this}prependCallback(t){const e=new n.Callback(t);return e.setParent(this),this.tweens.unshift([e]),this}prependInterval(t){const e=new a.Delay(t);return e.setParent(this),this.tweens.unshift([e]),this}skip(t){if(this.state>=3)this.info(1,"Cannot skip this tween ",this.state);else{for(const e of this.tweens)for(const i of e)0===i.elapsed&&this.emitEvent(this.events.stepStart,i),i.skip(t),this.emitEvent(this.events.stepEnd,i);super.skip()}}kill(){if(4!==this.state){for(const t of this.tweens)for(const e of t)e.kill();super.kill()}else this.info(1,"Cannot kill this tween ",this.state)}join(t){return 0===this.tweens.length?this.append(t):(t.setParent(this),this.tweens[this.tweens.length-1].push(t),this)}onStepStart(t){return this.onEvent("stepStart",t)}onStepEnd(t){return this.onEvent("stepEnd",t)}}e.Sequence=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EasingType=void 0;const s=i(5);e.default=new s.Fatina;var n=i(10);Object.defineProperty(e,"EasingType",{enumerable:!0,get:function(){return n.EasingType}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Fatina=void 0;const s=i(6),n=i(7),a=i(2),h=i(3),r=i(9);let o,u,c;"undefined"!=typeof window&&(u=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,c=window.cancelAnimationFrame||window.mozCancelAnimationFrame);e.Fatina=class{constructor(){this.plugin={},this.loadedPlugins=[],this.eventCreated=[],this.settings={logLevel:0,safe:!0,smooth:!1,maxFrameDt:50,maxFrameNumber:40,maxDt:500},this.version="3.0.6",this.time=0,this.dt=0,this.lastTime=0,this.initialized=!1,this.pulse=(t,e)=>s.pulsePreset(this,t,e),this.scale=(t,e)=>s.scalePreset(this,t,e),this.wobble=(t,e)=>s.wobblePreset(this,t,e),this.sonar=(t,e)=>s.sonarPreset(this,t,e),this.shake=(t,e)=>s.shakePreset(this,t,e)}get mainTicker(){return this.initialized||this.init(),this.manager}get elapsed(){return this.manager.elapsed}init(t){return!this.initialized&&(this.manager||(this.manager=new n.Ticker,this.manager.start(),this.defaultTicker=this.manager),"undefined"==typeof window||t||(console.log(" %c Fatina - Tweening library for games ("+this.version+") https://github.com/kefniark/Fatina ","background: #222; color: #9fbff4; padding: 5px"),this.lastTime=-1,"loading"!==document.readyState?o=u(this.updateLoop.bind(this)):document.addEventListener("DOMContentLoaded",()=>{o=u(this.updateLoop.bind(this))})),this.initialized=!0,!0)}setTimescale(t){this.init(),this.manager.setTimescale(t)}setDefaultTicker(t){this.defaultTicker=t}pause(){this.init(),this.manager.pause()}resume(){this.init(),this.manager.resume()}destroy(){this.manager&&this.manager.kill(),o&&c(o),this.initialized=!1}update(t){this.initialized&&this.manager&&(this.manager.tick(t),this.time+=t)}tween(t){const e=new r.Tween(t);return this.addContext(e),e}sequence(t){const e=new h.Sequence(t);return this.addContext(e),e}delay(t){const e=new a.Delay(t);return this.addContext(e),e}setTimeout(t,e){const i=new a.Delay(e).onComplete(t);return this.addContext(i),i.start()}setInterval(t,e){const i=new a.Delay(e).onRestart(t).setLoop(-1);return this.addContext(i),i.start()}addContext(t){this.initialized||this.init(),t.setParent(this.defaultTicker),0===this.settings.logLevel&&this.settings.safe||t.setSettings(this.settings),this.emitCreated(t)}ticker(){this.initialized||this.init();const t=new n.Ticker,e=t.tick.bind(t);return t.setParent(this.manager,e),this.manager.addTick(e),t.start(),this.emitCreated(t),t}updateLoop(t){if(this.dt=this.lastTime<0?16:this.dt+t-this.lastTime,this.dt>this.settings.maxDt&&(console.warn(`dt too high ${Math.round(this.dt)}ms. , Capped to ${this.settings.maxDt}ms.`),this.dt=this.settings.maxDt),this.settings.smooth){let t=0;for(;this.dt>0&&t<this.settings.maxFrameNumber;){const e=Math.min(this.dt,this.settings.maxFrameDt);this.update(e),this.dt-=e,t++}}else this.update(this.dt),this.dt=0;this.lastTime=t,o=u(this.updateLoop.bind(this))}loadPlugin(t){t.init(this),this.loadedPlugins.push(t),this.info(2,"Plugin Loaded",t.name)}info(t,e,i){t>this.settings.logLevel||(i?console.log(e,i):console.log(e))}emit(t,e){if(!this.settings.safe)return t(e);try{t(e)}catch(t){console.warn(t)}}emitCreated(t){for(const e of this.eventCreated)this.emit(e,t)}addListenerCreated(t){this.eventCreated.push(t)}removeListenerCreated(t){const e=this.eventCreated.indexOf(t);-1!==e&&this.eventCreated.splice(e,1)}setLog(t){this.settings.logLevel=t}setSafe(t){this.settings.safe=t}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shakePreset=e.wobblePreset=e.scalePreset=e.pulsePreset=e.sonarPreset=void 0;const s=i(1);function n(t,e){const i=e.split(".");let s=t;for(let t=0;t<i.length-1;t++)s=s[i[t]];return s}function a(t){const e=t.split(".");return e[e.length-1]}function h(t,e){const i={};return i[a(t)]=e,i}function r(t,e,i){const s=Object.assign(Object.assign({},{scaleX:"scale.x",scaleY:"scale.y",amplitude:.5,duration:2e3,bounce:5,friction:2,sinX:0}),i||{}),h=n(e,s.scaleX),r=a(s.scaleX),o=a(s.scaleY),u={x:h[r],y:h[o]};return t.tween({}).to({},s.duration).setEasing("inOutCubic").onUpdate((t,e)=>{const i=Math.pow(1-e,s.friction),n=e*s.bounce%s.duration;h[r]=u.x+Math.sin(s.sinX+n*Math.PI*2)*s.amplitude*i,h[o]=u.y+Math.sin(n*Math.PI*2)*s.amplitude*i}).onKilled(()=>{h[r]=u.x,h[o]=u.y})}e.sonarPreset=function(t,e,i){const h=Object.assign(Object.assign({},{alpha:"alpha",scaleX:"scale.x",scaleY:"scale.y",amplitude:4,duration:2e3}),i||{}),r=n(e,h.scaleX),o=n(e,h.alpha),u=a(h.scaleX),c=a(h.scaleY),l=a(h.alpha),d={x:r[u],y:r[c]},p=s.easeNames.outCubic;return t.tween({}).to({},h.duration).onUpdate((t,e)=>{o[l]=1-s.easeNames.inSine(e),r[u]=d.x+h.amplitude*p(e),r[c]=d.y+h.amplitude*p(e)}).onKilled(()=>{o[l]=1,r[u]=d.x,r[c]=d.y})},e.pulsePreset=function(t,e,i){const s=Object.assign(Object.assign({},{alpha:"alpha",duration:2e3}),i||{}),r=n(e,s.alpha);return t.tween(r).to(h(s.alpha,0),s.duration/2).setEasing("inOutQuad").toSequence().append(t.tween(r).to(h(s.alpha,1),s.duration/2).setEasing("inOutQuad")).onKilled(()=>r[a(s.alpha)]=1)},e.scalePreset=r,e.wobblePreset=function(t,e,i){const s={sinX:Math.PI};return r(t,e,Object.assign(Object.assign({},s),i||{}))},e.shakePreset=function(t,e,i){const s=Object.assign(Object.assign({},{posX:"position.x",posY:"position.y",amplitude:1.5,duration:2e3,bounce:10,friction:2}),i||{}),h=n(e,s.posX),r=a(s.posX),o=a(s.posY),u={x:h[r],y:h[o]},c=.5+Math.random(),l=.5+Math.random();return t.tween({}).to({},s.duration).onUpdate((t,e)=>{const i=Math.pow(1-e,s.friction),n=e*s.bounce%s.duration;h[r]=u.x+Math.sin(Math.PI+(n+c)*Math.PI*2)*s.amplitude*i,h[o]=u.y+Math.sin((n+l)*Math.PI*2)*s.amplitude*i}).onKilled(()=>{h[r]=u.x,h[o]=u.y})}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ticker=void 0;e.Ticker=class{constructor(){this.state=0,this.timescale=1,this.elapsed=0,this.duration=0,this.ticks=new Set,this.newTicks=new Set,this.dt=0}setParent(t,e){this.tickCb=e,this.parent=t}setTimescale(t){this.timescale=t}addTick(t){this.newTicks.add(t)}removeTick(t){this.ticks.delete(t)||this.newTicks.delete(t)}tick(t){1===this.state&&(this.dt=t*this.timescale,this.newTicks.size>0&&(this.newTicks.forEach(t=>this.ticks.add(t)),this.newTicks.clear()),this.ticks.forEach(t=>t(this.dt)),this.elapsed+=this.dt)}start(){0===this.state&&(this.state=1)}pause(){1===this.state&&(this.state=2)}resume(){2===this.state&&(this.state=1)}kill(){this.state>=3||(this.parent&&this.tickCb&&this.parent.removeTick(this.tickCb),this.state=4)}skip(){}reset(){this.state=0}get isIdle(){return 0===this.state}get isRunning(){return 1===this.state}get isFinished(){return this.state>=3}get isPaused(){return 2===this.state}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Callback=void 0;const s=i(0);class n extends s.BaseTween{constructor(t){super(),this.callback=t,this.tickCb=this.tick.bind(this)}tick(t){this.elapsed+=t,this.duration=0,this.callback(),this.emitEvent(this.events.update,[t,1]),this.complete()}}e.Callback=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Tween=void 0;const s=i(1),n=i(0),a=i(3);class h extends n.BaseTween{constructor(t){super(),this.prop=[],this.steps=0,this.relative=!1,this.p=0,this.v=0,this.remains=0,this.obj=t,this.tickCb=this.tick.bind(this)}init(t){this.obj=t,this.prop.length=0}validate(){if(!this.obj)throw new Error("undefined object");if(!this.parent)throw new Error("no ticker");this.ease||(this.ease=s.easeNames.linear),this.check()}check(){this.cf||(this.cf={}),this.ct||(this.ct={});for(const t of this.prop)this.f?(this.cf[t]=this.f[t],this.obj[t]=this.f[t]):this.cf[t]=this.obj[t],this.relative?this.ct[t]=this.obj[t]+this.t[t]:this.ct[t]=this.t[t]}tick(t){if(!(this.state>=3))for(this.remains=t*this.timescale;this.remains>0;){this.elapsed+=this.remains,this.p=Math.max(Math.min(this.elapsed/this.duration,1),0),this.v=this.ease(this.p),this.yo&&(this.yo.original-this.yo.value)%2==1&&(this.v=1-this.ease(1-this.p)),0!==this.steps&&(this.v=Math.round(this.v*this.steps)/this.steps);for(const t of this.prop)this.obj[t]=this.cf[t]+(this.ct[t]-this.cf[t])*this.v;if(this.events.update&&this.emitEvent(this.events.update,[this.remains,this.p]),this.elapsed<this.duration)return;if(this.remains=this.elapsed-this.duration,this.yo&&0!==this.yo.value)this.reverse(),this.resetAndStart(0),this.yo.value--;else{if(!this.loop||(this.loop.value--,0===this.loop.value))return void this.complete();this.check(),this.resetAndStart(0)}}}from(t){return this.f=t,this.updateProp(),this}to(t,e){return this.t=t,this.duration=e,this.updateProp(),this}updateProp(){if(this.obj){for(const t in this.t)this.t.hasOwnProperty(t)&&this.prop.push(t);this.prop.filter((t,e,i)=>e===i.indexOf(t))}}setRelative(t){return this.relative=t,this}modify(t,e){for(const i of this.prop)t.hasOwnProperty(i)&&(this.obj[i]+=t[i],e?this.ct[i]+=t[i]:this.cf[i]+=t[i])}reset(t){if(this.yo){if((this.yo.original-this.yo.value)%2==1){let t=this.cf;this.cf=this.ct,this.ct=t,t=this.f,this.f=this.t,this.t=t;const e=(1-this.elapsed/this.duration)*this.duration;this.elapsed=Math.round(1e3*e)/1e3}this.yo.value=this.yo.original}super.reset(t)}reverse(){let t=this.cf;this.cf=this.ct,this.ct=t,t=this.f,this.f=this.t,this.t=t;const e=(1-this.elapsed/this.duration)*this.duration;this.elapsed=Math.round(1e3*e)/1e3,3===this.state&&(this.reset(!0),this.start())}yoyo(t){return this.yo||(this.yo={original:0,value:0}),this.yo.original=t,this.yo.value=t,this}setSteps(t){return this.steps=t,this}toSequence(){if(!this.parent)throw new Error("parent ticker not defined");return(new a.Sequence).setParent(this.parent).append(this)}setEasing(t){if(!(t in s.easeNames))throw new Error("unknown easing method "+t);return this.ease=s.easeNames[t],this}loopInit(){this.elapsed=0}}e.Tween=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EasingType=void 0,function(t){t.Linear="linear",t.InQuad="inQuad",t.OutQuad="outQuad",t.InOutQuad="inOutQuad",t.InCubic="inCubic",t.OutCubic="outCubic",t.InOutCubic="inOutCubic",t.InQuart="inQuart",t.OutQuart="outQuart",t.InOutQuart="inOutQuart",t.InSine="inSine",t.OutSine="outSine",t.InOutSine="inOutSine",t.InCirc="inCirc",t.OutCirc="outCirc",t.InOutCirc="inOutCirc",t.InQuint="inQuint",t.OutQuint="outQuint",t.InOutQuint="inOutQuint",t.InExponential="inExponential",t.OutExponential="outExponential",t.InOutExponential="inOutExponential",t.InElastic="inElastic",t.OutElastic="outElastic",t.InOutElastic="inOutElastic",t.InBack="inBack",t.OutBack="outBack",t.InOutBack="inOutBack",t.InBounce="inBounce",t.OutBounce="outBounce",t.InOutBounce="inOutBounce"}(e.EasingType||(e.EasingType={}))}])})); |
{ | ||
"name": "fatina", | ||
"description": "Small & Light tweening library for web / games", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"homepage": "https://kefniark.github.io/Fatina/", | ||
@@ -6,0 +6,0 @@ "main": "build/code/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
599279
63
9038