Ledger shows each payout's username (Marty 2026-11-09), linked only when the member has a Stack POL page; LinkSpin zone spots on the blog index, posts and ledger (one zone per screen size, the hidden size never loads)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-09 14:32:34 -06:00
parent ad546660b9
commit e53565051b
6 changed files with 27 additions and 19 deletions
+4 -4
View File
@@ -9,7 +9,7 @@ const http = require('http');
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const { SITE, esc, head, tail } = require('./layout');
const { SITE, esc, head, tail, ZONES, spot } = require('./layout');
const { PROGRAMS, BY_KEY, BY_SLUG } = require('./programs');
const blog = require('./blog');
@@ -44,7 +44,7 @@ function feature(p, ref) {
function ledgerRows(rows, showWho) {
if (!rows || !rows.length) return '<tr><td colspan="5" style="color:var(--muted)">The ledger fills in on the next refresh.</td></tr>';
return rows.map(r => { const p = BY_KEY[r.k] || { n: r.k, c: '#888' };
return '<tr><td class="pg" style="--c:' + p.c + '"><i></i>' + esc(p.n) + '</td>' + (showWho ? '<td class="who">' + (r.u ? '<a href="/' + esc(r.u) + '">@' + esc(r.u) + '</a>' : 'a member') + '</td>' : '') + '<td class="amt">' + fmt(r.pol) + ' POL</td><td class="when">' + when(r.ts) + '</td><td class="tx">' + (r.tx ? '<a href="https://polygonscan.com/tx/' + esc(r.tx) + '" target="_blank" rel="noopener">' + shortTx(r.tx) + ' ↗</a>' : '') + '</td></tr>'; }).join('');
return '<tr><td class="pg" style="--c:' + p.c + '"><i></i>' + esc(p.n) + '</td>' + (showWho ? '<td class="who">' + (r.u ? (r.pub ? '<a href="/' + esc(r.u) + '">@' + esc(r.u) + '</a>' : '@' + esc(r.u)) : 'a member') + '</td>' : '') + '<td class="amt">' + fmt(r.pol) + ' POL</td><td class="when">' + when(r.ts) + '</td><td class="tx">' + (r.tx ? '<a href="https://polygonscan.com/tx/' + esc(r.tx) + '" target="_blank" rel="noopener">' + shortTx(r.tx) + ' ↗</a>' : '') + '</td></tr>'; }).join('');
}
const tableHead = showWho => '<div class="tbl"><table><thead><tr><th>Program</th>' + (showWho ? '<th>Member</th>' : '') + '<th class="r">Amount</th><th>When</th><th>Polygon transaction</th></tr></thead><tbody>';
const heroVideo = '<aside class="vid"><div class="frame"><video id="hero" src="/stackpol-hero.mp4" poster="/stackpol-hero-poster.jpg" autoplay muted loop playsinline preload="metadata" aria-label="Coins stacking up as POL payouts arrive"></video><button class="snd" id="snd" type="button">Tap for sound</button></div>'
@@ -112,9 +112,9 @@ function programPage(p) {
function ledgerPage(k) {
const p = k && BY_KEY[k]; const rows = ((IDX && IDX.recent) || []).filter(r => !p || r.k === p.k);
let h = head({ title: (p ? p.n + ' Payout Ledger' : 'The POL Payout Ledger') + ': Every Payment on Polygon | Stack POL', desc: 'The latest POL payouts across the network' + (p ? ' from ' + p.n : '') + ', each linked to its Polygon transaction. Refreshed every 5 minutes.', path: p ? '/ledger?p=' + p.k : '/ledger', nav: '/ledger', noindex: !!p });
h += live() + '<section style="padding:20px 0 6px"><p class="kick">Public and checkable</p><h1>The payout ledger</h1><p class="lead">The latest ' + rows.length + ' payouts' + (p ? ' from ' + esc(p.n) : ' across the network') + '. Members who switched on their Stack POL page show by name; everyone else shows as "a member". Every row links to its transaction on Polygonscan.</p></section>';
h += live() + '<section style="padding:20px 0 6px"><p class="kick">Public and checkable</p><h1>The payout ledger</h1><p class="lead">The latest ' + rows.length + ' payouts' + (p ? ' from ' + esc(p.n) : ' across the network') + '. Each row shows the member it was paid to; members with a Stack POL page link to it. Every row links to its transaction on Polygonscan.</p></section>';
h += '<div class="ltools"><a class="chip" href="/ledger"' + (!p ? ' aria-current="page"' : '') + '>All</a>' + sortedProgs().map(x => '<a class="chip" href="/ledger?p=' + x.k + '"' + (p && p.k === x.k ? ' aria-current="page"' : '') + '>' + esc(x.n) + '</a>').join('') + '</div>';
h += tableHead(true) + ledgerRows(rows, true) + '</tbody></table></div>';
h += spot(ZONES.banner, ZONES.strip) + tableHead(true) + ledgerRows(rows, true) + '</tbody></table></div>' + spot(ZONES.ledgerBox, ZONES.ledgerBox);
return h + tail();
}
function stackPage(u, st) {