Spaces:
Sleeping
Sleeping
Update static/js/main.js
Browse files- static/js/main.js +12 -3
static/js/main.js
CHANGED
@@ -177,9 +177,18 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
177 |
scoreValue.textContent = `${scorePercent}%`;
|
178 |
|
179 |
// Update circle progress
|
180 |
-
|
181 |
-
const
|
182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
184 |
// Set color based on score
|
185 |
if (scorePercent >= 80) {
|
|
|
177 |
scoreValue.textContent = `${scorePercent}%`;
|
178 |
|
179 |
// Update circle progress
|
180 |
+
function updateScoreCircle(score) {
|
181 |
+
const circle = document.querySelector(".score-progress");
|
182 |
+
const radius = circle.r.baseVal.value; // Gets the actual <circle r="...">
|
183 |
+
const circumference = 2 * Math.PI * radius;
|
184 |
+
|
185 |
+
circle.style.strokeDasharray = `${circumference}`;
|
186 |
+
circle.style.strokeDashoffset = `${circumference}`;
|
187 |
+
|
188 |
+
const offset = circumference - (score / 100) * circumference;
|
189 |
+
circle.style.strokeDashoffset = offset;
|
190 |
+
}
|
191 |
+
|
192 |
|
193 |
// Set color based on score
|
194 |
if (scorePercent >= 80) {
|