# wt-security/2.2.4/htdocs/js/circle-progress.js

WebTotem Security, version 2.2.4. 19 lines.

- Page: https://pluginprobe.com/plugins/wt-security/2.2.4/code/htdocs/js/circle-progress.js
- Raw: https://pluginprobe.com/plugins/wt-security/2.2.4/raw/htdocs/js/circle-progress.js
- Modified: 2020-12-28T10:17:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wt-security/2.2.4/code/htdocs/js/circle-progress.js#L10-L20`.

```javascript
// SVG circle progress bar %
const circle = document.querySelector(".wtotem_from__circle");
if(circle){
    const radius = circle.r.baseVal.value;
    const circumference = 2 * Math.PI * radius;
    const percentCircle = document.querySelector(".wtotem_from__percent");

    circle.style.strokeDasharray = `${circumference} ${circumference}`;
    circle.style.strokeDashoffset = circumference;

    const setProgress = (percent) => {
        const offset = circumference - (percent / 100) * circumference;
        circle.style.strokeDashoffset = offset;
        percentCircle.textContent = `${percent}%`;
    };
    setProgress(percentCircle.dataset.value);
}
//----------------------------------

```
