Fix diff coloring.
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 46s

This commit is contained in:
MaxJa4
2024-01-25 18:27:21 +01:00
parent efd5c2007e
commit 745b44eb10

View File

@@ -169,10 +169,13 @@
oppAvgScore.innerText = oppAvg.toFixed(2); oppAvgScore.innerText = oppAvg.toFixed(2);
if (!isNaN(homeAvg) && !isNaN(oppAvg)) { if (!isNaN(homeAvg) && !isNaN(oppAvg)) {
const diff = (((homeAvg / oppAvg) - 1.0) * 100).toFixed(1); const diff = (((homeAvg / oppAvg) - 1.0) * 100).toFixed(1);
if (diff > 0) diffScore.classList.remove('text-warning');
diffScore.classList.replace('text-warning', 'text-success'); diffScore.classList.remove('text-success');
else if (diff < 0) diffScore.classList.remove('text-danger');
diffScore.classList.replace('text-warning', 'text-danger'); if (diff > 0.0)
diffScore.classList.add('text-success');
else if (diff < 0.0)
diffScore.classList.add('text-danger');
diffScore.innerText = diff + "%"; diffScore.innerText = diff + "%";
} }