Weekly prize pot (Marty 2026-11-13): 10% of the week's sales, $20 floor topped up by the company, $50 cap kept internal; half per leaderboard, split 50/30/20; leaderboard page shows the live pot, never the cap; smoke 100/100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 15:42:03 -06:00
parent 832395daa4
commit cb77582926
6 changed files with 22 additions and 9 deletions
+2 -1
View File
@@ -2,12 +2,13 @@
(async function () {
VBB.renderNav('/leaders'); VBB.renderFooter();
const $ = VBB.$, esc = VBB.esc;
// weekly prizes from config (Marty 2026-11-13): displayed only, no payout code yet
// weekly prize pot (Marty 2026-11-13): grows with sales from a floor; displayed only, no payout code yet
const c = await VBB.getConfig().catch(() => ({}));
const pz = c.prizes || {}; const place = ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th'];
const plist = (title, arr) => '<div><h3>' + title + '</h3><ul class="pk-list">' + arr.map((v, i) => '<li>' + place[i] + ': $' + VBB.n(v) + ' in POL</li>').join('') + '</ul></div>';
if ((pz.visitors || []).length || (pz.sources || []).length) {
$('pz').innerHTML = ((pz.visitors || []).length ? plist('Most visitors sent', pz.visitors) : '') + ((pz.sources || []).length ? plist('Most traffic sources', pz.sources) : '');
if (pz.pot) $('potLbl').textContent = 'Prize pot this week: ' + (pz.atFloor ? 'at least ' : '') + '$' + VBB.n(pz.pot) + ', and it grows with sales. Half goes to each leaderboard, paid in POL to the top three (dollar value, converted to POL).';
$('prizes').hidden = false;
}
const d = await VBB.getJSON('/api/leaders');
+1 -1
View File
@@ -27,7 +27,7 @@
<body>
<main class="wrap">
<section class="hero"><div class="eyebrow"><i></i>This week</div><h1>Weekly leaderboards</h1><p class="lead" id="weekLbl">Monday to Sunday, Central time. Only verified visitors count: a real browser, on the page a few seconds, once a day per visitor.</p></section>
<div class="card" id="prizes" hidden><h2>Weekly prizes</h2><p class="muted small">Paid in POL to the top three on each leaderboard for the week (dollar value, converted to POL).</p><div class="pz" id="pz"></div></div>
<div class="card" id="prizes" hidden><h2>Weekly prizes</h2><p class="muted small" id="potLbl">Paid in POL to the top three on each leaderboard for the week (dollar value, converted to POL).</p><div class="pz" id="pz"></div></div>
<div class="card"><h2>Most visitors sent</h2><div class="scroll" id="lbVisitors"></div></div>
<div class="card"><h2>Most traffic sources</h2><p class="muted small">Different websites your visitors came from (the referring site), so spreading your link widely counts.</p><div class="scroll" id="lbSources"></div></div>
<div id="status" class="note" hidden></div>