• /home/barbar84/public_h.../wp-conte.../themes/Divi/js
• File: custom.unified.js
• Dòng [
43/
56]:
*/a=function(t){var e=function(t,e){var n,r=document.createElement("canvas");t.appendChild(r),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(r);var i=r.getContext("2d");r.width=r.height=e.size;var o=1;window.devicePixelRatio>1&&(o=window.devicePixelRatio,r.style.width=r.style.height=[e.size,"px"].join(""),r.width=r.height=e.size*o,i.scale(o,o)),i.translate(e.size/2,e.size/2),i.rotate((e.rotate/180-.5)*Math.PI);var a=(e.size-e.lineWidth)/2;e.scaleColor&&e.scaleLength&&(a-=e.scaleLength+2),Date.now=Date.now||function(){return+new Date};var s=function(t,e,n,r){var o=(n=Math.min(Math.max(-1,n||0),1))<=0;i.beginPath(),i.arc(0,0,a,0,2*Math.PI*n,o),i.strokeStyle=t,i.globalAlpha=r,i.lineWidth=e,i.stroke()},c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},u=function(){e.scaleColor&&function(){var t,n;i.lineWidth=1,i.fillStyle=e.scaleColor,i.save();for(var r=24;r>0;--r)r%6==0?(n=e.scaleLength,t=0):(n=.6*e.scaleLength,t=e.scaleLength-n),i.fillRect(-e.size/2+t,0,n,1),i.rotate(Math.PI/12);i.restore()}(),e.trackColor&&s(e.trackColor,e.lineWidth,1,e.trackAlpha)};this.getCanvas=function(){return r},this.getCtx=function(){return i},this.clear=function(){i.clearRect(e.size/-2,e.size/-2,e.size,e.size)},this.draw=function(t){var r;e.scaleColor||e.trackColor?i.getImageData&&i.putImageData?n?i.putImageData(n,0,0):(u(),n=i.getImageData(0,0,e.size*o,e.size*o)):(this.clear(),u()):this.clear(),i.lineCap=e.lineCap,r="function"==typeof e.barColor?e.barColor(t):e.barColor,s(r,e.lineWidth,t/100,e.barAlpha)}.bind(this),this.animate=function(t,n){var r=Date.now();e.onStart(t,n);var i=function(){var o=Math.min(Date.now()-r,e.animate.duration),a=e.easing(this,o,t,n-t,e.animate.duration);this.draw(a),e.onStep(t,n,a),o>=e.animate.duration?e.onStop(t,n):c(i)}.bind(this);c(i)}.bind(this)},n=function(t,n){var r={barColor:"#ef1e25",barAlpha:1,trackColor:"#f9f9f9",trackAlpha:1,scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,render:!0,animate:{duration:1e3,enabled:!0},easing:function(t,e,n,r,i){return(e/=i/2)<1?r/2*e*e+n:-r/2*(--e*(e-2)-1)+n},onStart:function(t,e){},onStep:function(t,e,n){},onStop:function(t,e){}};if(void 0!==e)r.renderer=e;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");r.renderer=SVGRenderer}var i={},o=0,a=function(){for(var e in this.el=t,this.options=i,r)r.hasOwnProperty(e)&&(i[e]=n&&void 0!==n[e]?n[e]:r[e],"function"==typeof i[e]&&(i[e]=i[e].bind(this)));"string"==typeof i.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[i.easing])?i.easing=jQuery.easing[i.easing]:i.easing=r.easing,"number"==typeof i.animate&&(i.animate={duration:i.animate,enabled:!0}),"boolean"!=typeof i.animate||i.animate||(i.animate={duration:1e3,enabled:i.animate}),this.renderer=new i.renderer(t,i),this.renderer.draw(o),t.dataset&&t.dataset.percent?this.update(parseFloat(t.dataset.percent)):t.getAttribute&&t.getAttribute("data-percent")&&this.update(parseFloat(t.getAttribute("data-percent")))}.bind(this);this.update=function(t){return t=parseFloat(t),i.animate.enabled?this.renderer.animate(o,t):this.renderer.draw(t),o=t,this}.bind(this),this.disableAnimation=function(){return i.animate.enabled=!1,this},this.enableAnimation=function(){return i.animate.enabled=!0,this},a()};t.fn.easyPieChart=function(e){return this.each((function(){var r;t.data(this,"easyPieChart")||(r=t.extend({},e,t(this).data()),t.data(this,"easyPieChart",new n(this,r)))}))}},"object"===s(e)?t.exports=a(n(1)):(i=[n(1)],void 0===(o="function"==typeof(r=a)?r.apply(e,i):r)||(t.exports=o))},function(t,e){function n(t){return(n="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})(t)}