es6-tween
Advanced tools
Comparing version 1.12.3 to 2.0.0
2983
dist/Tween.js
@@ -1,875 +0,481 @@ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
else if(typeof exports === 'object') | ||
exports["TWEEN"] = factory(); | ||
else | ||
root["TWEEN"] = factory(); | ||
})(this, function() { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 15); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.TWEEN = global.TWEEN || {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
"use strict"; | ||
if ( Object.assign === undefined ) { | ||
Object.assign = function () { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var first = args.shift(); | ||
args.map(function (obj) { | ||
for ( var p in obj ) { | ||
first[p] = obj[p]; | ||
} | ||
}); | ||
return first; | ||
}; | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var ROOT = typeof(window) !== "undefined" ? window : typeof(global) !== "undefined" ? global : {}; | ||
var _vendor = ['webkit', 'moz', 'ms', 'o']; | ||
var animFrame = 'AnimationFrame'; | ||
var rafSuffixForVendor = 'Request' + animFrame; | ||
var cafSuffixForVendor = 'Cancel' + animFrame; | ||
var cafSuffixForVendor2 = 'CancelRequest' + animFrame; | ||
var _timeout = setTimeout; | ||
var _clearTimeout = clearTimeout; | ||
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 ( ROOT.requestAnimationFrame === undefined ) { | ||
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 _raf, now, lastTime = Date.now(), frameMs = (50 / 3), fpsSec = frameMs; | ||
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] : {}; | ||
var instate = arguments[1]; | ||
_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; | ||
if (instate && instate.to) { | ||
return new Tween(object).to(instate.to, instate); | ||
_vendor.map(function (vendor) { | ||
if ((_raf = ROOT[vendor + rafSuffixForVendor]) === undefined) { | ||
_raf = function (fn) { | ||
return _timeout(function () { | ||
now = Date.now(); | ||
fn(now - lastTime); | ||
fpsSec = frameMs + (Date.now() - now); | ||
}, fpsSec); | ||
}; | ||
} | ||
}); | ||
return this; | ||
if (_raf !== undefined) { | ||
ROOT.requestAnimationFrame = _raf; | ||
} | ||
} | ||
_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; | ||
if ( ROOT.cancelAnimationFrame === undefined && (ROOT.cancelAnimationFrame = ROOT.cancelRequestAnimationFrame) === undefined ) { | ||
var _caf; | ||
this._reversed = !_reversed; | ||
return this; | ||
_vendor.map(function (vendor) { | ||
if ((_caf = ROOT[vendor + cafSuffixForVendor]) === undefined && (_caf = ROOT[vendor + cafSuffixForVendor2]) === undefined) { | ||
_caf = function (fn) { | ||
return _clearTimeout(fn); | ||
}; | ||
} | ||
}, { | ||
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]; | ||
} | ||
if (_caf !== undefined) { | ||
ROOT.cancelAnimationFrame = _caf; | ||
} | ||
} | ||
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; | ||
if ( Array.isArray === undefined ) { | ||
Array.isArray = function (arrayLike) { | ||
return arrayLike !== undefined && typeof arrayLike === "object" && arrayLike.length && arrayLike.push !== undefined && arrayLike.splice !== undefined; | ||
}; | ||
} | ||
var _tweens = []; | ||
var isStarted = false; | ||
var _autoPlay = false; | ||
var _tick; | ||
var _events = {}; | ||
var root = typeof (window) !== "undefined" ? window : typeof (global) !== "undefined" ? global : {}; | ||
var eventFn = _events[name]; | ||
var getAll = function () { | ||
return _tweens; | ||
}; | ||
if (!eventFn) { | ||
return this; | ||
} | ||
var autoPlay = function (state) { | ||
_autoPlay = state; | ||
}; | ||
var i = eventFn.length; | ||
while (i--) { | ||
eventFn[i].call(this, a, b, c, d, e); | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: 'pause', | ||
value: function pause() { | ||
var removeAll = function () { | ||
_tweens = []; | ||
}; | ||
if (!this._isPlaying) { | ||
return this; | ||
} | ||
var emit = function(name, a, b, c, d, e) { | ||
var this$1 = this; | ||
this._isPlaying = false; | ||
var eventFn = _events[name]; | ||
(0, _core.remove)(this); | ||
this._pausedTime = (0, _core.now)(); | ||
return this.emit('pause', this.object); | ||
if (eventFn) { | ||
var i = eventFn.length; | ||
while (i--) { | ||
eventFn[i].call(this$1, a, b, c, d, e); | ||
} | ||
}, { | ||
key: 'play', | ||
value: function play() { | ||
} | ||
}; | ||
if (this._isPlaying) { | ||
return this; | ||
var off = function (ev, fn) { | ||
if (ev === undefined || _events[ev] === undefined) { | ||
return; | ||
} | ||
if (fn !== undefined) { | ||
var eventsList = _events[name] | ||
, i = 0; | ||
while (i < eventsList.length) { | ||
if (eventsList[i] === fn) { | ||
eventsList.splice(i, 1); | ||
} | ||
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); | ||
i++; | ||
} | ||
}, { | ||
key: 'restart', | ||
value: function restart(noDelay) { | ||
} else { | ||
_events[name] = []; | ||
} | ||
}; | ||
this._repeat = this._r; | ||
this._startTime = (0, _core.now)() + (noDelay ? 0 : this._delayTime); | ||
var add = function (tween) { | ||
_tweens.push(tween); | ||
if (!this._isPlaying) { | ||
(0, _core.add)(this); | ||
} | ||
if (_autoPlay && !isStarted) { | ||
update(); | ||
isStarted = true; | ||
emit('start'); | ||
} | ||
emit('add', tween, _tweens); | ||
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)); | ||
var on = function (ev, fn) { | ||
if (_events[ev] === undefined) { | ||
_events[ev] = []; | ||
} | ||
_events[ev].push(fn); | ||
}; | ||
this.emit('seek', time, this._object); | ||
var once = function (ev, fn) { | ||
if (_events[ev] === undefined) { | ||
_events[ev] = []; | ||
} | ||
on(ev, function () { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return keepPlaying ? this : this.pause(); | ||
} | ||
}, { | ||
key: 'duration', | ||
value: function duration(amount) { | ||
fn.apply(void 0, args); | ||
off(ev); | ||
}); | ||
}; | ||
this._duration = typeof amount === "function" ? amount(this._duration) : amount; | ||
return this; | ||
var remove = function (tween) { | ||
_tweens.filter(function (tweens) { return tweens !== tween; }); | ||
var i = 0 | ||
, tweenFind; | ||
while (i < _tweens.length) { | ||
tweenFind = _tweens[i]; | ||
if (tweenFind === tween) { | ||
emit('remove', tween, _tweens); | ||
_tweens.splice(i, 1); | ||
} | ||
}, { | ||
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; | ||
i++; | ||
} | ||
}; | ||
var now$1 = function () { | ||
if (typeof (process) !== "undefined" && process.hrtime !== undefined) { | ||
return function () { | ||
var time = process.hrtime(); | ||
if (typeof properties === "number") { | ||
var _vE = { | ||
Number: properties | ||
}; | ||
this._valuesEnd = _vE; | ||
} else { | ||
this._valuesEnd = properties; | ||
} | ||
// Convert [seconds, nanoseconds] to milliseconds. | ||
return time[0] * 1000 + time[1] / 1000000; | ||
}; | ||
} | ||
// In a browser, use window.performance.now if it is available. | ||
else if (root.performance !== undefined && | ||
root.performance.now !== undefined) { | ||
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) { | ||
if (this[prop]) { | ||
this[prop](typeof duration[prop] === "function" ? duration[prop](this._duration) : duration); | ||
} | ||
} | ||
} | ||
return this; | ||
// This must be bound, because directly assigning this function | ||
// leads to an invocation exception in Chrome. | ||
return root.performance.now.bind(root.performance) | ||
} | ||
// Use Date.now if it is available. | ||
else { | ||
var offset = root.performance && root.performance.timing && root.performance.timing.navigationStart ? root.performance.timing.navigationStart : Date.now(); | ||
return function () { | ||
return Date.now() - offset; | ||
} | ||
}, { | ||
key: 'start', | ||
value: function start(time) { | ||
var _startTime = this._startTime, | ||
_delayTime = this._delayTime, | ||
_valuesEnd = this._valuesEnd, | ||
_valuesStart = this._valuesStart, | ||
object = this.object; | ||
} | ||
}(); | ||
var update = function (time, preserve) { | ||
_startTime = time !== undefined ? time : (0, _core.now)(); | ||
_startTime += _delayTime; | ||
time = time !== undefined ? time : now$1(); | ||
this._startTime = _startTime; | ||
if (_autoPlay) { | ||
_tick = requestAnimationFrame(update); | ||
} | ||
emit('update', time, _tweens); | ||
for (var property in _valuesEnd) { | ||
if (_tweens.length === 0) { | ||
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(); | ||
isStarted = false; | ||
cancelAnimationFrame(_tick); | ||
emit('stop', time); | ||
return false; | ||
this._valuesEnd[property] = clonedTween; | ||
} | ||
} else { | ||
var _clonedTween = (0, _clone2.default)(this, { | ||
object: object[property], | ||
_valuesEnd: _valuesEnd[property], | ||
_events: {} | ||
}).start().stop(); | ||
} | ||
this._valuesStart[property] = 1; | ||
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 i = 0; | ||
while (i < _tweens.length) { | ||
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._valuesStart[property] = 1; | ||
this._valuesEnd[property] = _clonedTween2; | ||
} | ||
// If value presented as function, | ||
// we should convert to value again by passing function | ||
if (typeof object[property] === "function") { | ||
object[property] = this.object[property] = object[property](this); | ||
} | ||
if (typeof _valuesEnd[property] === "function") { | ||
this._valuesEnd[property] = _valuesEnd[property](this); | ||
} | ||
// 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 skip from adding to _valuesStart | ||
if (object[property] === _valuesEnd[property]) { | ||
continue; | ||
} | ||
this._valuesStart[property] = object[property]; | ||
} | ||
(0, _core.add)(this); | ||
this._isPlaying = true; | ||
return this; | ||
if (_tweens[i].update(time) || preserve) { | ||
i++; | ||
} else { | ||
_tweens.splice(i, 1); | ||
} | ||
}, { | ||
key: 'stop', | ||
value: function stop() { | ||
var _isPlaying = this._isPlaying, | ||
object = this.object; | ||
} | ||
if (!_isPlaying) { | ||
return this; | ||
} | ||
return true; | ||
}; | ||
(0, _core.remove)(this); | ||
this._isPlaying = false; | ||
this.stopChainedTweens(); | ||
return this.emit('stop', object); | ||
// Normalise time when visiblity is changed ... | ||
if (root.document) { | ||
var doc = root.document, timeDiff = 0, timePause = 0; | ||
doc.addEventListener('visibilitychange', function (ev) { | ||
if (_tweens.length === 0) { | ||
return false; | ||
} | ||
}, { | ||
key: 'end', | ||
value: function end() { | ||
var _startTime = this._startTime, | ||
_duration = this._duration; | ||
if (document.hidden) { | ||
timePause = now$1(); | ||
} else { | ||
timeDiff = now$1() - timePause; | ||
_tweens.map(function (tween) { return tween._startTime += timeDiff; }); | ||
return this.update(_startTime + _duration); | ||
} | ||
}, { | ||
key: 'stopChainedTweens', | ||
value: function stopChainedTweens() { | ||
var _chainedTweens = this._chainedTweens; | ||
return true; | ||
}); | ||
} | ||
var Easing = { | ||
_chainedTweens.map(function (item) { | ||
return item.stop(); | ||
}); | ||
Linear: { | ||
return this; | ||
} | ||
}, { | ||
key: 'delay', | ||
value: function delay(amount) { | ||
None: function None( k ) { | ||
this._delayTime = typeof amount === "function" ? amount(this._delayTime) : amount; | ||
return k; | ||
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) { | ||
Quadratic: { | ||
this._repeatDelayTime = typeof amount === "function" ? amount(this._repeatDelayTime) : amount; | ||
In: function In( k ) { | ||
return this; | ||
} | ||
}, { | ||
key: 'reverseDelay', | ||
value: function reverseDelay(amount) { | ||
return k * k; | ||
this._reverseDelayTime = typeof amount === "function" ? amount(this._reverseDelayTime) : amount; | ||
}, | ||
return this; | ||
} | ||
}, { | ||
key: 'yoyo', | ||
value: function yoyo(state) { | ||
Out: function Out( k ) { | ||
this._yoyo = typeof state === "function" ? state(this._yoyo) : state; | ||
return k * ( 2 - k ); | ||
return this; | ||
} | ||
}, { | ||
key: 'easing', | ||
value: function easing(fn) { | ||
}, | ||
this._easingFunction = fn; | ||
InOut: function InOut( k ) { | ||
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]; | ||
if ( ( k *= 2 ) < 1 ) { | ||
return 0.5 * k * k; | ||
} | ||
this._chainedTweens = args; | ||
return -0.5 * ( --k * ( k - 2 ) - 1 ); | ||
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; | ||
Cubic: { | ||
time = time !== undefined ? time : (0, _core.now)(); | ||
In: function In( k ) { | ||
if (time < _startTime) { | ||
return true; | ||
} | ||
return k * k * k; | ||
if (!_onStartCallbackFired) { | ||
}, | ||
this.emit('start', object); | ||
Out: function Out( k ) { | ||
this._onStartCallbackFired = true; | ||
} | ||
return --k * k * k + 1; | ||
elapsed = (time - _startTime) / _duration; | ||
elapsed = elapsed > 1 ? 1 : elapsed; | ||
elapsed = _reversed ? 1 - elapsed : elapsed; | ||
}, | ||
value = _easingFunction(elapsed); | ||
InOut: function InOut( k ) { | ||
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; | ||
} | ||
if ( ( k *= 2 ) < 1 ) { | ||
return 0.5 * k * k * k; | ||
} | ||
this.emit('update', object, value, elapsed); | ||
return 0.5 * ( ( k -= 2 ) * k * k + 2 ); | ||
if (elapsed === 1 || _reversed && elapsed === 0) { | ||
} | ||
if (_repeat) { | ||
}, | ||
if (isFinite(_repeat)) { | ||
this._repeat--; | ||
} | ||
Quartic: { | ||
for (property in _valuesEnd) { | ||
In: function In( k ) { | ||
if (typeof _valuesEnd[property] === 'string' && typeof _valuesStart[property] === 'number') { | ||
this._valuesStart[property] = _valuesStart[property] + parseFloat(_valuesEnd[property]); | ||
} | ||
} | ||
return k * k * k * k; | ||
// Reassign starting values, restart by making startTime = now | ||
this.emit(_reversed ? 'reverse' : 'repeat', object); | ||
}, | ||
if (_yoyo) { | ||
this._reversed = !_reversed; | ||
} | ||
Out: function Out( k ) { | ||
if (!_reversed && _repeatDelayTime) { | ||
this._startTime += _duration + _repeatDelayTime; | ||
} else if (_reversed && _reverseDelayTime) { | ||
this._startTime += _duration + _reverseDelayTime; | ||
} else { | ||
this._startTime += _duration; | ||
} | ||
return 1 - ( --k * k * k * k ); | ||
return true; | ||
} else { | ||
}, | ||
this.emit('complete', object); | ||
InOut: function InOut( k ) { | ||
_chainedTweens.map(function (tween) { | ||
return tween.start(_startTime + _duration); | ||
}); | ||
return false; | ||
} | ||
if ( ( k *= 2 ) < 1 ) { | ||
return 0.5 * k * k * k * k; | ||
} | ||
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 -0.5 * ( ( k -= 2 ) * k * k * k - 2 ); | ||
exports.default = Tween; | ||
} | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
}, | ||
"use strict"; | ||
Quintic: { | ||
In: function In( k ) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var Easing = { | ||
return k * k * k * k * k; | ||
Linear: { | ||
None: function None(k) { | ||
}, | ||
return k; | ||
} | ||
}, | ||
Out: function Out( k ) { | ||
Quadratic: { | ||
In: function In(k) { | ||
return --k * k * k * k * k + 1; | ||
return k * k; | ||
}, | ||
Out: function Out(k) { | ||
return k * (2 - k); | ||
}, | ||
InOut: function InOut(k) { | ||
InOut: function InOut( k ) { | ||
if ((k *= 2) < 1) { | ||
return 0.5 * k * k; | ||
if ( ( k *= 2 ) < 1 ) { | ||
return 0.5 * k * k * k * k * k; | ||
} | ||
return -0.5 * (--k * (k - 2) - 1); | ||
return 0.5 * ( ( k -= 2 ) * k * k * k * k + 2 ); | ||
} | ||
}, | ||
Cubic: { | ||
In: function In(k) { | ||
Sinusoidal: { | ||
return k * k * k; | ||
}, | ||
Out: function Out(k) { | ||
In: function In( k ) { | ||
return --k * k * k + 1; | ||
return 1 - Math.cos( k * Math.PI / 2 ); | ||
}, | ||
InOut: function InOut(k) { | ||
if ((k *= 2) < 1) { | ||
return 0.5 * k * k * k; | ||
} | ||
Out: function Out( k ) { | ||
return 0.5 * ((k -= 2) * k * k + 2); | ||
} | ||
}, | ||
return Math.sin( k * Math.PI / 2 ); | ||
Quartic: { | ||
In: function In(k) { | ||
return k * k * k * k; | ||
}, | ||
Out: function Out(k) { | ||
return 1 - --k * k * k * k; | ||
}, | ||
InOut: function InOut(k) { | ||
InOut: function InOut( k ) { | ||
if ((k *= 2) < 1) { | ||
return 0.5 * k * k * k * k; | ||
} | ||
return 0.5 * ( 1 - Math.cos( Math.PI * k ) ); | ||
return -0.5 * ((k -= 2) * k * k * k - 2); | ||
} | ||
}, | ||
Quintic: { | ||
In: function In(k) { | ||
Exponential: { | ||
return k * k * k * k * k; | ||
}, | ||
Out: function Out(k) { | ||
In: function In( k ) { | ||
return --k * k * k * k * k + 1; | ||
}, | ||
InOut: function InOut(k) { | ||
return k === 0 ? 0 : Math.pow( 1024, ( k - 1 ) ); | ||
if ((k *= 2) < 1) { | ||
return 0.5 * k * k * k * k * k; | ||
} | ||
return 0.5 * ((k -= 2) * k * k * k * k + 2); | ||
} | ||
}, | ||
Sinusoidal: { | ||
In: function In(k) { | ||
return 1 - Math.cos(k * Math.PI / 2); | ||
}, | ||
Out: function Out(k) { | ||
return Math.sin(k * Math.PI / 2); | ||
}, | ||
InOut: function InOut(k) { | ||
Out: function Out( k ) { | ||
return 0.5 * (1 - Math.cos(Math.PI * k)); | ||
} | ||
}, | ||
return k === 1 ? 1 : 1 - Math.pow( -10 * k, 2 ); | ||
Exponential: { | ||
In: function In(k) { | ||
return k === 0 ? 0 : Math.pow(1024, k - 1); | ||
}, | ||
Out: function Out(k) { | ||
return k === 1 ? 1 : 1 - Math.pow(-10 * k, 2); | ||
}, | ||
InOut: function InOut(k) { | ||
InOut: function InOut( k ) { | ||
if (k === 0) { | ||
if ( k === 0 ) { | ||
return 0; | ||
} | ||
if (k === 1) { | ||
if ( k === 1 ) { | ||
return 1; | ||
} | ||
if ((k *= 2) < 1) { | ||
return 0.5 * Math.pow(1024, k - 1); | ||
if ( ( k *= 2 ) < 1 ) { | ||
return 0.5 * Math.pow( 1024, ( k - 1 ) ); | ||
} | ||
return 0.5 * (-Math.pow(-10 * (k - 1), 2) + 2); | ||
return 0.5 * ( -Math.pow( -10 * ( k - 1 ), 2 ) + 2 ); | ||
} | ||
}, | ||
Circular: { | ||
In: function In(k) { | ||
return 1 - Math.sqrt(1 - k * k); | ||
In: function In( k ) { | ||
return 1 - Math.sqrt( 1 - k * k ); | ||
}, | ||
Out: function Out(k) { | ||
return Math.sqrt(1 - --k * k); | ||
Out: function Out( k ) { | ||
return Math.sqrt( 1 - ( --k * k ) ); | ||
}, | ||
InOut: function InOut(k) { | ||
if ((k *= 2) < 1) { | ||
return -0.5 * (Math.sqrt(1 - k * k) - 1); | ||
InOut: function InOut( k ) { | ||
if ( ( k *= 2 ) < 1 ) { | ||
return -0.5 * ( Math.sqrt( 1 - k * k ) - 1 ); | ||
} | ||
return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); | ||
return 0.5 * ( Math.sqrt( 1 - ( k -= 2 ) * k ) + 1 ); | ||
} | ||
}, | ||
Elastic: { | ||
In: function In(k) { | ||
if (k === 0) { | ||
In: function In( k ) { | ||
if ( k === 0 ) { | ||
return 0; | ||
} | ||
if (k === 1) { | ||
if ( k === 1 ) { | ||
return 1; | ||
} | ||
return -Math.pow(10 * (k - 1), 2) * Math.sin((k - 1.1) * 5 * Math.PI); | ||
return -Math.pow( ( 10 * ( k - 1 ) ), 2 ) * Math.sin( ( k - 1.1 ) * 5 * Math.PI ); | ||
}, | ||
Out: function Out(k) { | ||
if (k === 0) { | ||
Out: function Out( k ) { | ||
if ( k === 0 ) { | ||
return 0; | ||
} | ||
if (k === 1) { | ||
if ( k === 1 ) { | ||
return 1; | ||
} | ||
return Math.pow(-10 * k, 2) * Math.sin((k - 0.1) * 5 * Math.PI) + 1; | ||
return Math.pow( -10 * k, 2 ) * Math.sin( ( k - 0.1 ) * 5 * Math.PI ) + 1; | ||
}, | ||
InOut: function InOut(k) { | ||
if (k === 0) { | ||
InOut: function InOut( k ) { | ||
if ( k === 0 ) { | ||
return 0; | ||
} | ||
if (k === 1) { | ||
if ( k === 1 ) { | ||
return 1; | ||
@@ -880,75 +486,92 @@ } | ||
if (k < 1) { | ||
return -0.5 * Math.pow(10 * (k - 1), 2) * Math.sin((k - 1.1) * 5 * Math.PI); | ||
if ( k < 1 ) { | ||
return -0.5 * Math.pow( ( 10 * ( k - 1 ) ), 2 ) * Math.sin( ( k - 1.1 ) * 5 * Math.PI ); | ||
} | ||
return 0.5 * Math.pow(-10 * (k - 1), 2) * Math.sin((k - 1.1) * 5 * Math.PI) + 1; | ||
return 0.5 * Math.pow( -10 * ( k - 1 ), 2 ) * Math.sin( ( k - 1.1 ) * 5 * Math.PI ) + 1; | ||
} | ||
}, | ||
Back: { | ||
In: function In(k) { | ||
In: function In( k ) { | ||
var s = 1.70158; | ||
return k * k * ((s + 1) * k - s); | ||
return k * k * ( ( s + 1 ) * k - s ); | ||
}, | ||
Out: function Out(k) { | ||
Out: function Out( k ) { | ||
var s = 1.70158; | ||
return --k * k * ((s + 1) * k + s) + 1; | ||
return --k * k * ( ( s + 1 ) * k + s ) + 1; | ||
}, | ||
InOut: function InOut(k) { | ||
InOut: function InOut( k ) { | ||
var s = 1.70158 * 1.525; | ||
if ((k *= 2) < 1) { | ||
return 0.5 * (k * k * ((s + 1) * k - s)); | ||
if ( ( k *= 2 ) < 1 ) { | ||
return 0.5 * ( k * k * ( ( s + 1 ) * k - s ) ); | ||
} | ||
return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); | ||
return 0.5 * ( ( k -= 2 ) * k * ( ( s + 1 ) * k + s ) + 2 ); | ||
} | ||
}, | ||
Bounce: { | ||
In: function In(k) { | ||
return 1 - Easing.Bounce.Out(1 - k); | ||
In: function In( k ) { | ||
return 1 - Easing.Bounce.Out( 1 - k ); | ||
}, | ||
Out: function Out(k) { | ||
if (k < 1 / 2.75) { | ||
Out: function Out( k ) { | ||
if ( k < ( 1 / 2.75 ) ) { | ||
return 7.5625 * k * k; | ||
} else if (k < 2 / 2.75) { | ||
return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75; | ||
} else if (k < 2.5 / 2.75) { | ||
return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375; | ||
} else if ( k < ( 2 / 2.75 ) ) { | ||
return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75; | ||
} else if ( k < ( 2.5 / 2.75 ) ) { | ||
return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375; | ||
} else { | ||
return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375; | ||
return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375; | ||
} | ||
}, | ||
InOut: function InOut(k) { | ||
if (k < 0.5) { | ||
return Easing.Bounce.In(k * 2) * 0.5; | ||
InOut: function InOut( k ) { | ||
if ( k < 0.5 ) { | ||
return Easing.Bounce.In( k * 2 ) * 0.5; | ||
} | ||
return Easing.Bounce.Out(k * 2 - 1) * 0.5 + 0.5; | ||
return Easing.Bounce.Out( k * 2 - 1 ) * 0.5 + 0.5; | ||
} | ||
}, | ||
Stepped: function Stepped(steps) { | ||
return function (k) { | ||
return Math.floor(k * steps) / steps; | ||
}; | ||
Stepped: function Stepped( steps ) { | ||
return function( k ) { | ||
return Math.floor( k * steps ) / steps; | ||
} | ||
}, | ||
Noisy: function Noisy(randomProportion, easingFunction) { | ||
Noisy: function Noisy( randomProportion, easingFunction ) { | ||
var normalProportion = 1.0 - randomProportion; | ||
return function (k) { | ||
return randomProportion * Math.random() + normalProportion * easingFunction(k); | ||
}; | ||
return function( k ) { | ||
return randomProportion * Math.random() + normalProportion * easingFunction( k ); | ||
} | ||
}, | ||
// Credits: | ||
@@ -958,237 +581,283 @@ // @michaelvillar for dynamics.js easing/physics | ||
get bezier() { | ||
var b, d; | ||
b = function b(_b, d, g, f, h) { | ||
var k = Math.pow(1 - _b, 3), | ||
l = 3 * Math.pow(1 - _b, 2) * _b, | ||
m = 3 * (1 - _b) * Math.pow(_b, 2); | ||
_b = Math.pow(_b, 3); | ||
return { | ||
x: k * d.x + l * g.x + m * f.x + _b * h.x, | ||
y: k * d.y + l * g.y + m * f.y + _b * h.y | ||
var b | ||
, d; | ||
b = function( b, d, g, f, h ) { | ||
var k = Math.pow( 1 - b, 3 ) | ||
, l = 3 * Math.pow( 1 - b, 2 ) * b | ||
, m = 3 * ( 1 - b ) * Math.pow( b, 2 ); | ||
b = Math.pow( b, 3 ); | ||
return { | ||
x: k * d.x + l * g.x + m * f.x + b * h.x | ||
, y: k * d.y + l * g.y + m * f.y + b * h.y | ||
} | ||
}; | ||
}; | ||
d = function d(b, _d) { | ||
var g, | ||
f, | ||
h = 0, | ||
k = 0, | ||
l = _d.length, | ||
m = 0, | ||
q = 1, | ||
w = (q + m) / 2; | ||
for (g = null; k < l;) { | ||
f = _d[k]; | ||
b >= f(0).x && b <= f(1).x && (g = f); | ||
if (null !== g) break; | ||
k++; | ||
d = function( b, d ) { | ||
var g | ||
, f | ||
, h = 0 | ||
, k = 0 | ||
, l = d.length | ||
, m = 0 | ||
, q = 1 | ||
, w = ( q + m ) / 2; | ||
for ( g = null; k < l; ) { | ||
f = d[ k ]; | ||
b >= f( 0 ) | ||
.x && b <= f( 1 ) | ||
.x && ( g = f ); | ||
if ( null !== g ) | ||
{ break; } | ||
k++; | ||
} | ||
if ( !g ) | ||
{ return 1; } | ||
for ( f = g( w ) | ||
.x; 1E-4 < Math.abs( b - f ) && 100 > h; ) | ||
{ b > f ? m = w : q = w, w = ( q + m ) / 2, f = g( w ) | ||
.x, h++; } | ||
return g( w ) | ||
.y | ||
}; | ||
return function( c ) { | ||
null == c && ( c = {} ); | ||
var e = c.points | ||
, g = function() { | ||
var c | ||
, d = 0 | ||
, k = e.length; | ||
g = []; | ||
for ( c = function( d, c ) { | ||
return g.push( function( e ) { | ||
return b( e, d, d.cp[ d.cp.length - 1 ], c.cp[ 0 ], c ) | ||
} ) | ||
}; d < k && !( d >= e.length - 1 ); ) | ||
{ c( e[ d ], e[ d + 1 ] ), d++; } | ||
return g | ||
} | ||
(); | ||
return function( b ) { | ||
return d( b, g ) | ||
} | ||
} | ||
if (!g) return 1; | ||
for (f = g(w).x; 1E-4 < Math.abs(b - f) && 100 > h;) { | ||
b > f ? m = w : q = w, w = (q + m) / 2, f = g(w).x, h++; | ||
}return g(w).y; | ||
}; | ||
return function (c) { | ||
null == c && (c = {}); | ||
var e = c.points, | ||
g = function () { | ||
var c, | ||
d = 0, | ||
k = e.length; | ||
g = []; | ||
for (c = function c(d, _c) { | ||
return g.push(function (e) { | ||
return b(e, d, d.cp[d.cp.length - 1], _c.cp[0], _c); | ||
}); | ||
}; d < k && !(d >= e.length - 1);) { | ||
c(e[d], e[d + 1]), d++; | ||
}return g; | ||
}(); | ||
return function (b) { | ||
return d(b, g); | ||
}; | ||
}; | ||
}, | ||
easeInOut: function easeInOut(b) { | ||
var d, c; | ||
null == b && (b = {}); | ||
d = null != (c = b.friction) ? c : Easing.easeInOut.defaults.friction; | ||
return Easing.bezier({ | ||
points: [{ | ||
x: 0, | ||
y: 0, | ||
cp: [{ | ||
x: .92 - d / 1E3, | ||
y: 0 | ||
}] | ||
}, { | ||
x: 1, | ||
y: 1, | ||
cp: [{ | ||
x: .08 + d / 1E3, | ||
y: 1 | ||
}] | ||
}] | ||
}); | ||
}, | ||
easeIn: function easeIn(b) { | ||
var d, c; | ||
null == b && (b = {}); | ||
d = null != (c = b.friction) ? c : Easing.easeIn.defaults.friction; | ||
return Easing.bezier({ | ||
points: [{ | ||
x: 0, | ||
y: 0, | ||
cp: [{ | ||
x: .92 - d / 1E3, | ||
y: 0 | ||
}] | ||
}, { | ||
x: 1, | ||
y: 1, | ||
cp: [{ | ||
x: 1, | ||
y: 1 | ||
}] | ||
}] | ||
}); | ||
}, | ||
easeOut: function easeOut(b) { | ||
var d, c; | ||
null == b && (b = {}); | ||
d = null != (c = b.friction) ? c : Easing.easeOut.defaults.friction; | ||
return Easing.bezier({ | ||
points: [{ | ||
x: 0, | ||
y: 0, | ||
cp: [{ | ||
x: 0, | ||
y: 0 | ||
}] | ||
}, { | ||
x: 1, | ||
y: 1, | ||
cp: [{ | ||
x: .08 + d / 1E3, | ||
y: 1 | ||
}] | ||
}] | ||
}); | ||
}, | ||
spring: function spring(b) { | ||
var d, c, e, g, f; | ||
null == b && (b = {}); | ||
Tools.extend(b, Easing.spring.defaults, true); | ||
e = Math.max(1, b.frequency / 20); | ||
g = Math.pow(20, b.friction / 100); | ||
} | ||
, easeInOut: function easeInOut( b ) { | ||
var d | ||
, c; | ||
null == b && ( b = {} ); | ||
d = null != ( c = b.friction ) ? c : Easing.easeInOut.defaults.friction; | ||
return Easing.bezier( { | ||
points: [ { | ||
x: 0 | ||
, y: 0 | ||
, cp: [ { | ||
x: .92 - d / 1E3 | ||
, y: 0 | ||
} | ||
] | ||
}, { | ||
x: 1 | ||
, y: 1 | ||
, cp: [ { | ||
x: .08 + d / 1E3 | ||
, y: 1 | ||
} | ||
] | ||
} | ||
] | ||
} ) | ||
} | ||
, easeIn: function easeIn( b ) { | ||
var d | ||
, c; | ||
null == b && ( b = {} ); | ||
d = null != ( c = b.friction ) ? c : Easing.easeIn.defaults.friction; | ||
return Easing.bezier( { | ||
points: [ { | ||
x: 0 | ||
, y: 0 | ||
, cp: [ { | ||
x: .92 - d / 1E3 | ||
, y: 0 | ||
} | ||
] | ||
}, { | ||
x: 1 | ||
, y: 1 | ||
, cp: [ { | ||
x: 1 | ||
, y: 1 | ||
} | ||
] | ||
} | ||
] | ||
} ) | ||
} | ||
, easeOut: function easeOut( b ) { | ||
var d | ||
, c; | ||
null == b && ( b = {} ); | ||
d = null != ( c = b.friction ) ? c : Easing.easeOut.defaults.friction; | ||
return Easing.bezier( { | ||
points: [ { | ||
x: 0 | ||
, y: 0 | ||
, cp: [ { | ||
x: 0 | ||
, y: 0 | ||
} | ||
] | ||
}, { | ||
x: 1 | ||
, y: 1 | ||
, cp: [ { | ||
x: .08 + d / 1E3 | ||
, y: 1 | ||
} | ||
] | ||
} | ||
] | ||
} ) | ||
} | ||
, spring: function spring( b ) { | ||
var d | ||
, c | ||
, e | ||
, g | ||
, f; | ||
null == b && ( b = {} ); | ||
Tools.extend( b, Easing.spring.defaults, true ); | ||
e = Math.max( 1, b.frequency / 20 ); | ||
g = Math.pow( 20, b.friction / 100 ); | ||
f = b.anticipationSize / 1E3; | ||
d = function d(_d2) { | ||
var c, e; | ||
e = f / (1 - f); | ||
c = (e - 0) / (e - 0); | ||
return (.8 - c) / e * _d2 * b.anticipationStrength / 100 + c; | ||
d = function( d ) { | ||
var c | ||
, e; | ||
e = f / ( 1 - f ); | ||
c = ( e - 0 ) / ( e - 0 ); | ||
return ( .8 - c ) / e * d * b.anticipationStrength / 100 + c | ||
}; | ||
c = function c(b) { | ||
return Math.pow(g / 10, -b) * (1 - b); | ||
c = function( b ) { | ||
return Math.pow( g / 10, -b ) * ( 1 - b ) | ||
}; | ||
return function (b) { | ||
var g, l, m, q; | ||
q = b / (1 - f) - f / (1 - f); | ||
b < f ? (m = f / (1 - f) - f / (1 - f), g = 0 / (1 - f) - f / (1 - f), m = Math.acos(1 / d(m)), l = (Math.acos(1 / d(g)) - m) / (e * -f), g = d) : (g = c, m = 0, l = 1); | ||
return 1 - g(q) * Math.cos(e * (b - f) * l + m); | ||
return function( b ) { | ||
var g | ||
, l | ||
, m | ||
, q; | ||
q = b / ( 1 - f ) - f / ( 1 - f ); | ||
b < f ? ( m = f / ( 1 - f ) - f / ( 1 - f ), g = 0 / ( 1 - f ) - f / ( | ||
1 - f ), m = Math.acos( | ||
1 / d( m ) ), l = ( Math.acos( 1 / d( g ) ) - m ) / ( e * -f ), g = | ||
d ) : ( g = c, m = 0, l = 1 ); | ||
return 1 - g( q ) * Math.cos( e * ( b - f ) * l + m ) | ||
} | ||
} | ||
, bounce: function bounce( b ) { | ||
var d | ||
, c | ||
, e | ||
, g; | ||
null == b && ( b = {} ); | ||
Tools.extend( b, Easing.bounce.defaults ); | ||
e = Math.max( 1, b.frequency / 20 ); | ||
g = Math.pow( 20, b.friction / 100 ); | ||
d = function( b ) { | ||
return Math.pow( g / 10, -b ) * ( 1 - b ) | ||
}; | ||
}, | ||
bounce: function bounce(b) { | ||
var d, c, e, g; | ||
null == b && (b = {}); | ||
Tools.extend(b, Easing.bounce.defaults); | ||
e = Math.max(1, b.frequency / 20); | ||
g = Math.pow(20, b.friction / 100); | ||
d = function d(b) { | ||
return Math.pow(g / 10, -b) * (1 - b); | ||
c = function( b ) { | ||
return d( b ) * Math.cos( e * b * 1 + -1.57 ) | ||
}; | ||
c = function c(b) { | ||
return d(b) * Math.cos(e * b * 1 + -1.57); | ||
}; | ||
c.initialForce = !0; | ||
return c; | ||
}, | ||
gravity: function gravity(b) { | ||
var d, c, e, g, f, h; | ||
null == b && (b = {}); | ||
Tools.extend(b, Easing.gravity.defaults); | ||
c = Math.min(b.bounciness / 1250, .8); | ||
return c | ||
} | ||
, gravity: function gravity( b ) { | ||
var d | ||
, c | ||
, e | ||
, g | ||
, f | ||
, h; | ||
null == b && ( b = {} ); | ||
Tools.extend( b, Easing.gravity.defaults ); | ||
c = Math.min( b.bounciness / 1250, .8 ); | ||
g = b.elasticity / 1E3; | ||
e = []; | ||
d = function () { | ||
var e; | ||
e = Math.sqrt(.02); | ||
e = { | ||
a: -e, | ||
b: e, | ||
H: 1 | ||
}; | ||
b.initialForce && (e.a = 0, e.b *= 2); | ||
for (; .001 < e.H;) { | ||
d = e.b - e.a, e = { | ||
a: e.b, | ||
b: e.b + d * c, | ||
H: e.H * c * c | ||
d = function() { | ||
var e; | ||
e = Math.sqrt( .02 ); | ||
e = { | ||
a: -e | ||
, b: e | ||
, H: 1 | ||
}; | ||
}return e.b; | ||
}(); | ||
h = function h(c, e, f, g) { | ||
b.initialForce && ( e.a = 0, e.b *= 2 ); | ||
for ( ; .001 < e.H; ) | ||
{ d = e.b - e.a, e = { | ||
a: e.b | ||
, b: e.b + d * c | ||
, H: e.H * c * c | ||
}; } | ||
return e.b | ||
} | ||
(); | ||
h = function( c, e, f, g ) { | ||
d = e - c; | ||
c = 2 / d * g - 1 - 2 * c / d; | ||
f = c * c * f - f + 1; | ||
b.initialForce && (f = 1 - f); | ||
return f; | ||
b.initialForce && ( f = 1 - f ); | ||
return f | ||
}; | ||
(function () { | ||
var f, h, m; | ||
f = Math.sqrt(2 / (100 * d * d)); | ||
( function() { | ||
var f | ||
, h | ||
, m; | ||
f = Math.sqrt( 2 / ( 100 * d * d ) ); | ||
h = { | ||
a: -f, | ||
b: f, | ||
H: 1 | ||
a: -f | ||
, b: f | ||
, H: 1 | ||
}; | ||
b.initialForce && (h.a = 0, h.b *= 2); | ||
e.push(h); | ||
for (m = []; 1 > h.b && .001 < h.H;) { | ||
f = h.b - h.a, h = { | ||
a: h.b, | ||
b: h.b + f * c, | ||
H: h.H * g | ||
}, m.push(e.push(h)); | ||
}return m; | ||
})(); | ||
f = function f(c) { | ||
var d, f; | ||
b.initialForce && ( h.a = 0, h.b *= 2 ); | ||
e.push( h ); | ||
for ( m = []; 1 > h.b && .001 < h.H; ) | ||
{ f = h.b - h.a, h = { | ||
a: h.b | ||
, b: h.b + f * c | ||
, H: h.H * g | ||
} | ||
, m.push( e.push( h ) ); } | ||
return m | ||
} )(); | ||
f = function( c ) { | ||
var d | ||
, f; | ||
f = 0; | ||
for (d = e[f]; !(c >= d.a && c <= d.b) && (f += 1, d = e[f], d);) {} | ||
return d ? h(d.a, d.b, d.H, c) : b.initialForce ? 0 : 1; | ||
for ( d = e[ f ]; !( c >= d.a && c <= d.b ) && ( f += 1, d = e[ f ], d ); ){ } | ||
return d ? h( d.a, d.b, d.H, c ) : b.initialForce ? 0 : 1 | ||
}; | ||
f.initialForce = b.initialForce; | ||
return f; | ||
}, | ||
forceWithGravity: function forceWithGravity(b) { | ||
null == b && (b = {}); | ||
Tools.extend(b, Easing.forceWithGravity.defaults); | ||
return f | ||
} | ||
, forceWithGravity: function forceWithGravity( b ) { | ||
null == b && ( b = {} ); | ||
Tools.extend( b, Easing.forceWithGravity.defaults ); | ||
b.initialForce = !0; | ||
return Easing.gravity(b); | ||
return Easing.gravity( b ) | ||
} | ||
}; | ||
Easing.spring.defaults = { | ||
frequency: 300, | ||
friction: 200, | ||
anticipationSize: 0, | ||
anticipationStrength: 0 | ||
frequency: 300 | ||
, friction: 200 | ||
, anticipationSize: 0 | ||
, anticipationStrength: 0 | ||
}; | ||
Easing.bounce.defaults = { | ||
frequency: 300, | ||
friction: 200 | ||
frequency: 300 | ||
, friction: 200 | ||
}; | ||
Easing.forceWithGravity.defaults = Easing.gravity.defaults = { | ||
bounciness: 400, | ||
elasticity: 200 | ||
bounciness: 400 | ||
, elasticity: 200 | ||
}; | ||
@@ -1199,34 +868,25 @@ Easing.easeInOut.defaults = Easing.easeIn.defaults = Easing.easeOut.defaults = { | ||
exports.default = Easing; | ||
var Interpolation = { | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
Linear: function Linear( v, k ) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var Interpolation = { | ||
Linear: function Linear(v, k) { | ||
var m = v.length - 1; | ||
var f = m * k; | ||
var i = Math.floor(f); | ||
var i = Math.floor( f ); | ||
var fn = Interpolation.Utils.Linear; | ||
if (k < 0) { | ||
return fn(v[0], v[1], f); | ||
if ( k < 0 ) { | ||
return fn( v[ 0 ], v[ 1 ], f ); | ||
} | ||
if (k > 1) { | ||
return fn(v[m], v[m - 1], m - f); | ||
if ( k > 1 ) { | ||
return fn( v[ m ], v[ m - 1 ], m - f ); | ||
} | ||
return fn(v[i], v[i + 1 > m ? m : i + 1], f - i); | ||
return fn( v[ i ], v[ i + 1 > m ? m : i + 1 ], f - i ); | ||
}, | ||
Bezier: function Bezier(v, k) { | ||
Bezier: function Bezier( v, k ) { | ||
var b = 0; | ||
@@ -1237,54 +897,61 @@ var n = v.length - 1; | ||
for (var i = 0; i <= n; i++) { | ||
b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i); | ||
for ( var i = 0; i <= n; i++ ) { | ||
b += pw( 1 - k, n - i ) * pw( k, i ) * v[ i ] * bn( n, i ); | ||
} | ||
return b; | ||
}, | ||
CatmullRom: function CatmullRom(v, k) { | ||
CatmullRom: function CatmullRom( v, k ) { | ||
var m = v.length - 1; | ||
var f = m * k; | ||
var i = Math.floor(f); | ||
var i = Math.floor( f ); | ||
var fn = Interpolation.Utils.CatmullRom; | ||
if (v[0] === v[m]) { | ||
if ( v[ 0 ] === v[ m ] ) { | ||
if (k < 0) { | ||
i = Math.floor(f = m * (1 + k)); | ||
if ( k < 0 ) { | ||
i = Math.floor( f = m * ( 1 + k ) ); | ||
} | ||
return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i); | ||
return fn( v[ ( i - 1 + m ) % m ], v[ i ], v[ ( i + 1 ) % m ], v[ ( i + 2 ) % m ], f - i ); | ||
} else { | ||
if (k < 0) { | ||
return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]); | ||
if ( k < 0 ) { | ||
return v[ 0 ] - ( fn( v[ 0 ], v[ 0 ], v[ 1 ], v[ 1 ], -f ) - v[ 0 ] ); | ||
} | ||
if (k > 1) { | ||
return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]); | ||
if ( k > 1 ) { | ||
return v[ m ] - ( fn( v[ m ], v[ m ], v[ m - 1 ], v[ m - 1 ], f - m ) - v[ m ] ); | ||
} | ||
return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i); | ||
return fn( v[ i ? i - 1 : 0 ], v[ i ], v[ m < i + 1 ? m : i + 1 ], v[ m < i + 2 ? m : i + 2 ], f - i ); | ||
} | ||
}, | ||
Utils: { | ||
Linear: function Linear(p0, p1, t) { | ||
return (p1 - p0) * t + p0; | ||
Linear: function Linear( p0, p1, t ) { | ||
return ( p1 - p0 ) * t + p0; | ||
}, | ||
Bernstein: function Bernstein(n, i) { | ||
Bernstein: function Bernstein( n, i ) { | ||
var fc = Interpolation.Utils.Factorial; | ||
return fc(n) / fc(i) / fc(n - i); | ||
return fc( n ) / fc( i ) / fc( n - i ); | ||
}, | ||
Factorial: ( ( function () { | ||
Factorial: function () { | ||
var a = [ 1 ]; | ||
var a = [1]; | ||
return function (n) { | ||
@@ -1294,201 +961,131 @@ | ||
if (a[n]) { | ||
return a[n]; | ||
if ( a[ n ] ) { | ||
return a[ n ]; | ||
} | ||
for (var i = n; i > 1; i--) { | ||
for ( var i = n; i > 1; i-- ) { | ||
s *= i; | ||
} | ||
a[n] = s; | ||
a[ n ] = s; | ||
return s; | ||
}; | ||
}(), | ||
CatmullRom: function CatmullRom(p0, p1, p2, p3, t) { | ||
} ) )(), | ||
var v0 = (p2 - p0) * 0.5; | ||
var v1 = (p3 - p1) * 0.5; | ||
CatmullRom: function CatmullRom( p0, p1, p2, p3, t ) { | ||
var v0 = ( p2 - p0 ) * 0.5; | ||
var v1 = ( p3 - p1 ) * 0.5; | ||
var t2 = t * t; | ||
var t3 = t * t2; | ||
return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; | ||
return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( -3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1; | ||
} | ||
} | ||
}; | ||
exports.default = Interpolation; | ||
function cloneTween(obj, configs, Constructor_Ex) { | ||
if ( obj === void 0 ) obj = {}; | ||
if ( configs === void 0 ) configs = {}; | ||
if ( Constructor_Ex === void 0 ) Constructor_Ex = Tween; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
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; | ||
} | ||
"use strict"; | ||
function joinToString (__array__like) { | ||
var str = ''; | ||
for ( var i = 0, len = __array__like.length; i < len; i++ ) { | ||
str += __array__like[i]; | ||
} | ||
return str; | ||
} | ||
function toNumber(val) { | ||
var floatedVal = parseFloat(val); | ||
return typeof floatedVal === "number" && !isNaN(floatedVal) ? floatedVal : val; | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
// 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 _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 = function Tween(object, instate) { | ||
if ( object === void 0 ) object = {}; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var cache = { | ||
filter: { | ||
grayscale: 1, | ||
brightness: 1, | ||
sepia: 1, | ||
invert: 1, | ||
saturate: 1, | ||
contrast: 1, | ||
blur: 1, | ||
hueRotate: 1, | ||
dropShadow: 1 | ||
}, | ||
transform: { | ||
translate: 1, | ||
translateX: 1, | ||
translateY: 1, | ||
translateZ: 1, | ||
rotate: 1, | ||
rotateX: 1, | ||
rotateY: 1, | ||
rotateZ: 1, | ||
scale: 1, | ||
scaleX: 1, | ||
scaleY: 1, | ||
scaleZ: 1, | ||
skew: 1, | ||
skewX: 1, | ||
skewY: 1 | ||
} | ||
}; | ||
this.object = object; | ||
this._valuesStart = Tween.createEmptyConst(object); | ||
this._valuesEnd = Tween.createEmptyConst(object); | ||
this._chainedTweens = []; | ||
var Plugins = function () { | ||
function Plugins() { | ||
_classCallCheck(this, Plugins); | ||
} | ||
this._duration = 1000; | ||
this._easingFunction = Easing.Linear.None; | ||
this._interpolationFunction = Interpolation.None; | ||
_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]; | ||
} | ||
} | ||
}; | ||
} | ||
}, { | ||
key: 'Transform', | ||
value: function Transform(Composite) { | ||
var layer = Composite.domNode, | ||
style = layer.style; | ||
return { | ||
update: function update(Tween, RenderObject) { | ||
var transform = ''; | ||
for (var p in RenderObject) { | ||
if (p === 'x' || p === 'y' || p === 'z') { | ||
transform += ' translate3d( ' + (RenderObject.x || '0px') + ', ' + (RenderObject.y || '0px') + ', ' + (RenderObject.z || '0px') + ')'; | ||
} else if (cache.transform[p]) { | ||
transform += ' ' + p + '( ' + RenderObject[p] + ')'; | ||
} | ||
} | ||
if (transform) { | ||
style.transform = transform; | ||
} | ||
} | ||
}; | ||
} | ||
}, { | ||
key: 'Filter', | ||
value: function Filter(Composite) { | ||
var layer = Composite.domNode, | ||
style = layer.style; | ||
return { | ||
update: function update(Tween, RenderObject) { | ||
var filter = ''; | ||
for (var p in RenderObject) { | ||
if (cache.filter[p]) { | ||
filter += ' ' + p + '( ' + RenderObject[p] + ')'; | ||
} | ||
} | ||
if (filter) { | ||
style.webkitFilter = style.filter = filter; | ||
} | ||
} | ||
}; | ||
} | ||
}, { | ||
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]; | ||
} | ||
} | ||
}; | ||
} | ||
}]); | ||
this._startTime = 0; | ||
this._delayTime = 0; | ||
this._repeat = 0; | ||
this._r = 0; | ||
this._isPlaying = false; | ||
this._yoyo = false; | ||
this._reversed = false; | ||
return Plugins; | ||
}(); | ||
this._onStartCallbackFired = false; | ||
this._events = {}; | ||
this._pausedTime = 0; | ||
exports.default = Plugins; | ||
; | ||
if (instate && instate.to) { | ||
/***/ }), | ||
/* 4 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
return new Tween(object).to(instate.to, instate); | ||
"use strict"; | ||
/* WEBPACK VAR INJECTION */(function(global, process) { | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
// TWEEN.js | ||
var _tweens = []; | ||
var isStarted = false; | ||
var _autoPlay = false; | ||
var _tick = void 0; | ||
var _events = {}; | ||
var root = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : undefined; | ||
return this; | ||
var getAll = function getAll() { | ||
return _tweens; | ||
}; | ||
var autoPlay = function autoPlay(state) { | ||
_autoPlay = state; | ||
Tween.createEmptyConst = function createEmptyConst (oldObject) { | ||
return typeof(oldObject) === "number" ? 0 : Array.isArray(oldObject) ? [] : typeof(oldObject) === "object" ? {} | ||
: ''; | ||
}; | ||
var removeAll = function removeAll() { | ||
_tweens = []; | ||
Tween.checkValidness = function checkValidness (valid) { | ||
return valid !== undefined && valid !== null && valid !== '' && valid !== NaN && valid !== Infinity; | ||
}; | ||
Tween.prototype.isPlaying = function isPlaying () { | ||
return this._isPlaying; | ||
}; | ||
Tween.prototype.isStarted = function isStarted () { | ||
return this._onStartCallbackFired; | ||
}; | ||
Tween.prototype.reverse = function reverse () { | ||
var emit = function emit(name, a, b, c, d, e) { | ||
var eventFn = _events[name]; | ||
var ref = this; | ||
var _reversed = ref._reversed; | ||
if (eventFn) { | ||
var i = eventFn.length; | ||
while (i--) { | ||
eventFn[i].call(undefined, a, b, c, d, e); | ||
} | ||
} | ||
this._reversed = !_reversed; | ||
return this; | ||
}; | ||
var off = function off(ev, fn) { | ||
if (ev === undefined || _events[ev] === undefined) { | ||
return; | ||
Tween.prototype.reversed = function reversed () { | ||
return this._reversed; | ||
}; | ||
Tween.prototype.off = function off$$1 (name, fn) { | ||
if (this._events[name] === undefined) { | ||
return this; | ||
} | ||
if (fn !== undefined) { | ||
var eventsList = _events[name], | ||
i = 0; | ||
if (name !== undefined && fn !== undefined) { | ||
var eventsList = this._events[name], | ||
i = 0; | ||
while (i < eventsList.length) { | ||
@@ -1500,768 +1097,694 @@ if (eventsList[i] === fn) { | ||
} | ||
} else { | ||
_events[name] = []; | ||
} else if (name !== undefined && fn === undefined) { | ||
this._events[name] = []; | ||
} | ||
return this; | ||
}; | ||
var add = function add(tween) { | ||
_tweens.push(tween); | ||
if (_autoPlay && !isStarted) { | ||
update(); | ||
isStarted = true; | ||
emit('start'); | ||
Tween.prototype.on = function on$$1 (name, fn) { | ||
if (this._events[name] === undefined) { | ||
this._events[name] = []; | ||
} | ||
emit('add', tween, _tweens); | ||
this._events[name].push(fn); | ||
return this; | ||
}; | ||
Tween.prototype.once = function once$$1 (name, fn) { | ||
var this$1 = this; | ||
var on = function on(ev, fn) { | ||
if (_events[ev] === undefined) { | ||
_events[ev] = []; | ||
if (this._events[name] === undefined) { | ||
this._events[name] = []; | ||
} | ||
_events[ev].push(fn); | ||
}; | ||
return this.on(name, function () { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var once = function once(ev, fn) { | ||
if (_events[ev] === undefined) { | ||
_events[ev] = []; | ||
} | ||
on(ev, function () { | ||
fn.apply(undefined, arguments); | ||
off(ev); | ||
fn.call.apply(fn, [ this$1 ].concat( args )); | ||
this$1.off(name); | ||
}); | ||
}; | ||
Tween.prototype.emit = function emit$$1 (name, a, b, c, d, e) { | ||
var this$1 = this; | ||
var remove = function remove(tween) { | ||
_tweens.filter(function (tweens) { | ||
return tweens !== tween; | ||
}); | ||
var i = 0, | ||
tweenFind = void 0; | ||
while (i < _tweens.length) { | ||
tweenFind = _tweens[i]; | ||
if (tweenFind === tween) { | ||
emit('remove', tween, _tweens); | ||
_tweens.splice(i, 1); | ||
} | ||
i++; | ||
var ref = this; | ||
var _events = ref._events; | ||
var eventFn = _events[name]; | ||
if (!eventFn) { | ||
return this; | ||
} | ||
var i = eventFn.length; | ||
while (i--) { | ||
eventFn[i].call(this$1, a, b, c, d, e); | ||
} | ||
return this; | ||
}; | ||
Tween.prototype.pause = function pause () { | ||
var now = function () { | ||
if (typeof process !== "undefined" && process.hrtime !== undefined) { | ||
return function () { | ||
var time = process.hrtime(); | ||
// Convert [seconds, nanoseconds] to milliseconds. | ||
return time[0] * 1000 + time[1] / 1000000; | ||
}; | ||
if (!this._isPlaying) { | ||
return this; | ||
} | ||
// In a browser, use window.performance.now if it is available. | ||
else if (root.performance !== undefined && root.performance.now !== undefined) { | ||
// This must be bound, because directly assigning this function | ||
// leads to an invocation exception in Chrome. | ||
return root.performance.now.bind(root.performance); | ||
} | ||
// Use Date.now if it is available. | ||
else { | ||
var offset = root.performance && root.performance.timing && root.performance.timing.navigationStart ? root.performance.timing.navigationStart : Date.now(); | ||
return function () { | ||
return Date.now() - offset; | ||
}; | ||
} | ||
}(); | ||
this._isPlaying = false; | ||
var update = function update(time, preserve) { | ||
remove(this); | ||
this._pausedTime = now$1(); | ||
time = time !== undefined ? time : now(); | ||
return this.emit('pause', this.object); | ||
}; | ||
Tween.prototype.play = function play () { | ||
if (_autoPlay) { | ||
_tick = requestAnimationFrame(update); | ||
if (this._isPlaying) { | ||
return this; | ||
} | ||
emit('update', time, _tweens); | ||
if (_tweens.length === 0) { | ||
this._isPlaying = true; | ||
isStarted = false; | ||
cancelAnimationFrame(_tick); | ||
emit('stop', time); | ||
return false; | ||
} | ||
this._startTime += now$1() - this._pausedTime; | ||
add(this); | ||
this._pausedTime = now$1(); | ||
var i = 0; | ||
while (i < _tweens.length) { | ||
return this.emit('play', this.object); | ||
}; | ||
Tween.prototype.restart = function restart (noDelay) { | ||
if (_tweens[i].update(time) || preserve) { | ||
i++; | ||
} else { | ||
_tweens.splice(i, 1); | ||
} | ||
this._repeat = this._r; | ||
this._startTime = now$1() + (noDelay ? 0 : this._delayTime); | ||
if (!this._isPlaying) { | ||
add(this); | ||
} | ||
return true; | ||
return this.emit('restart', this._object); | ||
}; | ||
Tween.prototype.seek = function seek (time, keepPlaying) { | ||
// Normalise time when visiblity is changed ... | ||
if (root.document) { | ||
var doc = root.document, | ||
timeDiff = 0, | ||
timePause = 0; | ||
doc.addEventListener('visibilitychange', function (ev) { | ||
if (_tweens.length === 0) { | ||
return false; | ||
} | ||
if (document.hidden) { | ||
timePause = now(); | ||
} else { | ||
timeDiff = now() - timePause; | ||
_tweens.map(function (tween) { | ||
return tween._startTime += timeDiff; | ||
}); | ||
} | ||
return true; | ||
}); | ||
} | ||
this._startTime = now$1() + Math.max(0, Math.min( | ||
time, this._duration)); | ||
exports.getAll = getAll; | ||
exports.removeAll = removeAll; | ||
exports.remove = remove; | ||
exports.add = add; | ||
exports.now = now; | ||
exports.update = update; | ||
exports.autoPlay = autoPlay; | ||
exports.on = on; | ||
exports.once = once; | ||
exports.off = off; | ||
exports.emit = emit; | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(12))) | ||
this.emit('seek', time, this._object); | ||
/***/ }), | ||
/* 5 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
return keepPlaying ? this : this.pause(); | ||
"use strict"; | ||
}; | ||
Tween.prototype.duration = function duration (amount) { | ||
this._duration = typeof(amount) === "function" ? amount(this._duration) : amount; | ||
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; }; | ||
return this; | ||
}; | ||
Tween.prototype.to = function to (properties, duration) { | ||
var this$1 = this; | ||
if ( properties === void 0 ) properties = {}; | ||
if ( duration === void 0 ) duration = 1000; | ||
var g; | ||
// This works in non-strict mode | ||
g = function () { | ||
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 === "object") { | ||
for (var prop in duration) { | ||
if (this$1[prop]) { | ||
this$1[prop](typeof duration[prop] === "function" ? duration[prop](this$1._duration) : duration); | ||
} | ||
} | ||
} | ||
return this; | ||
}(); | ||
try { | ||
// This works if eval is allowed (see CSP) | ||
g = g || Function("return this")() || (1, eval)("this"); | ||
} catch (e) { | ||
// This works if the window reference is available | ||
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; | ||
} | ||
}; | ||
Tween.prototype.start = function start (time) { | ||
var this$1 = this; | ||
// g can still be undefined, but nothing to do about it... | ||
// We return undefined, instead of nothing here, so it's | ||
// easier to handle this case. if(!global) { ...} | ||
module.exports = g; | ||
var ref = this; | ||
var _startTime = ref._startTime; | ||
var _delayTime = ref._delayTime; | ||
var _valuesEnd = ref._valuesEnd; | ||
var _valuesStart = ref._valuesStart; | ||
var object = ref.object; | ||
/***/ }), | ||
/* 6 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
_startTime = time !== undefined ? time : now$1(); | ||
_startTime += _delayTime; | ||
"use strict"; | ||
this._startTime = _startTime; | ||
for (var property in _valuesEnd) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = cloneTween; | ||
if (typeof _valuesEnd[property] === "object") { | ||
if (Array.isArray(_valuesEnd[property])) { | ||
if (typeof object[property] === "number") { | ||
this$1._valuesEnd[property] = [object[property]].concat(_valuesEnd[property]); | ||
} else { | ||
var clonedTween = cloneTween(this$1, { | ||
object: object[property], | ||
_valuesEnd: _valuesEnd[property], | ||
_events: {} | ||
}) | ||
.start() | ||
.stop(); | ||
var _Tween = __webpack_require__(0); | ||
this$1._valuesEnd[property] = clonedTween; | ||
} | ||
} else { | ||
var clonedTween$1 = cloneTween(this$1, { | ||
object: object[property], | ||
_valuesEnd: _valuesEnd[property], | ||
_events: {} | ||
}) | ||
.start() | ||
.stop(); | ||
var _Tween2 = _interopRequireDefault(_Tween); | ||
this$1._valuesStart[property] = 1; | ||
this$1._valuesEnd[property] = clonedTween$1; | ||
} | ||
} else if (typeof _valuesEnd[property] === "string" && typeof object[property] === "string" && Number_Match_RegEx.test(object[property]) && Number_Match_RegEx.test(_valuesEnd[property])) { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _get__Start = object[property].match(Number_Match_RegEx); | ||
_get__Start = _get__Start.map(toNumber); | ||
var _get__End = _valuesEnd[property].match(Number_Match_RegEx); | ||
_get__End = _get__End.map(toNumber); | ||
var clonedTween$2 = cloneTween(this$1, { | ||
object: _get__Start, | ||
_valuesEnd: _get__End, | ||
_events: {} | ||
}) | ||
.start() | ||
.stop(); | ||
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; | ||
clonedTween$2.join = true; // For string tweening | ||
this$1._valuesStart[property] = 1; | ||
this$1._valuesEnd[property] = clonedTween$2; | ||
var copyTween = new Constructor_Ex(); | ||
for (var config in obj) { | ||
if (configs[config] !== undefined) { | ||
copyTween[config] = configs[config]; | ||
} else { | ||
copyTween[config] = obj[config]; | ||
} | ||
// If value presented as function, | ||
// we should convert to value again by passing function | ||
if (typeof object[property] === "function") { | ||
object[property] = this$1.object[property] = object[property](this$1); | ||
} | ||
if (typeof _valuesEnd[property] === "function") { | ||
this$1._valuesEnd[property] = _valuesEnd[property](this$1); | ||
} | ||
// 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 skip from adding to _valuesStart | ||
if (object[property] === _valuesEnd[property]) { | ||
continue; | ||
} | ||
this$1._valuesStart[property] = object[property]; | ||
} | ||
return copyTween; | ||
} | ||
/***/ }), | ||
/* 7 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
add(this); | ||
"use strict"; | ||
this._isPlaying = true; | ||
return this; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
}; | ||
Tween.prototype.stop = function stop () { | ||
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 ref = this; | ||
var _isPlaying = ref._isPlaying; | ||
var object = ref.object; | ||
var _clone = __webpack_require__(6); | ||
if (!_isPlaying) { | ||
return this; | ||
} | ||
var _clone2 = _interopRequireDefault(_clone); | ||
remove(this); | ||
this._isPlaying = false; | ||
var _Plugins = __webpack_require__(3); | ||
this.stopChainedTweens(); | ||
return this.emit('stop', object); | ||
var _Plugins2 = _interopRequireDefault(_Plugins); | ||
}; | ||
Tween.prototype.end = function end () { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var ref = this; | ||
var _startTime = ref._startTime; | ||
var _duration = ref._duration; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
return this.update(_startTime + _duration); | ||
var Composite = function () { | ||
function Composite(domNode) { | ||
_classCallCheck(this, Composite); | ||
}; | ||
Tween.prototype.stopChainedTweens = function stopChainedTweens () { | ||
var self = this; | ||
var ref = this; | ||
var _chainedTweens = ref._chainedTweens; | ||
this.domNode = domNode; | ||
this.plugins = {}; | ||
var pluginList = this.plugins; | ||
_chainedTweens.map(function (item) { return item.stop(); }); | ||
this.render = function (object) { | ||
return this; | ||
for (var p in pluginList) { | ||
}; | ||
Tween.prototype.delay = function delay (amount) { | ||
pluginList[p] && pluginList[p].update && pluginList[p].update(this, object); | ||
} | ||
this._delayTime = typeof(amount) === "function" ? amount(this._delayTime) : amount; | ||
return this; | ||
}; | ||
return this; | ||
this.fetch = function () { | ||
}; | ||
Tween.prototype.repeat = function repeat (amount) { | ||
if (Object.keys(this.object).length) { | ||
this._repeat = typeof(amount) === "function" ? amount(this._repeat) : amount; | ||
this._r = this._repeat; | ||
return this; | ||
} | ||
return this; | ||
for (var p in pluginList) { | ||
}; | ||
Tween.prototype.repeatDelay = function repeatDelay (amount) { | ||
pluginList[p] && pluginList[p].fetch && pluginList[p].fetch(this); | ||
} | ||
this._repeatDelayTime = typeof(amount) === "function" ? amount(this._repeatDelayTime) : amount; | ||
return this; | ||
}; | ||
return this; | ||
this.init = function (object) { | ||
}; | ||
Tween.prototype.reverseDelay = function reverseDelay (amount) { | ||
for (var p in pluginList) { | ||
this._reverseDelayTime = typeof(amount) === "function" ? amount(this._reverseDelayTime) : amount; | ||
pluginList[p] && pluginList[p].init && pluginList[p].init(this, object); | ||
} | ||
return this; | ||
return this; | ||
}; | ||
}; | ||
Tween.prototype.yoyo = function yoyo (state) { | ||
return this; | ||
} | ||
this._yoyo = typeof(state) === "function" ? state(this._yoyo) : state; | ||
_createClass(Composite, [{ | ||
key: 'applyPlugin', | ||
value: function applyPlugin(name) { | ||
if (_Plugins2.default[name] !== undefined) { | ||
this.plugins[name] = _Plugins2.default[name](this); | ||
} | ||
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 this; | ||
return Composite; | ||
}(); | ||
}; | ||
Tween.prototype.easing = function easing (fn) { | ||
exports.default = Composite; | ||
this._easingFunction = fn; | ||
/***/ }), | ||
/* 8 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
return this; | ||
"use strict"; | ||
}; | ||
Tween.prototype.interpolation = function interpolation (fn) { | ||
this._interpolationFunction = fn; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
return this; | ||
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; }; | ||
}; | ||
Tween.prototype.chain = function chain () { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
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); | ||
this._chainedTweens = args; | ||
var _Tween2 = _interopRequireDefault(_Tween); | ||
return this; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
}; | ||
Tween.prototype.get = function get (time) { | ||
this.update(time); | ||
return this.object; | ||
}; | ||
Tween.prototype.update = function update$$1 (time) { | ||
var this$1 = this; | ||
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); | ||
var ref = this; | ||
var _onStartCallbackFired = ref._onStartCallbackFired; | ||
var _chainedTweens = ref._chainedTweens; | ||
var _easingFunction = ref._easingFunction; | ||
var _interpolationFunction = ref._interpolationFunction; | ||
var _repeat = ref._repeat; | ||
var _repeatDelayTime = ref._repeatDelayTime; | ||
var _reverseDelayTime = ref._reverseDelayTime; | ||
var _delayTime = ref._delayTime; | ||
var _yoyo = ref._yoyo; | ||
var _reversed = ref._reversed; | ||
var _startTime = ref._startTime; | ||
var _duration = ref._duration; | ||
var _valuesStart = ref._valuesStart; | ||
var _valuesEnd = ref._valuesEnd; | ||
var object = ref.object; | ||
this._private = { | ||
tweens: [], | ||
fullTime: 0 | ||
}; | ||
return this; | ||
var property; | ||
var elapsed; | ||
var value; | ||
time = time !== undefined ? time : now$1(); | ||
if (time < _startTime) { | ||
return true; | ||
} | ||
_createClass(Timeline, [{ | ||
key: "add", | ||
value: function add(tween) { | ||
var _this = this; | ||
if (!_onStartCallbackFired) { | ||
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]); | ||
} | ||
this.add(tweenExample); | ||
} else if ((typeof tween === "undefined" ? "undefined" : _typeof(tween)) === "object") { | ||
tween.map(function (add) { | ||
_this.add(add); | ||
}); | ||
} | ||
return this; | ||
} | ||
}, { | ||
key: "start", | ||
value: function start() { | ||
var _this2 = this; | ||
this.emit('start', object); | ||
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; | ||
} | ||
}]); | ||
this._onStartCallbackFired = true; | ||
} | ||
return Timeline; | ||
}(); | ||
elapsed = (time - _startTime) / _duration; | ||
elapsed = elapsed > 1 ? 1 : elapsed; | ||
elapsed = _reversed ? 1 - elapsed : elapsed; | ||
exports.default = Timeline; | ||
; | ||
value = _easingFunction(elapsed); | ||
/***/ }), | ||
/* 9 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
for (property in _valuesEnd) { | ||
"use strict"; | ||
// 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]; | ||
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 (end instanceof Tween) { | ||
if (Array.isArray === undefined) { | ||
Array.isArray = function (arrayLike) { | ||
return arrayLike !== undefined && (typeof arrayLike === "undefined" ? "undefined" : _typeof(arrayLike)) === "object" && arrayLike.length && arrayLike.push !== undefined && arrayLike.splice !== undefined; | ||
}; | ||
} | ||
var getValue = end.get(time); | ||
/***/ }), | ||
/* 10 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
if (end.join) { | ||
"use strict"; | ||
object[property] = joinToString(getValue); | ||
} else { | ||
if (Object.assign === undefined) { | ||
Object.assign = function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
object[property] = getValue; | ||
var first = args.shift(); | ||
args.map(function (obj) { | ||
for (var p in obj) { | ||
first[p] = obj[p]; | ||
} | ||
}); | ||
return first; | ||
}; | ||
} | ||
/***/ }), | ||
/* 11 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
} else if (Array.isArray(end)) { | ||
"use strict"; | ||
/* WEBPACK VAR INJECTION */(function(global) { | ||
object[property] = _interpolationFunction(end, value); | ||
var ROOT = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : undefined; | ||
var _vendor = ['webkit', 'moz', 'ms', 'o']; | ||
var animFrame = 'AnimationFrame'; | ||
var rafSuffixForVendor = 'Request' + animFrame; | ||
var cafSuffixForVendor = 'Cancel' + animFrame; | ||
var cafSuffixForVendor2 = 'CancelRequest' + animFrame; | ||
var _timeout = setTimeout; | ||
var _clearTimeout = clearTimeout; | ||
} else if (typeof(end) === 'string') { | ||
if (ROOT.requestAnimationFrame === undefined) { | ||
if (end.charAt(0) === '+' || end.charAt(0) === '-') { | ||
end = start + parseFloat(end); | ||
} else { | ||
end = parseFloat(end); | ||
} | ||
var _raf = void 0, | ||
now = void 0, | ||
lastTime = Date.now(), | ||
frameMs = 50 / 3, | ||
fpsSec = frameMs; | ||
_vendor.map(function (vendor) { | ||
if ((_raf = ROOT[vendor + rafSuffixForVendor]) === undefined) { | ||
_raf = function _raf(fn) { | ||
return _timeout(function () { | ||
now = Date.now(); | ||
fn(now - lastTime); | ||
fpsSec = frameMs + (Date.now() - now); | ||
}, fpsSec); | ||
}; | ||
// 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; | ||
} | ||
}); | ||
if (_raf !== undefined) { | ||
ROOT.requestAnimationFrame = _raf; | ||
} | ||
} | ||
if (ROOT.cancelAnimationFrame === undefined && (ROOT.cancelAnimationFrame = ROOT.cancelRequestAnimationFrame) === undefined) { | ||
var _caf = void 0; | ||
this.emit('update', object, value, elapsed); | ||
_vendor.map(function (vendor) { | ||
if ((_caf = ROOT[vendor + cafSuffixForVendor]) === undefined && (_caf = ROOT[vendor + cafSuffixForVendor2]) === undefined) { | ||
_caf = function _caf(fn) { | ||
return _clearTimeout(fn); | ||
}; | ||
} | ||
}); | ||
if (elapsed === 1 || (_reversed && elapsed === 0)) { | ||
if (_caf !== undefined) { | ||
ROOT.cancelAnimationFrame = _caf; | ||
} | ||
} | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) | ||
if (_repeat) { | ||
/***/ }), | ||
/* 12 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
if (isFinite(_repeat)) { | ||
this._repeat--; | ||
} | ||
"use strict"; | ||
for (property in _valuesEnd) { | ||
if (typeof(_valuesEnd[property]) === 'string' && typeof(_valuesStart[property]) === 'number') { | ||
this$1._valuesStart[property] = _valuesStart[property] + parseFloat(_valuesEnd[property]); | ||
} | ||
// shim for using process in browser | ||
var process = module.exports = {}; | ||
} | ||
// cached from whatever global is present so that test runners that stub it | ||
// don't break things. But we need to wrap it in a try catch in case it is | ||
// wrapped in strict mode code which doesn't define any globals. It's inside a | ||
// function because try/catches deoptimize in certain engines. | ||
// Reassign starting values, restart by making startTime = now | ||
this.emit(_reversed ? 'reverse' : 'repeat', object); | ||
var cachedSetTimeout; | ||
var cachedClearTimeout; | ||
if (_yoyo) { | ||
this._reversed = !_reversed; | ||
} | ||
function defaultSetTimout() { | ||
throw new Error('setTimeout has not been defined'); | ||
} | ||
function defaultClearTimeout() { | ||
throw new Error('clearTimeout has not been defined'); | ||
} | ||
(function () { | ||
try { | ||
if (typeof setTimeout === 'function') { | ||
cachedSetTimeout = setTimeout; | ||
} else { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
} catch (e) { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
try { | ||
if (typeof clearTimeout === 'function') { | ||
cachedClearTimeout = clearTimeout; | ||
} else { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} catch (e) { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
})(); | ||
function runTimeout(fun) { | ||
if (cachedSetTimeout === setTimeout) { | ||
//normal enviroments in sane situations | ||
return setTimeout(fun, 0); | ||
} | ||
// if setTimeout wasn't available but was latter defined | ||
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { | ||
cachedSetTimeout = setTimeout; | ||
return setTimeout(fun, 0); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedSetTimeout(fun, 0); | ||
} catch (e) { | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedSetTimeout.call(null, fun, 0); | ||
} catch (e) { | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error | ||
return cachedSetTimeout.call(this, fun, 0); | ||
} | ||
} | ||
} | ||
function runClearTimeout(marker) { | ||
if (cachedClearTimeout === clearTimeout) { | ||
//normal enviroments in sane situations | ||
return clearTimeout(marker); | ||
} | ||
// if clearTimeout wasn't available but was latter defined | ||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { | ||
cachedClearTimeout = clearTimeout; | ||
return clearTimeout(marker); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedClearTimeout(marker); | ||
} catch (e) { | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedClearTimeout.call(null, marker); | ||
} catch (e) { | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. | ||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout | ||
return cachedClearTimeout.call(this, marker); | ||
} | ||
} | ||
} | ||
var queue = []; | ||
var draining = false; | ||
var currentQueue; | ||
var queueIndex = -1; | ||
if (!_reversed && _repeatDelayTime) { | ||
this._startTime += _duration + _repeatDelayTime; | ||
} else if (_reversed && _reverseDelayTime) { | ||
this._startTime += _duration + _reverseDelayTime; | ||
} else { | ||
this._startTime += _duration; | ||
} | ||
function cleanUpNextTick() { | ||
if (!draining || !currentQueue) { | ||
return; | ||
} | ||
draining = false; | ||
if (currentQueue.length) { | ||
queue = currentQueue.concat(queue); | ||
} else { | ||
queueIndex = -1; | ||
} | ||
if (queue.length) { | ||
drainQueue(); | ||
} | ||
} | ||
return true; | ||
function drainQueue() { | ||
if (draining) { | ||
return; | ||
} | ||
var timeout = runTimeout(cleanUpNextTick); | ||
draining = true; | ||
} else { | ||
var len = queue.length; | ||
while (len) { | ||
currentQueue = queue; | ||
queue = []; | ||
while (++queueIndex < len) { | ||
if (currentQueue) { | ||
currentQueue[queueIndex].run(); | ||
} | ||
} | ||
queueIndex = -1; | ||
len = queue.length; | ||
} | ||
currentQueue = null; | ||
draining = false; | ||
runClearTimeout(timeout); | ||
} | ||
this.emit('complete', object); | ||
process.nextTick = function (fun) { | ||
var args = new Array(arguments.length - 1); | ||
if (arguments.length > 1) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
queue.push(new Item(fun, args)); | ||
if (queue.length === 1 && !draining) { | ||
runTimeout(drainQueue); | ||
} | ||
_chainedTweens.map(function (tween) { return tween.start(_startTime + _duration); }); | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
// v8 likes predictible objects | ||
function Item(fun, array) { | ||
this.fun = fun; | ||
this.array = array; | ||
} | ||
Item.prototype.run = function () { | ||
this.fun.apply(null, this.array); | ||
var cache = { | ||
filter: { | ||
grayscale: 1, | ||
brightness: 1, | ||
sepia: 1, | ||
invert: 1, | ||
saturate: 1, | ||
contrast: 1, | ||
blur: 1, | ||
hueRotate: 1, | ||
dropShadow: 1 | ||
}, | ||
transform: { | ||
translate: 1, | ||
translateX: 1, | ||
translateY: 1, | ||
translateZ: 1, | ||
rotate: 1, | ||
rotateX: 1, | ||
rotateY: 1, | ||
rotateZ: 1, | ||
scale: 1, | ||
scaleX: 1, | ||
scaleY: 1, | ||
scaleZ: 1, | ||
skew: 1, | ||
skewX: 1, | ||
skewY: 1 | ||
} | ||
}; | ||
process.title = 'browser'; | ||
process.browser = true; | ||
process.env = {}; | ||
process.argv = []; | ||
process.version = ''; // empty string to avoid regexp issues | ||
process.versions = {}; | ||
function noop() {} | ||
var Plugins = function Plugins () {}; | ||
process.on = noop; | ||
process.addListener = noop; | ||
process.once = noop; | ||
process.off = noop; | ||
process.removeListener = noop; | ||
process.removeAllListeners = noop; | ||
process.emit = noop; | ||
process.binding = function (name) { | ||
throw new Error('process.binding is not supported'); | ||
Plugins.DOM = 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]; | ||
} | ||
} | ||
} | ||
}; | ||
process.cwd = function () { | ||
return '/'; | ||
Plugins.Transform = function Transform (Composite) { | ||
var layer = Composite.domNode, | ||
style = layer.style; | ||
return { | ||
update: function update(Tween, RenderObject) { | ||
var transform = ''; | ||
for (var p in RenderObject) { | ||
if (p === 'x' || p === 'y' || p === 'z') { | ||
transform += ' translate3d( ' + (RenderObject.x || '0px') + ', ' + (RenderObject.y || '0px') + ', ' + (RenderObject.z || '0px') + ')'; | ||
} else if (cache.transform[p]) { | ||
transform += " " + p + "( " + (RenderObject[p]) + ")"; | ||
} | ||
} | ||
if (transform) { | ||
style.transform = transform; | ||
} | ||
} | ||
} | ||
}; | ||
process.chdir = function (dir) { | ||
throw new Error('process.chdir is not supported'); | ||
Plugins.Filter = function Filter (Composite) { | ||
var layer = Composite.domNode, | ||
style = layer.style; | ||
return { | ||
update: function update(Tween, RenderObject) { | ||
var filter = ''; | ||
for (var p in RenderObject) { | ||
if (cache.filter[p]) { | ||
filter += " " + p + "( " + (RenderObject[p]) + ")"; | ||
} | ||
} | ||
if (filter) { | ||
style.webkitFilter = style.filter = filter; | ||
} | ||
} | ||
} | ||
}; | ||
process.umask = function () { | ||
return 0; | ||
Plugins.Scroll = function Scroll (Composite) { | ||
var layer = Composite.domNode; | ||
return { | ||
update: function (Tween, RenderObject) { | ||
for (var p in RenderObject) { | ||
layer[p] = RenderObject[p]; | ||
} | ||
} | ||
} | ||
}; | ||
/***/ }), | ||
/* 13 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var Composite = function Composite(domNode) { | ||
"use strict"; | ||
var self = this; | ||
this.domNode = domNode; | ||
this.plugins = {}; | ||
var pluginList = this.plugins; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = joinToString; | ||
function joinToString(__array__like) { | ||
var str = ''; | ||
for (var i = 0, len = __array__like.length; i < len; i++) { | ||
str += __array__like[i]; | ||
} | ||
return str; | ||
} | ||
this.render = function (object) { | ||
var this$1 = this; | ||
/***/ }), | ||
/* 14 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
for (var p in pluginList) { | ||
pluginList[p] && pluginList[p].update && pluginList[p].update(this$1, object); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = toNumber; | ||
function toNumber(val) { | ||
var floatedVal = parseFloat(val); | ||
return typeof floatedVal === "number" && !isNaN(floatedVal) ? floatedVal : val; | ||
} | ||
} | ||
/***/ }), | ||
/* 15 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
return this; | ||
}; | ||
"use strict"; | ||
this.fetch = function () { | ||
var this$1 = this; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; | ||
if (Object.keys(this.object).length) { | ||
__webpack_require__(10); | ||
return this; | ||
__webpack_require__(11); | ||
} | ||
__webpack_require__(9); | ||
for (var p in pluginList) { | ||
var _core = __webpack_require__(4); | ||
pluginList[p] && pluginList[p].fetch && pluginList[p].fetch(this$1); | ||
var _Easing = __webpack_require__(1); | ||
} | ||
var _Easing2 = _interopRequireDefault(_Easing); | ||
return this; | ||
}; | ||
var _Tween = __webpack_require__(0); | ||
this.init = function (object) { | ||
var this$1 = this; | ||
var _Tween2 = _interopRequireDefault(_Tween); | ||
var _Interpolation = __webpack_require__(2); | ||
for (var p in pluginList) { | ||
var _Interpolation2 = _interopRequireDefault(_Interpolation); | ||
pluginList[p] && pluginList[p].init && pluginList[p].init(this$1, object); | ||
var _Composite = __webpack_require__(7); | ||
} | ||
var _Composite2 = _interopRequireDefault(_Composite); | ||
return this; | ||
}; | ||
var _Timeline = __webpack_require__(8); | ||
return this; | ||
}; | ||
var _Timeline2 = _interopRequireDefault(_Timeline); | ||
var prototypeAccessors = { object: {} }; | ||
Composite.prototype.applyPlugin = function applyPlugin (name) { | ||
if (Plugins[name] !== undefined) { | ||
this.plugins[name] = Plugins[name](this); | ||
} | ||
return this; | ||
}; | ||
prototypeAccessors.object.set = function (obj) { | ||
return this.render(obj); | ||
}; | ||
Composite.prototype.cloneLayer = function cloneLayer () { | ||
return cloneTween(this, {}, Composite) | ||
}; | ||
Composite.prototype.appendTo = function appendTo (node) { | ||
node.appendChild(this.domNode); | ||
return this; | ||
}; | ||
var _Plugins = __webpack_require__(3); | ||
Object.defineProperties( Composite.prototype, prototypeAccessors ); | ||
var _Plugins2 = _interopRequireDefault(_Plugins); | ||
var Timeline = function Timeline () { | ||
this._private = { | ||
tweens: [], | ||
fullTime: 0 | ||
}; | ||
return this; | ||
}; | ||
Timeline.prototype.add = function add (tween) { | ||
var this$1 = this; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
if (tween instanceof Tween) { | ||
this._private.tweens.push(tween); | ||
} else if (!Array.isArray(tween) && typeof tween === "object") { | ||
var tweenExample = new Tween({x:0}); | ||
for ( var p in tween ) { | ||
tweenExample[p](tween[p]); | ||
} | ||
this.add(tweenExample); | ||
} else if (typeof tween === "object") { | ||
tween.map(function (add) { | ||
this$1.add(add); | ||
}); | ||
} | ||
return this; | ||
}; | ||
Timeline.prototype.start = function start () { | ||
var this$1 = this; | ||
exports.getAll = _core.getAll; | ||
exports.removeAll = _core.removeAll; | ||
exports.remove = _core.remove; | ||
exports.add = _core.add; | ||
exports.now = _core.now; | ||
exports.update = _core.update; | ||
exports.autoPlay = _core.autoPlay; | ||
exports.on = _core.on; | ||
exports.once = _core.once; | ||
exports.off = _core.off; | ||
exports.emit = _core.emit; | ||
exports.Tween = _Tween2.default; | ||
exports.Easing = _Easing2.default; | ||
exports.Interpolation = _Interpolation2.default; | ||
exports.Composite = _Composite2.default; | ||
exports.Timeline = _Timeline2.default; | ||
exports.Plugins = _Plugins2.default; | ||
this._private.tweens.map(function (tween) { | ||
tween.start(this$1._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; | ||
}; | ||
/***/ }) | ||
/******/ ]); | ||
}); | ||
//# sourceMappingURL=Tween.js.map | ||
/* Shims will be deprecated in next update, please update browser */ | ||
exports.getAll = getAll; | ||
exports.removeAll = removeAll; | ||
exports.remove = remove; | ||
exports.add = add; | ||
exports.now = now$1; | ||
exports.update = update; | ||
exports.autoPlay = autoPlay; | ||
exports.on = on; | ||
exports.once = once; | ||
exports.off = off; | ||
exports.emit = emit; | ||
exports.Tween = Tween; | ||
exports.Easing = Easing; | ||
exports.Interpolation = Interpolation; | ||
exports.Composite = Composite; | ||
exports.Timeline = Timeline; | ||
exports.Plugins = Plugins; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
//# sourceMappingURL=TWEEN.js.map |
@@ -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=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]:{},n=arguments[1];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,n&&n.to?new t(e).to(n.to,n):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]&&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._valuesStart[s]=1,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._valuesStart[s]=1,this._valuesEnd[s]=v}"function"==typeof u[s]&&(u[s]=this.object[s]=u[s](this)),"function"==typeof r[s]&&(this._valuesEnd[s]=r[s](this)),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,this._yoyo),l=this._reversed,h=this._startTime,d=this._duration,v=this._valuesStart,y=this._valuesEnd,m=this.object,_=void 0,b=void 0,g=void 0;if(e=void 0!==e?e:(0,a.now)(),e<h)return!0;n||(this.emit("start",m),this._onStartCallbackFired=!0),b=(e-h)/d,b=b>1?1:b,b=l?1-b:b,g=r(b);for(_ in y)if(void 0!==v[_]){var w=v[_],T=y[_];if(T instanceof t){var M=T.get(e);T.join?m[_]=(0,p.default)(M):m[_]=M}else Array.isArray(T)?m[_]=o(T,g):"string"==typeof T?(T="+"===T.charAt(0)||"-"===T.charAt(0)?w+parseFloat(T):parseFloat(T),"number"==typeof T&&(m[_]=w+(T-w)*g)):"number"==typeof T&&(m[_]=w+(T-w)*g)}if(this.emit("update",m,g,b),1===b||l&&0===b){if(u){isFinite(u)&&this._repeat--;for(_ in y)"string"==typeof y[_]&&"number"==typeof v[_]&&(this._valuesStart[_]=v[_]+parseFloat(y[_]));return this.emit(l?"reverse":"repeat",m),c&&(this._reversed=!l),!l&&s?this._startTime+=d+s:l&&f?this._startTime+=d+f:this._startTime+=d,!0}return this.emit("complete",m),i.map(function(t){return t.start(h+d)}),!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={filter:{grayscale:1,brightness:1,sepia:1,invert:1,saturate:1,contrast:1,blur:1,hueRotate:1,dropShadow:1},transform:{translate:1,translateX:1,translateY:1,translateZ:1,rotate:1,rotateX:1,rotateY:1,rotateZ:1,scale:1,scaleX:1,scaleY:1,scaleZ:1,skew:1,skewX:1,skewY:1}},u=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:"Transform",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){var i="";for(var r in e)"x"===r||"y"===r||"z"===r?i+=" translate3d( "+(e.x||"0px")+", "+(e.y||"0px")+", "+(e.z||"0px")+")":o.transform[r]&&(i+=" "+r+"( "+e[r]+")");i&&(n.transform=i)}}}},{key:"Filter",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){var i="";for(var r in e)o.filter[r]&&(i+=" "+r+"( "+e[r]+")");i&&(n.webkitFilter=n.filter=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=u},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,T=0;g.addEventListener("visibilitychange",function(t){return 0!==i.length&&(document.hidden?T=_():(w=_()-T,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.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.fetch=function(){if(Object.keys(this.object).length)return this;for(var t in n)n[t]&&n[t].fetch&&n[t].fetch(this);return this},this.init=function(t){for(var e in n)n[e]&&n[e].init&&n[e].init(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:"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(t){var e=this;if(t instanceof s.default)this._private.tweens.push(t);else if(Array.isArray(t)||"object"!==("undefined"==typeof t?"undefined":o(t)))"object"===("undefined"==typeof t?"undefined":o(t))&&t.map(function(t){e.add(t)});else{var n=new s.default({x:0});for(var i in t)n[i](t[i]);this.add(n)}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}])}); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.TWEEN=t.TWEEN||{})}(this,function(t){"use strict";function n(t,n,e){void 0===t&&(t={}),void 0===n&&(n={}),void 0===e&&(e=L);var i=new e;for(var r in t)void 0!==n[r]?i[r]=n[r]:i[r]=t[r];return i}function e(t){for(var n="",e=0,i=t.length;e<i;e++)n+=t[e];return n}function i(t){var n=parseFloat(t);return"number"!=typeof n||isNaN(n)?t:n}void 0===Object.assign&&(Object.assign=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var e=t.shift();return t.map(function(t){for(var n in t)e[n]=t[n]}),e});var r="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},o=["webkit","moz","ms","o"],a="AnimationFrame",u="Request"+a,s="Cancel"+a,c="CancelRequest"+a,f=setTimeout,h=clearTimeout;if(void 0===r.requestAnimationFrame){var p,l,v=Date.now(),d=50/3,y=d;o.map(function(t){void 0===(p=r[t+u])&&(p=function(t){return f(function(){l=Date.now(),t(l-v),y=d+(Date.now()-l)},y)})}),void 0!==p&&(r.requestAnimationFrame=p)}if(void 0===r.cancelAnimationFrame&&void 0===(r.cancelAnimationFrame=r.cancelRequestAnimationFrame)){var m;o.map(function(t){void 0===(m=r[t+s])&&void 0===(m=r[t+c])&&(m=function(t){return h(t)})}),void 0!==m&&(r.cancelAnimationFrame=m)}void 0===Array.isArray&&(Array.isArray=function(t){return void 0!==t&&"object"==typeof t&&t.length&&void 0!==t.push&&void 0!==t.splice});var _,b=[],g=!1,M=!1,w={},T="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},x=function(){return b},F=function(t){M=t},I=function(){b=[]},O=function(t,n,e,i,r,o){var a=this,u=w[t];if(u)for(var s=u.length;s--;)u[s].call(a,n,e,i,r,o)},j=function(t,n){if(void 0!==t&&void 0!==w[t])if(void 0!==n)for(var e=w[name],i=0;i<e.length;)e[i]===n&&e.splice(i,1),i++;else w[name]=[]},A=function(t){b.push(t),M&&!g&&(N(),g=!0,O("start")),O("add",t,b)},E=function(t,n){void 0===w[t]&&(w[t]=[]),w[t].push(n)},P=function(t,n){void 0===w[t]&&(w[t]=[]),E(t,function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];n.apply(void 0,e),j(t)})},S=function(t){b.filter(function(n){return n!==t});for(var n,e=0;e<b.length;)n=b[e],n===t&&(O("remove",t,b),b.splice(e,1)),e++},C=function(){if("undefined"!=typeof process&&void 0!==process.hrtime)return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==T.performance&&void 0!==T.performance.now)return T.performance.now.bind(T.performance);var t=T.performance&&T.performance.timing&&T.performance.timing.navigationStart?T.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),N=function(t,n){if(t=void 0!==t?t:C(),M&&(_=requestAnimationFrame(N)),O("update",t,b),0===b.length)return g=!1,cancelAnimationFrame(_),O("stop",t),!1;for(var e=0;e<b.length;)b[e].update(t)||n?e++:b.splice(e,1);return!0};if(T.document){var q=T.document,k=0,D=0;q.addEventListener("visibilitychange",function(t){return 0!==b.length&&(document.hidden?D=C():(k=C()-D,b.map(function(t){return t._startTime+=k})),!0)})}var z={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 n=1.70158;return t*t*((n+1)*t-n)},Out:function(t){var n=1.70158;return--t*t*((n+1)*t+n)+1},InOut:function(t){var n=2.5949095;return(t*=2)<1?.5*(t*t*((n+1)*t-n)):.5*((t-=2)*t*((n+1)*t+n)+2)}},Bounce:{In:function(t){return 1-z.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*z.Bounce.In(2*t):.5*z.Bounce.Out(2*t-1)+.5}},Stepped:function(t){return function(n){return Math.floor(n*t)/t}},Noisy:function(t,n){var e=1-t;return function(i){return t*Math.random()+e*n(i)}},get bezier(){var t,n;return t=function(t,n,e,i,r){var o=Math.pow(1-t,3),a=3*Math.pow(1-t,2)*t,u=3*(1-t)*Math.pow(t,2);return t=Math.pow(t,3),{x:o*n.x+a*e.x+u*i.x+t*r.x,y:o*n.y+a*e.y+u*i.y+t*r.y}},n=function(t,n){var e,i,r=0,o=0,a=n.length,u=0,s=1,c=(s+u)/2;for(e=null;o<a&&(i=n[o],t>=i(0).x&&t<=i(1).x&&(e=i),null===e);)o++;if(!e)return 1;for(i=e(c).x;1e-4<Math.abs(t-i)&&100>r;)t>i?u=c:s=c,c=(s+u)/2,i=e(c).x,r++;return e(c).y},function(e){null==e&&(e={});var i=e.points,r=function(){var n,e=0,o=i.length;for(r=[],n=function(n,e){return r.push(function(i){return t(i,n,n.cp[n.cp.length-1],e.cp[0],e)})};e<o&&!(e>=i.length-1);)n(i[e],i[e+1]),e++;return r}();return function(t){return n(t,r)}}},easeInOut:function(t){var n,e;return null==t&&(t={}),n=null!=(e=t.friction)?e:z.easeInOut.defaults.friction,z.bezier({points:[{x:0,y:0,cp:[{x:.92-n/1e3,y:0}]},{x:1,y:1,cp:[{x:.08+n/1e3,y:1}]}]})},easeIn:function(t){var n,e;return null==t&&(t={}),n=null!=(e=t.friction)?e:z.easeIn.defaults.friction,z.bezier({points:[{x:0,y:0,cp:[{x:.92-n/1e3,y:0}]},{x:1,y:1,cp:[{x:1,y:1}]}]})},easeOut:function(t){var n,e;return null==t&&(t={}),n=null!=(e=t.friction)?e:z.easeOut.defaults.friction,z.bezier({points:[{x:0,y:0,cp:[{x:0,y:0}]},{x:1,y:1,cp:[{x:.08+n/1e3,y:1}]}]})},spring:function(t){var n,e,i,r,o;return null==t&&(t={}),Tools.extend(t,z.spring.defaults,!0),i=Math.max(1,t.frequency/20),r=Math.pow(20,t.friction/100),o=t.anticipationSize/1e3,n=function(n){var e,i;return i=o/(1-o),e=(i-0)/(i-0),(.8-e)/i*n*t.anticipationStrength/100+e},e=function(t){return Math.pow(r/10,-t)*(1-t)},function(t){var r,a,u,s;return s=t/(1-o)-o/(1-o),t<o?(u=o/(1-o)-o/(1-o),r=0/(1-o)-o/(1-o),u=Math.acos(1/n(u)),a=(Math.acos(1/n(r))-u)/(i*-o),r=n):(r=e,u=0,a=1),1-r(s)*Math.cos(i*(t-o)*a+u)}},bounce:function(t){var n,e,i,r;return null==t&&(t={}),Tools.extend(t,z.bounce.defaults),i=Math.max(1,t.frequency/20),r=Math.pow(20,t.friction/100),n=function(t){return Math.pow(r/10,-t)*(1-t)},e=function(t){return n(t)*Math.cos(i*t*1+-1.57)},e.initialForce=!0,e},gravity:function(t){var n,e,i,r,o,a;return null==t&&(t={}),Tools.extend(t,z.gravity.defaults),e=Math.min(t.bounciness/1250,.8),r=t.elasticity/1e3,i=[],n=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;)n=i.b-i.a,i={a:i.b,b:i.b+n*e,H:i.H*e*e};return i.b}(),a=function(e,i,r,o){return n=i-e,e=2/n*o-1-2*e/n,r=e*e*r-r+1,t.initialForce&&(r=1-r),r},function(){var o,a,u;for(o=Math.sqrt(2/(100*n*n)),a={a:-o,b:o,H:1},t.initialForce&&(a.a=0,a.b*=2),i.push(a),u=[];1>a.b&&.001<a.H;)o=a.b-a.a,a={a:a.b,b:a.b+o*e,H:a.H*r},u.push(i.push(a));return u}(),o=function(n){var e,r;for(r=0,e=i[r];!(n>=e.a&&n<=e.b)&&(r+=1,e=i[r]););return e?a(e.a,e.b,e.H,n):t.initialForce?0:1},o.initialForce=t.initialForce,o},forceWithGravity:function(t){return null==t&&(t={}),Tools.extend(t,z.forceWithGravity.defaults),t.initialForce=!0,z.gravity(t)}};z.spring.defaults={frequency:300,friction:200,anticipationSize:0,anticipationStrength:0},z.bounce.defaults={frequency:300,friction:200},z.forceWithGravity.defaults=z.gravity.defaults={bounciness:400,elasticity:200},z.easeInOut.defaults=z.easeIn.defaults=z.easeOut.defaults={friction:500};var H={Linear:function(t,n){var e=t.length-1,i=e*n,r=Math.floor(i),o=H.Utils.Linear;return n<0?o(t[0],t[1],i):n>1?o(t[e],t[e-1],e-i):o(t[r],t[r+1>e?e:r+1],i-r)},Bezier:function(t,n){for(var e=0,i=t.length-1,r=Math.pow,o=H.Utils.Bernstein,a=0;a<=i;a++)e+=r(1-n,i-a)*r(n,a)*t[a]*o(i,a);return e},CatmullRom:function(t,n){var e=t.length-1,i=e*n,r=Math.floor(i),o=H.Utils.CatmullRom;return t[0]===t[e]?(n<0&&(r=Math.floor(i=e*(1+n))),o(t[(r-1+e)%e],t[r],t[(r+1)%e],t[(r+2)%e],i-r)):n<0?t[0]-(o(t[0],t[0],t[1],t[1],-i)-t[0]):n>1?t[e]-(o(t[e],t[e],t[e-1],t[e-1],i-e)-t[e]):o(t[r?r-1:0],t[r],t[e<r+1?e:r+1],t[e<r+2?e:r+2],i-r)},Utils:{Linear:function(t,n,e){return(n-t)*e+t},Bernstein:function(t,n){var e=H.Utils.Factorial;return e(t)/e(n)/e(t-n)},Factorial:function(){var t=[1];return function(n){var e=1;if(t[n])return t[n];for(var i=n;i>1;i--)e*=i;return t[n]=e,e}}(),CatmullRom:function(t,n,e,i,r){var o=.5*(e-t),a=.5*(i-n),u=r*r,s=r*u;return(2*n-2*e+o+a)*s+(-3*n+3*e-2*o-a)*u+o*r+n}}},B=/\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi,L=function t(n,e){return void 0===n&&(n={}),this.object=n,this._valuesStart=t.createEmptyConst(n),this._valuesEnd=t.createEmptyConst(n),this._chainedTweens=[],this._duration=1e3,this._easingFunction=z.Linear.None,this._interpolationFunction=H.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,e&&e.to?new t(n).to(e.to,e):this};L.createEmptyConst=function(t){return"number"==typeof t?0:Array.isArray(t)?[]:"object"==typeof t?{}:""},L.checkValidness=function(t){return void 0!==t&&null!==t&&""!==t&&NaN!==t&&t!==1/0},L.prototype.isPlaying=function(){return this._isPlaying},L.prototype.isStarted=function(){return this._onStartCallbackFired},L.prototype.reverse=function(){var t=this,n=t._reversed;return this._reversed=!n,this},L.prototype.reversed=function(){return this._reversed},L.prototype.off=function(t,n){if(void 0===this._events[t])return this;if(void 0!==t&&void 0!==n)for(var e=this._events[t],i=0;i<e.length;)e[i]===n&&e.splice(i,1),i++;else void 0!==t&&void 0===n&&(this._events[t]=[]);return this},L.prototype.on=function(t,n){return void 0===this._events[t]&&(this._events[t]=[]),this._events[t].push(n),this},L.prototype.once=function(t,n){var e=this;return void 0===this._events[t]&&(this._events[t]=[]),this.on(t,function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];n.call.apply(n,[e].concat(i)),e.off(t)})},L.prototype.emit=function(t,n,e,i,r,o){var a=this,u=this,s=u._events,c=s[t];if(!c)return this;for(var f=c.length;f--;)c[f].call(a,n,e,i,r,o);return this},L.prototype.pause=function(){return this._isPlaying?(this._isPlaying=!1,S(this),this._pausedTime=C(),this.emit("pause",this.object)):this},L.prototype.play=function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=C()-this._pausedTime,A(this),this._pausedTime=C(),this.emit("play",this.object))},L.prototype.restart=function(t){return this._repeat=this._r,this._startTime=C()+(t?0:this._delayTime),this._isPlaying||A(this),this.emit("restart",this._object)},L.prototype.seek=function(t,n){return this._startTime=C()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),n?this:this.pause()},L.prototype.duration=function(t){return this._duration="function"==typeof t?t(this._duration):t,this},L.prototype.to=function(t,n){var e=this;if(void 0===t&&(t={}),void 0===n&&(n=1e3),"number"==typeof t){var i={Number:t};this._valuesEnd=i}else this._valuesEnd=t;if("number"==typeof n)this._duration="function"==typeof n?n(this._duration):n;else if("object"==typeof n)for(var r in n)e[r]&&e[r]("function"==typeof n[r]?n[r](e._duration):n);return this},L.prototype.start=function(t){var e=this,r=this,o=r._startTime,a=r._delayTime,u=r._valuesEnd,s=(r._valuesStart,r.object);o=void 0!==t?t:C(),o+=a,this._startTime=o;for(var c in u){if("object"==typeof u[c])if(Array.isArray(u[c]))if("number"==typeof s[c])e._valuesEnd[c]=[s[c]].concat(u[c]);else{var f=n(e,{object:s[c],_valuesEnd:u[c],_events:{}}).start().stop();e._valuesEnd[c]=f}else{var h=n(e,{object:s[c],_valuesEnd:u[c],_events:{}}).start().stop();e._valuesStart[c]=1,e._valuesEnd[c]=h}else if("string"==typeof u[c]&&"string"==typeof s[c]&&B.test(s[c])&&B.test(u[c])){var p=s[c].match(B);p=p.map(i);var l=u[c].match(B);l=l.map(i);var v=n(e,{object:p,_valuesEnd:l,_events:{}}).start().stop();v.join=!0,e._valuesStart[c]=1,e._valuesEnd[c]=v}"function"==typeof s[c]&&(s[c]=e.object[c]=s[c](e)),"function"==typeof u[c]&&(e._valuesEnd[c]=u[c](e)),L.checkValidness(s[c])!==!1&&s[c]!==u[c]&&(e._valuesStart[c]=s[c])}return A(this),this._isPlaying=!0,this},L.prototype.stop=function(){var t=this,n=t._isPlaying,e=t.object;return n?(S(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",e)):this},L.prototype.end=function(){var t=this,n=t._startTime,e=t._duration;return this.update(n+e)},L.prototype.stopChainedTweens=function(){var t=this,n=t._chainedTweens;return n.map(function(t){return t.stop()}),this},L.prototype.delay=function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this},L.prototype.repeat=function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this},L.prototype.repeatDelay=function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this},L.prototype.reverseDelay=function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this},L.prototype.yoyo=function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this},L.prototype.easing=function(t){return this._easingFunction=t,this},L.prototype.interpolation=function(t){return this._interpolationFunction=t,this},L.prototype.chain=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return this._chainedTweens=t,this},L.prototype.get=function(t){return this.update(t),this.object},L.prototype.update=function(t){var n,i,r,o=this,a=this,u=a._onStartCallbackFired,s=a._chainedTweens,c=a._easingFunction,f=a._interpolationFunction,h=a._repeat,p=a._repeatDelayTime,l=a._reverseDelayTime,v=(a._delayTime,a._yoyo),d=a._reversed,y=a._startTime,m=a._duration,_=a._valuesStart,b=a._valuesEnd,g=a.object;if(t=void 0!==t?t:C(),t<y)return!0;u||(this.emit("start",g),this._onStartCallbackFired=!0),i=(t-y)/m,i=i>1?1:i,i=d?1-i:i,r=c(i);for(n in b)if(void 0!==_[n]){var M=_[n],w=b[n];if(w instanceof L){var T=w.get(t);w.join?g[n]=e(T):g[n]=T}else Array.isArray(w)?g[n]=f(w,r):"string"==typeof w?(w="+"===w.charAt(0)||"-"===w.charAt(0)?M+parseFloat(w):parseFloat(w),"number"==typeof w&&(g[n]=M+(w-M)*r)):"number"==typeof w&&(g[n]=M+(w-M)*r)}if(this.emit("update",g,r,i),1===i||d&&0===i){if(h){isFinite(h)&&this._repeat--;for(n in b)"string"==typeof b[n]&&"number"==typeof _[n]&&(o._valuesStart[n]=_[n]+parseFloat(b[n]));return this.emit(d?"reverse":"repeat",g),v&&(this._reversed=!d),!d&&p?this._startTime+=m+p:d&&l?this._startTime+=m+l:this._startTime+=m,!0}return this.emit("complete",g),s.map(function(t){return t.start(y+m)}),!1}return!0};var R={filter:{grayscale:1,brightness:1,sepia:1,invert:1,saturate:1,contrast:1,blur:1,hueRotate:1,dropShadow:1},transform:{translate:1,translateX:1,translateY:1,translateZ:1,rotate:1,rotateX:1,rotateY:1,rotateZ:1,scale:1,scaleX:1,scaleY:1,scaleZ:1,skew:1,skewX:1,skewY:1}},U=function(){};U.DOM=function(t){var n=t.domNode,e=n.style;return{update:function(t,n){for(var i in n)e[i]=n[i]}}},U.Transform=function(t){var n=t.domNode,e=n.style;return{update:function(t,n){var i="";for(var r in n)"x"===r||"y"===r||"z"===r?i+=" translate3d( "+(n.x||"0px")+", "+(n.y||"0px")+", "+(n.z||"0px")+")":R.transform[r]&&(i+=" "+r+"( "+n[r]+")");i&&(e.transform=i)}}},U.Filter=function(t){var n=t.domNode,e=n.style;return{update:function(t,n){var i="";for(var r in n)R.filter[r]&&(i+=" "+r+"( "+n[r]+")");i&&(e.webkitFilter=e.filter=i)}}},U.Scroll=function(t){var n=t.domNode;return{update:function(t,e){for(var i in e)n[i]=e[i]}}};var W=function(t){this.domNode=t,this.plugins={};var n=this.plugins;return this.render=function(t){var e=this;for(var i in n)n[i]&&n[i].update&&n[i].update(e,t);return this},this.fetch=function(){var t=this;if(Object.keys(this.object).length)return this;for(var e in n)n[e]&&n[e].fetch&&n[e].fetch(t);return this},this.init=function(t){var e=this;for(var i in n)n[i]&&n[i].init&&n[i].init(e,t);return this},this},X={object:{}};W.prototype.applyPlugin=function(t){return void 0!==U[t]&&(this.plugins[t]=U[t](this)),this},X.object.set=function(t){return this.render(t)},W.prototype.cloneLayer=function(){return n(this,{},W)},W.prototype.appendTo=function(t){return t.appendChild(this.domNode),this},Object.defineProperties(W.prototype,X);var Y=function(){return this._private={tweens:[],fullTime:0},this};Y.prototype.add=function(t){var n=this;if(t instanceof L)this._private.tweens.push(t);else if(Array.isArray(t)||"object"!=typeof t)"object"==typeof t&&t.map(function(t){n.add(t)});else{var e=new L({x:0});for(var i in t)e[i](t[i]);this.add(e)}return this},Y.prototype.start=function(){var t=this;return this._private.tweens.map(function(n){n.start(t._private.fullTime)}),this._private.fullTime=Math.max.apply(0,this._private.tweens.reduce(function(t,n){return n._duration>t?n._duration:t},0)),this},t.getAll=x,t.removeAll=I,t.remove=S,t.add=A,t.now=C,t.update=N,t.autoPlay=F,t.on=E,t.once=P,t.off=j,t.emit=O,t.Tween=L,t.Easing=z,t.Interpolation=H,t.Composite=W,t.Timeline=Y,t.Plugins=U,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "es6-tween", | ||
"version": "1.12.3", | ||
"version": "2.0.0", | ||
"description": "ES6 implementation of amazing tween.js", | ||
"main": "dist/Tween.js", | ||
"module": "src/Tween.js", | ||
"directories": { | ||
@@ -10,6 +11,6 @@ "example": "examples" | ||
"scripts": { | ||
"build": "webpack --env build", | ||
"source": "webpack --progress --colors --env dev", | ||
"dev": "webpack --progress --colors --watch --env dev", | ||
"build": "rollup -c --environment BUILD:prod", | ||
"source": "rollup -c --sourcemap", | ||
"dist": "npm run source && npm run build", | ||
"dev": "rollup -c -w --sourcemap", | ||
"dist_test": "npm run dist && npm run test", | ||
@@ -45,21 +46,13 @@ "test": "npm run test-unit && npm run test-correctness && npm run test-style", | ||
"devDependencies": { | ||
"babel": "6.5.2", | ||
"babel-core": "6.22.1", | ||
"babel-eslint": "7.1.1", | ||
"babel-loader": "6.2.10", | ||
"babel-plugin-add-module-exports": "0.1.2", | ||
"babel-plugin-transform-es2015-classes": "latest", | ||
"babel-plugin-transform-proto-to-assign": "latest", | ||
"babel-plugin-transform-react-jsx": "latest", | ||
"babel-preset-es2015": "6.22.0", | ||
"eslint": "1.7.2", | ||
"eslint-loader": "1.6.1", | ||
"webpack": "2.2.1", | ||
"yargs": "6.6.0", | ||
"rollup": "^0.41.6", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"rollup-plugin-uglify": "^1.0.2", | ||
"rollup-watch": "^3.2.2", | ||
"semantic-release": "latest", | ||
"uglify-js-harmony": "^2.7.7", | ||
"jscs": "^2.2.0", | ||
"jshint": "^2.8.0", | ||
"nodeunit": "^0.9.1", | ||
"semantic-release": "latest" | ||
"nodeunit": "^0.9.1" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -1,2 +0,3 @@ | ||
// TWEEN.js | ||
let _tweens = []; | ||
@@ -7,3 +8,3 @@ let isStarted = false; | ||
let _events = {}; | ||
let root = typeof (window) !== "undefined" ? window : typeof (global) !== "undefined" ? global : this; | ||
let root = typeof (window) !== "undefined" ? window : typeof (global) !== "undefined" ? global : {}; | ||
@@ -22,3 +23,3 @@ const getAll = () => { | ||
const emit = (name, a, b, c, d, e) => { | ||
const emit = function(name, a, b, c, d, e) { | ||
let eventFn = _events[name]; | ||
@@ -25,0 +26,0 @@ |
@@ -1,2 +0,2 @@ | ||
let ROOT = typeof(window) !== "undefined" ? window : typeof(global) !== "undefined" ? global : this; | ||
let ROOT = typeof(window) !== "undefined" ? window : typeof(global) !== "undefined" ? global : {}; | ||
let _vendor = ['webkit', 'moz', 'ms', 'o']; | ||
@@ -3,0 +3,0 @@ let animFrame = 'AnimationFrame'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
364484
2805
1