Weekly prizes: top three of the Monday-to-Sunday Central week with 10+ finds get 3/2/1 POL as due prize drips (never finds, never against the pool), awarded once on the first tick after Sunday; Top Hunter badge; /api/prizes + winners on /leaders; admin award-by-hand
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+12
-1
@@ -21,10 +21,17 @@
|
||||
<section class="section" style="padding-top:14px">
|
||||
<h2>Leaderboard</h2>
|
||||
<div class="sub">Most finds wins. Ties go to the most POL, then to whoever got there first.</div>
|
||||
<div class="notice" id="prizes" style="margin:12px 0"></div>
|
||||
<div class="tabs" id="tabs"><button class="tab on" data-p="week">This week</button><button class="tab" data-p="month">This month</button><button class="tab" data-p="all">All time</button></div>
|
||||
<div class="notice" id="mine" style="display:none;margin:12px 0"></div>
|
||||
<div class="ledger" id="rows"><div class="row"><span class="site">Loading…</span></div></div>
|
||||
<p class="small" style="margin-top:14px">Weeks are the last seven days, Central time. The company account is not listed.</p>
|
||||
<p class="small" style="margin-top:14px">Weeks run Monday to Sunday, Central time. The company account is not listed.</p>
|
||||
</section>
|
||||
|
||||
<section class="section" id="winners" style="display:none">
|
||||
<h2>Last week’s winners</h2>
|
||||
<div class="sub" id="winsub"></div>
|
||||
<div class="ledger" id="winrows"></div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
@@ -51,6 +58,10 @@
|
||||
else if (me) { document.getElementById('mine').style.display = 'block'; document.getElementById('mine').innerHTML = 'You are not on this board yet. One find puts you on it. <a href="/app">Open your board</a>.'; }
|
||||
}
|
||||
document.querySelectorAll('.tab').forEach(t => t.addEventListener('click', () => show(t.dataset.p)));
|
||||
try { const pz = await (await fetch('/api/prizes')).json(); const pol = pz.rules.pol;
|
||||
document.getElementById('prizes').innerHTML = '<b>Weekly prizes:</b> ' + pol.map((v, i) => medal(i + 1) + ' ' + v + ' POL').join(' \u00b7 ') + ' for the top ' + pol.length + ' with ' + pz.rules.minFinds + '+ finds. Paid to your wallet Monday after midnight Central. Weekly #1 also earns the Top Hunter badge.';
|
||||
if (pz.last && pz.last.winners.length) { document.getElementById('winners').style.display = 'block'; document.getElementById('winsub').textContent = 'Week of ' + pz.last.week + '.'; document.getElementById('winrows').innerHTML = pz.last.winners.map(w => '<div class="row lb"><span><b class="num">' + medal(w.rank) + '</b> ' + esc(w.who) + '</span><span class="site">' + w.finds + ' finds</span><span class="pol">+' + w.prizePol + ' POL prize</span></div>').join(''); }
|
||||
} catch (e) {}
|
||||
const b = await (await fetch('/api/badges')).json();
|
||||
document.getElementById('badges').innerHTML = b.badges.map(x => '<div class="card"><div style="font-size:34px">' + x.icon + '</div><h3>' + esc(x.name) + '</h3><p>' + esc(x.why) + '</p>' + (me && me.badges && me.badges.some(y => y.id === x.id) ? '<p style="margin-top:8px"><span class="tag done">Earned</span></p>' : '') + '</div>').join('');
|
||||
show('week');
|
||||
|
||||
Reference in New Issue
Block a user