Skip to content

Commit 8831f6f

Browse files
feat: display totalSolved in leaderboard UI (#99)
* feat: display totalSolved in leaderboard UI * formatting
1 parent 240d5da commit 8831f6f

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

frontend/leaderboard.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ <h1 class="page-title">Leaderboard</h1>
105105
<div class="easy">Easy</div>
106106
<div class="medium">Medium</div>
107107
<div class="hard">Hard</div>
108+
<div class="total">Total</div>
108109
<div class="score-header">
109110
Score
110111
<div class="tooltip-container">
@@ -428,6 +429,7 @@ <h1 class="page-title">Leaderboard</h1>
428429
<div class="easy">${user.data.easySolved}</div>
429430
<div class="medium">${user.data.mediumSolved}</div>
430431
<div class="hard">${user.data.hardSolved}</div>
432+
<div class="total">${user.data.totalSolved}</div>
431433
<div class="mobile-score tooltip-score">
432434
<span>${user.score}</span>
433435
<span class="score-caret"></span>
@@ -441,6 +443,9 @@ <h1 class="page-title">Leaderboard</h1>
441443
<div>
442444
Hard: ${user.data.hardSolved} × ${hardPoints} = ${hardScore}
443445
</div>
446+
<div>
447+
Questions Solved: ${user.data.totalSolved}
448+
</div>
444449
<hr>
445450
<div>
446451
<strong>Total: ${user.score}</strong>
@@ -468,6 +473,9 @@ <h1 class="page-title">Leaderboard</h1>
468473
<div>
469474
Hard: ${user.data.hardSolved} × ${hardPoints} = ${hardScore}
470475
</div>
476+
<div>
477+
Questions Solved: ${user.data.totalSolved}
478+
</div>
471479
<hr>
472480
<div>
473481
<strong>Total: ${user.score}</strong>
@@ -500,6 +508,10 @@ <h1 class="page-title">Leaderboard</h1>
500508
<div class="mobile-stat-number hard">${user.data.hardSolved}</div>
501509
<div class="mobile-stat-label">Hard</div>
502510
</div>
511+
<div class="mobile-stat">
512+
<div class="mobile-stat-number total">${user.data.totalSolved}</div>
513+
<div class="mobile-stat-label">Total</div>
514+
</div>
503515
</div>
504516
`;
505517
mobileCards.appendChild(card);

frontend/styles/main.css

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ body::after {
818818

819819
.leaderboard-header {
820820
display: grid;
821-
grid-template-columns: 55px 1fr 170px 65px 65px 65px 85px;
821+
grid-template-columns: 55px 1fr 170px 65px 65px 65px 85px 85px;
822822
padding: 0.7rem 1.25rem;
823823
background: var(--bg-raised);
824824
font-weight: 700;
@@ -834,7 +834,7 @@ body::after {
834834

835835
.leaderboard-row {
836836
display: grid;
837-
grid-template-columns: 55px 1fr 170px 65px 65px 65px 85px;
837+
grid-template-columns: 55px 1fr 170px 65px 65px 65px 85px 85px;
838838
padding: 0.6rem 1.25rem;
839839
border-bottom: 1px solid var(--border);
840840
transition: background 0.1s ease;
@@ -1008,6 +1008,7 @@ body::after {
10081008
justify-content: space-between;
10091009
align-items: center;
10101010
margin-bottom: 0.5rem;
1011+
gap: 12px;
10111012
}
10121013

10131014
.mobile-rank {
@@ -1021,13 +1022,20 @@ body::after {
10211022
font-weight: 700;
10221023
color: var(--amber);
10231024
text-shadow: 0 0 6px rgba(255, 176, 0, 0.3);
1025+
white-space: nowrap !important;
1026+
display: inline-flex;
1027+
align-items: center;
1028+
justify-content: flex-end;
1029+
gap: 6px;
10241030
}
10251031

10261032
.mobile-name {
10271033
font-size: 1rem;
10281034
font-weight: 600;
10291035
margin-bottom: 0.2rem;
10301036
color: var(--text);
1037+
word-break: break-word;
1038+
overflow-wrap: break-word;
10311039
}
10321040

10331041
.mobile-username {
@@ -1622,8 +1630,8 @@ body::after {
16221630

16231631
@media (max-width: 768px) {
16241632
.score-tooltip {
1625-
left: auto;
1626-
right: 0;
1633+
left: auto !important;
1634+
right: -10px !important;
16271635
/* left: 50%; */
16281636
transform: translateX(0%);
16291637
white-space: normal;
@@ -2183,7 +2191,7 @@ body::-webkit-scrollbar-thumb {
21832191
.tooltip-score {
21842192
position: relative;
21852193
cursor: pointer;
2186-
display: inline-flex;
2194+
display: inline-flex !important;
21872195
/* key fix */
21882196
width: fit-content;
21892197
align-items: center;
@@ -2192,6 +2200,7 @@ body::-webkit-scrollbar-thumb {
21922200
color: #ffffff;
21932201
font-weight: 700;
21942202
text-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
2203+
flex-shrink: 0;
21952204
}
21962205

21972206
.score-tooltip {

0 commit comments

Comments
 (0)