animationjs
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,1 +0,1 @@ | ||
(typeof window === 'undefined') && (window = {ctrl: {}, lib: {}});!window.ctrl && (window.ctrl = {});!window.lib && (window.lib = {});!function(a,b){function c(b){function d(){e=!0,i&&i.forEach(function(a){a&&a()})}var e=!1;Object.defineProperty(this,"isRequested",{get:function(){return e}});var f,i=[],j=!1;this.request=function(){if(!e){var c=arguments;return j=!1,f=g(function(){j||(b.apply(a,c),d())}),this}},this.cancel=function(){f&&(j=!0,h(f))},this.then=function(a){return e?a&&a():i.push(a),this},this.clone=function(){return new c(b)}}function d(a,d,e,g){"function"==typeof g&&(g={0:g});for(var h=a/f,i=1/h,j=[],k=Object.keys(g).map(function(a){return parseInt(a)}),l=0;h>l;l++){var m=k[0],n=i*l;if(null!=m&&100*n>=m){var o=g[""+m];o instanceof c||(o=new c(o)),j.push(o),k.shift()}else j.length&&j.push(j[j.length-1].clone())}var p;"string"==typeof d||d instanceof Array?b.cubicbezier?"string"==typeof d?b.cubicbezier[d]&&(p=b.cubicbezier[d]):d instanceof Array&&4===d.length&&(p=b.cubicbezier.apply(b.cubicbezier,d)):console.error("require lib.cubicbezier"):"function"==typeof d&&(p=d),p||console.error("unexcept timing function");var q,r=!1,s=0,t=0;this.play=function(){function a(){r=!1,u&&u()}function b(){var a=i*(t+1).toFixed(10);q=j[t],q.request(a.toFixed(10),d(a).toFixed(10)),q.then(function(){t++,c()})}function c(){r&&(t===j.length?a():b())}if(!r)return r=!0,s=setTimeout(function(){s=0,c()},!t&&e||0),this},this.stop=function(){return r?(r=!1,s&&(clearTimeout(s),s=0),q&&q.cancel(),this):void 0};var u;this.onend=function(a){u=a}}var e=60,f=1e3/e,g=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,f)},h=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||function(a){clearTimeout(a)};b.animation=d,b.animation.Frame=c,b.animation.requestFrame=function(a){var b=new c(a);return b.request(),b}}(window,window.lib||(window.lib={}));;module.exports = window.lib['animation']; | ||
(typeof window === 'undefined') && (window = {ctrl: {}, lib: {}});!window.ctrl && (window.ctrl = {});!window.lib && (window.lib = {});!function(a,b){function c(a){return setTimeout(a,h)}function d(a){clearTimeout(a)}function e(b){function c(){d=!0,g&&g.forEach(function(a){a&&a()})}var d=!1;Object.defineProperty(this,"isRequested",{get:function(){return d}});var f,g=[],h=!1;this.request=function(){if(!d){var e=arguments;return h=!1,f=i(function(){h||(b.apply(a,e),c())}),this}},this.cancel=function(){f&&(h=!0,j(f))},this.then=function(a){return d?a&&a():g.push(a),this},this.clone=function(){return new e(b)}}function f(a,c,d,f){"function"==typeof f&&(f={0:f});for(var g=a/h,i=1/g,j=[],k=Object.keys(f).map(function(a){return parseInt(a)}),l=0;g>l;l++){var m=k[0],n=i*l;if(null!=m&&100*n>=m){var o=f[""+m];o instanceof e||(o=new e(o)),j.push(o),k.shift()}else j.length&&j.push(j[j.length-1].clone())}var p;"string"==typeof c||c instanceof Array?b.cubicbezier?"string"==typeof c?b.cubicbezier[c]&&(p=b.cubicbezier[c]):c instanceof Array&&4===c.length&&(p=b.cubicbezier.apply(b.cubicbezier,c)):console.error("require lib.cubicbezier"):"function"==typeof c&&(p=c),p||console.error("unexcept timing function");var q,r=!1,s=0,t=0;this.play=function(){function a(){r=!1,u&&u()}function b(){var a=i*(t+1).toFixed(10);q=j[t],q.request(a.toFixed(10),c(a).toFixed(10)),q.then(function(){t++,e()})}function e(){r&&(t===j.length?a():b())}if(!r)return r=!0,s=setTimeout(function(){s=0,e()},!t&&d||0),this},this.stop=function(){return r?(r=!1,s&&(clearTimeout(s),s=0),q&&q.cancel(),this):void 0};var u;this.onend=function(a){u=a}}var g=60,h=1e3/g,i=window.requestAnimationFrame||window.msRequestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||c,j=window.cancelAnimationFrame||window.msCancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||d;(i===c||j===d)&&(i=c,j=d),b.animation=f,b.animation.Frame=e,b.animation.requestFrame=function(a){var b=new e(a);return b.request(),b}}(window,window.lib||(window.lib={}));;module.exports = window.lib['animation']; |
@@ -6,8 +6,16 @@ ;(function(win, lib) { | ||
function setTimeoutFrame(cb) { | ||
return setTimeout(cb, INTERVAL); | ||
} | ||
function clearTimeoutFrame(tick) { | ||
clearTimeout(tick); | ||
} | ||
var requestAnimationFrame = | ||
window.requestAnimationFrame || | ||
window.msRequestAnimationFrame || | ||
window.webkitRequestAnimationFrame || | ||
function (cb) { | ||
return setTimeout(cb, INTERVAL); | ||
}; | ||
window.mozRequestAnimationFrame || | ||
setTimeoutFrame; | ||
@@ -17,7 +25,12 @@ | ||
window.cancelAnimationFrame || | ||
window.msCancelAnimationFrame || | ||
window.webkitCancelAnimationFrame || | ||
function (tick) { | ||
clearTimeout(tick); | ||
}; | ||
window.mozCancelAnimationFrame || | ||
clearTimeoutFrame; | ||
if (requestAnimationFrame === setTimeoutFrame || cancelAnimationFrame === clearTimeoutFrame) { | ||
requestAnimationFrame = setTimeoutFrame; | ||
cancelAnimationFrame = clearTimeoutFrame; | ||
} | ||
function Frame(fun) { | ||
@@ -24,0 +37,0 @@ var isRequested = false; |
@@ -1,1 +0,1 @@ | ||
!function(a,b){function c(b){function d(){e=!0,i&&i.forEach(function(a){a&&a()})}var e=!1;Object.defineProperty(this,"isRequested",{get:function(){return e}});var f,i=[],j=!1;this.request=function(){if(!e){var c=arguments;return j=!1,f=g(function(){j||(b.apply(a,c),d())}),this}},this.cancel=function(){f&&(j=!0,h(f))},this.then=function(a){return e?a&&a():i.push(a),this},this.clone=function(){return new c(b)}}function d(a,d,e,g){"function"==typeof g&&(g={0:g});for(var h=a/f,i=1/h,j=[],k=Object.keys(g).map(function(a){return parseInt(a)}),l=0;h>l;l++){var m=k[0],n=i*l;if(null!=m&&100*n>=m){var o=g[""+m];o instanceof c||(o=new c(o)),j.push(o),k.shift()}else j.length&&j.push(j[j.length-1].clone())}var p;"string"==typeof d||d instanceof Array?b.cubicbezier?"string"==typeof d?b.cubicbezier[d]&&(p=b.cubicbezier[d]):d instanceof Array&&4===d.length&&(p=b.cubicbezier.apply(b.cubicbezier,d)):console.error("require lib.cubicbezier"):"function"==typeof d&&(p=d),p||console.error("unexcept timing function");var q,r=!1,s=0,t=0;this.play=function(){function a(){r=!1,u&&u()}function b(){var a=i*(t+1).toFixed(10);q=j[t],q.request(a.toFixed(10),d(a).toFixed(10)),q.then(function(){t++,c()})}function c(){r&&(t===j.length?a():b())}if(!r)return r=!0,s=setTimeout(function(){s=0,c()},!t&&e||0),this},this.stop=function(){return r?(r=!1,s&&(clearTimeout(s),s=0),q&&q.cancel(),this):void 0};var u;this.onend=function(a){u=a}}var e=60,f=1e3/e,g=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,f)},h=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||function(a){clearTimeout(a)};b.animation=d,b.animation.Frame=c,b.animation.requestFrame=function(a){var b=new c(a);return b.request(),b}}(window,window.lib||(window.lib={})); | ||
!function(a,b){function c(a){return setTimeout(a,h)}function d(a){clearTimeout(a)}function e(b){function c(){d=!0,g&&g.forEach(function(a){a&&a()})}var d=!1;Object.defineProperty(this,"isRequested",{get:function(){return d}});var f,g=[],h=!1;this.request=function(){if(!d){var e=arguments;return h=!1,f=i(function(){h||(b.apply(a,e),c())}),this}},this.cancel=function(){f&&(h=!0,j(f))},this.then=function(a){return d?a&&a():g.push(a),this},this.clone=function(){return new e(b)}}function f(a,c,d,f){"function"==typeof f&&(f={0:f});for(var g=a/h,i=1/g,j=[],k=Object.keys(f).map(function(a){return parseInt(a)}),l=0;g>l;l++){var m=k[0],n=i*l;if(null!=m&&100*n>=m){var o=f[""+m];o instanceof e||(o=new e(o)),j.push(o),k.shift()}else j.length&&j.push(j[j.length-1].clone())}var p;"string"==typeof c||c instanceof Array?b.cubicbezier?"string"==typeof c?b.cubicbezier[c]&&(p=b.cubicbezier[c]):c instanceof Array&&4===c.length&&(p=b.cubicbezier.apply(b.cubicbezier,c)):console.error("require lib.cubicbezier"):"function"==typeof c&&(p=c),p||console.error("unexcept timing function");var q,r=!1,s=0,t=0;this.play=function(){function a(){r=!1,u&&u()}function b(){var a=i*(t+1).toFixed(10);q=j[t],q.request(a.toFixed(10),c(a).toFixed(10)),q.then(function(){t++,e()})}function e(){r&&(t===j.length?a():b())}if(!r)return r=!0,s=setTimeout(function(){s=0,e()},!t&&d||0),this},this.stop=function(){return r?(r=!1,s&&(clearTimeout(s),s=0),q&&q.cancel(),this):void 0};var u;this.onend=function(a){u=a}}var g=60,h=1e3/g,i=window.requestAnimationFrame||window.msRequestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||c,j=window.cancelAnimationFrame||window.msCancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||d;(i===c||j===d)&&(i=c,j=d),b.animation=f,b.animation.Frame=e,b.animation.requestFrame=function(a){var b=new e(a);return b.request(),b}}(window,window.lib||(window.lib={})); |
{ | ||
"name": "animationjs", | ||
"description": "贝塞尔动画函数", | ||
"version": "0.1.2", | ||
"name": "animation", | ||
"description": "播放动画", | ||
"version": "0.1.4", | ||
"contributors": [ | ||
@@ -38,3 +38,3 @@ { | ||
], | ||
"main": "build/animationjs.common.js" | ||
"main": "build/animation.common.js" | ||
} |
{ | ||
"name": "animationjs", | ||
"description": "贝塞尔动画函数", | ||
"version": "0.1.3", | ||
"description": "播放动画", | ||
"version": "0.1.4", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ { |
@@ -5,3 +5,3 @@ #lib.animation | ||
**0.1.0** | ||
**0.1.4** | ||
@@ -8,0 +8,0 @@ ## 依赖库 |
@@ -6,8 +6,16 @@ ;(function(win, lib) { | ||
function setTimeoutFrame(cb) { | ||
return setTimeout(cb, INTERVAL); | ||
} | ||
function clearTimeoutFrame(tick) { | ||
clearTimeout(tick); | ||
} | ||
var requestAnimationFrame = | ||
window.requestAnimationFrame || | ||
window.msRequestAnimationFrame || | ||
window.webkitRequestAnimationFrame || | ||
function (cb) { | ||
return setTimeout(cb, INTERVAL); | ||
}; | ||
window.mozRequestAnimationFrame || | ||
setTimeoutFrame; | ||
@@ -17,7 +25,12 @@ | ||
window.cancelAnimationFrame || | ||
window.msCancelAnimationFrame || | ||
window.webkitCancelAnimationFrame || | ||
function (tick) { | ||
clearTimeout(tick); | ||
}; | ||
window.mozCancelAnimationFrame || | ||
clearTimeoutFrame; | ||
if (requestAnimationFrame === setTimeoutFrame || cancelAnimationFrame === clearTimeoutFrame) { | ||
requestAnimationFrame = setTimeoutFrame; | ||
cancelAnimationFrame = clearTimeoutFrame; | ||
} | ||
function Frame(fun) { | ||
@@ -24,0 +37,0 @@ var isRequested = false; |
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
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
24789
408