Friday Bonus Hunts: extra Friday hunts banked on InstantAdPay

lib/fridaybank.js asks InstantAdPay (HMAC with HUNT_SSO_SECRET, 3-minute
cache) how many days Sat-Thu the hunter opened an inbox ad and watched a
video. On Friday that many extra hunts are added to the daily limit, capped at
live missions minus the normal three so every bonus has a mission to hunt.
If InstantAdPay can't be reached the bonus is 0: it never grants hunts it could
not verify. The board shows the week's chips and today's steps; the done-for-
today overlay now points at banking. dailyMsg counts past five.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-26 15:22:23 -05:00
parent 7bdb1c2c6a
commit b9e0e40a93
5 changed files with 547 additions and 462 deletions
+2 -1
View File
@@ -19,6 +19,7 @@
<h2>Your missions</h2>
<div class="sub" id="rangeLine">Each find pays a random drip. Your codes are yours alone.</div>
<div id="refSlot"></div>
<div id="fbank" hidden style="margin:12px 0 16px;padding:14px 16px;border-radius:16px;border:1px solid var(--edge-hi);background:rgba(130,71,229,.12)"></div>
<div class="grid" id="missions"><div class="card"><p>Loading your board…</p></div></div>
</section>
@@ -47,6 +48,6 @@
<footer class="foot">Rewards are for completed missions, not income. The daily pool is limited; when it is spent, claims close until midnight Central. Cryptocurrency involves risk of loss.</footer>
</div>
<div class="modal" id="shareModal" hidden><div class="modal-card"><button class="modal-x" id="shareClose" type="button" aria-label="Close">×</button><div id="shareBody"></div></div></div>
<script src="/app.js?v=18"></script>
<script src="/app.js?v=19"></script>
</body>
</html>
+23 -1
View File
@@ -149,6 +149,7 @@
}
watchPaid(); if (seenLedger === null) watchLedger();
doneNudge(board.daily);
fridayCard(board.fridayBank);
const dl = board.daily; if (dl && $('rangeLine')) $('rangeLine').innerHTML = ($('rangeLine').textContent.replace(/\s*·\s*You have.*$/, '')) + ' \u00b7 ' + (dl.left ? 'You have <b>' + dl.left + ' of ' + dl.limit + '</b> missions left today.' : '<b>That is your ' + dl.limit + ' for today.</b> Fresh missions at midnight Central.');
$('mine').innerHTML = board.drips.length ? board.drips.map(d => '<div class="row"><span>' + esc(d.site) + '</span><span class="site">' + ({ paid: 'paid', sent: 'sending', due: 'paying next', queued: 'queued for the next pool', failed: 'held, being looked at' }[d.status] || d.status) + '</span><span class="pol">+' + d.pol + ' POL</span>' + (d.tx ? '<a class="when" target="_blank" rel="noopener" href="' + explorer + '/tx/' + d.tx + '">verify ↗</a>' : '<span class="when"></span>') + '</div>').join('')
: '<div class="row"><span class="site">Nothing yet. Your first find goes here.</span></div>';
@@ -169,7 +170,7 @@
+ '<button type="button" data-x aria-label="Close" style="position:absolute;top:10px;right:12px;background:none;border:0;color:var(--muted);font-size:26px;line-height:1;cursor:pointer">&times;</button>'
+ '<div style="font:700 12px var(--font);letter-spacing:.14em;text-transform:uppercase;color:var(--ok)">All ' + dl.done + ' missions done today</div>'
+ '<h2 id="phDoneH" style="margin:8px 0 10px;font:700 23px/1.25 var(--font)">Nice hunting. Keep earning on InstantAdPay.</h2>'
+ '<p style="margin:0 0 16px;color:var(--muted);line-height:1.55">New missions open at midnight Central. Until then, view ads on InstantAdPay to earn ad credits, then put them to work: run your own ad, or grab an ad package that pays your sponsor line on-chain.</p>'
+ '<p style="margin:0 0 16px;color:var(--muted);line-height:1.55">New missions open at midnight Central. Until then, head to InstantAdPay: <b>open an inbox ad and watch a video</b> to bank an extra hunt for Friday, and earn ad credits while you are there.</p>'
+ '<div style="display:flex;flex-wrap:wrap;gap:10px">'
+ '<a class="btn" href="https://instantadpay.com/my#earn">Earn ad credits</a>'
+ '<a class="btn ghost" href="https://instantadpay.com/my#buy">See ad packages</a></div></div>';
@@ -180,6 +181,27 @@
document.body.appendChild(w);
try { w.querySelector('[data-x]').focus(); } catch (e) {}
}
// Friday Bonus Hunts (2026-09-26): banked on InstantAdPay Sat-Thu, used here on Friday.
function fridayCard(fb) {
const el = $('fbank'); if (!el) return;
if (!fb || !fb.available) { el.hidden = true; return; }
const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
const wd = d => WD[new Date(d + 'T12:00:00Z').getUTCDay()];
const chips = (fb.days || []).map(d => {
const c = d.banked ? 'var(--ok)' : d.day === fb.today ? 'var(--gold)' : 'var(--edge)';
return '<span style="display:inline-block;margin:0 6px 6px 0;padding:3px 10px;border-radius:999px;border:1px solid ' + c + ';font-size:13px">' + (d.banked ? '&#10003; ' : '') + wd(d.day) + '</span>';
}).join('');
const t = (fb.days || []).find(d => d.day === fb.today);
let line;
if (fb.isFriday) line = fb.bonus ? '<b>It is Friday: +' + fb.bonus + ' bonus hunt' + (fb.bonus === 1 ? '' : 's') + ' today</b> from the days you banked.' : 'It is Friday. Bank hunts Saturday through Thursday on InstantAdPay for next Friday.';
else if (t && t.banked) line = '&#10003; <b>Today is banked.</b> Come back tomorrow for another.';
else line = 'Bank today: on InstantAdPay, <b>watch one video</b>' + (t && !t.soloNeeded ? '' : ' and <b>open one inbox ad</b>') + '. <a href="https://instantadpay.com/my#earn">Go bank it</a>';
const capNote = fb.banked > fb.usable ? ' <span class="small" style="color:var(--muted)">(' + fb.usable + ' usable: one per open mission)</span>' : '';
el.innerHTML = '<div style="font:700 12px var(--font);letter-spacing:.12em;text-transform:uppercase;color:var(--pol-hi)">Friday Bonus Hunts</div>'
+ '<div style="margin:6px 0 8px;font-size:15px"><b>' + fb.banked + '</b> banked for Friday' + capNote + '</div>'
+ '<div>' + chips + '</div><div style="font-size:14px;color:var(--muted)">' + line + '</div>';
el.hidden = false;
}
let explorer = 'https://polygonscan.com';
async function load() { board = await api('/api/my/board'); render(); }
async function start(id) {