Skip to content

Commit 22608e0

Browse files
author
Dexter
committed
fix: remove $ prefix from locked score (show as plain number) + fix leaderboard row alignment (clean 2-row grid, hidden sparkline)
1 parent 2f7e360 commit 22608e0

3 files changed

Lines changed: 21 additions & 29 deletions

File tree

fandom.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<meta name="twitter:description" content="Every Moment is real. Every collector is real. Every connection is on-chain." />
1616
<meta name="twitter:image" content="https://fandom-v3.vercel.app/og-default.png" />
1717
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='6' fill='%23ff2d4e'/%3E%3Ctext x='16' y='22' font-family='Arial Black' font-size='18' font-weight='900' text-anchor='middle' fill='white'%3ETS%3C/text%3E%3C/svg%3E" />
18-
<link rel="stylesheet" href="styles.css?v=20260627m10" />
18+
<link rel="stylesheet" href="styles.css?v=20260627m11" />
1919
<style>
2020
body { overflow-x: hidden; }
2121

@@ -247,6 +247,6 @@ <h2>Pick a player</h2>
247247
<!-- Both classic+defer to guarantee document-order execution: data-layer.js runs first
248248
and assigns window.DataLayer; fandom.js runs second and reads it. -->
249249
<script defer src="data-layer.js?v=20260627m6"></script>
250-
<script defer src="fandom.js?v=20260627m10"></script>
250+
<script defer src="fandom.js?v=20260627m11"></script>
251251
</body>
252252
</html>

fandom.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,13 @@
113113
if (v >= 1e3) return '$' + (v / 1e3).toFixed(1) + 'K';
114114
return '$' + Math.round(v);
115115
}
116-
function fmtLockedScore(cents) {
117-
if (!cents || cents <= 0) return '$0';
118-
const dollars = cents / 100;
119-
if (dollars >= 1e6) return '$' + (dollars / 1e6).toFixed(2) + 'M';
120-
if (dollars >= 1e3) return '$' + (dollars / 1e3).toFixed(1) + 'K';
121-
return '$' + Math.round(dollars).toLocaleString();
116+
function fmtLockedScore(score) {
117+
if (!score || score <= 0) return '0';
118+
// The atlas API returns score as an integer (summed ASP in cents).
119+
// The Top Shot app displays it as a plain number with commas — not currency.
120+
if (score >= 1e6) return (score / 1e6).toFixed(2) + 'M';
121+
if (score >= 1e3) return (score / 1e3).toFixed(1) + 'K';
122+
return Math.round(score).toLocaleString();
122123
}
123124
function shortAddr(a) { if (!a) return '—'; return a.length > 10 ? a.slice(0, 6) + '…' + a.slice(-4) : a; }
124125
function initials(name) { return (name || '').split(' ').map(p => p[0] || '').slice(0, 2).join('').toUpperCase(); }

styles.css

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,10 @@ details[open] .sig-expand::after { content: ''; }
442442
.lb-row {
443443
display: grid;
444444
grid-template-columns: 28px 36px 1fr auto;
445-
gap: 10px;
445+
grid-template-rows: auto 3px;
446+
gap: 8px 10px;
446447
align-items: center;
447-
padding: 9px 10px;
448+
padding: 10px 10px;
448449
border-radius: 8px;
449450
cursor: pointer;
450451
transition: background 0.12s ease;
@@ -460,6 +461,7 @@ details[open] .sig-expand::after { content: ''; }
460461
font-size: 18px;
461462
color: var(--fg-muted);
462463
text-align: center;
464+
grid-row: 1;
463465
}
464466
.lb-row:nth-child(1) .lb-rank { color: var(--accent-gold); font-size: 20px; }
465467
.lb-row:nth-child(2) .lb-rank { color: #d4d4d9; }
@@ -480,11 +482,12 @@ details[open] .sig-expand::after { content: ''; }
480482
font-weight: 800;
481483
font-size: 12px;
482484
color: #fff;
485+
grid-row: 1;
483486
}
484487
.lb-row:nth-child(1) .lb-avatar { border-color: var(--accent-gold); box-shadow: 0 0 12px rgba(245,184,64,0.5); }
485488
.lb-row:nth-child(2) .lb-avatar { border-color: #d4d4d9; }
486489
.lb-row:nth-child(3) .lb-avatar { border-color: #c58a53; }
487-
.lb-info { overflow: hidden; }
490+
.lb-info { overflow: hidden; grid-row: 1; }
488491
.lb-name {
489492
font-size: 13px;
490493
font-weight: 600;
@@ -502,14 +505,16 @@ details[open] .sig-expand::after { content: ''; }
502505
.lb-holdings {
503506
font-family: var(--hdr);
504507
font-weight: 800;
505-
font-size: 16px;
508+
font-size: 15px;
506509
color: var(--accent-teal);
507510
text-align: right;
511+
white-space: nowrap;
512+
grid-row: 1;
508513
}
509514
.lb-row:nth-child(1) .lb-holdings { color: var(--accent-gold); }
510515
.lb-bar {
511-
grid-column: 3 / 5;
512-
grid-row: 3;
516+
grid-column: 1 / 5;
517+
grid-row: 2;
513518
height: 3px;
514519
background: rgba(255,255,255,0.06);
515520
border-radius: 2px;
@@ -521,23 +526,9 @@ details[open] .sig-expand::after { content: ''; }
521526
background: linear-gradient(90deg, var(--accent-gold), var(--accent-teal));
522527
border-radius: 2px;
523528
}
524-
/* T1.10 — Leaderboard sparkline. Per-edition fingerprint for each collector. */
525529
.lb-spark-wrap {
526-
grid-column: 3 / 5;
527-
grid-row: 2;
528-
display: flex;
529-
align-items: center;
530-
justify-content: flex-end;
531-
margin-top: 3px;
532-
}
533-
.lb-spark {
534-
display: block;
535-
overflow: visible;
536-
filter: drop-shadow(0 0 2px rgba(0,0,0,0.45));
530+
display: none; /* hidden — sparkline was for per-edition holdings, less relevant with locked scores */
537531
}
538-
.lb-spark rect { transition: opacity 0.15s ease; }
539-
.lb-spark:hover rect { opacity: 0.9; }
540-
.lb-spark-empty rect { opacity: 0.35; }
541532

542533
/* Spotlight overlay — pride reveal */
543534
.spotlight-overlay {

0 commit comments

Comments
 (0)