Fuel Your Offers member guide at /refuel (Marty, 2026-10-24): LinkSpin-first wording (Credits, Ads, Banner Spin), same rules as InstantAdPay's refuel.js, flow drawn in HTML/CSS (works at 390 px), pub.css look, hero og:image banners/fuel-your-offers-1200x675.jpg, refuel-guide.js opens join/member/off-site links in a new tab (with ?ref) when framed. Route + TRAFFIC_PAGES + sitemap; Training entry (catalog/training.json "refuel-guide"); "How the Refuel streak works" link on the Monthly Refuel panel and in the Engine Room.
Fixes: Engine Room streak line no longer asks for the other site once both are refueled (engine.js + engine-room.js copied from InstantAdPay, byte-identical). Ads-screen Monthly Refuel rows had no spacing ("InstantAdPay+30%"): own flex row style. Load into my Banner Spin: size checkboxes, pre-ticked to what fits the tier (728x90 + 300x250 on an empty Starter), and kitspin.js returns one plain message: what loaded, what did not and why (tier holds N Banner Spins), and what to do; /api/my/kits adds spinRoom. Test added (refuel-kit 6/6).
Chatbot CANNED + refuelFact point to /refuel. fuel.js + engine-room.js ?v=20261024rg.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,14 +35,15 @@
|
||||
+ dial(c.pct, n(c.week), 'Clicks this week<br>' + clickCap, 'Clicks this week: ' + n(c.week) + (c.prevWeek ? ', last week ' + n(c.prevWeek) : '') + (c.per1000 != null ? ', ' + c.per1000 + ' per 1,000 credits' : ''), false)
|
||||
+ dial(g.pct, g.month == null ? '?' : n(g.month), 'Goals this month<br>' + goalCap, 'Goals this month: ' + (g.month == null ? 'unknown' : g.month) + (g.target ? ' of ' + g.target : ''), false) + '</div>';
|
||||
const streak = '<div class="er-streak"><p class="er-h">Streak</p>' + (s.active ? '<b>' + s.months + ' month' + (s.months === 1 ? '' : 's') + '</b>' + (s.both ? ', both engines this cycle' : '') + '. Refuel day <b>' + esc(s.refuelDay) + '</b>, grace to ' + esc(s.graceEnd) + ' (Central).'
|
||||
+ (s.next ? (s.windowOpen ? ' Window open: next refuel +' + s.next.single + '% (+' + s.next.both + '% on each with both).' : s.next.secondEngine ? ' Refuel the other site this cycle for +' + s.next.secondEngine + '% on both.' : '') : '')
|
||||
+ (typeof s.note === 'string' ? (s.note ? ' ' + esc(s.note) : '') : s.next ? (s.windowOpen ? ' Window open: next refuel +' + s.next.single + '% (+' + s.next.both + '% on each with both).' : s.both ? ' Both engines fueled this cycle.' : s.next.secondEngine ? ' Refuel the other site this cycle for +' + s.next.secondEngine + '% on both.' : '') : '') // s.note from engine.js (2026-10-24: no 'refuel the other site' once both are done)
|
||||
+ (s.pitStop ? ' Pit Stop: +' + s.pitStop.pct + '% ' + (s.pitStop.iap || s.pitStop.linkspin ? 'available' : 'used') + ' this cycle.' : '') + (s.best > s.months ? ' Best: ' + s.best + '.' : '') : 'Not started.') + '</div>';
|
||||
const warns = '<div><p class="er-h">Warning lights</p><div class="er-row">' + d.warnings.map(w => '<span class="er-light" title="' + esc(w.note) + '"><span class="er-dot' + (w.on ? ' on' : '') + '" aria-hidden="true"></span>' + esc(w.label) + ': ' + (w.on ? '<b>on</b>' : 'off') + '<span class="sr" style="position:absolute;left:-9999px"> (' + esc(w.note) + ')</span></span>').join('') + '</div></div>';
|
||||
const parts = '<div><p class="er-h">The six parts</p><div class="er-parts">' + d.parts.map(p => '<div class="er-part"><b><span class="er-dot ' + p.state + '" aria-hidden="true"></span>' + esc(p.label) + ' <span style="font-weight:400;opacity:.75">(' + (p.state === 'green' ? 'working' : p.state === 'amber' ? 'needs attention' : 'not started') + ')</span></b><span>' + esc(p.note) + '</span>'
|
||||
+ (p.state !== 'green' && p.link ? '<a href="' + esc(sameSite(p.link)) + '">' + (p.state === 'grey' ? 'Set it up' : 'Fix it') + '</a>' : '') + '</div>').join('') + '</div></div>';
|
||||
const next = '<div class="er-next"><div class="w"><p class="er-h">Next move</p><b>' + esc(d.next.label) + '</b><br>' + esc(d.next.why) + '</div><a class="btn' + (d.locked ? '' : ' pri') + '" href="' + esc(sameSite(d.next.link)) + '">' + esc(d.next.label) + '</a></div>';
|
||||
if (d.locked) return '<div class="er">' + next + '<div class="er-locked" aria-hidden="true">' + dials + warns + parts + '</div></div>';
|
||||
return '<div class="er">' + next + dials + streak + warns + parts + '<p class="small muted" style="margin:0;font-size:12px;opacity:.75">Numbers cover InstantAdPay and LinkSpin together' + (d.sites && (!d.sites.iap || !d.sites.linkspin) ? ' (one site did not answer just now)' : '') + '. Credits buy ad delivery only.</p></div>';
|
||||
const how = '<p style="margin:0;font-size:12.5px"><a href="/refuel" target="_blank" rel="noopener">How the Refuel streak works</a></p>'; // the member guide (2026-10-24)
|
||||
if (d.locked) return '<div class="er">' + next + how + '<div class="er-locked" aria-hidden="true">' + dials + warns + parts + '</div></div>';
|
||||
return '<div class="er">' + next + dials + streak + how + warns + parts + '<p class="small muted" style="margin:0;font-size:12px;opacity:.75">Numbers cover InstantAdPay and LinkSpin together' + (d.sites && (!d.sites.iap || !d.sites.linkspin) ? ' (one site did not answer just now)' : '') + '. Credits buy ad delivery only.</p></div>';
|
||||
}
|
||||
async function load(fresh) {
|
||||
try {
|
||||
|
||||
+20
-6
@@ -5,16 +5,18 @@
|
||||
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
||||
const n = v => Number(v || 0).toLocaleString('en-US');
|
||||
window.FUEL = window.FUEL || {};
|
||||
const HOW = '<p class="muted" style="margin:10px 0 0"><a href="/refuel" target="_blank" rel="noopener">How the Refuel streak works</a></p>'; // the member guide (2026-10-24)
|
||||
function site(name, s, minUsd) {
|
||||
return s && s.refueled ? '<div class="row"><span>' + name + '</span><b>+' + s.pct + '% · ' + n(s.bonus) + ' credits</b></div>'
|
||||
: '<div class="row"><span>' + name + '</span><span class="muted">not yet ($' + minUsd + '+ counts)</span></div>';
|
||||
const row = '<div class="row" style="display:flex;justify-content:space-between;align-items:baseline;gap:4px 12px;flex-wrap:wrap;padding:3px 0"><span>' + name + ':</span> '; // own spacing: the Ads screen has no .row rule (2026-10-24)
|
||||
return s && s.refueled ? row + '<b>+' + s.pct + '% · ' + n(s.bonus) + ' bonus credits</b></div>'
|
||||
: row + '<span class="muted">not yet ($' + minUsd + '+ counts)</span></div>';
|
||||
}
|
||||
function body(v) {
|
||||
if (v.error) return '<p class="muted">' + esc(v.error) + '</p>';
|
||||
if (!v.active) {
|
||||
return '<p style="margin:0 0 8px">' + (v.started ? 'Your last streak ended. ' : '') + 'A package of <b>$' + v.minUsd.linkspin + ' or more</b> here, or $' + v.minUsd.iap + '+ on InstantAdPay, ' + (v.started ? 'starts it again' : 'starts your monthly refuel streak and sets your own refuel day') + '.</p>'
|
||||
+ '<p class="muted" style="margin:0 0 10px">Bonus ad credits: month 1 +' + v.ladder.single[0] + '%, then +' + v.ladder.single.slice(1).join('%, +') + '%. Refuel both sites in the same cycle and each gets +' + v.ladder.both.join('%, +') + '%.</p>'
|
||||
+ '<a class="btn pri" href="/credits">Start my streak</a>';
|
||||
+ '<a class="btn pri" href="/credits">Start my streak</a>' + HOW;
|
||||
}
|
||||
const c = v.cycle || {};
|
||||
let h = v.windowOpen
|
||||
@@ -24,7 +26,7 @@
|
||||
if (!v.windowOpen && c.month && !c.both) h += '<p class="muted" style="margin:0 0 8px">Refuel ' + (c.linkspin && c.linkspin.refueled ? 'InstantAdPay ($' + v.minUsd.iap + '+)' : 'LinkSpin ($' + v.minUsd.linkspin + '+)') + ' before ' + esc(v.opensLabel) + ' and both sites move to +' + v.next.secondEngine + '%.</p>';
|
||||
if (v.pitStop && (v.pitStop.linkspin || v.pitStop.usedLinkspin)) h += '<p class="muted" style="margin:0 0 8px"><b>Pit Stop</b> ' + (v.pitStop.linkspin ? 'available here: +' + v.pitStop.pct + '% on a $' + v.minUsd.linkspin + '+ top-up, once this cycle. It does not count as your refuel.' : 'used here this cycle.') + '</p>';
|
||||
h += '<p class="muted" style="margin:0 0 10px">' + (v.freeMiss.available ? 'One free miss left this year.' : 'Free miss for this year used.') + '</p>';
|
||||
return h + '<a class="btn' + (v.windowOpen ? ' pri' : '') + '" href="/credits">' + (v.windowOpen ? 'Refuel now' : 'Buy a package') + '</a>';
|
||||
return h + '<a class="btn' + (v.windowOpen ? ' pri' : '') + '" href="/credits">' + (v.windowOpen ? 'Refuel now' : 'Buy a package') + '</a>' + HOW;
|
||||
}
|
||||
async function load() {
|
||||
const panel = $('rfPanel'); if (!panel) return;
|
||||
@@ -42,10 +44,20 @@
|
||||
// ---- the Refuel Kit: members-only LinkSpin banners with your @name and a QR to your link ----
|
||||
const post = async (url, body) => { const r = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body || {}) }); const j = await r.json().catch(() => ({})); if (!r.ok || j.error) throw new Error(j.error || ('HTTP ' + r.status)); return j; };
|
||||
const note = (el, m) => { if (el) el.textContent = m; };
|
||||
// Banner Spin sizes to load (2026-10-24): each size needs its own Banner Spin, and a Starter tier holds 2, so the sizes that
|
||||
// fit are ticked first (728x90 and 300x250 when nothing is set up yet) and the panel says why before the member presses Load
|
||||
function spinPick(k, d) {
|
||||
const R = d.spinRoom; const sizes = k.sizes.filter(s => s.ready && (!R || !R.sizes || R.sizes.includes(s.size))).map(s => s.size).filter(z => z !== '1200x630');
|
||||
if (!sizes.length) return '';
|
||||
const pick = R && R.ok && R.suggested ? R.suggested : sizes;
|
||||
const note = R && R.ok && !R.all ? '<p class="muted" style="margin:0 0 6px">Each size goes into its own Banner Spin. Your ' + esc(R.tier) + ' tier holds ' + R.spins + ' (' + R.used + ' in use), so the sizes that fit are ticked. Untick one to load another instead' + (R.next ? ', or reach ' + esc(R.next.label) + ' (' + esc(R.next.need) + ') for ' + R.next.spins : '') + '.</p>' : '';
|
||||
return note + '<div style="display:flex;gap:6px 14px;flex-wrap:wrap;margin:0 0 8px">' + sizes.map(z => '<label class="muted" style="display:flex;gap:4px;align-items:center"><input type="checkbox" data-ksize="' + esc(k.month) + '" value="' + z + '"' + (pick.includes(z) ? ' checked' : '') + '> ' + z + '</label>').join('') + '</div>';
|
||||
}
|
||||
function kitHtml(k, d) {
|
||||
const head = '<div style="display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap"><b>' + esc(k.label) + (k.theme ? ' · ' + esc(k.theme) : '') + '</b><span class="muted">' + (k.unlocked ? 'yours' : 'locked') + '</span></div>';
|
||||
if (!k.unlocked) return head + '<p class="muted" style="margin:6px 0 0">Your next counted refuel unlocks it: $25+ here or $20+ on InstantAdPay' + (d.nextRefuel ? ' (refuel day ' + esc(d.nextRefuel) + ')' : '') + '.</p>';
|
||||
return head + '<p class="muted" style="margin:6px 0">Your ' + esc(d.name || 'name') + ' and a QR to your link on every banner. Yours to keep after the month.</p>'
|
||||
+ spinPick(k, d)
|
||||
+ '<div style="display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px"><button class="btn pri" type="button" data-kbs="' + esc(k.month) + '">Load into my Banner Spin</button>'
|
||||
+ (k.gif ? '<label class="muted" style="display:flex;gap:4px;align-items:center"><input type="checkbox" data-kgif="' + esc(k.month) + '"> animated</label>' : '') + '</div>'
|
||||
+ '<div class="muted" data-kres="' + esc(k.month) + '" role="status"></div>'
|
||||
@@ -64,8 +76,10 @@
|
||||
const m = b.dataset.kbs; const out = panel.querySelector('[data-kres="' + m + '"]'); const g = panel.querySelector('[data-kgif="' + m + '"]');
|
||||
b.disabled = true; note(out, 'Drawing your banners and loading them...');
|
||||
try {
|
||||
const r = await post('/api/my/kits/bannerspin', { month: m, variant: g && g.checked ? 'gif' : 'still' });
|
||||
note(out, r.results.map(x => x.size + ': ' + (x.error ? x.error : x.already ? 'already in "' + x.spin + '"' : (x.created ? 'new Banner Spin "' : 'added to "') + x.spin + '"')).join(' | ') + ' (see Banner Spin under Links)');
|
||||
const boxes = panel.querySelectorAll('[data-ksize="' + m + '"]'); const sizes = Array.prototype.filter.call(boxes, c => c.checked).map(c => c.value);
|
||||
if (boxes.length && !sizes.length) { note(out, 'Tick at least one size to load.'); b.disabled = false; return; }
|
||||
const r = await post('/api/my/kits/bannerspin', Object.assign({ month: m, variant: g && g.checked ? 'gif' : 'still' }, boxes.length ? { sizes } : {}));
|
||||
note(out, (r.message || r.results.map(x => x.size + ': ' + (x.error ? x.error : x.already ? 'already in "' + x.spin + '"' : (x.created ? 'new Banner Spin "' : 'added to "') + x.spin + '"')).join(' | ')) + ' See Banner Spin under Links.');
|
||||
} catch (e) { note(out, e.message); }
|
||||
b.disabled = false;
|
||||
}));
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Fuel Your Offers guide page (/refuel, 2026-10-24). Inside a traffic-exchange frame the session and sponsor cookies are
|
||||
// dropped, so sign-in, join, member screens and off-site links open in a new tab, and /join carries the ?ref= this page
|
||||
// was opened with.
|
||||
(function () {
|
||||
var framed = false; try { framed = window.top !== window.self; } catch (e) { framed = true; }
|
||||
if (!framed) return;
|
||||
var ref = ''; try { ref = new URLSearchParams(location.search).get('ref') || ''; } catch (e) {}
|
||||
ref = String(ref).toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 40);
|
||||
document.querySelectorAll('a[href]').forEach(function (a) {
|
||||
var h = a.getAttribute('href') || ''; if (h.charAt(0) === '#') return;
|
||||
var member = a.host === location.host && /^\/(join|credits|ads|links|signin|login)(\/|$)/.test(a.pathname);
|
||||
if (member && ref && a.pathname === '/join' && !/[?&]ref=/.test(a.search)) a.search = (a.search ? a.search + '&' : '?') + 'ref=' + ref;
|
||||
if (member || a.host !== location.host) { a.target = '_blank'; a.rel = 'noopener'; }
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user