es6-tween
Advanced tools
Comparing version 1.4.1 to 1.10.3
# CHANGELOG | ||
## v1.10.3: Much new features | ||
#### Fixes | ||
- Fixed bug where `Composite` plugin sometime doesn't worked | ||
#### NEW features | ||
- Added `Timeline` feature | ||
- Added `Plugins` feature | ||
- Added `Composite Scroll` feature | ||
- Added function argument passing feature | ||
- Added `Composite#Render` feature | ||
#### Deprecation | ||
- Deprecated `Composite#setStyle` | ||
- Deprecated `Composite#style` | ||
## v1.5.1: New `Composite` and deprecated function | ||
#### Fixes (Triggered v1.5.x+1) | ||
- To avoid error for tests, we removed `TWEEN.cloneTween(tween)` method | ||
#### NEW (Triggered v1.x+1.?:0) | ||
- feat(Composite): New `Composite` feature for working with DOM or drawers | ||
## v1.4.1: Fix small issue | ||
#### Fixes | ||
- Fixed `NPM_TOKEN` issue and now removed from `README` | ||
## v1.4.0: Improvements | ||
@@ -4,0 +34,0 @@ |
1448
dist/Tween.js
@@ -76,3 +76,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 12); | ||
/******/ return __webpack_require__(__webpack_require__.s = 15); | ||
/******/ }) | ||
@@ -90,2 +90,590 @@ /************************************************************************/ | ||
}); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _core = __webpack_require__(4); | ||
var _Easing = __webpack_require__(1); | ||
var _Easing2 = _interopRequireDefault(_Easing); | ||
var _Interpolation = __webpack_require__(2); | ||
var _Interpolation2 = _interopRequireDefault(_Interpolation); | ||
var _clone = __webpack_require__(6); | ||
var _clone2 = _interopRequireDefault(_clone); | ||
var _joinToString = __webpack_require__(13); | ||
var _joinToString2 = _interopRequireDefault(_joinToString); | ||
var _toNumber = __webpack_require__(14); | ||
var _toNumber2 = _interopRequireDefault(_toNumber); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// Credits: | ||
// @jkroso for string parse library | ||
// Optimized, Extended by @dalisoft | ||
var Number_Match_RegEx = /\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi; | ||
var Tween = function () { | ||
function Tween() { | ||
var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
_classCallCheck(this, Tween); | ||
this.object = object; | ||
this._valuesStart = Tween.createEmptyConst(object); | ||
this._valuesEnd = Tween.createEmptyConst(object); | ||
this._chainedTweens = []; | ||
this._duration = 1000; | ||
this._easingFunction = _Easing2.default.Linear.None; | ||
this._interpolationFunction = _Interpolation2.default.None; | ||
this._startTime = 0; | ||
this._delayTime = 0; | ||
this._repeat = 0; | ||
this._r = 0; | ||
this._isPlaying = false; | ||
this._yoyo = false; | ||
this._reversed = false; | ||
this._onStartCallbackFired = false; | ||
this._events = {}; | ||
this._pausedTime = 0; | ||
return this; | ||
} | ||
_createClass(Tween, [{ | ||
key: 'isPlaying', | ||
value: function isPlaying() { | ||
return this._isPlaying; | ||
} | ||
}, { | ||
key: 'isStarted', | ||
value: function isStarted() { | ||
return this._onStartCallbackFired; | ||
} | ||
}, { | ||
key: 'reverse', | ||
value: function reverse() { | ||
var _reversed = this._reversed; | ||
this._reversed = !_reversed; | ||
return this; | ||
} | ||
}, { | ||
key: 'reversed', | ||
value: function reversed() { | ||
return this._reversed; | ||
} | ||
}, { | ||
key: 'off', | ||
value: function off(name, fn) { | ||
if (this._events[name] === undefined) { | ||
return this; | ||
} | ||
if (name !== undefined && fn !== undefined) { | ||
var eventsList = this._events[name], | ||
i = 0; | ||
while (i < eventsList.length) { | ||
if (eventsList[i] === fn) { | ||
eventsList.splice(i, 1); | ||
} | ||
i++; | ||
} | ||
} else if (name !== undefined && fn === undefined) { | ||
this._events[name] = []; | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: 'on', | ||
value: function on(name, fn) { | ||
if (this._events[name] === undefined) { | ||
this._events[name] = []; | ||
} | ||
this._events[name].push(fn); | ||
return this; | ||
} | ||
}, { | ||
key: 'once', | ||
value: function once(name, fn) { | ||
var _this = this; | ||
if (this._events[name] === undefined) { | ||
this._events[name] = []; | ||
} | ||
return this.on(name, function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
fn.call.apply(fn, [_this].concat(args)); | ||
_this.off(name); | ||
}); | ||
} | ||
}, { | ||
key: 'emit', | ||
value: function emit(name, a, b, c, d, e) { | ||
var _events = this._events; | ||
var eventFn = _events[name]; | ||
if (!eventFn) { | ||
return this; | ||
} | ||
var i = eventFn.length; | ||
while (i--) { | ||
eventFn[i].call(this, a, b, c, d, e); | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: 'pause', | ||
value: function pause() { | ||
if (!this._isPlaying) { | ||
return this; | ||
} | ||
this._isPlaying = false; | ||
(0, _core.remove)(this); | ||
this._pausedTime = (0, _core.now)(); | ||
return this.emit('pause', this.object); | ||
} | ||
}, { | ||
key: 'play', | ||
value: function play() { | ||
if (this._isPlaying) { | ||
return this; | ||
} | ||
this._isPlaying = true; | ||
this._startTime += (0, _core.now)() - this._pausedTime; | ||
(0, _core.add)(this); | ||
this._pausedTime = (0, _core.now)(); | ||
return this.emit('play', this.object); | ||
} | ||
}, { | ||
key: 'restart', | ||
value: function restart(noDelay) { | ||
this._repeat = this._r; | ||
this._startTime = (0, _core.now)() + (noDelay ? 0 : this._delayTime); | ||
if (!this._isPlaying) { | ||
(0, _core.add)(this); | ||
} | ||
return this.emit('restart', this._object); | ||
} | ||
}, { | ||
key: 'seek', | ||
value: function seek(time, keepPlaying) { | ||
this._startTime = (0, _core.now)() + Math.max(0, Math.min(time, this._duration)); | ||
this.emit('seek', time, this._object); | ||
return keepPlaying ? this : this.pause(); | ||
} | ||
}, { | ||
key: 'duration', | ||
value: function duration(amount) { | ||
this._duration = typeof amount === "function" ? amount(this._duration) : amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'to', | ||
value: function to() { | ||
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000; | ||
if (typeof properties === "number") { | ||
var _vE = { | ||
Number: properties | ||
}; | ||
this._valuesEnd = _vE; | ||
} else { | ||
this._valuesEnd = properties; | ||
} | ||
if (typeof duration === "number") { | ||
this._duration = typeof duration === "function" ? duration(this._duration) : duration; | ||
} else if ((typeof duration === 'undefined' ? 'undefined' : _typeof(duration)) === "object") { | ||
for (var prop in duration) { | ||
this[prop](typeof duration[prop] === "function" ? duration[prop](this._duration) : duration); | ||
} | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: 'start', | ||
value: function start(time) { | ||
var _startTime = this._startTime, | ||
_delayTime = this._delayTime, | ||
_valuesEnd = this._valuesEnd, | ||
_valuesStart = this._valuesStart, | ||
object = this.object; | ||
_startTime = time !== undefined ? time : (0, _core.now)(); | ||
_startTime += _delayTime; | ||
this._startTime = _startTime; | ||
for (var property in _valuesEnd) { | ||
if (_typeof(_valuesEnd[property]) === "object") { | ||
if (Array.isArray(_valuesEnd[property])) { | ||
if (typeof object[property] === "number") { | ||
this._valuesEnd[property] = [object[property]].concat(_valuesEnd[property]); | ||
} else { | ||
var clonedTween = (0, _clone2.default)(this, { | ||
object: object[property], | ||
_valuesEnd: _valuesEnd[property], | ||
_events: {} | ||
}).start().stop(); | ||
this._valuesEnd[property] = clonedTween; | ||
} | ||
} else { | ||
var _clonedTween = (0, _clone2.default)(this, { | ||
object: object[property], | ||
_valuesEnd: _valuesEnd[property], | ||
_events: {} | ||
}).start().stop(); | ||
this._valuesEnd[property] = _clonedTween; | ||
} | ||
} else if (typeof _valuesEnd[property] === "string" && typeof object[property] === "string" && Number_Match_RegEx.test(object[property]) && Number_Match_RegEx.test(_valuesEnd[property])) { | ||
var __get__Start = object[property].match(Number_Match_RegEx); | ||
__get__Start = __get__Start.map(_toNumber2.default); | ||
var __get__End = _valuesEnd[property].match(Number_Match_RegEx); | ||
__get__End = __get__End.map(_toNumber2.default); | ||
var _clonedTween2 = (0, _clone2.default)(this, { | ||
object: __get__Start, | ||
_valuesEnd: __get__End, | ||
_events: {} | ||
}).start().stop(); | ||
_clonedTween2.join = true; // For string tweening | ||
this._valuesEnd[property] = _clonedTween2; | ||
} | ||
// If `to()` specifies a property that doesn't exist in the source object, | ||
// we should not set that property in the object | ||
if (Tween.checkValidness(object[property]) === false) { | ||
continue; | ||
} | ||
// If duplicate or non-tweening numerics matched, | ||
// we should delete from _valuesEnd | ||
if (object[property] === _valuesEnd[property]) { | ||
continue; | ||
} | ||
this._valuesStart[property] = object[property]; | ||
} | ||
(0, _core.add)(this); | ||
this._isPlaying = true; | ||
return this; | ||
} | ||
}, { | ||
key: 'stop', | ||
value: function stop() { | ||
var _isPlaying = this._isPlaying, | ||
object = this.object; | ||
if (!_isPlaying) { | ||
return this; | ||
} | ||
(0, _core.remove)(this); | ||
this._isPlaying = false; | ||
this.stopChainedTweens(); | ||
return this.emit('stop', object); | ||
} | ||
}, { | ||
key: 'end', | ||
value: function end() { | ||
var _startTime = this._startTime, | ||
_duration = this._duration; | ||
return this.update(_startTime + _duration); | ||
} | ||
}, { | ||
key: 'stopChainedTweens', | ||
value: function stopChainedTweens() { | ||
var _chainedTweens = this._chainedTweens; | ||
_chainedTweens.map(function (item) { | ||
return item.stop(); | ||
}); | ||
return this; | ||
} | ||
}, { | ||
key: 'delay', | ||
value: function delay(amount) { | ||
this._delayTime = typeof amount === "function" ? amount(this._delayTime) : amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'repeat', | ||
value: function repeat(amount) { | ||
this._repeat = typeof amount === "function" ? amount(this._repeat) : amount; | ||
this._r = this._repeat; | ||
return this; | ||
} | ||
}, { | ||
key: 'repeatDelay', | ||
value: function repeatDelay(amount) { | ||
this._repeatDelayTime = typeof amount === "function" ? amount(this._repeatDelayTime) : amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'reverseDelay', | ||
value: function reverseDelay(amount) { | ||
this._reverseDelayTime = typeof amount === "function" ? amount(this._reverseDelayTime) : amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'yoyo', | ||
value: function yoyo(state) { | ||
this._yoyo = typeof state === "function" ? state(this._yoyo) : state; | ||
return this; | ||
} | ||
}, { | ||
key: 'easing', | ||
value: function easing(fn) { | ||
this._easingFunction = fn; | ||
return this; | ||
} | ||
}, { | ||
key: 'interpolation', | ||
value: function interpolation(fn) { | ||
this._interpolationFunction = fn; | ||
return this; | ||
} | ||
}, { | ||
key: 'chain', | ||
value: function chain() { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
this._chainedTweens = args; | ||
return this; | ||
} | ||
}, { | ||
key: 'get', | ||
value: function get(time) { | ||
this.update(time); | ||
return this.object; | ||
} | ||
}, { | ||
key: 'update', | ||
value: function update(time) { | ||
var _onStartCallbackFired = this._onStartCallbackFired, | ||
_chainedTweens = this._chainedTweens, | ||
_easingFunction = this._easingFunction, | ||
_interpolationFunction = this._interpolationFunction, | ||
_repeat = this._repeat, | ||
_repeatDelayTime = this._repeatDelayTime, | ||
_reverseDelayTime = this._reverseDelayTime, | ||
_delayTime = this._delayTime, | ||
_yoyo = this._yoyo, | ||
_reversed = this._reversed, | ||
_startTime = this._startTime, | ||
_duration = this._duration, | ||
_valuesStart = this._valuesStart, | ||
_valuesEnd = this._valuesEnd, | ||
object = this.object; | ||
var property = void 0; | ||
var elapsed = void 0; | ||
var value = void 0; | ||
time = time !== undefined ? time : (0, _core.now)(); | ||
if (time < _startTime) { | ||
return true; | ||
} | ||
if (!_onStartCallbackFired) { | ||
this.emit('start', object); | ||
this._onStartCallbackFired = true; | ||
} | ||
elapsed = (time - _startTime) / _duration; | ||
elapsed = elapsed > 1 ? 1 : elapsed; | ||
elapsed = _reversed ? 1 - elapsed : elapsed; | ||
value = _easingFunction(elapsed); | ||
for (property in _valuesEnd) { | ||
// Don't update properties that do not exist in the source object | ||
if (_valuesStart[property] === undefined) { | ||
continue; | ||
} | ||
var start = _valuesStart[property]; | ||
var end = _valuesEnd[property]; | ||
if (end instanceof Tween) { | ||
var getValue = end.get(time); | ||
if (end.join) { | ||
object[property] = (0, _joinToString2.default)(getValue); | ||
} else { | ||
object[property] = getValue; | ||
} | ||
} else if (Array.isArray(end)) { | ||
object[property] = _interpolationFunction(end, value); | ||
} else if (typeof end === 'string') { | ||
if (end.charAt(0) === '+' || end.charAt(0) === '-') { | ||
end = start + parseFloat(end); | ||
} else { | ||
end = parseFloat(end); | ||
} | ||
// Protect against non numeric properties. | ||
if (typeof end === 'number') { | ||
object[property] = start + (end - start) * value; | ||
} | ||
} else if (typeof end === 'number') { | ||
object[property] = start + (end - start) * value; | ||
} | ||
} | ||
this.emit('update', object, value, elapsed); | ||
if (elapsed === 1 || _reversed && elapsed === 0) { | ||
if (_repeat) { | ||
if (isFinite(_repeat)) { | ||
this._repeat--; | ||
} | ||
for (property in _valuesEnd) { | ||
if (typeof _valuesEnd[property] === 'string' && typeof _valuesStart[property] === 'number') { | ||
this._valuesStart[property] = _valuesStart[property] + parseFloat(_valuesEnd[property]); | ||
} | ||
} | ||
// Reassign starting values, restart by making startTime = now | ||
this.emit(_reversed ? 'reverse' : 'repeat', object); | ||
if (_yoyo) { | ||
this.reverse(); | ||
} | ||
if (!_reversed && _repeatDelayTime) { | ||
this._startTime += _duration + _repeatDelayTime; | ||
} else if (_reversed && _reverseDelayTime) { | ||
this._startTime += _duration + _reverseDelayTime; | ||
} else { | ||
this._startTime += _duration + _delayTime; | ||
} | ||
return true; | ||
} else { | ||
this.emit('complete', object); | ||
_chainedTweens.map(function (tween) { | ||
return tween.start(_startTime + _duration); | ||
}); | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
}], [{ | ||
key: 'createEmptyConst', | ||
value: function createEmptyConst(oldObject) { | ||
return typeof oldObject === "number" ? 0 : Array.isArray(oldObject) ? [] : (typeof oldObject === 'undefined' ? 'undefined' : _typeof(oldObject)) === "object" ? {} : ''; | ||
} | ||
}, { | ||
key: 'checkValidness', | ||
value: function checkValidness(valid) { | ||
return valid !== undefined && valid !== null && valid !== '' && valid !== NaN && valid !== Infinity; | ||
} | ||
}]); | ||
return Tween; | ||
}(); | ||
exports.default = Tween; | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var Easing = { | ||
@@ -594,3 +1182,3 @@ | ||
/***/ }), | ||
/* 1 */ | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -713,3 +1301,3 @@ | ||
/***/ }), | ||
/* 2 */ | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -724,612 +1312,45 @@ | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _core = __webpack_require__(4); | ||
var _Easing = __webpack_require__(0); | ||
var _Easing2 = _interopRequireDefault(_Easing); | ||
var _Interpolation = __webpack_require__(1); | ||
var _Interpolation2 = _interopRequireDefault(_Interpolation); | ||
var _clone = __webpack_require__(3); | ||
var _clone2 = _interopRequireDefault(_clone); | ||
var _joinToString = __webpack_require__(10); | ||
var _joinToString2 = _interopRequireDefault(_joinToString); | ||
var _toNumber = __webpack_require__(11); | ||
var _toNumber2 = _interopRequireDefault(_toNumber); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// Credits: | ||
// @jkroso for string parse library | ||
// Optimized, Extended by @dalisoft | ||
var Number_Match_RegEx = /\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi; | ||
var Tween = function () { | ||
function Tween() { | ||
var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
_classCallCheck(this, Tween); | ||
this.object = object; | ||
this._valuesStart = Tween.createEmptyConst(object); | ||
this._valuesEnd = Tween.createEmptyConst(object); | ||
this._chainedTweens = []; | ||
this._duration = 1000; | ||
this._easingFunction = _Easing2.default.Linear.None; | ||
this._interpolationFunction = _Interpolation2.default.None; | ||
this._startTime = 0; | ||
this._delayTime = 0; | ||
this._repeat = 0; | ||
this._r = 0; | ||
this._isPlaying = false; | ||
this._yoyo = false; | ||
this._reversed = false; | ||
this._onStartCallbackFired = false; | ||
this._events = {}; | ||
this._pausedTime = 0; | ||
return this; | ||
var Plugins = function () { | ||
function Plugins() { | ||
_classCallCheck(this, Plugins); | ||
} | ||
_createClass(Tween, [{ | ||
key: 'isPlaying', | ||
value: function isPlaying() { | ||
return this._isPlaying; | ||
} | ||
}, { | ||
key: 'isStarted', | ||
value: function isStarted() { | ||
return this._onStartCallbackFired; | ||
} | ||
}, { | ||
key: 'reverse', | ||
value: function reverse() { | ||
/*let { | ||
_valuesEnd | ||
, _valuesStart | ||
, _reversed | ||
} = this; | ||
// Reassign starting values, restart by making startTime = now | ||
for ( let property in _valuesEnd ) { | ||
let tmp = _valuesStart[ property ]; | ||
this._valuesStart[ property ] = _valuesEnd[ property ]; | ||
this._valuesEnd[ property ] = tmp; | ||
}*/ | ||
var _reversed = this._reversed; | ||
this._reversed = !_reversed; | ||
return this; | ||
} | ||
}, { | ||
key: 'reversed', | ||
value: function reversed() { | ||
return this._reversed; | ||
} | ||
}, { | ||
key: 'off', | ||
value: function off(name, fn) { | ||
if (this._events[name] === undefined) { | ||
return this; | ||
} | ||
if (name !== undefined && fn !== undefined) { | ||
var eventsList = this._events[name], | ||
i = 0; | ||
while (i < eventsList.length) { | ||
if (eventsList[i] === fn) { | ||
eventsList.splice(i, 1); | ||
_createClass(Plugins, null, [{ | ||
key: "DOM", | ||
value: function DOM(Composite) { | ||
var layer = Composite.domNode, | ||
style = layer.style; | ||
return { | ||
update: function update(Tween, RenderObject) { | ||
for (var p in RenderObject) { | ||
style[p] = RenderObject[p]; | ||
} | ||
i++; | ||
} | ||
} else if (name !== undefined && fn === undefined) { | ||
this._events[name] = []; | ||
} | ||
return this; | ||
}; | ||
} | ||
}, { | ||
key: 'on', | ||
value: function on(name, fn) { | ||
if (this._events[name] === undefined) { | ||
this._events[name] = []; | ||
} | ||
this._events[name].push(fn); | ||
return this; | ||
} | ||
}, { | ||
key: 'once', | ||
value: function once(name, fn) { | ||
var _this = this; | ||
if (this._events[name] === undefined) { | ||
this._events[name] = []; | ||
} | ||
return this.on(name, function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
fn.call.apply(fn, [_this].concat(args)); | ||
_this.off(name); | ||
}); | ||
} | ||
}, { | ||
key: 'emit', | ||
value: function emit(name, a, b, c, d, e) { | ||
var _events = this._events; | ||
var eventFn = _events[name]; | ||
if (!eventFn) { | ||
return this; | ||
} | ||
var i = eventFn.length; | ||
while (i--) { | ||
eventFn[i].call(this, a, b, c, d, e); | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: 'pause', | ||
value: function pause() { | ||
if (!this._isPlaying) { | ||
return this; | ||
} | ||
this._isPlaying = false; | ||
(0, _core.remove)(this); | ||
this._pausedTime = (0, _core.now)(); | ||
return this.emit('pause', this.object); | ||
} | ||
}, { | ||
key: 'play', | ||
value: function play() { | ||
if (this._isPlaying) { | ||
return this; | ||
} | ||
this._isPlaying = true; | ||
this._startTime += (0, _core.now)() - this._pausedTime; | ||
(0, _core.add)(this); | ||
this._pausedTime = (0, _core.now)(); | ||
return this.emit('play', this.object); | ||
} | ||
}, { | ||
key: 'restart', | ||
value: function restart(noDelay) { | ||
this._repeat = this._r; | ||
this._startTime = (0, _core.now)() + (noDelay ? 0 : this._delayTime); | ||
if (!this._isPlaying) { | ||
(0, _core.add)(this); | ||
} | ||
return this.emit('restart', this._object); | ||
} | ||
}, { | ||
key: 'seek', | ||
value: function seek(time, keepPlaying) { | ||
this._startTime = (0, _core.now)() + Math.max(0, Math.min(time, this._duration)); | ||
this.emit('seek', time, this._object); | ||
return keepPlaying ? this : this.pause(); | ||
} | ||
}, { | ||
key: 'duration', | ||
value: function duration(amount) { | ||
this._duration = typeof amount === "function" ? amount(this._duration) : amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'to', | ||
value: function to() { | ||
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000; | ||
if (typeof properties === "number") { | ||
var _vE = { Number: properties }; | ||
this._valuesEnd = _vE; | ||
} else { | ||
this._valuesEnd = properties; | ||
} | ||
if (typeof duration === "number") { | ||
this._duration = duration; | ||
} else if ((typeof duration === 'undefined' ? 'undefined' : _typeof(duration)) === "object") { | ||
for (var prop in duration) { | ||
this[prop](duration[prop]); | ||
} | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: 'start', | ||
value: function start(time) { | ||
var _startTime = this._startTime, | ||
_delayTime = this._delayTime, | ||
_valuesEnd = this._valuesEnd, | ||
_valuesStart = this._valuesStart, | ||
object = this.object; | ||
_startTime = time !== undefined ? time : (0, _core.now)(); | ||
_startTime += _delayTime; | ||
this._startTime = _startTime; | ||
for (var property in _valuesEnd) { | ||
if (_typeof(_valuesEnd[property]) === "object") { | ||
if (Array.isArray(_valuesEnd[property])) { | ||
if (typeof object[property] === "number") { | ||
this._valuesEnd[property] = [object[property]].concat(_valuesEnd[property]); | ||
} else { | ||
var clonedTween = (0, _clone2.default)(this, { object: object[property], _valuesEnd: _valuesEnd[property] }).start().stop(); | ||
this._valuesEnd[property] = clonedTween; | ||
} | ||
} else { | ||
var _clonedTween = (0, _clone2.default)(this, { object: object[property], _valuesEnd: _valuesEnd[property] }).start().stop(); | ||
this._valuesEnd[property] = _clonedTween; | ||
key: "Scroll", | ||
value: function Scroll(Composite) { | ||
var layer = Composite.domNode; | ||
return { | ||
update: function update(Tween, RenderObject) { | ||
for (var p in RenderObject) { | ||
layer[p] = RenderObject[p]; | ||
} | ||
} else if (typeof _valuesEnd[property] === "string" && typeof object[property] === "string" && Number_Match_RegEx.test(object[property]) && Number_Match_RegEx.test(_valuesEnd[property])) { | ||
var __get__Start = object[property].match(Number_Match_RegEx); | ||
__get__Start = __get__Start.map(_toNumber2.default); | ||
var __get__End = _valuesEnd[property].match(Number_Match_RegEx); | ||
__get__End = __get__End.map(_toNumber2.default); | ||
var _clonedTween2 = (0, _clone2.default)(this, { object: __get__Start, _valuesEnd: __get__End }).start().stop(); | ||
_clonedTween2.join = true; // For string tweening | ||
this._valuesEnd[property] = _clonedTween2; | ||
} | ||
// If `to()` specifies a property that doesn't exist in the source object, | ||
// we should not set that property in the object | ||
if (Tween.checkValidness(object[property]) === false) { | ||
continue; | ||
} | ||
// If duplicate or non-tweening numerics matched, | ||
// we should delete from _valuesEnd | ||
if (object[property] === _valuesEnd[property]) { | ||
continue; | ||
} | ||
this._valuesStart[property] = object[property]; | ||
} | ||
(0, _core.add)(this); | ||
this._isPlaying = true; | ||
return this; | ||
}; | ||
} | ||
}, { | ||
key: 'stop', | ||
value: function stop() { | ||
var _isPlaying = this._isPlaying, | ||
object = this.object; | ||
if (!_isPlaying) { | ||
return this; | ||
} | ||
(0, _core.remove)(this); | ||
this._isPlaying = false; | ||
this.stopChainedTweens(); | ||
return this.emit('stop', object); | ||
} | ||
}, { | ||
key: 'end', | ||
value: function end() { | ||
var _startTime = this._startTime, | ||
_duration = this._duration; | ||
return this.update(_startTime + _duration); | ||
} | ||
}, { | ||
key: 'stopChainedTweens', | ||
value: function stopChainedTweens() { | ||
var _chainedTweens = this._chainedTweens; | ||
_chainedTweens.map(function (item) { | ||
return item.stop(); | ||
}); | ||
return this; | ||
} | ||
}, { | ||
key: 'delay', | ||
value: function delay(amount) { | ||
this._delayTime = amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'repeat', | ||
value: function repeat(times) { | ||
this._repeat = times; | ||
this._r = times; | ||
return this; | ||
} | ||
}, { | ||
key: 'repeatDelay', | ||
value: function repeatDelay(amount) { | ||
this._repeatDelayTime = amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'reverseDelay', | ||
value: function reverseDelay(amount) { | ||
this._reverseDelayTime = amount; | ||
return this; | ||
} | ||
}, { | ||
key: 'yoyo', | ||
value: function yoyo(state) { | ||
this._yoyo = state; | ||
return this; | ||
} | ||
}, { | ||
key: 'easing', | ||
value: function easing(fn) { | ||
this._easingFunction = fn; | ||
return this; | ||
} | ||
}, { | ||
key: 'interpolation', | ||
value: function interpolation(fn) { | ||
this._interpolationFunction = fn; | ||
return this; | ||
} | ||
}, { | ||
key: 'chain', | ||
value: function chain() { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
this._chainedTweens = args; | ||
return this; | ||
} | ||
}, { | ||
key: 'get', | ||
value: function get(time) { | ||
this.update(time); | ||
return this.object; | ||
} | ||
}, { | ||
key: 'update', | ||
value: function update(time) { | ||
var _onStartCallbackFired = this._onStartCallbackFired, | ||
_chainedTweens = this._chainedTweens, | ||
_easingFunction = this._easingFunction, | ||
_interpolationFunction = this._interpolationFunction, | ||
_repeat = this._repeat, | ||
_repeatDelayTime = this._repeatDelayTime, | ||
_reverseDelayTime = this._reverseDelayTime, | ||
_delayTime = this._delayTime, | ||
_yoyo = this._yoyo, | ||
_reversed = this._reversed, | ||
_startTime = this._startTime, | ||
_duration = this._duration, | ||
_valuesStart = this._valuesStart, | ||
_valuesEnd = this._valuesEnd, | ||
object = this.object; | ||
var property = void 0; | ||
var elapsed = void 0; | ||
var value = void 0; | ||
time = time !== undefined ? time : (0, _core.now)(); | ||
if (time < _startTime) { | ||
return true; | ||
} | ||
if (!_onStartCallbackFired) { | ||
this.emit('start', object); | ||
this._onStartCallbackFired = true; | ||
} | ||
elapsed = (time - _startTime) / _duration; | ||
elapsed = elapsed > 1 ? 1 : elapsed; | ||
elapsed = _reversed ? 1 - elapsed : elapsed; | ||
value = _easingFunction(elapsed); | ||
for (property in _valuesEnd) { | ||
// Don't update properties that do not exist in the source object | ||
if (_valuesStart[property] === undefined) { | ||
continue; | ||
} | ||
var start = _valuesStart[property]; | ||
var end = _valuesEnd[property]; | ||
if (end instanceof Tween) { | ||
var getValue = end.get(time); | ||
if (end.join) { | ||
object[property] = (0, _joinToString2.default)(getValue); | ||
} else { | ||
object[property] = getValue; | ||
} | ||
} else if (Array.isArray(end)) { | ||
object[property] = _interpolationFunction(end, value); | ||
} else if (typeof end === 'string') { | ||
if (end.charAt(0) === '+' || end.charAt(0) === '-') { | ||
end = start + parseFloat(end); | ||
} else { | ||
end = parseFloat(end); | ||
} | ||
// Protect against non numeric properties. | ||
if (typeof end === 'number') { | ||
object[property] = start + (end - start) * value; | ||
} | ||
} else if (typeof end === 'number') { | ||
object[property] = start + (end - start) * value; | ||
} | ||
} | ||
this.emit('update', object, value, elapsed); | ||
if (elapsed === 1 || _reversed && elapsed === 0) { | ||
if (_repeat) { | ||
if (isFinite(_repeat)) { | ||
this._repeat--; | ||
} | ||
for (property in _valuesEnd) { | ||
if (typeof _valuesEnd[property] === 'string') { | ||
this._valuesStart[property] = _valuesStart[property] + parseFloat(_valuesEnd[property]); | ||
} | ||
} | ||
// Reassign starting values, restart by making startTime = now | ||
this.emit(_reversed ? 'reverse' : 'repeat', object); | ||
if (_yoyo) { | ||
this.reverse(); | ||
} | ||
if (!_reversed && _repeatDelayTime) { | ||
this._startTime += _duration + _repeatDelayTime; | ||
} else if (_reversed && _reverseDelayTime) { | ||
this._startTime += _duration + _reverseDelayTime; | ||
} else { | ||
this._startTime += _duration + _delayTime; | ||
} | ||
return true; | ||
} else { | ||
this.emit('complete', object); | ||
_chainedTweens.map(function (tween) { | ||
return tween.start(_startTime + _duration); | ||
}); | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
}], [{ | ||
key: 'createEmptyConst', | ||
value: function createEmptyConst(oldObject) { | ||
return typeof oldObject === "number" ? 0 : Array.isArray(oldObject) ? [] : (typeof oldObject === 'undefined' ? 'undefined' : _typeof(oldObject)) === "object" ? {} : ''; | ||
} | ||
}, { | ||
key: 'checkValidness', | ||
value: function checkValidness(valid) { | ||
return valid !== undefined && valid !== null && valid !== '' && valid !== NaN && valid !== Infinity; | ||
} | ||
}]); | ||
return Tween; | ||
return Plugins; | ||
}(); | ||
exports.default = Tween; | ||
exports.default = Plugins; | ||
; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = cloneTween; | ||
var _Tween = __webpack_require__(2); | ||
var _Tween2 = _interopRequireDefault(_Tween); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function cloneTween() { | ||
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var copyTween = new _Tween2.default({ x: 0 }); | ||
for (var config in obj) { | ||
if (configs[config] !== undefined) { | ||
copyTween[config] = configs[config]; | ||
} else { | ||
copyTween[config] = obj[config]; | ||
} | ||
} | ||
return copyTween; | ||
} | ||
/***/ }), | ||
/* 4 */ | ||
@@ -1524,3 +1545,3 @@ /***/ (function(module, exports, __webpack_require__) { | ||
exports.emit = emit; | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(9))) | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(12))) | ||
@@ -1564,4 +1585,200 @@ /***/ }), | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = cloneTween; | ||
var _Tween = __webpack_require__(0); | ||
var _Tween2 = _interopRequireDefault(_Tween); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function cloneTween() { | ||
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var Constructor_Ex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _Tween2.default; | ||
var copyTween = new Constructor_Ex(); | ||
for (var config in obj) { | ||
if (configs[config] !== undefined) { | ||
copyTween[config] = configs[config]; | ||
} else { | ||
copyTween[config] = obj[config]; | ||
} | ||
} | ||
return copyTween; | ||
} | ||
/***/ }), | ||
/* 7 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _clone = __webpack_require__(6); | ||
var _clone2 = _interopRequireDefault(_clone); | ||
var _Plugins = __webpack_require__(3); | ||
var _Plugins2 = _interopRequireDefault(_Plugins); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Composite = function () { | ||
function Composite(domNode) { | ||
_classCallCheck(this, Composite); | ||
var self = this; | ||
this.mode = 'dom'; | ||
this.domNode = domNode; | ||
this.plugins = {}; | ||
var pluginList = this.plugins; | ||
this.render = function (object) { | ||
for (var p in pluginList) { | ||
pluginList[p] && pluginList[p].update && pluginList[p].update(this, object); | ||
} | ||
return this; | ||
}; | ||
return this; | ||
} | ||
_createClass(Composite, [{ | ||
key: 'applyPlugin', | ||
value: function applyPlugin(name) { | ||
if (_Plugins2.default[name] !== undefined) { | ||
this.plugins[name] = _Plugins2.default[name](this); | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: 'drawMode', | ||
value: function drawMode() { | ||
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'dom'; | ||
// TO-DO: Implement SVG and Canvas mode | ||
this.mode = mode; | ||
return this; | ||
} | ||
}, { | ||
key: 'cloneLayer', | ||
value: function cloneLayer() { | ||
return (0, _clone2.default)(this, {}, Composite); | ||
} | ||
}, { | ||
key: 'appendTo', | ||
value: function appendTo(node) { | ||
node.appendChild(this.domNode); | ||
return this; | ||
} | ||
}, { | ||
key: 'object', | ||
set: function set(obj) { | ||
return this.render(obj); | ||
} | ||
}]); | ||
return Composite; | ||
}(); | ||
exports.default = Composite; | ||
/***/ }), | ||
/* 8 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _Tween = __webpack_require__(0); | ||
var _Tween2 = _interopRequireDefault(_Tween); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Timeline = function () { | ||
function Timeline() { | ||
_classCallCheck(this, Timeline); | ||
this._private = { | ||
tweens: [], | ||
fullTime: 0 | ||
}; | ||
return this; | ||
} | ||
_createClass(Timeline, [{ | ||
key: "add", | ||
value: function add(tween) { | ||
var _this = this; | ||
if (tween instanceof _Tween2.default) { | ||
this._private.tweens.push(tween); | ||
} else if (!Array.isArray(tween) && (typeof tween === "undefined" ? "undefined" : _typeof(tween)) === "object") { | ||
var tweenExample = new _Tween2.default({ x: 0 }); | ||
for (var p in tween) { | ||
tweenExample[p](tween[p]); | ||
} | ||
} else if ((typeof tween === "undefined" ? "undefined" : _typeof(tween)) === "object") { | ||
tween.map(function (add) { | ||
Timeline.add.call(_this, add); | ||
}); | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: "start", | ||
value: function start() { | ||
var _this2 = this; | ||
this._private.tweens.map(function (tween) { | ||
tween.start(_this2._private.fullTime); | ||
}); | ||
this._private.fullTime = Math.max.apply(0, this._private.tweens.reduce(function (prev, curr) { | ||
return curr._duration > prev ? curr._duration : prev; | ||
}, 0)); | ||
return this; | ||
} | ||
}]); | ||
return Timeline; | ||
}(); | ||
exports.default = Timeline; | ||
; | ||
/***/ }), | ||
/* 9 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
if (Array.isArray === undefined) { | ||
@@ -1574,3 +1791,3 @@ Array.isArray = function (arrayLike) { | ||
/***/ }), | ||
/* 7 */ | ||
/* 10 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1598,3 +1815,3 @@ | ||
/***/ }), | ||
/* 8 */ | ||
/* 11 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1657,3 +1874,3 @@ | ||
/***/ }), | ||
/* 9 */ | ||
/* 12 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1845,3 +2062,3 @@ | ||
/***/ }), | ||
/* 10 */ | ||
/* 13 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1865,3 +2082,3 @@ | ||
/***/ }), | ||
/* 11 */ | ||
/* 14 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1882,3 +2099,3 @@ | ||
/***/ }), | ||
/* 12 */ | ||
/* 15 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1892,28 +2109,36 @@ | ||
}); | ||
exports.Interpolation = exports.Easing = exports.Tween = exports.emit = exports.off = exports.once = exports.on = exports.autoPlay = exports.update = exports.now = exports.add = exports.remove = exports.removeAll = exports.getAll = undefined; | ||
exports.Plugins = exports.Timeline = exports.Composite = exports.Interpolation = exports.Easing = exports.Tween = exports.emit = exports.off = exports.once = exports.on = exports.autoPlay = exports.update = exports.now = exports.add = exports.remove = exports.removeAll = exports.getAll = undefined; | ||
__webpack_require__(7); | ||
__webpack_require__(10); | ||
__webpack_require__(8); | ||
__webpack_require__(11); | ||
__webpack_require__(6); | ||
__webpack_require__(9); | ||
var _core = __webpack_require__(4); | ||
var _Easing = __webpack_require__(0); | ||
var _Easing = __webpack_require__(1); | ||
var _Easing2 = _interopRequireDefault(_Easing); | ||
var _Tween = __webpack_require__(2); | ||
var _Tween = __webpack_require__(0); | ||
var _Tween2 = _interopRequireDefault(_Tween); | ||
var _Interpolation = __webpack_require__(1); | ||
var _Interpolation = __webpack_require__(2); | ||
var _Interpolation2 = _interopRequireDefault(_Interpolation); | ||
var _clone = __webpack_require__(3); | ||
var _Composite = __webpack_require__(7); | ||
var _clone2 = _interopRequireDefault(_clone); | ||
var _Composite2 = _interopRequireDefault(_Composite); | ||
var _Timeline = __webpack_require__(8); | ||
var _Timeline2 = _interopRequireDefault(_Timeline); | ||
var _Plugins = __webpack_require__(3); | ||
var _Plugins2 = _interopRequireDefault(_Plugins); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -1935,2 +2160,5 @@ | ||
exports.Interpolation = _Interpolation2.default; | ||
exports.Composite = _Composite2.default; | ||
exports.Timeline = _Timeline2.default; | ||
exports.Plugins = _Plugins2.default; | ||
@@ -1937,0 +2165,0 @@ /***/ }) |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TWEEN=e():t.TWEEN=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=12)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(-10*t,2)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(-10*(t-1),2)+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(-10*t,2)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2,t<1?-.5*Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(-10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Bounce.Out(1-t)},Out:function(t){return 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},InOut:function(t){return t<.5?.5*i.Bounce.In(2*t):.5*i.Bounce.Out(2*t-1)+.5}},Stepped:function(t){return function(e){return Math.floor(e*t)/t}},Noisy:function(t,e){var n=1-t;return function(i){return t*Math.random()+n*e(i)}},get bezier(){var t,e;return t=function(t,e,n,i,r){var o=Math.pow(1-t,3),u=3*Math.pow(1-t,2)*t,a=3*(1-t)*Math.pow(t,2);return t=Math.pow(t,3),{x:o*e.x+u*n.x+a*i.x+t*r.x,y:o*e.y+u*n.y+a*i.y+t*r.y}},e=function(t,e){var n,i,r=0,o=0,u=e.length,a=0,s=1,c=(s+a)/2;for(n=null;o<u&&(i=e[o],t>=i(0).x&&t<=i(1).x&&(n=i),null===n);)o++;if(!n)return 1;for(i=n(c).x;1e-4<Math.abs(t-i)&&100>r;)t>i?a=c:s=c,c=(s+a)/2,i=n(c).x,r++;return n(c).y},function(n){null==n&&(n={});var i=n.points,r=function(){var e,n=0,o=i.length;for(r=[],e=function(e,n){return r.push(function(i){return t(i,e,e.cp[e.cp.length-1],n.cp[0],n)})};n<o&&!(n>=i.length-1);)e(i[n],i[n+1]),n++;return r}();return function(t){return e(t,r)}}},easeInOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeInOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},easeIn:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeIn.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:1,y:1}]}]})},easeOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:0,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},spring:function(t){var e,n,r,o,u;return null==t&&(t={}),Tools.extend(t,i.spring.defaults,!0),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),u=t.anticipationSize/1e3,e=function(e){var n,i;return i=u/(1-u),n=(i-0)/(i-0),(.8-n)/i*e*t.anticipationStrength/100+n},n=function(t){return Math.pow(o/10,-t)*(1-t)},function(t){var i,o,a,s;return s=t/(1-u)-u/(1-u),t<u?(a=u/(1-u)-u/(1-u),i=0/(1-u)-u/(1-u),a=Math.acos(1/e(a)),o=(Math.acos(1/e(i))-a)/(r*-u),i=e):(i=n,a=0,o=1),1-i(s)*Math.cos(r*(t-u)*o+a)}},bounce:function(t){var e,n,r,o;return null==t&&(t={}),Tools.extend(t,i.bounce.defaults),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),e=function(t){return Math.pow(o/10,-t)*(1-t)},n=function(t){return e(t)*Math.cos(r*t*1+-1.57)},n.initialForce=!0,n},gravity:function(t){var e,n,r,o,u,a;return null==t&&(t={}),Tools.extend(t,i.gravity.defaults),n=Math.min(t.bounciness/1250,.8),o=t.elasticity/1e3,r=[],e=function(){var i;for(i=Math.sqrt(.02),i={a:-i,b:i,H:1},t.initialForce&&(i.a=0,i.b*=2);.001<i.H;)e=i.b-i.a,i={a:i.b,b:i.b+e*n,H:i.H*n*n};return i.b}(),a=function(n,i,r,o){return e=i-n,n=2/e*o-1-2*n/e,r=n*n*r-r+1,t.initialForce&&(r=1-r),r},function(){var i,u,a;for(i=Math.sqrt(2/(100*e*e)),u={a:-i,b:i,H:1},t.initialForce&&(u.a=0,u.b*=2),r.push(u),a=[];1>u.b&&.001<u.H;)i=u.b-u.a,u={a:u.b,b:u.b+i*n,H:u.H*o},a.push(r.push(u));return a}(),u=function e(n){var i,e;for(e=0,i=r[e];!(n>=i.a&&n<=i.b)&&(e+=1,i=r[e]););return i?a(i.a,i.b,i.H,n):t.initialForce?0:1},u.initialForce=t.initialForce,u},forceWithGravity:function(t){return null==t&&(t={}),Tools.extend(t,i.forceWithGravity.defaults),t.initialForce=!0,i.gravity(t)}};i.spring.defaults={frequency:300,friction:200,anticipationSize:0,anticipationStrength:0},i.bounce.defaults={frequency:300,friction:200},i.forceWithGravity.defaults=i.gravity.defaults={bounciness:400,elasticity:200},i.easeInOut.defaults=i.easeIn.defaults=i.easeOut.defaults={friction:500},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.Linear;return e<0?u(t[0],t[1],r):e>1?u(t[n],t[n-1],n-r):u(t[o],t[o+1>n?n:o+1],r-o)},Bezier:function(t,e){for(var n=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-e,r-a)*o(e,a)*t[a]*u(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(r=n*(1+e))),u(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],r-o)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(u(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):u(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),u=.5*(i-e),a=r*r,s=r*a;return(2*e-2*n+o+u)*s+(-3*e+3*n-2*o-u)*a+o*r+e}}};e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(4),s=n(0),c=i(s),f=n(1),l=i(f),h=n(3),d=i(h),v=n(10),p=i(v),y=n(11),m=i(y),_=/\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi,b=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.object=e,this._valuesStart=t.createEmptyConst(e),this._valuesEnd=t.createEmptyConst(e),this._chainedTweens=[],this._duration=1e3,this._easingFunction=c.default.Linear.None,this._interpolationFunction=l.default.None,this._startTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events={},this._pausedTime=0,this}return u(t,[{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(){var t=this._reversed;return this._reversed=!t,this}},{key:"reversed",value:function(){return this._reversed}},{key:"off",value:function(t,e){if(void 0===this._events[t])return this;if(void 0!==t&&void 0!==e)for(var n=this._events[t],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else void 0!==t&&void 0===e&&(this._events[t]=[]);return this}},{key:"on",value:function(t,e){return void 0===this._events[t]&&(this._events[t]=[]),this._events[t].push(e),this}},{key:"once",value:function(t,e){var n=this;return void 0===this._events[t]&&(this._events[t]=[]),this.on(t,function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];e.call.apply(e,[n].concat(r)),n.off(t)})}},{key:"emit",value:function(t,e,n,i,r,o){var u=this._events,a=u[t];if(!a)return this;for(var s=a.length;s--;)a[s].call(this,e,n,i,r,o);return this}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,(0,a.remove)(this),this._pausedTime=(0,a.now)(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=(0,a.now)()-this._pausedTime,(0,a.add)(this),this._pausedTime=(0,a.now)(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this._startTime=(0,a.now)()+(t?0:this._delayTime),this._isPlaying||(0,a.add)(this),this.emit("restart",this._object)}},{key:"seek",value:function(t,e){return this._startTime=(0,a.now)()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if("number"==typeof t){var n={Number:t};this._valuesEnd=n}else this._valuesEnd=t;if("number"==typeof e)this._duration=e;else if("object"===("undefined"==typeof e?"undefined":o(e)))for(var i in e)this[i](e[i]);return this}},{key:"start",value:function(e){var n=this._startTime,i=this._delayTime,r=this._valuesEnd,u=(this._valuesStart,this.object);n=void 0!==e?e:(0,a.now)(),n+=i,this._startTime=n;for(var s in r){if("object"===o(r[s]))if(Array.isArray(r[s]))if("number"==typeof u[s])this._valuesEnd[s]=[u[s]].concat(r[s]);else{var c=(0,d.default)(this,{object:u[s],_valuesEnd:r[s]}).start().stop();this._valuesEnd[s]=c}else{var f=(0,d.default)(this,{object:u[s],_valuesEnd:r[s]}).start().stop();this._valuesEnd[s]=f}else if("string"==typeof r[s]&&"string"==typeof u[s]&&_.test(u[s])&&_.test(r[s])){var l=u[s].match(_);l=l.map(m.default);var h=r[s].match(_);h=h.map(m.default);var v=(0,d.default)(this,{object:l,_valuesEnd:h}).start().stop();v.join=!0,this._valuesEnd[s]=v}t.checkValidness(u[s])!==!1&&u[s]!==r[s]&&(this._valuesStart[s]=u[s])}return(0,a.add)(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,e=this.object;return t?((0,a.remove)(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",e)):this}},{key:"end",value:function(){var t=this._startTime,e=this._duration;return this.update(t+e)}},{key:"stopChainedTweens",value:function(){var t=this._chainedTweens;return t.map(function(t){return t.stop()}),this}},{key:"delay",value:function(t){return this._delayTime=t,this}},{key:"repeat",value:function(t){return this._repeat=t,this._r=t,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime=t,this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime=t,this}},{key:"yoyo",value:function(t){return this._yoyo=t,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return this._interpolationFunction=t,this}},{key:"chain",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._chainedTweens=e,this}},{key:"get",value:function(t){return this.update(t),this.object}},{key:"update",value:function(e){var n=this._onStartCallbackFired,i=this._chainedTweens,r=this._easingFunction,o=this._interpolationFunction,u=this._repeat,s=this._repeatDelayTime,c=this._reverseDelayTime,f=this._delayTime,l=this._yoyo,h=this._reversed,d=this._startTime,v=this._duration,y=this._valuesStart,m=this._valuesEnd,_=this.object,b=void 0,g=void 0,w=void 0;if(e=void 0!==e?e:(0,a.now)(),e<d)return!0;n||(this.emit("start",_),this._onStartCallbackFired=!0),g=(e-d)/v,g=g>1?1:g,g=h?1-g:g,w=r(g);for(b in m)if(void 0!==y[b]){var M=y[b],T=m[b];if(T instanceof t){var k=T.get(e);T.join?_[b]=(0,p.default)(k):_[b]=k}else Array.isArray(T)?_[b]=o(T,w):"string"==typeof T?(T="+"===T.charAt(0)||"-"===T.charAt(0)?M+parseFloat(T):parseFloat(T),"number"==typeof T&&(_[b]=M+(T-M)*w)):"number"==typeof T&&(_[b]=M+(T-M)*w)}if(this.emit("update",_,w,g),1===g||h&&0===g){if(u){isFinite(u)&&this._repeat--;for(b in m)"string"==typeof m[b]&&(this._valuesStart[b]=y[b]+parseFloat(m[b]));return this.emit(h?"reverse":"repeat",_),l&&this.reverse(),!h&&s?this._startTime+=v+s:h&&c?this._startTime+=v+c:this._startTime+=v+f,!0}return this.emit("complete",_),i.map(function(t){return t.start(d+v)}),!1}return!0}}],[{key:"createEmptyConst",value:function(t){return"number"==typeof t?0:Array.isArray(t)?[]:"object"===("undefined"==typeof t?"undefined":o(t))?{}:""}},{key:"checkValidness",value:function(t){return void 0!==t&&null!==t&&""!==t&&NaN!==t&&t!==1/0}}]),t}();e.default=b},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new u.default({x:0});for(var i in t)void 0!==e[i]?n[i]=e[i]:n[i]=t[i];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var o=n(2),u=i(o)},function(t,e,n){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0});var i=[],r=!1,o=!1,u=void 0,a={},s="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,c=function(){return i},f=function(t){o=t},l=function(){i=[]},h=function(t,e,n,i,r,o){var u=a[t];if(u)for(var s=u.length;s--;)u[s].call(void 0,e,n,i,r,o)},d=function(t,e){if(void 0!==t&&void 0!==a[t])if(void 0!==e)for(var n=a[name],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else a[name]=[]},v=function(t){i.push(t),o&&!r&&(b(),r=!0,h("start")),h("add",t,i)},p=function(t,e){void 0===a[t]&&(a[t]=[]),a[t].push(e)},y=function(t,e){void 0===a[t]&&(a[t]=[]),p(t,function(){e.apply(void 0,arguments),d(t)})},m=function(t){i.filter(function(e){return e!==t});for(var e=0,n=void 0;e<i.length;)n=i[e],n===t&&(h("remove",t,i),i.splice(e,1)),e++},_=function(){if("undefined"!=typeof n&&void 0!==n.hrtime)return function(){var t=n.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==s.performance&&void 0!==s.performance.now)return s.performance.now.bind(s.performance);var t=s.performance&&s.performance.timing&&s.performance.timing.navigationStart?s.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),b=function t(e,n){if(e=void 0!==e?e:_(),o&&(u=requestAnimationFrame(t)),h("update",e,i),0===i.length)return r=!1,cancelAnimationFrame(u),h("stop",e),!1;for(var a=0;a<i.length;)i[a].update(e)||n?a++:i.splice(a,1);return!0};if(s.document){var g=s.document,w=0,M=0;g.addEventListener("visibilitychange",function(t){return 0!==i.length&&(document.hidden?M=_():(w=_()-M,i.map(function(t){return t._startTime+=w})),!0)})}e.getAll=c,e.removeAll=l,e.remove=m,e.add=v,e.now=_,e.update=b,e.autoPlay=f,e.on=p,e.once=y,e.off=d,e.emit=h}).call(e,n(5),n(9))},function(t,e,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}t.exports=i},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};void 0===Array.isArray&&(Array.isArray=function(t){return void 0!==t&&"object"===("undefined"==typeof t?"undefined":i(t))&&t.length&&void 0!==t.push&&void 0!==t.splice})},function(t,e,n){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e.shift();return e.map(function(t){for(var e in t)i[e]=t[e]}),i})},function(t,e,n){"use strict";(function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,n=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===e.requestAnimationFrame){var c=void 0,f=void 0,l=Date.now(),h=50/3,d=h;n.map(function(t){void 0===(c=e[t+r])&&(c=function(t){return a(function(){f=Date.now(),t(f-l),d=h+(Date.now()-f)},d)})}),void 0!==c&&(e.requestAnimationFrame=c)}if(void 0===e.cancelAnimationFrame&&void 0===(e.cancelAnimationFrame=e.cancelRequestAnimationFrame)){var v=void 0;n.map(function(t){void 0===(v=e[t+o])&&void 0===(v=e[t+u])&&(v=function(t){return s(t)})}),void 0!==v&&(e.cancelAnimationFrame=v)}}).call(e,n(5))},function(t,e,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(l===setTimeout)return setTimeout(t,0);if((l===i||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function u(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function a(){y&&v&&(y=!1,v.length?p=v.concat(p):m=-1,p.length&&s())}function s(){if(!y){var t=o(a);y=!0;for(var e=p.length;e;){for(v=p,p=[];++m<e;)v&&v[m].run();m=-1,e=p.length}v=null,y=!1,u(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var l,h,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:i}catch(t){l=i}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var v,p=[],y=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new c(t,e)),1!==p.length||y||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,n){"use strict";function i(t){for(var e="",n=0,i=t.length;n<i;n++)e+=t[n];return e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Interpolation=e.Easing=e.Tween=e.emit=e.off=e.once=e.on=e.autoPlay=e.update=e.now=e.add=e.remove=e.removeAll=e.getAll=void 0,n(7),n(8),n(6);var r=n(4),o=n(0),u=i(o),a=n(2),s=i(a),c=n(1),f=i(c),l=n(3);i(l);e.getAll=r.getAll,e.removeAll=r.removeAll,e.remove=r.remove,e.add=r.add,e.now=r.now,e.update=r.update,e.autoPlay=r.autoPlay,e.on=r.on,e.once=r.once,e.off=r.off,e.emit=r.emit,e.Tween=s.default,e.Easing=u.default,e.Interpolation=f.default}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TWEEN=e():t.TWEEN=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=15)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(4),s=n(1),f=i(s),c=n(2),l=i(c),h=n(6),d=i(h),v=n(13),p=i(v),y=n(14),m=i(y),_=/\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi,b=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.object=e,this._valuesStart=t.createEmptyConst(e),this._valuesEnd=t.createEmptyConst(e),this._chainedTweens=[],this._duration=1e3,this._easingFunction=f.default.Linear.None,this._interpolationFunction=l.default.None,this._startTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events={},this._pausedTime=0,this}return u(t,[{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(){var t=this._reversed;return this._reversed=!t,this}},{key:"reversed",value:function(){return this._reversed}},{key:"off",value:function(t,e){if(void 0===this._events[t])return this;if(void 0!==t&&void 0!==e)for(var n=this._events[t],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else void 0!==t&&void 0===e&&(this._events[t]=[]);return this}},{key:"on",value:function(t,e){return void 0===this._events[t]&&(this._events[t]=[]),this._events[t].push(e),this}},{key:"once",value:function(t,e){var n=this;return void 0===this._events[t]&&(this._events[t]=[]),this.on(t,function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];e.call.apply(e,[n].concat(r)),n.off(t)})}},{key:"emit",value:function(t,e,n,i,r,o){var u=this._events,a=u[t];if(!a)return this;for(var s=a.length;s--;)a[s].call(this,e,n,i,r,o);return this}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,(0,a.remove)(this),this._pausedTime=(0,a.now)(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=(0,a.now)()-this._pausedTime,(0,a.add)(this),this._pausedTime=(0,a.now)(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this._startTime=(0,a.now)()+(t?0:this._delayTime),this._isPlaying||(0,a.add)(this),this.emit("restart",this._object)}},{key:"seek",value:function(t,e){return this._startTime=(0,a.now)()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if("number"==typeof t){var n={Number:t};this._valuesEnd=n}else this._valuesEnd=t;if("number"==typeof e)this._duration="function"==typeof e?e(this._duration):e;else if("object"===("undefined"==typeof e?"undefined":o(e)))for(var i in e)this[i]("function"==typeof e[i]?e[i](this._duration):e);return this}},{key:"start",value:function(e){var n=this._startTime,i=this._delayTime,r=this._valuesEnd,u=(this._valuesStart,this.object);n=void 0!==e?e:(0,a.now)(),n+=i,this._startTime=n;for(var s in r){if("object"===o(r[s]))if(Array.isArray(r[s]))if("number"==typeof u[s])this._valuesEnd[s]=[u[s]].concat(r[s]);else{var f=(0,d.default)(this,{object:u[s],_valuesEnd:r[s],_events:{}}).start().stop();this._valuesEnd[s]=f}else{var c=(0,d.default)(this,{object:u[s],_valuesEnd:r[s],_events:{}}).start().stop();this._valuesEnd[s]=c}else if("string"==typeof r[s]&&"string"==typeof u[s]&&_.test(u[s])&&_.test(r[s])){var l=u[s].match(_);l=l.map(m.default);var h=r[s].match(_);h=h.map(m.default);var v=(0,d.default)(this,{object:l,_valuesEnd:h,_events:{}}).start().stop();v.join=!0,this._valuesEnd[s]=v}t.checkValidness(u[s])!==!1&&u[s]!==r[s]&&(this._valuesStart[s]=u[s])}return(0,a.add)(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,e=this.object;return t?((0,a.remove)(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",e)):this}},{key:"end",value:function(){var t=this._startTime,e=this._duration;return this.update(t+e)}},{key:"stopChainedTweens",value:function(){var t=this._chainedTweens;return t.map(function(t){return t.stop()}),this}},{key:"delay",value:function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this}},{key:"repeat",value:function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this}},{key:"yoyo",value:function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return this._interpolationFunction=t,this}},{key:"chain",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._chainedTweens=e,this}},{key:"get",value:function(t){return this.update(t),this.object}},{key:"update",value:function(e){var n=this._onStartCallbackFired,i=this._chainedTweens,r=this._easingFunction,o=this._interpolationFunction,u=this._repeat,s=this._repeatDelayTime,f=this._reverseDelayTime,c=this._delayTime,l=this._yoyo,h=this._reversed,d=this._startTime,v=this._duration,y=this._valuesStart,m=this._valuesEnd,_=this.object,b=void 0,g=void 0,w=void 0;if(e=void 0!==e?e:(0,a.now)(),e<d)return!0;n||(this.emit("start",_),this._onStartCallbackFired=!0),g=(e-d)/v,g=g>1?1:g,g=h?1-g:g,w=r(g);for(b in m)if(void 0!==y[b]){var M=y[b],T=m[b];if(T instanceof t){var k=T.get(e);T.join?_[b]=(0,p.default)(k):_[b]=k}else Array.isArray(T)?_[b]=o(T,w):"string"==typeof T?(T="+"===T.charAt(0)||"-"===T.charAt(0)?M+parseFloat(T):parseFloat(T),"number"==typeof T&&(_[b]=M+(T-M)*w)):"number"==typeof T&&(_[b]=M+(T-M)*w)}if(this.emit("update",_,w,g),1===g||h&&0===g){if(u){isFinite(u)&&this._repeat--;for(b in m)"string"==typeof m[b]&&"number"==typeof y[b]&&(this._valuesStart[b]=y[b]+parseFloat(m[b]));return this.emit(h?"reverse":"repeat",_),l&&this.reverse(),!h&&s?this._startTime+=v+s:h&&f?this._startTime+=v+f:this._startTime+=v+c,!0}return this.emit("complete",_),i.map(function(t){return t.start(d+v)}),!1}return!0}}],[{key:"createEmptyConst",value:function(t){return"number"==typeof t?0:Array.isArray(t)?[]:"object"===("undefined"==typeof t?"undefined":o(t))?{}:""}},{key:"checkValidness",value:function(t){return void 0!==t&&null!==t&&""!==t&&NaN!==t&&t!==1/0}}]),t}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(-10*t,2)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(-10*(t-1),2)+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(-10*t,2)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2,t<1?-.5*Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(-10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Bounce.Out(1-t)},Out:function(t){return 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},InOut:function(t){return t<.5?.5*i.Bounce.In(2*t):.5*i.Bounce.Out(2*t-1)+.5}},Stepped:function(t){return function(e){return Math.floor(e*t)/t}},Noisy:function(t,e){var n=1-t;return function(i){return t*Math.random()+n*e(i)}},get bezier(){var t,e;return t=function(t,e,n,i,r){var o=Math.pow(1-t,3),u=3*Math.pow(1-t,2)*t,a=3*(1-t)*Math.pow(t,2);return t=Math.pow(t,3),{x:o*e.x+u*n.x+a*i.x+t*r.x,y:o*e.y+u*n.y+a*i.y+t*r.y}},e=function(t,e){var n,i,r=0,o=0,u=e.length,a=0,s=1,f=(s+a)/2;for(n=null;o<u&&(i=e[o],t>=i(0).x&&t<=i(1).x&&(n=i),null===n);)o++;if(!n)return 1;for(i=n(f).x;1e-4<Math.abs(t-i)&&100>r;)t>i?a=f:s=f,f=(s+a)/2,i=n(f).x,r++;return n(f).y},function(n){null==n&&(n={});var i=n.points,r=function(){var e,n=0,o=i.length;for(r=[],e=function(e,n){return r.push(function(i){return t(i,e,e.cp[e.cp.length-1],n.cp[0],n)})};n<o&&!(n>=i.length-1);)e(i[n],i[n+1]),n++;return r}();return function(t){return e(t,r)}}},easeInOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeInOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},easeIn:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeIn.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:1,y:1}]}]})},easeOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:0,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},spring:function(t){var e,n,r,o,u;return null==t&&(t={}),Tools.extend(t,i.spring.defaults,!0),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),u=t.anticipationSize/1e3,e=function(e){var n,i;return i=u/(1-u),n=(i-0)/(i-0),(.8-n)/i*e*t.anticipationStrength/100+n},n=function(t){return Math.pow(o/10,-t)*(1-t)},function(t){var i,o,a,s;return s=t/(1-u)-u/(1-u),t<u?(a=u/(1-u)-u/(1-u),i=0/(1-u)-u/(1-u),a=Math.acos(1/e(a)),o=(Math.acos(1/e(i))-a)/(r*-u),i=e):(i=n,a=0,o=1),1-i(s)*Math.cos(r*(t-u)*o+a)}},bounce:function(t){var e,n,r,o;return null==t&&(t={}),Tools.extend(t,i.bounce.defaults),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),e=function(t){return Math.pow(o/10,-t)*(1-t)},n=function(t){return e(t)*Math.cos(r*t*1+-1.57)},n.initialForce=!0,n},gravity:function(t){var e,n,r,o,u,a;return null==t&&(t={}),Tools.extend(t,i.gravity.defaults),n=Math.min(t.bounciness/1250,.8),o=t.elasticity/1e3,r=[],e=function(){var i;for(i=Math.sqrt(.02),i={a:-i,b:i,H:1},t.initialForce&&(i.a=0,i.b*=2);.001<i.H;)e=i.b-i.a,i={a:i.b,b:i.b+e*n,H:i.H*n*n};return i.b}(),a=function(n,i,r,o){return e=i-n,n=2/e*o-1-2*n/e,r=n*n*r-r+1,t.initialForce&&(r=1-r),r},function(){var i,u,a;for(i=Math.sqrt(2/(100*e*e)),u={a:-i,b:i,H:1},t.initialForce&&(u.a=0,u.b*=2),r.push(u),a=[];1>u.b&&.001<u.H;)i=u.b-u.a,u={a:u.b,b:u.b+i*n,H:u.H*o},a.push(r.push(u));return a}(),u=function e(n){var i,e;for(e=0,i=r[e];!(n>=i.a&&n<=i.b)&&(e+=1,i=r[e]););return i?a(i.a,i.b,i.H,n):t.initialForce?0:1},u.initialForce=t.initialForce,u},forceWithGravity:function(t){return null==t&&(t={}),Tools.extend(t,i.forceWithGravity.defaults),t.initialForce=!0,i.gravity(t)}};i.spring.defaults={frequency:300,friction:200,anticipationSize:0,anticipationStrength:0},i.bounce.defaults={frequency:300,friction:200},i.forceWithGravity.defaults=i.gravity.defaults={bounciness:400,elasticity:200},i.easeInOut.defaults=i.easeIn.defaults=i.easeOut.defaults={friction:500},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.Linear;return e<0?u(t[0],t[1],r):e>1?u(t[n],t[n-1],n-r):u(t[o],t[o+1>n?n:o+1],r-o)},Bezier:function(t,e){for(var n=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-e,r-a)*o(e,a)*t[a]*u(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(r=n*(1+e))),u(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],r-o)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(u(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):u(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),u=.5*(i-e),a=r*r,s=r*a;return(2*e-2*n+o+u)*s+(-3*e+3*n-2*o-u)*a+o*r+e}}};e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(){function t(){i(this,t)}return r(t,null,[{key:"DOM",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){for(var i in e)n[i]=e[i]}}}},{key:"Scroll",value:function(t){var e=t.domNode;return{update:function(t,n){for(var i in n)e[i]=n[i]}}}}]),t}();e.default=o},function(t,e,n){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0});var i=[],r=!1,o=!1,u=void 0,a={},s="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,f=function(){return i},c=function(t){o=t},l=function(){i=[]},h=function(t,e,n,i,r,o){var u=a[t];if(u)for(var s=u.length;s--;)u[s].call(void 0,e,n,i,r,o)},d=function(t,e){if(void 0!==t&&void 0!==a[t])if(void 0!==e)for(var n=a[name],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else a[name]=[]},v=function(t){i.push(t),o&&!r&&(b(),r=!0,h("start")),h("add",t,i)},p=function(t,e){void 0===a[t]&&(a[t]=[]),a[t].push(e)},y=function(t,e){void 0===a[t]&&(a[t]=[]),p(t,function(){e.apply(void 0,arguments),d(t)})},m=function(t){i.filter(function(e){return e!==t});for(var e=0,n=void 0;e<i.length;)n=i[e],n===t&&(h("remove",t,i),i.splice(e,1)),e++},_=function(){if("undefined"!=typeof n&&void 0!==n.hrtime)return function(){var t=n.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==s.performance&&void 0!==s.performance.now)return s.performance.now.bind(s.performance);var t=s.performance&&s.performance.timing&&s.performance.timing.navigationStart?s.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),b=function t(e,n){if(e=void 0!==e?e:_(),o&&(u=requestAnimationFrame(t)),h("update",e,i),0===i.length)return r=!1,cancelAnimationFrame(u),h("stop",e),!1;for(var a=0;a<i.length;)i[a].update(e)||n?a++:i.splice(a,1);return!0};if(s.document){var g=s.document,w=0,M=0;g.addEventListener("visibilitychange",function(t){return 0!==i.length&&(document.hidden?M=_():(w=_()-M,i.map(function(t){return t._startTime+=w})),!0)})}e.getAll=f,e.removeAll=l,e.remove=m,e.add=v,e.now=_,e.update=b,e.autoPlay=c,e.on=p,e.once=y,e.off=d,e.emit=h}).call(e,n(5),n(12))},function(t,e,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default,i=new n;for(var r in t)void 0!==e[r]?i[r]=e[r]:i[r]=t[r];return i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var o=n(0),u=i(o)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=n(6),a=i(u),s=n(3),f=i(s),c=function(){function t(e){r(this,t);this.mode="dom",this.domNode=e,this.plugins={};var n=this.plugins;return this.render=function(t){for(var e in n)n[e]&&n[e].update&&n[e].update(this,t);return this},this}return o(t,[{key:"applyPlugin",value:function(t){return void 0!==f.default[t]&&(this.plugins[t]=f.default[t](this)),this}},{key:"drawMode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dom";return this.mode=t,this}},{key:"cloneLayer",value:function(){return(0,a.default)(this,{},t)}},{key:"appendTo",value:function(t){return t.appendChild(this.domNode),this}},{key:"object",set:function(t){return this.render(t)}}]),t}();e.default=c},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(0),s=i(a),f=function(){function t(){return r(this,t),this._private={tweens:[],fullTime:0},this}return u(t,[{key:"add",value:function(e){var n=this;if(e instanceof s.default)this._private.tweens.push(e);else if(Array.isArray(e)||"object"!==("undefined"==typeof e?"undefined":o(e)))"object"===("undefined"==typeof e?"undefined":o(e))&&e.map(function(e){t.add.call(n,e)});else{var i=new s.default({x:0});for(var r in e)i[r](e[r])}return this}},{key:"start",value:function(){var t=this;return this._private.tweens.map(function(e){e.start(t._private.fullTime)}),this._private.fullTime=Math.max.apply(0,this._private.tweens.reduce(function(t,e){return e._duration>t?e._duration:t},0)),this}}]),t}();e.default=f},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};void 0===Array.isArray&&(Array.isArray=function(t){return void 0!==t&&"object"===("undefined"==typeof t?"undefined":i(t))&&t.length&&void 0!==t.push&&void 0!==t.splice})},function(t,e,n){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e.shift();return e.map(function(t){for(var e in t)i[e]=t[e]}),i})},function(t,e,n){"use strict";(function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,n=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===e.requestAnimationFrame){var f=void 0,c=void 0,l=Date.now(),h=50/3,d=h;n.map(function(t){void 0===(f=e[t+r])&&(f=function(t){return a(function(){c=Date.now(),t(c-l),d=h+(Date.now()-c)},d)})}),void 0!==f&&(e.requestAnimationFrame=f)}if(void 0===e.cancelAnimationFrame&&void 0===(e.cancelAnimationFrame=e.cancelRequestAnimationFrame)){var v=void 0;n.map(function(t){void 0===(v=e[t+o])&&void 0===(v=e[t+u])&&(v=function(t){return s(t)})}),void 0!==v&&(e.cancelAnimationFrame=v)}}).call(e,n(5))},function(t,e,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(l===setTimeout)return setTimeout(t,0);if((l===i||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function u(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function a(){y&&v&&(y=!1,v.length?p=v.concat(p):m=-1,p.length&&s())}function s(){if(!y){var t=o(a);y=!0;for(var e=p.length;e;){for(v=p,p=[];++m<e;)v&&v[m].run();m=-1,e=p.length}v=null,y=!1,u(t)}}function f(t,e){this.fun=t,this.array=e}function c(){}var l,h,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:i}catch(t){l=i}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var v,p=[],y=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new f(t,e)),1!==p.length||y||o(s)},f.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,n){"use strict";function i(t){for(var e="",n=0,i=t.length;n<i;n++)e+=t[n];return e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Plugins=e.Timeline=e.Composite=e.Interpolation=e.Easing=e.Tween=e.emit=e.off=e.once=e.on=e.autoPlay=e.update=e.now=e.add=e.remove=e.removeAll=e.getAll=void 0,n(10),n(11),n(9);var r=n(4),o=n(1),u=i(o),a=n(0),s=i(a),f=n(2),c=i(f),l=n(7),h=i(l),d=n(8),v=i(d),p=n(3),y=i(p);e.getAll=r.getAll,e.removeAll=r.removeAll,e.remove=r.remove,e.add=r.add,e.now=r.now,e.update=r.update,e.autoPlay=r.autoPlay,e.on=r.on,e.once=r.once,e.off=r.off,e.emit=r.emit,e.Tween=s.default,e.Easing=u.default,e.Interpolation=c.default,e.Composite=h.default,e.Timeline=v.default,e.Plugins=y.default}])}); |
{ | ||
"name": "es6-tween", | ||
"version": "1.4.1", | ||
"version": "1.10.3", | ||
"description": "ES6 implementation of amazing tween.js", | ||
@@ -18,8 +18,7 @@ "main": "dist/Tween.js", | ||
"test-correctness": "jshint --config test/jshintrc src/Tween.js", | ||
"test-style": "jscs --config test/jscs.json src/Tween.js", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
"test-style": "jscs --config test/jscs.json src/Tween.js" | ||
}, | ||
"release": { | ||
"debug": false, | ||
"githubToken": "32558a13585b92da451b3d55f1623f36513586ea" | ||
"githubToken": "00000" | ||
}, | ||
@@ -26,0 +25,0 @@ "repository": { |
import Tween from './Tween'; | ||
export default function cloneTween(obj = {}, configs = {}) { | ||
let copyTween = new Tween({x:0}); | ||
export default function cloneTween(obj = {}, configs = {}, Constructor_Ex = Tween) { | ||
let copyTween = new Constructor_Ex(); | ||
for ( let config in obj ) { | ||
@@ -6,0 +6,0 @@ if (configs[config] !== undefined) { |
import { | ||
add | ||
, remove | ||
, now | ||
add, | ||
remove, | ||
now | ||
} | ||
from './core'; | ||
from './core'; | ||
import Easing from './Easing'; | ||
@@ -13,3 +13,3 @@ import Interpolation from './Interpolation'; | ||
// Credits: | ||
// Credits: | ||
// @jkroso for string parse library | ||
@@ -47,3 +47,4 @@ // Optimized, Extended by @dalisoft | ||
static createEmptyConst(oldObject) { | ||
return typeof (oldObject) === "number" ? 0 : Array.isArray(oldObject) ? [] : typeof (oldObject) === "object" ? {} : ''; | ||
return typeof(oldObject) === "number" ? 0 : Array.isArray(oldObject) ? [] : typeof(oldObject) === "object" ? {} | ||
: ''; | ||
} | ||
@@ -61,21 +62,6 @@ static checkValidness(valid) { | ||
/*let { | ||
_valuesEnd | ||
, _valuesStart | ||
, _reversed | ||
const { | ||
_reversed | ||
} = this; | ||
// Reassign starting values, restart by making startTime = now | ||
for ( let property in _valuesEnd ) { | ||
let tmp = _valuesStart[ property ]; | ||
this._valuesStart[ property ] = _valuesEnd[ property ]; | ||
this._valuesEnd[ property ] = tmp; | ||
}*/ | ||
const { _reversed } = this; | ||
this._reversed = !_reversed; | ||
@@ -93,4 +79,4 @@ | ||
if (name !== undefined && fn !== undefined) { | ||
let eventsList = this._events[name] | ||
, i = 0; | ||
let eventsList = this._events[name], | ||
i = 0; | ||
while (i < eventsList.length) { | ||
@@ -125,3 +111,5 @@ if (eventsList[i] === fn) { | ||
let { _events } = this; | ||
let { | ||
_events | ||
} = this; | ||
@@ -183,3 +171,3 @@ let eventFn = _events[name]; | ||
this._startTime = now() + Math.max(0, Math.min( | ||
time, this._duration)); | ||
time, this._duration)); | ||
@@ -193,3 +181,3 @@ this.emit('seek', time, this._object); | ||
this._duration = typeof (amount) === "function" ? amount(this._duration) : amount; | ||
this._duration = typeof(amount) === "function" ? amount(this._duration) : amount; | ||
@@ -201,3 +189,5 @@ return this; | ||
if (typeof properties === "number") { | ||
let _vE = { Number: properties }; | ||
let _vE = { | ||
Number: properties | ||
}; | ||
this._valuesEnd = _vE; | ||
@@ -209,6 +199,6 @@ } else { | ||
if (typeof duration === "number") { | ||
this._duration = duration; | ||
this._duration = typeof(duration) === "function" ? duration(this._duration) : duration; | ||
} else if (typeof duration === "object") { | ||
for (let prop in duration) { | ||
this[prop](duration[prop]); | ||
this[prop](typeof duration[prop] === "function" ? duration[prop](this._duration) : duration); | ||
} | ||
@@ -223,7 +213,7 @@ } | ||
let { | ||
_startTime | ||
, _delayTime | ||
, _valuesEnd | ||
, _valuesStart | ||
, object | ||
_startTime, | ||
_delayTime, | ||
_valuesEnd, | ||
_valuesStart, | ||
object | ||
} = this; | ||
@@ -243,3 +233,7 @@ | ||
} else { | ||
let clonedTween = cloneTween(this, { object: object[property], _valuesEnd: _valuesEnd[property] }) | ||
let clonedTween = cloneTween(this, { | ||
object: object[property], | ||
_valuesEnd: _valuesEnd[property], | ||
_events: {} | ||
}) | ||
.start() | ||
@@ -251,3 +245,7 @@ .stop(); | ||
} else { | ||
let clonedTween = cloneTween(this, { object: object[property], _valuesEnd: _valuesEnd[property] }) | ||
let clonedTween = cloneTween(this, { | ||
object: object[property], | ||
_valuesEnd: _valuesEnd[property], | ||
_events: {} | ||
}) | ||
.start() | ||
@@ -264,3 +262,7 @@ .stop(); | ||
__get__End = __get__End.map(toNumber); | ||
let clonedTween = cloneTween(this, { object: __get__Start, _valuesEnd: __get__End }) | ||
let clonedTween = cloneTween(this, { | ||
object: __get__Start, | ||
_valuesEnd: __get__End, | ||
_events: {} | ||
}) | ||
.start() | ||
@@ -288,3 +290,2 @@ .stop(); | ||
} | ||
@@ -302,4 +303,4 @@ | ||
let { | ||
_isPlaying | ||
, object | ||
_isPlaying, | ||
object | ||
} = this; | ||
@@ -321,4 +322,4 @@ | ||
const { | ||
_startTime | ||
, _duration | ||
_startTime, | ||
_duration | ||
} = this; | ||
@@ -342,3 +343,3 @@ | ||
this._delayTime = amount; | ||
this._delayTime = typeof(amount) === "function" ? amount(this._delayTime) : amount; | ||
@@ -348,6 +349,6 @@ return this; | ||
} | ||
repeat(times) { | ||
repeat(amount) { | ||
this._repeat = times; | ||
this._r = times; | ||
this._repeat = typeof(amount) === "function" ? amount(this._repeat) : amount; | ||
this._r = this._repeat; | ||
@@ -359,3 +360,3 @@ return this; | ||
this._repeatDelayTime = amount; | ||
this._repeatDelayTime = typeof(amount) === "function" ? amount(this._repeatDelayTime) : amount; | ||
@@ -367,3 +368,3 @@ return this; | ||
this._reverseDelayTime = amount; | ||
this._reverseDelayTime = typeof(amount) === "function" ? amount(this._reverseDelayTime) : amount; | ||
@@ -375,3 +376,3 @@ return this; | ||
this._yoyo = state; | ||
this._yoyo = typeof(state) === "function" ? state(this._yoyo) : state; | ||
@@ -409,17 +410,17 @@ return this; | ||
let { | ||
_onStartCallbackFired | ||
, _chainedTweens | ||
, _easingFunction | ||
, _interpolationFunction | ||
, _repeat | ||
, _repeatDelayTime | ||
, _reverseDelayTime | ||
, _delayTime | ||
, _yoyo | ||
, _reversed | ||
, _startTime | ||
, _duration | ||
, _valuesStart | ||
, _valuesEnd | ||
, object | ||
_onStartCallbackFired, | ||
_chainedTweens, | ||
_easingFunction, | ||
_interpolationFunction, | ||
_repeat, | ||
_repeatDelayTime, | ||
_reverseDelayTime, | ||
_delayTime, | ||
_yoyo, | ||
_reversed, | ||
_startTime, | ||
_duration, | ||
_valuesStart, | ||
_valuesEnd, | ||
object | ||
} = this; | ||
@@ -470,3 +471,3 @@ | ||
object[property] = getValue; | ||
object[property] = getValue; | ||
@@ -479,3 +480,3 @@ } | ||
} else if (typeof (end) === 'string') { | ||
} else if (typeof(end) === 'string') { | ||
@@ -489,6 +490,6 @@ if (end.charAt(0) === '+' || end.charAt(0) === '-') { | ||
// Protect against non numeric properties. | ||
if (typeof (end) === 'number') { | ||
if (typeof(end) === 'number') { | ||
object[property] = start + (end - start) * value; | ||
} | ||
} else if (typeof (end) === 'number') { | ||
} else if (typeof(end) === 'number') { | ||
object[property] = start + (end - start) * value; | ||
@@ -501,50 +502,49 @@ } | ||
if (elapsed === 1 || (_reversed && elapsed === 0)) { | ||
if (elapsed === 1 || (_reversed && elapsed === 0)) { | ||
if (_repeat) { | ||
if (_repeat) { | ||
if (isFinite(_repeat)) { | ||
this._repeat--; | ||
} | ||
if (isFinite(_repeat)) { | ||
this._repeat--; | ||
} | ||
for (property in _valuesEnd) { | ||
for (property in _valuesEnd) { | ||
if (typeof (_valuesEnd[property]) === 'string') { | ||
this._valuesStart[property] = _valuesStart[property] + parseFloat(_valuesEnd[property]); | ||
} | ||
if (typeof(_valuesEnd[property]) === 'string' && typeof(_valuesStart[property]) === 'number') { | ||
this._valuesStart[property] = _valuesStart[property] + parseFloat(_valuesEnd[property]); | ||
} | ||
} | ||
} | ||
// Reassign starting values, restart by making startTime = now | ||
this.emit(_reversed ? 'reverse' : 'repeat', object); | ||
// Reassign starting values, restart by making startTime = now | ||
this.emit(_reversed ? 'reverse' : 'repeat', object); | ||
if (_yoyo) { | ||
this.reverse(); | ||
} | ||
if (_yoyo) { | ||
this.reverse(); | ||
} | ||
if (!_reversed && _repeatDelayTime) { | ||
this._startTime += _duration + _repeatDelayTime; | ||
} else if (_reversed && _reverseDelayTime) { | ||
this._startTime += _duration + _reverseDelayTime; | ||
} else { | ||
this._startTime += _duration + _delayTime; | ||
} | ||
if (!_reversed && _repeatDelayTime) { | ||
this._startTime += _duration + _repeatDelayTime; | ||
} else if (_reversed && _reverseDelayTime) { | ||
this._startTime += _duration + _reverseDelayTime; | ||
} else { | ||
this._startTime += _duration + _delayTime; | ||
} | ||
return true; | ||
return true; | ||
} else { | ||
} else { | ||
this.emit('complete', object); | ||
this.emit('complete', object); | ||
_chainedTweens.map(tween => tween.start(_startTime + _duration)); | ||
_chainedTweens.map(tween => tween.start(_startTime + _duration)); | ||
return false; | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
export default Tween; | ||
export default Tween; |
@@ -15,4 +15,8 @@ import './shim/object_assign'; | ||
import cloneTween from './dist/clone'; | ||
import Composite from './dist/Composite'; | ||
export { getAll, removeAll, remove, add, now, update, autoPlay, on, once, off, emit, Tween, Easing, Interpolation }; | ||
import Timeline from './dist/Timeline'; | ||
import Plugins from './dist/Plugins'; | ||
export { getAll, removeAll, remove, add, now, update, autoPlay, on, once, off, emit, Tween, Easing, Interpolation, Composite, Timeline, Plugins }; |
Sorry, the diff of this file is not supported yet
446811
31
3049