Commit 218a062d authored by JetLu's avatar JetLu 🚴🏻

add: cubic bezier

parent b9bcf550
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.moto=n():t.moto=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=42)}([function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)},function(t,n,e){var r=e(15),o=e(35);t.exports=e(6)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){t.exports=!e(10)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(31)("wks"),o=e(14),i=e(0).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,n,e){var r=e(47),o=e(22);t.exports=function(t){return r(o(t))}},function(t,n,e){t.exports=!e(33)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n,e){var r,o,i;o=[n],void 0===(i="function"==typeof(r=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linear=function(t){return t},t.easeOut=function(t){return t*(2-t)},t.easeIn=function(t){return Math.pow(t,2)},t.easeInOut=function(t){return(t*=2)<1?.5*Math.pow(t,2):.5*(1- --t*(t-2))}})?r.apply(n,o):r)||(t.exports=i)},function(t,n){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n,e){var r=e(16),o=e(66),i=e(67),u=Object.defineProperty;n.f=e(6)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(17);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports={}},function(t,n,e){var r=e(69),o=e(36);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(0),o=e(2),i=e(7),u=e(14)("src"),c=Function.toString,f=(""+c).split("toString");e(13).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,e,c){var a="function"==typeof e;a&&(i(e,"name")||o(e,"name",n)),t[n]!==e&&(a&&(i(e,u)||o(e,u,t[n]?""+t[n]:f.join(String(n)))),t===r?t[n]=e:c?t[n]?t[n]=e:o(t,n,e):(delete t[n],o(t,n,e)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[u]||c.call(this)})},function(t,n,e){var r=e(31)("keys"),o=e(14);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(8);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,e){t.exports=!e(3)&&!e(10)(function(){return 7!=Object.defineProperty(e(51)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(27),o=e(1),i=e(10);t.exports=function(t,n){var e=(o.Object||{})[t]||Object[t],u={};u[t]=n(e),r(r.S+r.F*i(function(){e(1)}),"Object",u)}},function(t,n,e){var r=e(11),o=e(1),i=e(52),u=e(54),c=e(9),f=function(t,n,e){var a,s,p,l=t&f.F,v=t&f.G,y=t&f.S,h=t&f.P,d=t&f.B,x=t&f.W,m=v?o:o[n]||(o[n]={}),g=m.prototype,b=v?r:y?r[n]:(r[n]||{}).prototype;for(a in v&&(e=n),e)(s=!l&&b&&void 0!==b[a])&&c(m,a)||(p=s?b[a]:e[a],m[a]=v&&"function"!=typeof b[a]?e[a]:d&&s?i(p,r):x&&b[a]==p?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(p):h&&"function"==typeof p?i(Function.call,p):p,h&&((m.virtual||(m.virtual={}))[a]=p,t&f.R&&g&&!g[a]&&u(g,a,p)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,n,e){var r=e(55),o=e(25),i=e(24),u=Object.defineProperty;n.f=e(3)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n){!function(n){"use strict";var e,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag",a="object"==typeof t,s=n.regeneratorRuntime;if(s)a&&(t.exports=s);else{(s=n.regeneratorRuntime=a?t.exports:{}).wrap=b;var p="suspendedStart",l="suspendedYield",v="executing",y="completed",h={},d={};d[u]=function(){return this};var x=Object.getPrototypeOf,m=x&&x(x(k([])));m&&m!==r&&o.call(m,u)&&(d=m);var g=j.prototype=O.prototype=Object.create(d);_.prototype=g.constructor=j,j.constructor=_,j[f]=_.displayName="GeneratorFunction",s.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===_||"GeneratorFunction"===(n.displayName||n.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,f in t||(t[f]="GeneratorFunction")),t.prototype=Object.create(g),t},s.awrap=function(t){return{__await:t}},S(P.prototype),P.prototype[c]=function(){return this},s.AsyncIterator=P,s.async=function(t,n,e,r){var o=new P(b(t,n,e,r));return s.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(g),g[f]="Generator",g[u]=function(){return this},g.toString=function(){return"[object Generator]"},s.keys=function(t){var n=[];for(var e in t)n.push(e);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},s.values=k,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var f=o.call(u,"catchLoc"),a=o.call(u,"finallyLoc");if(f&&a){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(f){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),h},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),E(e),h}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;E(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}}}function b(t,n,e,r){var o=n&&n.prototype instanceof O?n:O,i=Object.create(o.prototype),u=new T(r||[]);return i._invoke=function(t,n,e){var r=p;return function(o,i){if(r===v)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return F()}for(e.method=o,e.arg=i;;){var u=e.delegate;if(u){var c=L(u,e);if(c){if(c===h)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===p)throw r=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=v;var f=w(t,n,e);if("normal"===f.type){if(r=e.done?y:l,f.arg===h)continue;return{value:f.arg,done:e.done}}"throw"===f.type&&(r=y,e.method="throw",e.arg=f.arg)}}}(t,e,u),i}function w(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}function O(){}function _(){}function j(){}function S(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function P(t){var n;this._invoke=function(e,r){function i(){return new Promise(function(n,i){!function n(e,r,i,u){var c=w(t[e],t,r);if("throw"!==c.type){var f=c.arg,a=f.value;return a&&"object"==typeof a&&o.call(a,"__await")?Promise.resolve(a.__await).then(function(t){n("next",t,i,u)},function(t){n("throw",t,i,u)}):Promise.resolve(a).then(function(t){f.value=t,i(f)},function(t){return n("throw",t,i,u)})}u(c.arg)}(e,r,n,i)})}return n=n?n.then(i,i):i()}}function L(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,L(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=w(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function M(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function E(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function k(t){if(t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:F}}function F(){return{value:e,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(t,n,e){"use strict";var r=e(65),o=e(68),i=e(18),u=e(19);t.exports=e(71)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,o(1)):o(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,n,e){var r=e(13),o=e(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(32)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!1},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){var r=e(17),o=e(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){var r=e(78),o=e(39);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,e){var r=e(15).f,o=e(7),i=e(4)("toStringTag");t.exports=function(t,n,e){t&&!o(t=e?t:t.prototype,i)&&r(t,i,{configurable:!0,value:n})}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){t.exports=e(43)},function(t,n,e){var r,o,i,u=e(44),c=e(56);o=[n,e(12),e(59),e(64)],void 0===(i="function"==typeof(r=function(t,n,e,r){"use strict";function o(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=c&&u?u(t,e):{};r.get||r.set?c(n,e,r):n[e]=t[e]}return n.default=t,n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"tween",{enumerable:!0,get:function(){return r.default}}),t.curve=t.easing=void 0,n=o(n),t.easing=n,e=o(e),t.curve=e,r=function(t){return t&&t.__esModule?t:{default:t}}(r)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){t.exports=e(45)},function(t,n,e){e(46);var r=e(1).Object;t.exports=function(t,n){return r.getOwnPropertyDescriptor(t,n)}},function(t,n,e){var r=e(5),o=e(49).f;e(26)("getOwnPropertyDescriptor",function(){return function(t,n){return o(r(t),n)}})},function(t,n,e){var r=e(48);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var r=e(50),o=e(23),i=e(5),u=e(24),c=e(9),f=e(25),a=Object.getOwnPropertyDescriptor;n.f=e(3)?a:function(t,n){if(t=i(t),n=u(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return o(!r.f.call(t,n),t[n])}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){var r=e(8),o=e(11).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(53);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(28),o=e(23);t.exports=e(3)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(8);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=e(57)},function(t,n,e){e(58);var r=e(1).Object;t.exports=function(t,n,e){return r.defineProperty(t,n,e)}},function(t,n,e){var r=e(27);r(r.S+r.F*!e(3),"Object",{defineProperty:e(28).f})},function(t,n,e){var r,o,i;o=[n,e(60),e(61)],void 0===(i="function"==typeof(r=function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bezier",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"catmullRom",{enumerable:!0,get:function(){return e.default}}),n=r(n),e=r(e)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){var r,o,i;o=[n,e(12)],void 0===(i="function"==typeof(r=function(t,n){"use strict";function e(t,n,e,r){return Math.pow(1-r,2)*t+2*(1-r)*r*n+Math.pow(r,2)*e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var r=t.p1,o=t.p2,i=t.p3,u=t.duration,c=void 0===u?1:u,f=t.ease,a=void 0===f?n.linear:f;return{start:function(t){var n,u,f,s=0;return t instanceof Function?u=t:(u=t.update,f=t.complete),function t(){(s+=1/60/c)>1&&(s=1),u(function(t,n,r,o){return{x:e(t.x,n.x,r.x,o),y:e(t.y,n.y,r.y,o)}}(r,o,i,a(s))),1===s?f&&f():n=requestAnimationFrame(t)}(),{stop:function(){cancelAnimationFrame(n)}}}}}})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){var r,o,i;o=[n,e(62),e(29)],void 0===(i="function"==typeof(r=function(t,n,e){"use strict";function r(t,n){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function o(t,n,e,r,o){var u=[Math.pow(o,3),Math.pow(o,2),o,1],c=[[-.5,1.5,-1.5,.5],[1,-2.5,2,-.5],[-.5,0,.5,0],[0,1,0,0]],f=[t,n,e,r];return i(u.map(function(t,n){return i(u,c.map(function(t,e){return c[e][n]}))}),f)}function i(t,n){return t.map(function(t,e){return t*n[e]}).reduce(function(t,n){return t+n})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return t.unshift(t[0]),t.push(t[t.length-1]),{start:function(i){var u,c,f,a=n.default.mark(p),s=0;function p(){var o;return n.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:o=0;case 1:if(!(o+3<t.length)){n.next=7;break}return n.next=4,{p1:t[o],p2:t[o+1],p3:t[o+2],p4:t[o+3],delta:e/r(t[o+1],t[o+2])};case 4:o++,n.next=1;break;case 7:case"end":return n.stop()}},a,this)}i instanceof Function?c=i:(c=i.update,f=i.complete);var l=p(),v=l.next().value,y=v.p1,h=v.p2,d=v.p3,x=v.p4,m=v.delta;return function t(){if((s+=m)>1&&(s=1),c(function(t,n,e,r,i){return{x:o(t.x,n.x,e.x,r.x,i),y:o(t.y,n.y,e.y,r.y,i)}}(y,h,d,x,s)),1===s){var n=l.next(),e=n.value;n.done?f&&f():(y=e.p1,h=e.p2,d=e.p3,x=e.p4,m=e.delta,s=0,u=requestAnimationFrame(t))}else u=requestAnimationFrame(t)}(),{stop:function(){cancelAnimationFrame(u)}}}}},n=function(t){return t&&t.__esModule?t:{default:t}}(n)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){t.exports=e(63)},function(t,n,e){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=e(29),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,n,e){var r,o,i;e(30),o=[n,e(85),e(99),e(12)],void 0===(i="function"==typeof(r=function(t,n,e,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e=t.from,o=t.to,i=t.duration,u=void 0===i?1:i,c=t.ease,f=void 0===c?r.linear:c;return{start:function(t){var r,i,c,a,s,p=isNaN(e),l=0;return p?(a={},s={},(0,n.default)(e).forEach(function(t){a[t]=o[t]-e[t]})):a=o-e,t instanceof Function?r=t:(r=t.update,i=t.complete),function t(){if((l+=1/60/u)>1&&(l=1),p)for(var n in a)s[n]=e[n]+a[n]*f(l);else s=e+a*f(l);r(s),1===l?i&&i():c=requestAnimationFrame(t)}(),{stop:function(){cancelAnimationFrame(c)}}}}},n=function(t){return t&&t.__esModule?t:{default:t}}(n)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){var r=e(4)("unscopables"),o=Array.prototype;void 0==o[r]&&e(2)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,n,e){t.exports=!e(6)&&!e(33)(function(){return 7!=Object.defineProperty(e(34)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(17);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,e){var r=e(70);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){"use strict";var r=e(32),o=e(72),i=e(20),u=e(2),c=e(18),f=e(75),a=e(40),s=e(83),p=e(4)("iterator"),l=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,n,e,y,h,d,x){f(e,n,y);var m,g,b,w=function(t){if(!l&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new e(this,t)}}return function(){return new e(this,t)}},O=n+" Iterator",_="values"==h,j=!1,S=t.prototype,P=S[p]||S["@@iterator"]||h&&S[h],L=P||w(h),M=h?_?w("entries"):L:void 0,E="Array"==n&&S.entries||P;if(E&&(b=s(E.call(new t)))!==Object.prototype&&b.next&&(a(b,O,!0),r||"function"==typeof b[p]||u(b,p,v)),_&&P&&"values"!==P.name&&(j=!0,L=function(){return P.call(this)}),r&&!x||!l&&!j&&S[p]||u(S,p,L),c[n]=L,c[O]=v,h)if(m={values:_?L:w("values"),keys:d?L:w("keys"),entries:M},x)for(g in m)g in S||i(S,g,m[g]);else o(o.P+o.F*(l||j),n,m);return m}},function(t,n,e){var r=e(0),o=e(13),i=e(2),u=e(20),c=e(73),f=function(t,n,e){var a,s,p,l,v=t&f.F,y=t&f.G,h=t&f.S,d=t&f.P,x=t&f.B,m=y?r:h?r[n]||(r[n]={}):(r[n]||{}).prototype,g=y?o:o[n]||(o[n]={}),b=g.prototype||(g.prototype={});for(a in y&&(e=n),e)p=((s=!v&&m&&void 0!==m[a])?m:e)[a],l=x&&s?c(p,r):d&&"function"==typeof p?c(Function.call,p):p,m&&u(m,a,p,t&f.U),g[a]!=p&&i(g,a,l),d&&b[a]!=p&&(b[a]=p)};r.core=o,f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,n,e){var r=e(74);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){"use strict";var r=e(76),o=e(35),i=e(40),u={};e(2)(u,e(4)("iterator"),function(){return this}),t.exports=function(t,n,e){t.prototype=r(u,{next:o(1,e)}),i(t,n+" Iterator")}},function(t,n,e){var r=e(16),o=e(77),i=e(39),u=e(21)("IE_PROTO"),c=function(){},f=function(){var t,n=e(34)("iframe"),r=i.length;for(n.style.display="none",e(82).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;r--;)delete f.prototype[i[r]];return f()};t.exports=Object.create||function(t,n){var e;return null!==t?(c.prototype=r(t),e=new c,c.prototype=null,e[u]=t):e=f(),void 0===n?e:o(e,n)}},function(t,n,e){var r=e(15),o=e(16),i=e(37);t.exports=e(6)?Object.defineProperties:function(t,n){o(t);for(var e,u=i(n),c=u.length,f=0;c>f;)r.f(t,e=u[f++],n[e]);return t}},function(t,n,e){var r=e(7),o=e(19),i=e(79)(!1),u=e(21)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),f=0,a=[];for(e in c)e!=u&&r(c,e)&&a.push(e);for(;n.length>f;)r(c,e=n[f++])&&(~i(a,e)||a.push(e));return a}},function(t,n,e){var r=e(19),o=e(80),i=e(81);t.exports=function(t){return function(n,e,u){var c,f=r(n),a=o(f.length),s=i(u,a);if(t&&e!=e){for(;a>s;)if((c=f[s++])!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===e)return t||s||0;return!t&&-1}}},function(t,n,e){var r=e(38),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(38),o=Math.max,i=Math.min;t.exports=function(t,n){return(t=r(t))<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(0).document;t.exports=r&&r.documentElement},function(t,n,e){var r=e(7),o=e(84),i=e(21)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,e){var r=e(36);t.exports=function(t){return Object(r(t))}},function(t,n,e){t.exports=e(86)},function(t,n,e){e(87),t.exports=e(1).Object.keys},function(t,n,e){var r=e(88),o=e(89);e(26)("keys",function(){return function(t){return o(r(t))}})},function(t,n,e){var r=e(22);t.exports=function(t){return Object(r(t))}},function(t,n,e){var r=e(90),o=e(98);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n,e){var r=e(9),o=e(5),i=e(91)(!1),u=e(94)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),f=0,a=[];for(e in c)e!=u&&r(c,e)&&a.push(e);for(;n.length>f;)r(c,e=n[f++])&&(~i(a,e)||a.push(e));return a}},function(t,n,e){var r=e(5),o=e(92),i=e(93);t.exports=function(t){return function(n,e,u){var c,f=r(n),a=o(f.length),s=i(u,a);if(t&&e!=e){for(;a>s;)if((c=f[s++])!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===e)return t||s||0;return!t&&-1}}},function(t,n,e){var r=e(41),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(41),o=Math.max,i=Math.min;t.exports=function(t,n){return(t=r(t))<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(95)("keys"),o=e(97);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n,e){var r=e(1),o=e(11),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(96)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!0},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,e){for(var r=e(30),o=e(37),i=e(20),u=e(0),c=e(2),f=e(18),a=e(4),s=a("iterator"),p=a("toStringTag"),l=f.Array,v={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},y=o(v),h=0;h<y.length;h++){var d,x=y[h],m=v[x],g=u[x],b=g&&g.prototype;if(b&&(b[s]||c(b,s,l),b[p]||c(b,p,x),f[x]=l,m))for(d in r)b[d]||i(b,d,r[d],!0)}}])}); !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.moto=n():t.moto=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=42)}([function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)},function(t,n,e){var r=e(15),o=e(35);t.exports=e(7)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){t.exports=!e(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(31)("wks"),o=e(14),i=e(0).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,n,e){var r=e(47),o=e(22);t.exports=function(t){return r(o(t))}},function(t,n,e){var r,o,i;o=[n],void 0===(i="function"==typeof(r=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linear=function(t){return t},t.easeOut=function(t){return t*(2-t)},t.easeIn=function(t){return Math.pow(t,2)},t.easeInOut=function(t){return(t*=2)<1?.5*Math.pow(t,2):.5*(1- --t*(t-2))}})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){t.exports=!e(33)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n,e){var r=e(16),o=e(67),i=e(68),u=Object.defineProperty;n.f=e(7)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(17);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports={}},function(t,n,e){var r=e(70),o=e(36);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(0),o=e(2),i=e(8),u=e(14)("src"),c=Function.toString,a=(""+c).split("toString");e(13).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,e,c){var f="function"==typeof e;f&&(i(e,"name")||o(e,"name",n)),t[n]!==e&&(f&&(i(e,u)||o(e,u,t[n]?""+t[n]:a.join(String(n)))),t===r?t[n]=e:c?t[n]?t[n]=e:o(t,n,e):(delete t[n],o(t,n,e)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[u]||c.call(this)})},function(t,n,e){var r=e(31)("keys"),o=e(14);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(9);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,e){t.exports=!e(3)&&!e(11)(function(){return 7!=Object.defineProperty(e(51)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(27),o=e(1),i=e(11);t.exports=function(t,n){var e=(o.Object||{})[t]||Object[t],u={};u[t]=n(e),r(r.S+r.F*i(function(){e(1)}),"Object",u)}},function(t,n,e){var r=e(12),o=e(1),i=e(52),u=e(54),c=e(10),a=function(t,n,e){var f,s,p,l=t&a.F,v=t&a.G,y=t&a.S,h=t&a.P,d=t&a.B,x=t&a.W,m=v?o:o[n]||(o[n]={}),g=m.prototype,b=v?r:y?r[n]:(r[n]||{}).prototype;for(f in v&&(e=n),e)(s=!l&&b&&void 0!==b[f])&&c(m,f)||(p=s?b[f]:e[f],m[f]=v&&"function"!=typeof b[f]?e[f]:d&&s?i(p,r):x&&b[f]==p?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(p):h&&"function"==typeof p?i(Function.call,p):p,h&&((m.virtual||(m.virtual={}))[f]=p,t&a.R&&g&&!g[f]&&u(g,f,p)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,n,e){var r=e(55),o=e(25),i=e(24),u=Object.defineProperty;n.f=e(3)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n){!function(n){"use strict";var e,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",f="object"==typeof t,s=n.regeneratorRuntime;if(s)f&&(t.exports=s);else{(s=n.regeneratorRuntime=f?t.exports:{}).wrap=b;var p="suspendedStart",l="suspendedYield",v="executing",y="completed",h={},d={};d[u]=function(){return this};var x=Object.getPrototypeOf,m=x&&x(x(T([])));m&&m!==r&&o.call(m,u)&&(d=m);var g=j.prototype=O.prototype=Object.create(d);_.prototype=g.constructor=j,j.constructor=_,j[a]=_.displayName="GeneratorFunction",s.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===_||"GeneratorFunction"===(n.displayName||n.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},s.awrap=function(t){return{__await:t}},P(S.prototype),S.prototype[c]=function(){return this},s.AsyncIterator=S,s.async=function(t,n,e,r){var o=new S(b(t,n,e,r));return s.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},P(g),g[a]="Generator",g[u]=function(){return this},g.toString=function(){return"[object Generator]"},s.keys=function(t){var n=[];for(var e in t)n.push(e);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},s.values=T,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var a=o.call(u,"catchLoc"),f=o.call(u,"finallyLoc");if(a&&f){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),h},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),E(e),h}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;E(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}}}function b(t,n,e,r){var o=n&&n.prototype instanceof O?n:O,i=Object.create(o.prototype),u=new F(r||[]);return i._invoke=function(t,n,e){var r=p;return function(o,i){if(r===v)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return k()}for(e.method=o,e.arg=i;;){var u=e.delegate;if(u){var c=M(u,e);if(c){if(c===h)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===p)throw r=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=v;var a=w(t,n,e);if("normal"===a.type){if(r=e.done?y:l,a.arg===h)continue;return{value:a.arg,done:e.done}}"throw"===a.type&&(r=y,e.method="throw",e.arg=a.arg)}}}(t,e,u),i}function w(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}function O(){}function _(){}function j(){}function P(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function S(t){var n;this._invoke=function(e,r){function i(){return new Promise(function(n,i){!function n(e,r,i,u){var c=w(t[e],t,r);if("throw"!==c.type){var a=c.arg,f=a.value;return f&&"object"==typeof f&&o.call(f,"__await")?Promise.resolve(f.__await).then(function(t){n("next",t,i,u)},function(t){n("throw",t,i,u)}):Promise.resolve(f).then(function(t){a.value=t,i(a)},function(t){return n("throw",t,i,u)})}u(c.arg)}(e,r,n,i)})}return n=n?n.then(i,i):i()}}function M(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,M(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=w(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function L(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function E(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function T(t){if(t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:k}}function k(){return{value:e,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(t,n,e){"use strict";var r=e(66),o=e(69),i=e(18),u=e(19);t.exports=e(72)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,o(1)):o(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,n,e){var r=e(13),o=e(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(32)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!1},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){var r=e(17),o=e(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){var r=e(79),o=e(39);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,e){var r=e(15).f,o=e(8),i=e(4)("toStringTag");t.exports=function(t,n,e){t&&!o(t=e?t:t.prototype,i)&&r(t,i,{configurable:!0,value:n})}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){t.exports=e(43)},function(t,n,e){var r,o,i,u=e(44),c=e(56);o=[n,e(6),e(59),e(65)],void 0===(i="function"==typeof(r=function(t,n,e,r){"use strict";function o(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=c&&u?u(t,e):{};r.get||r.set?c(n,e,r):n[e]=t[e]}return n.default=t,n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"tween",{enumerable:!0,get:function(){return r.default}}),t.curve=t.easing=void 0,n=o(n),t.easing=n,e=o(e),t.curve=e,r=function(t){return t&&t.__esModule?t:{default:t}}(r)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){t.exports=e(45)},function(t,n,e){e(46);var r=e(1).Object;t.exports=function(t,n){return r.getOwnPropertyDescriptor(t,n)}},function(t,n,e){var r=e(5),o=e(49).f;e(26)("getOwnPropertyDescriptor",function(){return function(t,n){return o(r(t),n)}})},function(t,n,e){var r=e(48);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var r=e(50),o=e(23),i=e(5),u=e(24),c=e(10),a=e(25),f=Object.getOwnPropertyDescriptor;n.f=e(3)?f:function(t,n){if(t=i(t),n=u(n,!0),a)try{return f(t,n)}catch(t){}if(c(t,n))return o(!r.f.call(t,n),t[n])}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){var r=e(9),o=e(12).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(53);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(28),o=e(23);t.exports=e(3)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(9);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=e(57)},function(t,n,e){e(58);var r=e(1).Object;t.exports=function(t,n,e){return r.defineProperty(t,n,e)}},function(t,n,e){var r=e(27);r(r.S+r.F*!e(3),"Object",{defineProperty:e(28).f})},function(t,n,e){var r,o,i;o=[n,e(60),e(61),e(62)],void 0===(i="function"==typeof(r=function(t,n,e,r){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bezier",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"cubicBezier",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"catmullRom",{enumerable:!0,get:function(){return r.default}}),n=o(n),e=o(e),r=o(r)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){var r,o,i;o=[n,e(6)],void 0===(i="function"==typeof(r=function(t,n){"use strict";function e(t,n,e,r){return Math.pow(1-r,2)*t+2*(1-r)*r*n+Math.pow(r,2)*e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var r=t.p1,o=t.p2,i=t.p3,u=t.duration,c=void 0===u?1:u,a=t.ease,f=void 0===a?n.linear:a;return{start:function(t){var n,u,a,s=0;return t instanceof Function?u=t:(u=t.update,a=t.complete),function t(){(s+=1/60/c)>1&&(s=1),u(function(t,n,r,o){return{x:e(t.x,n.x,r.x,o),y:e(t.y,n.y,r.y,o)}}(r,o,i,f(s))),1===s?a&&a():n=requestAnimationFrame(t)}(),{stop:function(){cancelAnimationFrame(n)}}}}}})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){var r,o,i;o=[n,e(6)],void 0===(i="function"==typeof(r=function(t,n){"use strict";function e(t,n,e,r,o){return Math.pow(1-o,3)*t+3*Math.pow(1-o,2)*o*n+3*(1-o)*Math.pow(o,2)*e+Math.pow(o,3)*r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var r=t.p1,o=t.p2,i=t.p3,u=t.p4,c=t.duration,a=void 0===c?1:c,f=t.ease,s=void 0===f?n.linear:f;return{start:function(t){var n,c,f,p=0;return t instanceof Function?c=t:(c=t.update,f=t.complete),function t(){(p+=1/60/a)>1&&(p=1),c(function(t,n,r,o,i){return{x:e(t.x,n.x,r.x,o.x,i),y:e(t.y,n.y,r.y,o.y,i)}}(r,o,i,u,s(p))),1===p?f&&f():n=requestAnimationFrame(t)}(),{stop:function(){cancelAnimationFrame(n)}}}}}})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){var r,o,i;o=[n,e(63),e(29)],void 0===(i="function"==typeof(r=function(t,n,e){"use strict";function r(t,n){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function o(t,n,e,r,o){var u=[Math.pow(o,3),Math.pow(o,2),o,1],c=[[-.5,1.5,-1.5,.5],[1,-2.5,2,-.5],[-.5,0,.5,0],[0,1,0,0]],a=[t,n,e,r];return i(u.map(function(t,n){return i(u,c.map(function(t,e){return c[e][n]}))}),a)}function i(t,n){return t.map(function(t,e){return t*n[e]}).reduce(function(t,n){return t+n})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return t.unshift(t[0]),t.push(t[t.length-1]),{start:function(i){var u,c,a,f=n.default.mark(p),s=0;function p(){var o;return n.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:o=0;case 1:if(!(o+3<t.length)){n.next=7;break}return n.next=4,{p1:t[o],p2:t[o+1],p3:t[o+2],p4:t[o+3],delta:e/r(t[o+1],t[o+2])};case 4:o++,n.next=1;break;case 7:case"end":return n.stop()}},f,this)}i instanceof Function?c=i:(c=i.update,a=i.complete);var l=p(),v=l.next().value,y=v.p1,h=v.p2,d=v.p3,x=v.p4,m=v.delta;return function t(){if((s+=m)>1&&(s=1),c(function(t,n,e,r,i){return{x:o(t.x,n.x,e.x,r.x,i),y:o(t.y,n.y,e.y,r.y,i)}}(y,h,d,x,s)),1===s){var n=l.next(),e=n.value;n.done?a&&a():(y=e.p1,h=e.p2,d=e.p3,x=e.p4,m=e.delta,s=0,u=requestAnimationFrame(t))}else u=requestAnimationFrame(t)}(),{stop:function(){cancelAnimationFrame(u)}}}}},n=function(t){return t&&t.__esModule?t:{default:t}}(n)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){t.exports=e(64)},function(t,n,e){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=e(29),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,n,e){var r,o,i;e(30),o=[n,e(86),e(100),e(6)],void 0===(i="function"==typeof(r=function(t,n,e,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e=t.from,o=t.to,i=t.duration,u=void 0===i?1:i,c=t.ease,a=void 0===c?r.linear:c;return{start:function(t){var r,i,c,f,s,p=isNaN(e),l=0;return p?(f={},s={},(0,n.default)(e).forEach(function(t){f[t]=o[t]-e[t]})):f=o-e,t instanceof Function?r=t:(r=t.update,i=t.complete),function t(){if((l+=1/60/u)>1&&(l=1),p)for(var n in f)s[n]=e[n]+f[n]*a(l);else s=e+f*a(l);r(s),1===l?i&&i():c=requestAnimationFrame(t)}(),{stop:function(){cancelAnimationFrame(c)}}}}},n=function(t){return t&&t.__esModule?t:{default:t}}(n)})?r.apply(n,o):r)||(t.exports=i)},function(t,n,e){var r=e(4)("unscopables"),o=Array.prototype;void 0==o[r]&&e(2)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,n,e){t.exports=!e(7)&&!e(33)(function(){return 7!=Object.defineProperty(e(34)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(17);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,e){var r=e(71);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){"use strict";var r=e(32),o=e(73),i=e(20),u=e(2),c=e(18),a=e(76),f=e(40),s=e(84),p=e(4)("iterator"),l=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,n,e,y,h,d,x){a(e,n,y);var m,g,b,w=function(t){if(!l&&t in P)return P[t];switch(t){case"keys":case"values":return function(){return new e(this,t)}}return function(){return new e(this,t)}},O=n+" Iterator",_="values"==h,j=!1,P=t.prototype,S=P[p]||P["@@iterator"]||h&&P[h],M=S||w(h),L=h?_?w("entries"):M:void 0,E="Array"==n&&P.entries||S;if(E&&(b=s(E.call(new t)))!==Object.prototype&&b.next&&(f(b,O,!0),r||"function"==typeof b[p]||u(b,p,v)),_&&S&&"values"!==S.name&&(j=!0,M=function(){return S.call(this)}),r&&!x||!l&&!j&&P[p]||u(P,p,M),c[n]=M,c[O]=v,h)if(m={values:_?M:w("values"),keys:d?M:w("keys"),entries:L},x)for(g in m)g in P||i(P,g,m[g]);else o(o.P+o.F*(l||j),n,m);return m}},function(t,n,e){var r=e(0),o=e(13),i=e(2),u=e(20),c=e(74),a=function(t,n,e){var f,s,p,l,v=t&a.F,y=t&a.G,h=t&a.S,d=t&a.P,x=t&a.B,m=y?r:h?r[n]||(r[n]={}):(r[n]||{}).prototype,g=y?o:o[n]||(o[n]={}),b=g.prototype||(g.prototype={});for(f in y&&(e=n),e)p=((s=!v&&m&&void 0!==m[f])?m:e)[f],l=x&&s?c(p,r):d&&"function"==typeof p?c(Function.call,p):p,m&&u(m,f,p,t&a.U),g[f]!=p&&i(g,f,l),d&&b[f]!=p&&(b[f]=p)};r.core=o,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,n,e){var r=e(75);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){"use strict";var r=e(77),o=e(35),i=e(40),u={};e(2)(u,e(4)("iterator"),function(){return this}),t.exports=function(t,n,e){t.prototype=r(u,{next:o(1,e)}),i(t,n+" Iterator")}},function(t,n,e){var r=e(16),o=e(78),i=e(39),u=e(21)("IE_PROTO"),c=function(){},a=function(){var t,n=e(34)("iframe"),r=i.length;for(n.style.display="none",e(83).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[i[r]];return a()};t.exports=Object.create||function(t,n){var e;return null!==t?(c.prototype=r(t),e=new c,c.prototype=null,e[u]=t):e=a(),void 0===n?e:o(e,n)}},function(t,n,e){var r=e(15),o=e(16),i=e(37);t.exports=e(7)?Object.defineProperties:function(t,n){o(t);for(var e,u=i(n),c=u.length,a=0;c>a;)r.f(t,e=u[a++],n[e]);return t}},function(t,n,e){var r=e(8),o=e(19),i=e(80)(!1),u=e(21)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),a=0,f=[];for(e in c)e!=u&&r(c,e)&&f.push(e);for(;n.length>a;)r(c,e=n[a++])&&(~i(f,e)||f.push(e));return f}},function(t,n,e){var r=e(19),o=e(81),i=e(82);t.exports=function(t){return function(n,e,u){var c,a=r(n),f=o(a.length),s=i(u,f);if(t&&e!=e){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===e)return t||s||0;return!t&&-1}}},function(t,n,e){var r=e(38),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(38),o=Math.max,i=Math.min;t.exports=function(t,n){return(t=r(t))<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(0).document;t.exports=r&&r.documentElement},function(t,n,e){var r=e(8),o=e(85),i=e(21)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,e){var r=e(36);t.exports=function(t){return Object(r(t))}},function(t,n,e){t.exports=e(87)},function(t,n,e){e(88),t.exports=e(1).Object.keys},function(t,n,e){var r=e(89),o=e(90);e(26)("keys",function(){return function(t){return o(r(t))}})},function(t,n,e){var r=e(22);t.exports=function(t){return Object(r(t))}},function(t,n,e){var r=e(91),o=e(99);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n,e){var r=e(10),o=e(5),i=e(92)(!1),u=e(95)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),a=0,f=[];for(e in c)e!=u&&r(c,e)&&f.push(e);for(;n.length>a;)r(c,e=n[a++])&&(~i(f,e)||f.push(e));return f}},function(t,n,e){var r=e(5),o=e(93),i=e(94);t.exports=function(t){return function(n,e,u){var c,a=r(n),f=o(a.length),s=i(u,f);if(t&&e!=e){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===e)return t||s||0;return!t&&-1}}},function(t,n,e){var r=e(41),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(41),o=Math.max,i=Math.min;t.exports=function(t,n){return(t=r(t))<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(96)("keys"),o=e(98);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n,e){var r=e(1),o=e(12),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(97)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!0},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,e){for(var r=e(30),o=e(37),i=e(20),u=e(0),c=e(2),a=e(18),f=e(4),s=f("iterator"),p=f("toStringTag"),l=a.Array,v={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},y=o(v),h=0;h<y.length;h++){var d,x=y[h],m=v[x],g=u[x],b=g&&g.prototype;if(b&&(b[s]||c(b,s,l),b[p]||c(b,p,x),a[x]=l,m))for(d in r)b[d]||i(b,d,r[d],!0)}}])});
\ No newline at end of file \ No newline at end of file
...@@ -19,6 +19,7 @@ npm i git+ssh://git@gitlab2.dui88.com:lufei/moto.git ...@@ -19,6 +19,7 @@ npm i git+ssh://git@gitlab2.dui88.com:lufei/moto.git
```js ```js
import {curve, tween, easing} from 'moto' import {curve, tween, easing} from 'moto'
// 二次贝塞尔曲线
curve.bezier({ curve.bezier({
p1: {x: 0, y: 0}, p1: {x: 0, y: 0},
p2: {x: 50, y: 50}, p2: {x: 50, y: 50},
...@@ -29,6 +30,18 @@ curve.bezier({ ...@@ -29,6 +30,18 @@ curve.bezier({
console.log(v) console.log(v)
}) })
// 三次贝塞尔曲线
curve.cubicBezier({
p1: {x: 0, y: 0},
p2: {x: 30, y: 30},
p3: {x: 70, y: -30},
p4: {x: 100, y: 0},
duration: 3, // 可选
ease: easing.easeInOut // 时间函数,可选
}).start(v => {
console.log(v)
})
curve.catmullRom( curve.catmullRom(
[{x: 0, y: 0}, {x: 50, y: 50}, {x: 100, y: 0}], [{x: 0, y: 0}, {x: 50, y: 50}, {x: 100, y: 0}],
8 // 运动速度,可选 8 // 运动速度,可选
......
...@@ -24,6 +24,7 @@ document.body.on('pointerdown', ev => { ...@@ -24,6 +24,7 @@ document.body.on('pointerdown', ev => {
document.body.appendChild(dot) document.body.appendChild(dot)
} else if (target.classList.contains('btn-run')) { } else if (target.classList.contains('btn-run')) {
target.classList.contains('bezier') && run('bezier') target.classList.contains('bezier') && run('bezier')
target.classList.contains('cubic-bezier') && run('cubicBezier')
target.classList.contains('catmull-rom') && run('catmullRom') target.classList.contains('catmull-rom') && run('catmullRom')
target.classList.contains('tween') && run('tween') target.classList.contains('tween') && run('tween')
} else if (target.classList.contains('btn-clear')) { } else if (target.classList.contains('btn-clear')) {
...@@ -38,7 +39,7 @@ async function run(action) { ...@@ -38,7 +39,7 @@ async function run(action) {
player.setAttribute('style', '') player.setAttribute('style', '')
if (action === 'bezier') { if (action === 'bezier') {
if (dots.length < 2) return alert('至少 2 个点!') if (dots.length < 2) return alert('至少 2 个点!')
const points = Array.prototype.map.call(dots, dot => JSON.parse(dot.dataset.position)) const points = Array.prototype.map.call(dots, dot => JSON.parse(dot.dataset.position))
curve.bezier({ curve.bezier({
p1: {x: player.offsetLeft, y: player.offsetTop}, p1: {x: player.offsetLeft, y: player.offsetTop},
...@@ -47,14 +48,25 @@ async function run(action) { ...@@ -47,14 +48,25 @@ async function run(action) {
duration: 1, duration: 1,
ease: easing.easeInOut ease: easing.easeInOut
}).start(trace) }).start(trace)
} else if (action === 'cubicBezier') {
if (dots.length < 3) return alert('至少 3 个点!')
const points = Array.prototype.map.call(dots, dot => JSON.parse(dot.dataset.position))
curve.cubicBezier({
p1: {x: player.offsetLeft, y: player.offsetTop},
p2: points[0],
p3: points[1],
p4: points[2],
duration: 1,
ease: easing.easeInOut
}).start(trace)
} else if (action === 'catmullRom') { } else if (action === 'catmullRom') {
if (dots.length < 1) return alert('至少 1 个点!') if (dots.length < 1) return alert('至少 1 个点!')
const points = Array.prototype.map.call(dots, dot => JSON.parse(dot.dataset.position)) const points = Array.prototype.map.call(dots, dot => JSON.parse(dot.dataset.position))
points.unshift({x: player.offsetLeft, y: player.offsetTop}) points.unshift({x: player.offsetLeft, y: player.offsetTop})
curve.catmullRom(points).start(trace) curve.catmullRom(points).start(trace)
} else if (action === 'tween') { } else if (action === 'tween') {
if (dots.length < 1) return alert('至少 1 个点!') if (dots.length < 1) return alert('至少 1 个点!')
const points = Array.prototype.map.call(dots, dot => JSON.parse(dot.dataset.position)) const points = Array.prototype.map.call(dots, dot => JSON.parse(dot.dataset.position))
......
import {linear} from '../easing'
export default function(option) {
const {p1, p2, p3, p4, duration = 1, ease = linear} = option
function start(option) {
let id, update, complete, t = 0
if (option instanceof Function) update = option
else ({update, complete} = option)
!function loop() {
t += 1 / 60 / duration
t > 1 ? t = 1 : null
update(bezier(p1, p2, p3, p4, ease(t)))
t === 1 ? complete && complete() : id = requestAnimationFrame(loop)
}()
return {
stop() {
cancelAnimationFrame(id)
}
}
}
return {start}
}
function bezier(p1, p2, p3, p4, t) {
return {
x: calc(p1.x, p2.x, p3.x, p4.x, t),
y: calc(p1.y, p2.y, p3.y, p4.y, t)
}
}
function calc(p1, p2, p3, p4, t) {
return (1 - t) ** 3 * p1 +
3 * (1 - t) ** 2 * t * p2 +
3 * (1 - t) * t ** 2 * p3 +
t ** 3 * p4
}
\ No newline at end of file
export bezier from './bezier' export bezier from './bezier'
export cubicBezier from './bezier.cubic'
export catmullRom from './catmullRom' export catmullRom from './catmullRom'
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Curve</title> <title>MOTO</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<section class="btn-group"> <section class="btn-group">
<button class="btn-clear">Clear</button> <button class="btn-clear">Clear</button>
<button class="btn-run bezier">Bezier</button> <button class="btn-run bezier">Bezier</button>
<button class="btn-run cubic-bezier">Cubic Bezier</button>
<button class="btn-run catmull-rom">CatmullRom</button> <button class="btn-run catmull-rom">CatmullRom</button>
<button class="btn-run tween">Tween</button> <button class="btn-run tween">Tween</button>
</section> </section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment