Facts you learn as you play (SkyCash): tips priced from the live IAP catalog on the lobby, run-over and chapter-cleared cards; Level up on InstantAdPay button in the lobby

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-30 15:35:32 -05:00
parent a4d6597f9a
commit 83da8c33f2
4 changed files with 50 additions and 6 deletions
+5
View File
@@ -76,6 +76,7 @@ canvas#game{position:absolute;inset:0;width:100%;height:100%;display:block;touch
.buy.no{opacity:.4;pointer-events:none}
.led{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:var(--ink2);padding:7px 2px;border-top:1px solid var(--line)}.led:first-child{border-top:0}.led .m{font:700 12px var(--mono);color:var(--gold);white-space:nowrap}.led .m.ok{color:var(--ok)}.led .m.neg{color:var(--sig)}.led a{color:var(--cyan2)}
.prog{height:8px;background:rgba(255,255,255,.08);border-radius:4px;overflow:hidden;margin-top:8px}.prog i{display:block;height:100%;background:linear-gradient(90deg,var(--cyan),var(--gold));box-shadow:0 0 10px rgba(255,194,75,.5)}
.tip{margin:12px 0 0;padding:10px 12px;border-radius:10px;background:rgba(34,211,238,.07);border:1px solid rgba(34,211,238,.25);font-size:12px;line-height:1.45;color:var(--ink2);text-align:left}.tip b{display:block;font:700 9px var(--body);letter-spacing:.16em;text-transform:uppercase;color:var(--cyan);margin-bottom:3px}
.toast{position:absolute;left:50%;bottom:calc(70px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:20;background:var(--panel2);border:1px solid var(--line);color:var(--ink);font-size:12px;padding:8px 12px;border-radius:10px;opacity:0;transition:opacity .2s;pointer-events:none;max-width:92%;text-align:center}
.toast.on{opacity:1}
.tapdesk{position:absolute;bottom:calc(14px + env(safe-area-inset-bottom,0px));left:14px;z-index:5;font:600 10px var(--body);letter-spacing:.14em;text-transform:uppercase;color:var(--muted);pointer-events:none}
@@ -105,8 +106,10 @@ canvas#game{position:absolute;inset:0;width:100%;height:100%;display:block;touch
<div class="stat"><small>Balance</small><b class="ok" id="lPol">0.000</b></div>
</div>
<div class="pool" id="lPool"></div>
<div class="tip" id="lTip" hidden></div>
<button class="btn" id="bPlay" type="button">Play</button>
<div class="row2"><button class="btn ghost" id="bHangar" type="button">Hangar</button><button class="btn ghost" id="bBalance" type="button">Balance</button></div>
<a class="btn gold" id="bLevel" href="https://instantadpay.com/my#buy" style="text-decoration:none;text-align:center;font-size:13px;padding:11px">Level up on InstantAdPay</a>
<div class="member" id="lMember"><i></i>connecting…</div>
<div class="member" style="margin-top:6px"><a id="lIap" href="https://instantadpay.com/my" style="color:var(--muted)">InstantAdPay dashboard</a> · <a href="/" style="color:var(--muted)">tester briefing</a></div>
</div>
@@ -117,12 +120,14 @@ canvas#game{position:absolute;inset:0;width:100%;height:100%;display:block;touch
<div class="ov" id="ovClear" hidden><div class="card">
<div class="eyebrow" id="cEyebrow">Chapter cleared</div><h2 id="cTitle">Banked 20 drips</h2>
<div class="big" id="cBig">+0.010<small>POL</small></div><p id="cText"></p><span class="chip ok" id="cChip"></span>
<div class="tip" id="cTip" hidden></div>
<button class="btn gold" id="bNext" type="button">Next chapter</button><button class="btn ghost" id="bLobby1" type="button">Back to lobby</button>
</div></div>
<div class="ov" id="ovOver" hidden><div class="card">
<div class="eyebrow" id="oEyebrow">Out of fuel</div><h2 id="oTitle">Run over</h2><p id="oText"></p>
<button class="btn sig" id="bRefuel" type="button">Refuel · sponsor page</button><span class="chip sig" id="oChip">verified visit on InstantAdPay · pays your fuel</span>
<div class="tip" id="oTip" hidden></div>
<div class="row2"><button class="btn ghost" id="bRestart" type="button">Restart</button><button class="btn ghost" id="bLobby2" type="button">Lobby</button></div>
</div></div>
+6 -5
View File
@@ -6,7 +6,8 @@ var $ = function (id) { return document.getElementById(id); };
var canvas = $('game'), ctx = canvas.getContext('2d');
var W = 390, H = 760, DPR = 1, floorY = H - DRSpawn.FLOOR;
var player = { x: 100, y: 300, vy: 0, r: 13, tilt: 0 };
var ME = null, P = null, BAL = null, POOL = null, IAP = 'https://instantadpay.com';
var ME = null, P = null, BAL = null, POOL = null, IAP = 'https://instantadpay.com', TIPS = [], tipAt = Math.floor(Math.random() * 97);
function tip(id) { var el = $(id); if (!TIPS.length) { el.hidden = true; return; } var t = TIPS[tipAt++ % TIPS.length]; el.innerHTML = '<b>Did you know</b>' + esc(t); el.hidden = false; } // rotates through the facts
var R = null; // the live run
var muted = false; try { muted = localStorage.getItem('dr.muted') === '1'; } catch (e) {}
@@ -43,12 +44,12 @@ var hudCache = {}; function setHud() { if (!R) return; var v = { d: R.drips, c:
function f3(n) { return Number(n || 0).toFixed(3); }
/* ---------- lobby / me ---------- */
function loadMe() { return api('/api/me').then(function (r) { if (r._status !== 200) throw r; ME = r.me; P = r.player; BAL = r.balance; POOL = r.pool; IAP = r.iap || IAP; return r; }); }
function loadMe() { return api('/api/me').then(function (r) { if (r._status !== 200) throw r; ME = r.me; P = r.player; BAL = r.balance; POOL = r.pool; IAP = r.iap || IAP; TIPS = r.tips || []; return r; }); }
function lobby() {
R = null; $('hud').classList.remove('on'); $('tapdesk').hidden = true;
$('lChap').textContent = P.chapter; $('lDrips').textContent = P.bank.toLocaleString(); $('lPol').textContent = f3(BAL.unpaid);
$('lPool').innerHTML = 'POL pool <b>' + f3(POOL.available) + '</b> · today’s cap left <b>' + f3(POOL.capLeft) + '</b> · a chapter drip is <b>' + f3(POOL.dripPol) + '</b>';
$('lIap').href = IAP + '/my';
$('lIap').href = IAP + '/my'; $('bLevel').href = IAP + '/my#buy'; tip('lTip');
$('lMember').innerHTML = '<i class="' + (ME.wallet ? '' : 'no') + '"></i>InstantAdPay · ' + (ME.username ? '@' + ME.username : '#' + ME.memberId) + ' · ' + (ME.wallet ? ME.wallet.slice(0, 6) + '…' + ME.wallet.slice(-4) : 'no wallet on file');
show('ovLobby');
}
@@ -110,7 +111,7 @@ function update(dt) {
function crash(x, y) { sfx.crash(); burst(x, y, 36, '255,59,122', 260); burst(x, y, 14, '255,255,255', 160); R.shake = .5; over('Courier hit', 'A bot got you.'); }
function over(title, why) {
R.paused = true; flush(false);
setTimeout(function () { if (!R) return; $('oEyebrow').textContent = title; $('oTitle').textContent = 'Run over at ' + R.drips; $('oText').textContent = why + ' Refuel with a sponsor visit and keep this run, drips and chapter progress intact.'; $('bRefuel').hidden = false; $('oChip').hidden = false; show('ovOver'); }, 450);
setTimeout(function () { if (!R) return; $('oEyebrow').textContent = title; $('oTitle').textContent = 'Run over at ' + R.drips; $('oText').textContent = why + ' Refuel with a sponsor visit and keep this run, drips and chapter progress intact.'; $('bRefuel').hidden = false; $('oChip').hidden = false; tip('oTip'); show('ovOver'); }, 450);
}
function cleared() {
R.paused = true; pill('Verifying…');
@@ -124,7 +125,7 @@ function cleared() {
var why = { paid: 'First clear, verified. Added to your game balance.', replay: c.first ? 'Verified.' : 'You cleared this one before. Only the first clear pays.', pool: 'The POL pool is empty right now. Refuel visits fill it, so this clear counts but pays nothing.', cap: 'Today’s pool cap is spent. Chapter counts, no POL today.', flagged: 'This run was flagged by the server check, so it pays nothing.' };
$('cText').textContent = why[c.reason] || ''; $('cChip').className = 'chip ' + (c.pol ? 'ok' : 'sig'); $('cChip').textContent = (c.pol ? 'verified' : c.reason) + ' · ' + tm + ' play time';
R.chapter = c.next; R.goal = c.nextGoal; R.chapDrips = 0; if (r.pool != null) POOL.available = r.pool;
setTimeout(function () { show('ovClear'); }, 500);
tip('cTip'); setTimeout(function () { show('ovClear'); }, 500);
});
}
$('bNext').addEventListener('click', function () { if (!R) return; R.paused = false; R.inv = 1.5; hideAll(); });