PluginProbe
WebTotem Security / 2.2.2
WebTotem Security v2.2.2
3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 2.2.4 All 109 releases
wt-security / htdocs / js / circle-progress.js

circle-progress.js in WebTotem Security 2.2.2, at htdocs/js/circle-progress.js

19 lines 697 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // SVG circle progress bar %
2 const circle = document.querySelector(".wtotem_from__circle");
3 if(circle){
4 const radius = circle.r.baseVal.value;
5 const circumference = 2 * Math.PI * radius;
6 const percentCircle = document.querySelector(".wtotem_from__percent");
7
8 circle.style.strokeDasharray = `${circumference} ${circumference}`;
9 circle.style.strokeDashoffset = circumference;
10
11 const setProgress = (percent) => {
12 const offset = circumference - (percent / 100) * circumference;
13 circle.style.strokeDashoffset = offset;
14 percentCircle.textContent = `${percent}%`;
15 };
16 setProgress(percentCircle.dataset.value);
17 }
18 //----------------------------------
19