Files
loot-hunt/src/views/leaderboard/global.ejs
Mike Johnston ea537ff293
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 29s
feat: add display name functionality for users and update related views
2026-03-20 12:58:30 -04:00

43 lines
1.4 KiB
Plaintext

<%- include('../partials/header') %>
<div class="container">
<h1 style="margin-bottom: 1.5rem;">&#x1F3C6; Global Leaderboard</h1>
<% if (leaderboard.length === 0) { %>
<div class="card" style="text-align: center; padding: 3rem;">
<p style="color: var(--muted);">No scans recorded yet. Start hunting!</p>
</div>
<% } else { %>
<div class="card">
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Rank</th>
<th>Player</th>
<th>Points</th>
<th>Packages Found</th>
</tr>
</thead>
<tbody>
<% leaderboard.forEach((entry, i) => { %>
<% const rank = (typeof offset !== 'undefined' ? offset : 0) + i + 1; %>
<tr>
<td class="rank-cell rank-<%= rank %>">
<% if (rank === 1) { %>&#x1F947;<% } else if (rank === 2) { %>&#x1F948;<% } else if (rank === 3) { %>&#x1F949;<% } else { %><%= rank %><% } %>
</td>
<td><strong><a href="/player/<%= entry.username %>"><%= entry.display_name %></a></strong></td>
<td><span class="points-badge"><%= entry.total_points %></span></td>
<td><%= entry.scans %></td>
</tr>
<% }) %>
</tbody>
</table>
</div>
</div>
<%- include('../partials/pagination') %>
<% } %>
</div>
<%- include('../partials/footer') %>