diff --git a/public/assets/door.js b/public/assets/door.js
index a4e63af..a2e95a1 100644
--- a/public/assets/door.js
+++ b/public/assets/door.js
@@ -3,15 +3,20 @@
'use strict';
var $ = function (id) { return document.getElementById(id); };
var q = new URLSearchParams(location.search); var tok = q.get('t') || '';
- var nonce = '', tokRet = ''; try { var claims = JSON.parse(atob(tok.split('.')[0].replace(/-/g, '+').replace(/_/g, '/'))); nonce = claims.nonce || ''; tokRet = claims.ret || ''; } catch (e) {}
+ var nonce = '', tokRet = '', game = 'spookydoors'; try { var claims = JSON.parse(atob(tok.split('.')[0].replace(/-/g, '+').replace(/_/g, '/'))); nonce = claims.nonce || ''; tokRet = claims.ret || ''; if (claims.game === 'roadagent') game = 'roadagent'; } catch (e) {}
+ // Road Agent (2026-10-07) uses the same door as a fuel stop; the words change, the round trip does not
+ var RA = game === 'roadagent';
+ var W = RA ? { back: 'Back to the highway', unit: 'Fuel stop', name: 'Road Agent', home: 'https://roadagent.app/play', open: 'Open this page from a fuel stop in Road Agent.', waiting: 'Pulling into the fuel stop…', treat: ' has fuel for you.', treatSomeone: 'Visit counted. Fuel loaded.', house: 'A house ad: a smaller fuel bonus while the sponsors’ ads are resting. Stay on this page.', capTitle: 'That is tonight’s fuel stops', cap: 'You have used every fuel stop for today. Your scrap is safe, and the pumps open again at midnight Central.', none: 'This stop is closed: there are no sponsor pages or videos left for you right now. No fuel here, and this stop does not count. Head back and try again later.', noneTitle: 'Pumps are closed' }
+ : { back: 'Back to the street', unit: 'Door', name: 'Spooky Doors', home: 'https://spookydoors.com/play', open: 'Open this page by knocking on a door in Spooky Doors.', waiting: 'Someone is coming to the door…', treat: ' has a treat for you.', treatSomeone: 'Visit counted. Someone has a treat for you.', house: 'A house ad: a smaller treat while the street’s ads are resting. Stay on this page.', capTitle: 'That is tonight’s doors', cap: 'You have knocked on every door for today. Your candy is safe, and the doors open again at midnight Central.', none: 'The lights are out at this house: there are no member pages or videos left for you right now. No candy here, and this door does not count. Head back and try the next house.', noneTitle: 'Nobody’s home' };
+ if (RA) { document.body.classList.add('ra'); var bb0 = document.getElementById('sdBrand'); if (bb0) bb0.textContent = W.name; var t0 = document.getElementById('sdTitle'); if (t0) t0.textContent = W.waiting; document.title = 'Fuel stop · Road Agent verified visit'; var kk = document.querySelector('#sdFrame h1'); if (kk) { kk.textContent = 'Fuel stop'; kk.nextElementSibling.textContent = 'Pulling in...'; } }
// every dead end on this page keeps a way back to the street
- var gameHome = tokRet ? tokRet.split('?')[0] : 'https://spookydoors.com/play';
+ var gameHome = tokRet ? tokRet.split('?')[0] : W.home;
var dwell = 8, left = 8, timer = null;
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]; }); }
function msg(title, text, backUrl, auto) {
$('sdFrame').innerHTML = '
' + esc(title) + '
' + esc(text) + '
';
$('sdDone').hidden = true; $('sdCheck').hidden = true; $('sdRow').hidden = true;
- var b = $('sdBack'); b.hidden = false; var to = backUrl || gameHome; b.textContent = 'Back to the street'; b.onclick = function () { location.href = to; };
+ var b = $('sdBack'); b.hidden = false; var to = backUrl || gameHome; b.textContent = W.back; b.onclick = function () { location.href = to; };
if (auto && backUrl) setTimeout(function () { location.href = backUrl; }, 2500);
}
function api(p, body) { return fetch(p, body ? { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) } : {}).then(function (r) { return r.json(); }); }
@@ -36,28 +41,28 @@
api('/api/door/done', { n: nonce, answer: i }).then(function (r) {
if (r.error) {
if (r.retry) return challenge();
- if (r.cap && r.ret) return msg('That is tonight’s doors', 'You have knocked on every door for today. Your candy is safe, and the doors open again at midnight Central.', r.ret, true);
+ if (r.cap && r.ret) return msg(W.capTitle, W.cap, r.ret, true);
$('sdHint').textContent = r.error; $('sdCheck').hidden = true; var bb = $('sdBack'); bb.hidden = false; bb.onclick = function () { location.href = gameHome; }; return;
}
- $('sdCheck').hidden = true; $('sdHint').textContent = r.golden ? 'Visit counted. Golden Door! ' + (r.host ? '@' + r.host + ' has' : 'Someone has') + ' a treat for you, plus ' + (r.bonus || 0) + ' bonus candy.' : r.house ? 'Visit counted. A smaller treat from ' + (r.program || 'the house') + ' is on its way.' : r.host ? 'Visit counted. @' + r.host + ' has a treat for you.' : 'Visit counted. Someone has a treat for you.';
- var b = $('sdDone'); b.disabled = false; b.textContent = 'Back to the street'; b.onclick = function () { location.href = r.ret; };
+ $('sdCheck').hidden = true; $('sdHint').textContent = r.golden ? 'Visit counted. Golden Door! ' + (r.host ? '@' + r.host + ' has' : 'Someone has') + ' a treat for you, plus ' + (r.bonus || 0) + ' bonus candy.' : r.house ? 'Visit counted. A smaller treat from ' + (r.program || 'the house') + ' is on its way.' : r.host ? 'Visit counted. @' + r.host + W.treat : W.treatSomeone;
+ var b = $('sdDone'); b.disabled = false; b.textContent = W.back; b.onclick = function () { location.href = r.ret; };
setTimeout(function () { location.href = r.ret; }, 1200);
});
}
- if (!tok) return msg('No door here', 'Open this page by knocking on a door in Spooky Doors.');
+ if (!tok) return msg(RA ? 'No fuel stop here' : 'No door here', W.open);
api('/api/door/open?t=' + encodeURIComponent(tok)).then(function (r) {
if (r.error) return msg('Door link problem', r.error);
if (r.done) { location.href = r.ret; return; }
if (r.none) return r.why === 'cap'
- ? msg('That is tonight’s doors', 'You have knocked on every door for today. Your candy is safe, and the doors open again at midnight Central. Your regular InstantAdPay visits are not affected.', r.ret, true)
- : msg('Nobody’s home', 'The lights are out at this house: there are no member pages or videos left for you right now. No candy here, and this door does not count. Head back and try the next house.', r.ret, true);
+ ? msg(W.capTitle, W.cap + ' Your regular InstantAdPay visits are not affected.', r.ret, true)
+ : msg(W.noneTitle, W.none, r.ret, true);
dwell = r.dwell || 8; left = Math.max(1, dwell - (r.elapsed || 0));
- if (r.doors && r.doors.cap) { var ch = $('sdDoors'); ch.textContent = 'Door ' + Math.min(r.doors.cap, (r.doors.used || 0) + 1) + ' of ' + r.doors.cap; ch.hidden = false; }
- var who = r.house ? 'House ad' : r.host ? '@' + r.host + '’s door' : 'A member’s door';
+ if (r.doors && r.doors.cap) { var ch = $('sdDoors'); ch.textContent = W.unit + ' ' + Math.min(r.doors.cap, (r.doors.used || 0) + 1) + ' of ' + r.doors.cap; ch.hidden = false; }
+ var who = r.house ? 'House ad' : r.host ? '@' + r.host + (RA ? '’s stop' : '’s door') : (RA ? 'A sponsor’s stop' : 'A member’s door');
if (r.golden) { document.body.classList.add('gold'); $('sdGold').hidden = false; who = 'Golden Door! ' + who; } // gold variant: bonus candy on this one
if (r.mode === 'video') { // no member pages left: a member video ad instead
$('sdTitle').textContent = who + ': ' + (r.title || 'member video'); $('sdUrl').textContent = 'video ad';
- $('sdHint').textContent = 'You have visited every member page running right now, so this door is a short member video. Keep it playing.';
+ $('sdHint').textContent = 'You have visited every member page running right now, so this ' + (RA ? 'stop' : 'door') + ' is a short member video. Keep it playing.';
var v = document.createElement('video'); v.id = 'sdVideo'; 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';
$('sdFrame').innerHTML = ''; $('sdFrame').appendChild(v);
@@ -67,10 +72,10 @@
ring(); timer = setInterval(tick, 1000); return;
}
$('sdTitle').textContent = who + ': ' + (r.title || 'member site'); try { $('sdUrl').textContent = new URL(r.target).hostname; } catch (e) {}
- if (r.house) $('sdHint').textContent = 'A house ad: a smaller treat while the street’s ads are resting. Stay on this page.';
+ if (r.house) $('sdHint').textContent = W.house;
if (r.golden) $('sdHint').textContent = 'A Golden Door: this one comes with ' + (r.bonus || 0) + ' bonus candy. Stay on this page; the timer only runs while it is in front.';
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'); $('sdFrame').innerHTML = ''; $('sdFrame').appendChild(f);
var o = $('sdOpen'); o.href = r.target; o.hidden = false;
ring(); timer = setInterval(tick, 1000);
- }).catch(function () { msg('Could not open the door', 'Check your connection and go back to the street.'); });
+ }).catch(function () { msg(RA ? 'Could not open the fuel stop' : 'Could not open the door', RA ? 'Check your connection and go back to the highway.' : 'Check your connection and go back to the street.'); });
})();
diff --git a/public/door.html b/public/door.html
index 71ab558..a38230c 100644
--- a/public/door.html
+++ b/public/door.html
@@ -39,10 +39,12 @@ body.gold{--pumpkin:#FFC83D;--pumpkin-d:#A86F00;--line:#7A5A12}
body.gold .dr-bar,body.gold .dr-dock{background:linear-gradient(90deg,#3B2A08,#241339 60%)}
body.gold .dr-ring{box-shadow:0 0 18px rgba(255,200,61,.55)}
body.gold #sdTitle{color:#FFE27A}
+body.ra{--night:#0B0F1A;--plum:#121a2b;--plum-2:#1a2438;--line:#2a3a5c;--pumpkin:#F5A623;--pumpkin-d:#B86E00;--candy:#F5A623;--moon:#58C4F6;--ghost:#F2F6FF;--muted:#9FB0CC;--display:"Trebuchet MS",system-ui,sans-serif}
+body.ra .dr-frame{background-image:none}
-