diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-15 21:59:11 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-15 21:59:11 +0900 |
| commit | 6fe42b8840fd3508615e022cc65dad28a335abcd (patch) | |
| tree | ef1857bad66a215260fdd2b6f7c8eb5b4bb2029f /frontend/app/components/Gaming/ScoreBar.tsx | |
| parent | 5bcb86f50f35de764039cb93f5057dce3ebe4729 (diff) | |
| download | iosdc-japan-2025-albatross-6fe42b8840fd3508615e022cc65dad28a335abcd.tar.gz iosdc-japan-2025-albatross-6fe42b8840fd3508615e022cc65dad28a335abcd.tar.zst iosdc-japan-2025-albatross-6fe42b8840fd3508615e022cc65dad28a335abcd.zip | |
feat(frontend): enhance score bar ratio
Diffstat (limited to 'frontend/app/components/Gaming/ScoreBar.tsx')
| -rw-r--r-- | frontend/app/components/Gaming/ScoreBar.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/frontend/app/components/Gaming/ScoreBar.tsx b/frontend/app/components/Gaming/ScoreBar.tsx index 4eac3ad..cacdd50 100644 --- a/frontend/app/components/Gaming/ScoreBar.tsx +++ b/frontend/app/components/Gaming/ScoreBar.tsx @@ -14,7 +14,12 @@ export default function ScoreBar({ scoreA, scoreB, bgA, bgB }: Props) { } else if (scoreB === null) { scoreRatio = 100; } else { - scoreRatio = (scoreB / (scoreA + scoreB)) * 100; + const rawRatio = scoreB / (scoreA + scoreB); + const k = 3.0; + const emphasizedRatio = + Math.pow(rawRatio, k) / + (Math.pow(rawRatio, k) + Math.pow(1 - rawRatio, k)); + scoreRatio = emphasizedRatio * 100; } return ( |
