frontend.js
2.03 KB
!function(t){function e(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,a){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:a})},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=2)}({2:function(t,e){/*!
* getwid-circle-progress-bar
*/
!function(t){t(document).ready(function(e){t(document.body).on("post-load",function(t){n()});var n=function(){t(".wp-block-getwid-circle-progress-bar:not(.getwid-init)").each(function(e){function n(){var t=s.find("".concat(u,"__canvas")).get(0);t.width=parseFloat(f),t.height=parseFloat(f)}function a(t,e){var a=s.find("".concat(u,"__canvas")).get(0).getContext("2d"),r="auto"===p?f/14:p,i=f/2,d=Math.PI/180*-90;n(),a.clearRect(0,0,f,f),a.beginPath(),a.arc(i,i,i-r/2,d,d+2*Math.PI),a.lineWidth=r,a.strokeStyle=o,a.stroke(),a.beginPath(),a.arc(i,i,i-r/2,d,d+2*Math.PI*(t/100)),a.lineWidth=r,a.strokeStyle=c,a.stroke(),a.beginPath(),a.textAlign="center",a.font="16px serif",a.fillText(e||t+"%",i+6.5,i+5),a.stroke()}function r(t){var e=0,n=setInterval(function(){a(e,t),++e>i&&clearInterval(n)},35)}var o,c,i,d,f,p,l,u=".wp-block-getwid-circle-progress-bar",s=t(this);t(this).addClass("getwid-init"),o=s.find("".concat(u,"__wrapper")).data("background-color")?s.find("".concat(u,"__wrapper")).data("background-color"):"#eeeeee",c=s.find("".concat(u,"__wrapper")).data("text-color")?s.find("".concat(u,"__wrapper")).data("text-color"):"#0000ee",i=s.find("".concat(u,"__wrapper")).data("fill-amount"),d=s.find("".concat(u,"__wrapper")).data("is-animated"),f=s.find("".concat(u,"__wrapper")).data("size"),p=s.find("".concat(u,"__wrapper")).data("thickness"),l=s.find("".concat(u,"__wrapper")).data("value");var _=s.find(t("".concat(u,"__wrapper"))),g=new Waypoint({element:_.get(0),handler:function(){d?r(l):a(i,l),g.destroy()},offset:"100%"})})};n()})}(jQuery)}});