feat: add ELO refresh job to GitLab CI and polish mobile display
- Add refresh-elo job to .gitlab-ci.yml triggered by schedules; runs the Python scraper and commits updated elo-data.json back to main - Hide Stat-Check ELO column header on mobile (sm:hidden), fold ELO score as a subtitle under ITC Points on mobile instead Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+8
-8
@@ -304,6 +304,8 @@ function render(state) {
|
||||
// Rows
|
||||
applySort(kept).forEach((r, i) => {
|
||||
const u = r.user || {}, name = fullName(u) || u.nickname || "Unknown";
|
||||
const uid = r.userId || r.user?.id;
|
||||
const eloMatch = findElo(name, uid);
|
||||
const tr = document.createElement("tr");
|
||||
tr.innerHTML =
|
||||
`<td class="font-mono text-base-content/60">${i === 0 ? `<strong class="text-base-content">1</strong>` : (i + 1)}</td>` +
|
||||
@@ -312,7 +314,6 @@ function render(state) {
|
||||
`<span class="block text-xs opacity-40 sm:hidden"><span class="text-success">${r.wins || 0}</span>–<span class="text-error">${r.losses || 0}</span>–${r.ties || 0} · ITC #${r.placing ?? "—"}</span>` +
|
||||
`</td>` +
|
||||
(() => {
|
||||
const uid = r.userId || r.user?.id;
|
||||
const d = uid && careerData[uid];
|
||||
const careerSub = d == null
|
||||
? `<span class="block text-xs opacity-20">…</span>`
|
||||
@@ -323,8 +324,9 @@ function render(state) {
|
||||
: (d.w + d.l + d.t) === 0 ? ''
|
||||
: `<span class="block text-xs opacity-40">${fmtWpct(d.w, d.l, d.t)} career</span>`;
|
||||
const mobilePct = `<span class="block text-xs opacity-40 sm:hidden">${fmtWpct(r.wins, r.losses, r.ties)} win rate</span>`;
|
||||
const mobileElo = eloMatch ? `<span class="block text-xs opacity-40 sm:hidden">ELO ${Math.round(eloMatch.elo)}</span>` : '';
|
||||
return `<td class="text-right font-mono font-bold">${fmtPts(r.ITCPoints)}` +
|
||||
mobilePct + `</td>` +
|
||||
mobilePct + mobileElo + `</td>` +
|
||||
`<td class="text-right font-mono hidden sm:table-cell">` +
|
||||
`<span class="text-success">${r.wins || 0}</span>–<span class="text-error">${r.losses || 0}</span>–${r.ties || 0}` +
|
||||
careerSub + `</td>` +
|
||||
@@ -333,11 +335,9 @@ function render(state) {
|
||||
})() +
|
||||
`<td class="text-right font-mono text-base-content/40 hidden sm:table-cell">#${r.placing ?? "—"}</td>` +
|
||||
(() => {
|
||||
const uid = r.userId || r.user?.id;
|
||||
const e = findElo(fullName(r.user || {}), uid);
|
||||
if (e === undefined) return `<td class="text-center font-mono"><span class="opacity-20">…</span></td>`;
|
||||
if (!e) return `<td class="text-center font-mono text-base-content/40">—</td>`;
|
||||
return `<td class="text-center font-mono">${Math.round(e.elo)}</td>`;
|
||||
if (eloMatch === undefined) return `<td class="text-center font-mono hidden sm:table-cell"><span class="opacity-20">…</span></td>`;
|
||||
if (!eloMatch) return `<td class="text-center font-mono text-base-content/40 hidden sm:table-cell">—</td>`;
|
||||
return `<td class="text-center font-mono hidden sm:table-cell">${Math.round(eloMatch.elo)}</td>`;
|
||||
})();
|
||||
tb.appendChild(tr);
|
||||
});
|
||||
@@ -406,7 +406,7 @@ function showSkeleton() {
|
||||
`<td class="hidden sm:table-cell"><div class="skeleton h-4 w-14 ml-auto"></div></td>` +
|
||||
`<td class="hidden sm:table-cell"><div class="skeleton h-4 w-12 ml-auto"></div></td>` +
|
||||
`<td class="hidden sm:table-cell"><div class="skeleton h-4 w-10 ml-auto"></div></td>` +
|
||||
`<td><div class="skeleton h-4 w-12 mx-auto"></div></td>`;
|
||||
`<td class="hidden sm:table-cell"><div class="skeleton h-4 w-12 mx-auto"></div></td>`;
|
||||
tb.appendChild(tr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user