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

WebTotem Security, version 2.2.2. 19 lines.

- Page: https://pluginprobe.com/plugins/wt-security/2.2.2/code/htdocs/js/circle-progress.js
- Raw: https://pluginprobe.com/plugins/wt-security/2.2.2/raw/htdocs/js/circle-progress.js
- Modified: 2020-10-06T09:33:46+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.2/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);
}
//----------------------------------

```
