accordion.js
2 months ago
add-to-cart.js
2 months ago
animated-heading.js
2 months ago
block-animations.js
2 months ago
carousel.js
2 months ago
count-animations.js
2 months ago
countdown.js
2 months ago
form.js
2 months ago
popup.js
2 months ago
progress-bar.js
2 months ago
reveal-button.js
2 months ago
sticky.js
2 months ago
table-of-contents-smooth-scroll.js
2 months ago
typing-animations.js
2 months ago
progress-bar.js
1 lines
| 1 | (()=>{function e(e){var t="true"===e.getAttribute("data-animate"),r=parseInt(e.getAttribute("data-duration"),10)||1500,i=parseInt(e.getAttribute("data-value"),10)||0,a=parseInt(e.getAttribute("data-goal"),10)||100,s=e.getAttribute("data-value-display")||"value",n="false"!==e.getAttribute("data-show-percentage"),o=e.getAttribute("data-prefix")||"",l=e.getAttribute("data-suffix")||"",u=a>0?Math.min(100,i/a*100):0;function d(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var c=e.className||"",f=-1!==c.indexOf("is-style-circle")||-1!==c.indexOf("is-style-glow-circle"),g=-1!==c.indexOf("is-style-semicircle")||-1!==c.indexOf("is-style-glow-semicircle"),b=!f&&!g,v=e.querySelector(".superb-progress-fill"),p=e.querySelector(".superb-progress-fill-circle"),y=e.querySelectorAll(".superb-progress-percentage"),h=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function m(){if(b&&v&&(v.style.transition="width "+r+"ms ease-out",v.style.width=u+"%"),(f||g)&&p){var e=parseFloat(p.getAttribute("data-target-offset"));p.style.transition="stroke-dashoffset "+r+"ms ease-out",p.style.strokeDashoffset=e}!function(){if(!n||0===y.length)return;var e=null;function t(a){null===e&&(e=a);var s=a-e,n=Math.min(s/r,1),o=1-Math.pow(1-n,3);w(Math.round(o*i)),n<1?requestAnimationFrame(t):w(i)}requestAnimationFrame(t)}()}function w(e){if(n){var t,r=d(e);t="valueGoal"===s?o+r+" / "+o+d(a)+l:o+r+l;for(var i=0;i<y.length;i++)y[i].textContent=t}}if(!t||h)return function(){if(b&&v&&(v.style.transition="none",v.style.width=u+"%"),(f||g)&&p){var e=parseFloat(p.getAttribute("data-target-offset"));p.style.transition="none",p.style.strokeDashoffset=e}w(i)}(),void(e.style.visibility="visible");if("IntersectionObserver"in window){var A=new IntersectionObserver((function(e){for(var t=0;t<e.length;t++)if(e[t].isIntersecting){A.disconnect(),m();break}}),{threshold:.2});A.observe(e)}else m();e.style.visibility="visible"}document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".wp-block-superb-addons-progress-bar").forEach(e)}))})(); |