Skip to content
Snippets Groups Projects
Commit a9e788ab authored by Enzo Simonnet's avatar Enzo Simonnet
Browse files

refix succes 5

parent 5d56a6d4
No related branches found
No related tags found
No related merge requests found
...@@ -102,7 +102,7 @@ class AppTwigExtension extends AbstractExtension ...@@ -102,7 +102,7 @@ class AppTwigExtension extends AbstractExtension
$nextMilestoneIndex = $currentMilestone < $numSuccesses - 1 ? $currentMilestone + 1 : $numSuccesses - 1; $nextMilestoneIndex = $currentMilestone < $numSuccesses - 1 ? $currentMilestone + 1 : $numSuccesses - 1;
$progressPercentage = ($counter - $successMilestones[$currentMilestone]) / ($successMilestones[$currentMilestone+1] - $currentMilestone) * 100; // Calculate progress percentage $progressPercentage = ($counter - $successMilestones[$currentMilestone]) / ($successMilestones[min($currentMilestone+1, $numSuccesses-1)] - $currentMilestone) * 100; // Calculate progress percentage
// Define CSS styles for the progress bar container and fill // Define CSS styles for the progress bar container and fill
$containerStyle = sprintf('background-color: %s;', $successColors[1]); // Use the first color in $successColors for the container background $containerStyle = sprintf('background-color: %s;', $successColors[1]); // Use the first color in $successColors for the container background
$fillStyle = sprintf('background-color: %s; width: %s%%;', $successColors[0], $progressPercentage); // Use the second color in $successColors for the fill $fillStyle = sprintf('background-color: %s; width: %s%%;', $successColors[0], $progressPercentage); // Use the second color in $successColors for the fill
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment