yeswanthvarma commited on
Commit
e0d9bb9
·
verified ·
1 Parent(s): 0542785

Update static/js/main.js

Browse files
Files changed (1) hide show
  1. 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
- const circumference = 2 * Math.PI * 90; // 2πr where r=90
181
- const offset = circumference - (scorePercent / 100) * circumference;
182
- scoreProgress.style.strokeDashoffset = offset;
 
 
 
 
 
 
 
 
 
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) {