mirror of https://github.com/luileito/jsketch.git
Added animate dist files
This commit is contained in:
parent
58e6abea10
commit
d86c3db799
|
|
@ -0,0 +1 @@
|
|||
!function(a){function b(a){function b(a,b,c,d){var e=b[c-1],f=b[c];if(a.data.firstPointSize&&(1===c||f.strokeId!==e.strokeId)){var g=c>1?f:e;a.beginFill(a.data.strokeStyle).fillCircle(g.x,g.y,a.data.firstPointSize)}a.lineStyle(d.strokeStyle,d.lineWidth).beginPath(),f.strokeId===e.strokeId&&a.line(e.x,e.y,f.x,f.y).stroke(),a.closePath()}function d(a){return a instanceof Array?{x:a[0],y:a[1],t:a[2]}:a}for(var e=a.data(c),f=e.sketch,g=e.strokes,h=e.options.events,i=e.options.graphics,j=[],k=0;k<g.length;k++)for(var l=g[k],m=0;m<l.length;m++){var n=d(l[m]);n.strokeId=k,j.push(n)}var o,p=1,q=j.length-1;"function"==typeof h.animationstart&&h.animationstart(a,e),function r(){o=requestAnimationFrame(r);try{b(f,j,p,i),p++}catch(c){console.error(c),cancelAnimationFrame(o)}p==q&&(cancelAnimationFrame(o),"function"==typeof h.animationend&&h.animationend(a,e))}(),this.cancel=function(){return cancelAnimationFrame(o),this}}var c="sketchable";a.fn.sketchable.plugins.animate=function(d){function e(a){if(!f.options["_bound.animate$"+a])if(f.options["_bound.animate$"+a]=!0,f.options.events&&"function"==typeof f.options.events[a]){var b=f.options.events[a];f.options.events[a]=function(){b.apply(d,arguments),g[a].apply(d,arguments)}}else f.options.events[a]=g[a]}for(var f=d.sketchable("config"),g={clear:function(a,b){b.animate&&b.animate.cancel()},destroy:function(a,b){b.animate&&b.animate.cancel()}},h="clear destroy".split(" "),i=0;i<h.length;i++)e(h[i]);a.extend(a.fn.sketchable.api,{animate:{strokes:function(){var e=a(this).data(c);return e.animate=new b(d),d}}})}}(jQuery);
|
||||
|
|
@ -0,0 +1 @@
|
|||
!function(a){function b(a){function b(a,b,c,d){var e=b[c-1],f=b[c];if(a.data.firstPointSize&&(1===c||f.strokeId!==e.strokeId)){var g=c>1?f:e;a.beginFill(a.data.strokeStyle).fillCircle(g.x,g.y,a.data.firstPointSize)}a.lineStyle(d.strokeStyle,d.lineWidth).beginPath(),f.strokeId===e.strokeId&&a.line(e.x,e.y,f.x,f.y).stroke(),a.closePath()}function d(a){return a instanceof Array?{x:a[0],y:a[1],t:a[2]}:a}for(var e=dataBind(a.elem)[c],f=e.sketch,g=e.strokes,h=e.options.events,i=e.options.graphics,j=[],k=0;k<g.length;k++)for(var l=g[k],m=0;m<l.length;m++){var n=d(l[m]);n.strokeId=k,j.push(n)}var o,p=1,q=j.length-1;"function"==typeof h.animationstart&&h.animationstart(a.elem,e),function r(){o=requestAnimationFrame(r);try{b(f,j,p,i),p++}catch(c){console.error(c),cancelAnimationFrame(o)}p==q&&(cancelAnimationFrame(o),"function"==typeof h.animationend&&h.animationend(a.elem,e))}(),this.cancel=function(){return cancelAnimationFrame(o),this}}var c="sketchable";Sketchable.prototype.plugins.animate=function(a){function d(b){if(!e.options["_bound.animate$"+b])if(e.options["_bound.animate$"+b]=!0,e.options.events&&"function"==typeof e.options.events[b]){var c=e.options.events[b];e.options.events[b]=function(){c.apply(a,arguments),f[b].apply(a,arguments)}}else e.options.events[b]=f[b]}for(var e=a.config(),f={clear:function(a,b){b.animate&&b.animate.cancel()},destroy:function(a,b){b.animate&&b.animate.cancel()}},g="clear destroy".split(" "),h=0;h<g.length;h++)d(g[h]);deepExtend(a,{animate:{strokes:function(){var d=dataBind(a.elem)[c];return d.animate=new b(a),a}}})}}(this);
|
||||
Loading…
Reference in New Issue