Menu link back to InstantAdPay on every page; done-for-today nudge

Jim Watts: no return path to the InstantAdPay dashboard. A purple
"<- InstantAdPay" button now leads every PolHunter nav. And Marty: when a
hunter has used all of the day's missions, a one-per-day overlay sends them to
InstantAdPay to earn ad credits or buy an ad package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-26 09:10:01 -05:00
parent 1b4a6d5398
commit 7bdb1c2c6a
5 changed files with 268 additions and 239 deletions
+2 -2
View File
@@ -11,7 +11,7 @@
<div class="wrap"> <div class="wrap">
<header class="top"> <header class="top">
<a class="mark" href="/"><span class="coin"></span>PolHunter</a> <a class="mark" href="/"><span class="coin"></span>PolHunter</a>
<nav class="nav"><span class="pill" id="who"><i></i> …</span><a class="btn ghost sm" href="/leaders">Leaderboard</a><a class="btn ghost sm" href="/promo">Promo tools</a><a class="btn ghost sm" href="/logout">Sign out</a></nav> <nav class="nav"><span class="pill" id="who"><i></i> …</span><a class="btn pol sm" href="https://instantadpay.com/my" title="Back to your InstantAdPay dashboard">&larr; InstantAdPay</a><a class="btn ghost sm" href="/leaders">Leaderboard</a><a class="btn ghost sm" href="/promo">Promo tools</a><a class="btn ghost sm" href="/logout">Sign out</a></nav>
</header> </header>
<div class="standing" id="standing"></div> <div class="standing" id="standing"></div>
@@ -47,6 +47,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> <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>
<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> <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=17"></script> <script src="/app.js?v=18"></script>
</body> </body>
</html> </html>
+26
View File
@@ -148,12 +148,38 @@
$('copylink').onclick = () => copy($('mylink'), $('copylink')); $('copytext').onclick = () => copy($('sharetext'), $('copytext')); $('copylink').onclick = () => copy($('mylink'), $('copylink')); $('copytext').onclick = () => copy($('sharetext'), $('copytext'));
} }
watchPaid(); if (seenLedger === null) watchLedger(); watchPaid(); if (seenLedger === null) watchLedger();
doneNudge(board.daily);
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.'); 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('') $('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>'; : '<div class="row"><span class="site">Nothing yet. Your first find goes here.</span></div>';
document.querySelectorAll('[data-start]').forEach(b => b.addEventListener('click', () => start(b.dataset.start))); document.querySelectorAll('[data-start]').forEach(b => b.addEventListener('click', () => start(b.dataset.start)));
const s = $('submit'); if (s) { s.addEventListener('click', submit); $('code').addEventListener('keydown', e => { if (e.key === 'Enter') submit(); }); tick(); } const s = $('submit'); if (s) { s.addEventListener('click', submit); $('code').addEventListener('keydown', e => { if (e.key === 'Enter') submit(); }); tick(); }
} }
// Done for the day (Marty, 2026-09-26): once a hunter has used all of today's missions, send
// them back to InstantAdPay to keep earning. Shown once per Central-time day per browser.
function doneNudge(dl) {
if (!dl || dl.left > 0 || !dl.done) return;
const day = new Date().toLocaleDateString('en-CA', { timeZone: 'America/Chicago' });
try { if (localStorage.getItem('ph.doneNudge') === day) return; localStorage.setItem('ph.doneNudge', day); } catch (e) {}
if (document.getElementById('phDone')) return;
const w = document.createElement('div');
w.id = 'phDone'; w.setAttribute('role', 'dialog'); w.setAttribute('aria-modal', 'true'); w.setAttribute('aria-labelledby', 'phDoneH');
w.style.cssText = 'position:fixed;inset:0;z-index:500;background:rgba(8,6,20,.78);display:flex;align-items:center;justify-content:center;padding:18px;backdrop-filter:blur(3px)';
w.innerHTML = '<div style="position:relative;max-width:440px;width:100%;background:var(--bg2);border:1px solid var(--edge-hi);border-radius:20px;padding:26px 22px 22px;color:var(--ink);box-shadow:0 26px 70px rgba(0,0,0,.6)">'
+ '<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>'
+ '<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>';
const close = () => { w.remove(); document.removeEventListener('keydown', onKey); };
const onKey = e => { if (e.key === 'Escape') close(); };
w.addEventListener('click', e => { if (e.target === w || e.target.closest('[data-x]')) close(); });
document.addEventListener('keydown', onKey);
document.body.appendChild(w);
try { w.querySelector('[data-x]').focus(); } catch (e) {}
}
let explorer = 'https://polygonscan.com'; let explorer = 'https://polygonscan.com';
async function load() { board = await api('/api/my/board'); render(); } async function load() { board = await api('/api/my/board'); render(); }
async function start(id) { async function start(id) {
+1
View File
@@ -19,6 +19,7 @@
<header class="top"> <header class="top">
<a class="mark" href="/"><span class="coin"></span>PolHunter</a> <a class="mark" href="/"><span class="coin"></span>PolHunter</a>
<nav class="nav"> <nav class="nav">
<a class="btn pol sm" href="https://instantadpay.com/my" title="Back to your InstantAdPay dashboard">&larr; InstantAdPay</a>
<a class="btn ghost sm" href="#start">Get started</a> <a class="btn ghost sm" href="#start">Get started</a>
<a class="btn ghost sm" href="#how">How it works</a> <a class="btn ghost sm" href="#how">How it works</a>
<a class="btn ghost sm" href="/leaders">Leaderboard</a> <a class="btn ghost sm" href="/leaders">Leaderboard</a>
+1
View File
@@ -12,6 +12,7 @@
<header class="top"> <header class="top">
<a class="mark" href="/"><span class="coin"></span>PolHunter</a> <a class="mark" href="/"><span class="coin"></span>PolHunter</a>
<nav class="nav"> <nav class="nav">
<a class="btn pol sm" href="https://instantadpay.com/my" title="Back to your InstantAdPay dashboard">&larr; InstantAdPay</a>
<a class="btn ghost sm" href="/promo">Promo tools</a> <a class="btn ghost sm" href="/promo">Promo tools</a>
<a class="btn ghost sm" href="/#how">How it works</a> <a class="btn ghost sm" href="/#how">How it works</a>
<a class="btn sm" href="https://instantadpay.com/api/my/polhunter">Open my board</a> <a class="btn sm" href="https://instantadpay.com/api/my/polhunter">Open my board</a>
+1
View File
@@ -12,6 +12,7 @@
<header class="top"> <header class="top">
<a class="mark" href="/"><span class="coin"></span>PolHunter</a> <a class="mark" href="/"><span class="coin"></span>PolHunter</a>
<nav class="nav"> <nav class="nav">
<a class="btn pol sm" href="https://instantadpay.com/my" title="Back to your InstantAdPay dashboard">&larr; InstantAdPay</a>
<a class="btn ghost sm" href="/leaders">Leaderboard</a> <a class="btn ghost sm" href="/leaders">Leaderboard</a>
<a class="btn ghost sm" href="/#how">How it works</a> <a class="btn ghost sm" href="/#how">How it works</a>
<a class="btn sm" href="https://instantadpay.com/api/my/polhunter">Open my board</a> <a class="btn sm" href="https://instantadpay.com/api/my/polhunter">Open my board</a>