This commit is contained in:
thednp 2020-08-14 11:50:15 +00:00
parent 307f59a7a4
commit eb72644cfe
5 changed files with 50 additions and 42 deletions

View file

@ -1,5 +1,5 @@
/*!
* KUTE.js Base v2.0.12 (http://thednp.github.io/kute.js)
* KUTE.js Base v2.0.13 (http://thednp.github.io/kute.js)
* Copyright 2015-2020 © thednp
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
*/
@ -9,7 +9,7 @@
(global = global || self, global.KUTE = factory());
}(this, (function () { 'use strict';
var version = "2.0.12";
var version = "2.0.13";
var KUTE = {};

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*!
* KUTE.js Extra v2.0.12 (http://thednp.github.io/kute.js)
* KUTE.js Extra v2.0.13 (http://thednp.github.io/kute.js)
* Copyright 2015-2020 © thednp
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
*/
@ -9,7 +9,7 @@
(global = global || self, global.KUTE = factory());
}(this, (function () { 'use strict';
var version = "2.0.12";
var version = "2.0.13";
var KUTE = {};
@ -21,7 +21,7 @@
var Interpolate = {};
var onStart = {};
var onStart$1 = {};
var Time = {};
Time.now = self.performance.now.bind(self.performance);
@ -42,11 +42,11 @@
if (!Tweens.length && Tick) {
cancelAnimationFrame(Tick);
Tick = null;
for (var obj in onStart) {
if (typeof (onStart[obj]) === 'function') {
for (var obj in onStart$1) {
if (typeof (onStart$1[obj]) === 'function') {
KUTE[obj] && (delete KUTE[obj]);
} else {
for (var prop in onStart[obj]) {
for (var prop in onStart$1[obj]) {
KUTE[prop] && (delete KUTE[prop]);
}
}
@ -92,7 +92,7 @@
prepareProperty: prepareProperty,
prepareStart: prepareStart,
crossCheck: crossCheck,
onStart: onStart,
onStart: onStart$1,
onComplete: onComplete,
linkProperty: linkProperty
};
@ -112,7 +112,7 @@
function removeAll () { Tweens.length = 0; }
function linkInterpolation() {
function linkInterpolation$1() {
var this$1 = this;
var loop = function ( component ) {
var componentLink = linkProperty[component];
@ -149,7 +149,7 @@
getAll: getAll,
removeAll: removeAll,
stop: stop,
linkInterpolation: linkInterpolation
linkInterpolation: linkInterpolation$1
};
function getInlineStyle(el) {
@ -369,8 +369,8 @@
if( !(internalOption in this ) ) { this[internalOption] = options[op]; }
}
var easingFnName = this._easing.name;
if (!onStart[easingFnName]) {
onStart[easingFnName] = function(prop){
if (!onStart$1[easingFnName]) {
onStart$1[easingFnName] = function(prop){
!KUTE[prop] && prop === this._easing.name && (KUTE[prop] = this._easing);
};
}
@ -385,16 +385,16 @@
if (this._onStart) {
this._onStart.call(this);
}
for (var obj in onStart) {
if (typeof (onStart[obj]) === 'function') {
onStart[obj].call(this,obj);
for (var obj in onStart$1) {
if (typeof (onStart$1[obj]) === 'function') {
onStart$1[obj].call(this,obj);
} else {
for (var prop in onStart[obj]) {
onStart[obj][prop].call(this,prop);
for (var prop in onStart$1[obj]) {
onStart$1[obj][prop].call(this,prop);
}
}
}
linkInterpolation.call(this);
linkInterpolation$1.call(this);
this._startFired = true;
}
!Tick && Ticker();
@ -540,6 +540,16 @@
if (this._onResume !== undefined) {
this._onResume.call(this);
}
for (var obj in onStart) {
if (typeof (onStart[obj]) === 'function') {
onStart[obj].call(this,obj);
} else {
for (var prop in onStart[obj]) {
onStart[obj][prop].call(this,prop);
}
}
}
linkInterpolation.call(this);
this._startTime += KUTE.Time() - this._pauseTime;
add(this);
!Tick && Ticker();
@ -789,7 +799,7 @@
Animation.prototype.setComponent = function setComponent (Component){
var propertyInfo = this;
var ComponentName = Component.component;
var Functions = { prepareProperty: prepareProperty, prepareStart: prepareStart, onStart: onStart, onComplete: onComplete, crossCheck: crossCheck };
var Functions = { prepareProperty: prepareProperty, prepareStart: prepareStart, onStart: onStart$1, onComplete: onComplete, crossCheck: crossCheck };
var Category = Component.category;
var Property = Component.property;
var Length = Component.properties && Component.properties.length || Component.subProperties && Component.subProperties.length;
@ -858,7 +868,7 @@
AnimationDevelopment.prototype.setComponent = function setComponent (Component){
Animation.prototype.setComponent.call(this, Component);
var propertyInfo = this;
var Functions = { prepareProperty: prepareProperty,prepareStart: prepareStart,onStart: onStart,onComplete: onComplete,crossCheck: crossCheck };
var Functions = { prepareProperty: prepareProperty,prepareStart: prepareStart,onStart: onStart$1,onComplete: onComplete,crossCheck: crossCheck };
var Category = Component.category;
var Property = Component.property;
var Length = Component.properties && Component.properties.length || Component.subProperties && Component.subProperties.length;
@ -1222,7 +1232,7 @@
if ( currentValue !== null && regex.test(currentValue) ) {
var unit = trueDimension(currentValue).u || trueDimension(attrObj[p]).u;
var suffix = /%/.test(unit) ? '_percent' : ("_" + unit);
onStart[ComponentName][prop+suffix] = function(tp) {
onStart$1[ComponentName][prop+suffix] = function(tp) {
if ( this.valuesEnd[tweenProp] && this.valuesEnd[tweenProp][tp] && !(tp in attributes) ) {
attributes[tp] = function (elem, p, a, b, v) {
var _p = p.replace(suffix,'');
@ -1232,7 +1242,7 @@
};
attributesObject[prop+suffix] = trueDimension(attrObj[p]);
} else if ( !regex.test(attrObj[p]) || currentValue === null || currentValue !== null && !regex.test(currentValue) ) {
onStart[ComponentName][prop] = function(tp) {
onStart$1[ComponentName][prop] = function(tp) {
if ( this.valuesEnd[tweenProp] && this.valuesEnd[tweenProp][tp] && !(tp in attributes) ) {
attributes[tp] = function (elem, oneAttr, a, b, v) {
elem.setAttribute(oneAttr, (numbers(a,b,v) * 1000 >> 0) / 1000 );
@ -1242,7 +1252,7 @@
attributesObject[prop] = parseFloat(attrObj[p]);
}
} else {
onStart[ComponentName][prop] = function(tp) {
onStart$1[ComponentName][prop] = function(tp) {
if ( this.valuesEnd[tweenProp] && this.valuesEnd[tweenProp][tp] && !(tp in attributes) ) {
attributes[tp] = function (elem, oneAttr, a, b, v) {
elem.setAttribute(oneAttr, colors(a,b,v));
@ -1962,9 +1972,9 @@
}
function path2curve(path, path2) {
var p = pathToAbsolute(path),
p2 = path2 && pathToAbsolute(path2),
attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null};
p2 = path2 && pathToAbsolute(path2),
attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null};
var pcoms1 = [], pcoms2 = [], pfirst = "", pcom = "";
for (var i = 0, ii = Math.max(p.length, p2 && p2.length || 0); i < ii; i++) {
p[i] && (pfirst = p[i][0]);
@ -1993,9 +2003,9 @@
p2 && fixM(p2, p, attrs2, attrs, i);
ii = Math.max(p.length, p2 && p2.length || 0);
var seg = p[i],
seg2 = p2 && p2[i],
seglen = seg.length,
seg2len = p2 && seg2.length;
seg2 = p2 && p2[i],
seglen = seg.length,
seg2len = p2 && seg2.length;
attrs.x = seg[seglen - 2];
attrs.y = seg[seglen - 1];
attrs.bx = parseFloat(seg[seglen - 4]) || attrs.x;
@ -2014,15 +2024,13 @@
return np
}
function getSegments(curveArray) {
var result = [];
curveArray.map(function (seg, i) {
result[i] = {
return curveArray.map(function (seg) {
return {
x: seg[seg[0] === 'M' ? 1 : 5],
y: seg[seg[0] === 'M' ? 2 : 6],
seg: seg
};
});
return result
}
})
}
function reverseCurve(path){
var newSegments = [],

File diff suppressed because one or more lines are too long

4
src/kute.min.js vendored

File diff suppressed because one or more lines are too long