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 | |
| parent | 5bcb86f50f35de764039cb93f5057dce3ebe4729 (diff) | |
| download | phperkaigi-2025-albatross-6fe42b8840fd3508615e022cc65dad28a335abcd.tar.gz phperkaigi-2025-albatross-6fe42b8840fd3508615e022cc65dad28a335abcd.tar.zst phperkaigi-2025-albatross-6fe42b8840fd3508615e022cc65dad28a335abcd.zip | |
feat(frontend): enhance score bar ratio
Diffstat (limited to 'frontend/app')
| -rw-r--r-- | frontend/app/components/Gaming/ScoreBar.tsx | 7 | ||||
| -rw-r--r-- | frontend/app/routes/dashboard.tsx | 2 |
2 files changed, 7 insertions, 2 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 ( diff --git a/frontend/app/routes/dashboard.tsx b/frontend/app/routes/dashboard.tsx index 78ed531..3c4a684 100644 --- a/frontend/app/routes/dashboard.tsx +++ b/frontend/app/routes/dashboard.tsx @@ -41,7 +41,7 @@ export default function Dashboard() { {games.length === 0 ? ( <p>エントリーできる試合はありません</p> ) : ( - <ul className="divide-y"> + <ul className="divide-y divide-gray-300"> {games.map((game) => ( <li key={game.game_id} |
