Skip to content

Commit

Permalink
More legible MMR values
Browse files Browse the repository at this point in the history
  • Loading branch information
geneotech committed Jan 17, 2024
1 parent 8ae87cc commit de52563
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions public/assets/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -930,3 +930,8 @@ input:-webkit-autofill:active{
.external-link-icon::after {
content: '\2197'; /* Unicode character for an arrow */
}

.monospace-big {
font-family: monospace;
font-size: 1.2em;
}
3 changes: 2 additions & 1 deletion src/format_delta.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
function formatMMRDelta(mmr_delta, monospace = false) {
const deltaSymbol = mmr_delta >= 0 ? '↑' : '↓';
const deltaColor = mmr_delta >= 0 ? 'chartreuse' : '#f85e73';
const fontFamily = monospace ? 'font-family: monospace;' : '';
// Adjust the font size when monospace is true
const fontFamily = monospace ? 'font-family: monospace; font-size: 1.2em;' : '';
return `<span style="color:${deltaColor}; ${fontFamily}">${deltaSymbol}${Math.abs(mmr_delta).toFixed(2)}</span>`;
}

Expand Down
4 changes: 2 additions & 2 deletions views/leaderboards.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<%= i.nickname %>
</a>
</td>
<td><b><%= i.mmr.toFixed(3) %></b></td>
<td class="monospace-big"><%= i.mmr.toFixed(3) %></td>
<!--
<td><%= i.mu.toFixed(3) %></td>
<td><%= i.sigma.toFixed(3) %></td>
Expand Down Expand Up @@ -73,7 +73,7 @@
<%= i.nickname %>
</a>
</td>
<td><b><%= i.mmr.toFixed(3) %></b></td>
<td class="monospace-big"><%= i.mmr.toFixed(3) %></td>
<!--
<td><%= i.mu.toFixed(3) %></td>
<td><%= i.sigma.toFixed(3) %></td>
Expand Down
10 changes: 5 additions & 5 deletions views/user.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
</tr>
<tr>
<td>MMR:</td>
<td>
<b><%= teamData.mmr.toFixed(6) %></b>
<td class="monospace-big">
<%= teamData.mmr.toFixed(6) %>
</td>
</tr>
<tr>
<td>MMR (FFA):</td>
<td>
<b><%= ffaData.mmr.toFixed(6) %></b>
<td class="monospace-big">
<%= ffaData.mmr.toFixed(6) %>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -72,7 +72,7 @@
<% matches.forEach(match => { %>
<tr>
<td style="min-width: 150px;"><%= match.date %></td>
<td style="font-family: monospace;"><%= match.prev_mmr %></td>
<td class="monospace-big"><%= match.prev_mmr %></td>
<td style="min-width: 200px; max-width: 400px; white-space: normal;"><%- match.description %></td>
</tr>
<% }); %>
Expand Down

0 comments on commit de52563

Please sign in to comment.