Skip to content

Commit

Permalink
winRate
Browse files Browse the repository at this point in the history
  • Loading branch information
hu8813 committed Apr 29, 2024
1 parent 328afca commit a37d4a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion srcs/frontend/js/Leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function openProfile(username) {
for (let index = startIndex; index < endIndex; index++) {
const member = leaderboardData[index];
const row = document.createElement('tr');
let winRate = member.winning_rate * 2;
row.innerHTML = `
<td>${index + 1} &nbsp; ${index < 3 ? `<i class="bi bi-trophy-fill" style="color: ${index === 0 ? 'gold' : (index === 1 ? '#A7A7AD ' : '#A77044')}"></i>` : ''}</td>
<td>
Expand All @@ -86,7 +87,7 @@ function openProfile(username) {
</div>
</td>
<td>${await calculatePointsProgressBar(member.score)}</td>
<td>${await calculateWinningRateProgressBar(member.winning_rate)}</td>
<td>${await calculateWinningRateProgressBar(winRate)}</td>
<td>${await calculateDaysSinceJoining(member.date_joined)}</td>
`;
leaderboardBody.appendChild(row);
Expand Down

0 comments on commit a37d4a8

Please sign in to comment.