diff --git a/ads.js b/ads.js
index a82e12b..0d501bf 100644
Binary files a/ads.js and b/ads.js differ
diff --git a/public/assets/refuel.js b/public/assets/refuel.js
index 0376187..0e9bc5f 100644
--- a/public/assets/refuel.js
+++ b/public/assets/refuel.js
@@ -13,6 +13,7 @@
function ring() { $('rfN').textContent = left; $('rfRing').style.setProperty('--p', ((dwell - left) / dwell * 100) + '%'); }
function tick() {
if (document.hidden) return; // the timer only runs while the page is in front
+ var vid = document.getElementById('rfVideo'); if (vid && (vid.paused || vid.ended && left > 1)) return; // a video must actually be playing
left--; if (left > 0) return ring();
clearInterval(timer); ring(); $('rfHint').textContent = 'One quick check to count the visit:';
challenge();
@@ -38,8 +39,19 @@
api('/api/refuel/open?t=' + encodeURIComponent(tok)).then(function (r) {
if (r.error) return msg('Refuel link problem', esc(r.error));
if (r.done) { location.href = r.ret; return; }
- if (r.none) return msg(r.why === 'cap' ? 'That is today’s refuels' : 'No sponsor pages right now', r.why === 'cap' ? 'You have used today’s refuels. Your run and progress are saved, and refuels reopen at midnight Central. Your regular InstantAdPay visits are not affected.' : 'You have visited every sponsor page running right now, or none are running. Try again later: new packs start all the time.', r.ret + '&none=1');
+ if (r.none) return msg(r.why === 'cap' ? 'That is today’s refuels' : 'No sponsor pages right now', r.why === 'cap' ? 'You have used today’s refuels. Your run and progress are saved, and refuels reopen at midnight Central. Your regular InstantAdPay visits are not affected.' : 'You have used every sponsor page and video running right now. Try again later: new ones start all the time.', r.ret + '&none=1');
ret = r.ret; dwell = r.dwell || 8; left = Math.max(1, dwell - (r.elapsed || 0));
+ if (r.mode === 'video') { // no sponsor pages left: a member video ad instead
+ $('rfTitle').textContent = r.title || 'Member video'; $('rfUrl').textContent = 'video ad';
+ $('rfHint').textContent = 'You have visited every sponsor page running right now, so this refuel is a short member video. Keep it playing.';
+ var v = document.createElement('video'); v.id = 'rfVideo'; v.src = r.video.url; v.autoplay = true; v.muted = true; v.playsInline = true; v.setAttribute('playsinline', ''); v.loop = true; v.controls = false;
+ v.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000';
+ $('rfFrame').innerHTML = ''; $('rfFrame').appendChild(v);
+ var un = document.createElement('button'); un.type = 'button'; un.textContent = 'Tap for sound'; un.style.cssText = 'position:absolute;right:10px;bottom:10px;z-index:2;padding:8px 12px;border-radius:8px;border:0;background:rgba(0,0,0,.6);color:#fff;font:600 12px system-ui';
+ un.onclick = function () { v.muted = false; v.play().catch(function () {}); un.remove(); }; $('rfFrame').appendChild(un);
+ v.play().catch(function () { $('rfHint').textContent = 'Tap the video to start it. The timer runs while it plays.'; v.onclick = function () { v.play(); }; });
+ ring(); timer = setInterval(tick, 1000); return;
+ }
$('rfTitle').textContent = r.title || 'Member site'; try { $('rfUrl').textContent = new URL(r.target).hostname; } catch (e) {}
var f = document.createElement('iframe'); f.src = r.target; f.setAttribute('referrerpolicy', 'no-referrer'); f.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups'); $('rfFrame').innerHTML = ''; $('rfFrame').appendChild(f);
var o = $('rfOpen'); o.href = r.target; o.hidden = false;
diff --git a/public/refuel.html b/public/refuel.html
index d66a0a2..b78637b 100644
--- a/public/refuel.html
+++ b/public/refuel.html
@@ -37,6 +37,6 @@ a.rf-open{color:#8FF0FF;font-size:12px}
-
+