Refuel in the menu + arrivals from InstantAdPay (Marty 2026-10-25: "I don't see any kind of refueling option on LinkSpin in the menu"; "it took me to LinkSpin but I don't know how to pick up from there"). Rail item Refuel -> /credits#refuel: the Refuel panel is scrolled to and flashed once loaded (also after sign-in pop-ups, settles again on phones); /credits#buy and /ads#engine work the same way. Refuel panel: says any $25+ package counts, button "Buy a $25+ package" scrolls to the picker, links to the Engine Room, and a Buy on InstantAdPay link when LinkSpin is done but InstantAdPay is not. Packages of $25+ carry a "counts for Refuel" tag. Links from InstantAdPay (?from=iap&task=refuel|conversions|bannerspin|spinlink|testing|page|ads) open with a strip: "You came from InstantAdPay to <job>. Step 1: ...", guide link, Back to InstantAdPay; signed out, the strip and the sign-in pop-up say to use the same InstantAdPay email, and the Refuel/Engine panels reload after sign-in (cr:signedin). Engine Room built with site 'linkspin': buy/top-up/Fuel links stay on LinkSpin. engine.js / engine-room.js byte-identical with InstantAdPay. Chatbot routes, KNOWLEDGE_DATE 2026-10-25. QA: fuel 16/16 + drift check, member walk 0 bugs. cr-shell.js ?v=20261025ff on all 12 pages; fuel.js, engine-room.js, credits-screen.js bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-25 09:06:06 -05:00
parent f38eec9a38
commit 837d4b6569
19 changed files with 140 additions and 57 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ let DATA_DIR = null;
let chain = null;
const MODEL = process.env.OPENROUTER_MODEL || 'deepseek/deepseek-v4-flash:nitro';
const CONTRACT = '0x26Bdc556b94399bEdd69ae3ACA5aA6c54D946e8b';
const KNOWLEDGE_DATE = '2026-10-24'; // the day the CANNED answers and FACTS below were last checked against the site
const KNOWLEDGE_DATE = '2026-10-25'; // the day the CANNED answers and FACTS below were last checked against the site
function init(opts) {
if (opts && typeof opts.refuelOn === 'function') REFUEL_ON = opts.refuelOn; DATA_DIR = opts.dataDir; chain = opts.chain; return kb.init({ dataDir: DATA_DIR, seeds: seeds() }); }
@@ -41,7 +41,7 @@ const SUPPORT_RE = /(contact|reach|email|e-mail|message|talk to|speak (to|with)|
const CANNED = [
{ id: 'refuel', title: 'Monthly Refuel streak and Pit Stops', q: ['What is my refuel day?', 'How does the refuel streak work?', 'What is a Pit Stop?', 'How much should I spend each month?'], tags: ['refuel', 'streak', 'pit stop', 'twin engine', 'bonus credits'],
re: /(refuel(ing)? (day|streak|bonus|window)|my refuel|monthly refuel|pit ?stop|twin engine|both engines|refuel streak|streak bonus|free miss)/i,
a: 'The Monthly Refuel streak rewards members who refuel their ads every month. A counted refuel is a new package of $20 or more on InstantAdPay, or $25 or more on LinkSpin, bought by one of your own positions. Your first one sets your refuel day; the next is due 30 days later, the window opens 5 days before that day and there is a 5-day grace after it (Central time). Each refuel adds bonus ad credits on the site where you bought: month 1 +10%, month 2 +15%, month 3 +20%, month 4 and up +25%. Refuel BOTH sites in the same cycle and each gets +15%, +20%, +30% or +40% (the first site is topped up to that rate), plus a 100-credit Featured bonus on InstantAdPay from month 4 (enough for two Featured days and more). Either site alone keeps your streak going; both sites in a cycle is the bigger bonus. The bonus stacks on Five Dollar Friday and Wired Wednesday. Another $20+/$25+ package on a site you already refueled this cycle, before your next window opens, is a Pit Stop: half your current rate, once per site per cycle, and it does not count as the refuel. Miss the grace and the streak starts again, except for one free miss a year. Badges at your first refuel and at 3, 6 and 12 months. Each counted refuel also unlocks the Refuel Kit for that month: members-only banners (728x90, 300x250, 468x60, 160x600 and 1200x630) with your @name and a QR code to your own link drawn on them, in the Ads screen (with a Load into my Banner Spin button); they stay yours after the month, a 3-month streak adds an animated version and 6 months a custom-banners credit. Your first counted refuel also opens the Engine Room panel on the Ads screen: three plain dials (fuel left on both sites against this cycle’s refuel with days left at your burn, clicks this week with clicks per 1,000 credits, goals this month against a goal you set), warning lights, six part lights with setup links and one next move. Your refuel day, streak, next bonus and Pit Stop status are on the Refuel card on your Credits screen. Buy here: https://linkspin.app/credits. The full guide, with the flow step by step: https://linkspin.app/refuel. Bonus credits are ad credits that buy delivery, never cash, and no income is guaranteed.' },
a: 'The Monthly Refuel streak rewards members who refuel their ads every month. A counted refuel is a new package of $20 or more on InstantAdPay, or $25 or more on LinkSpin, bought by one of your own positions. Your first one sets your refuel day; the next is due 30 days later, the window opens 5 days before that day and there is a 5-day grace after it (Central time). Each refuel adds bonus ad credits on the site where you bought: month 1 +10%, month 2 +15%, month 3 +20%, month 4 and up +25%. Refuel BOTH sites in the same cycle and each gets +15%, +20%, +30% or +40% (the first site is topped up to that rate), plus a 100-credit Featured bonus on InstantAdPay from month 4 (enough for two Featured days and more). Either site alone keeps your streak going; both sites in a cycle is the bigger bonus. The bonus stacks on Five Dollar Friday and Wired Wednesday. Another $20+/$25+ package on a site you already refueled this cycle, before your next window opens, is a Pit Stop: half your current rate, once per site per cycle, and it does not count as the refuel. Miss the grace and the streak starts again, except for one free miss a year. Badges at your first refuel and at 3, 6 and 12 months. Each counted refuel also unlocks the Refuel Kit for that month: members-only banners (728x90, 300x250, 468x60, 160x600 and 1200x630) with your @name and a QR code to your own link drawn on them, in the Ads screen (with a Load into my Banner Spin button); they stay yours after the month, a 3-month streak adds an animated version and 6 months a custom-banners credit. Your first counted refuel also opens the Engine Room panel on the Ads screen: three plain dials (fuel left on both sites against this cycle’s refuel with days left at your burn, clicks this week with clicks per 1,000 credits, goals this month against a goal you set), warning lights, six part lights with setup links and one next move. Your refuel day, streak, next bonus and Pit Stop status are on the Refuel card on your Credits screen: Refuel in the menu takes you straight there (https://linkspin.app/credits#refuel), and packages that count are marked counts for Refuel. Buy here: https://linkspin.app/credits#buy. The full guide, with the flow step by step: https://linkspin.app/refuel. Bonus credits are ad credits that buy delivery, never cash, and no income is guaranteed.' },
{ id: 'support', title: 'Contact support or open a ticket', q: ['How do I contact support?', 'How do I talk to a real person?', 'How do I open a ticket?'], tags: ['support', 'help', 'ticket', 'contact'],
re: SUPPORT_RE, handoff: true,
a: 'Open Help in your Control Room (' + SITE_URL + '/help) to send Marty a ticket, and his replies land right there and in your email. Not signed in or locked out? Use ' + SITE_URL + '/support. You can also tap "Send this to support" below and I will pass this chat along.' },
@@ -153,7 +153,7 @@ function seeds() {
// ---- facts for the AI fallback ----
// the refuel fact follows the refuelStreak switch: while it is off the assistant says it is not live yet (2026-10-24)
let REFUEL_ON = () => false;
function refuelFact() { return REFUEL_ON() ? "- MONTHLY REFUEL STREAK (built 2026-10-24, switch refuelStreak): ONE streak per member across InstantAdPay and LinkSpin. Counted refuel = a NEW package of $20+ on InstantAdPay or $25+ on LinkSpin by one of the member's own positions. First one sets the member's own refuel day; next due 30 days after the last counted refuel; window opens 5 days before the due day; 5-day grace after it; Central time. Missing the grace resets the streak, except one free miss per 365 days. Bonus (purchased-grade ad credits on the site where bought, credit log 'Refuel streak'): one engine m1 +10%, m2 +15%, m3 +20%, m4+ +25%; both sites in the same cycle m1 +15%, m2 +20%, m3 +30%, m4+ +40% each (first site topped up to the both rate, difference only) plus a 100-credit Featured bonus on InstantAdPay at m4+ (purchased-grade credits, any format). Stacks on Five Dollar Friday / Wired Wednesday. Pit Stop: another $20+/$25+ package on a site already refueled this cycle, before the next window opens (the other site's first package in the cycle is the second engine instead) = half the current streak rate, once per site per cycle, not a counted refuel. Badges: Engine Started (first refuel), Refueled 3 / 6 / 12 months. ENGINE ROOM: unlocked by the first counted refuel (greyed 'Refuel to start your engine' before), IAP tab Engine Room + LinkSpin Ads screen panel, same data both sites: dials Fuel left (credits free + in campaigns on both sites vs this cycle's refuel credits incl. bonus, days left at the recent burn), Clicks this week (vs last week, clicks per 1,000 credits), Goals this month (conversion pixel conversions since the 1st Central vs the member's own goal); streak panel; warning lights (ads at 80%, ads out, refuel day coming, login slot open); six part lights (fuel, banner spin, spin link, page, testing, conversion tracking: green working, amber needs attention, grey not started with a Set it up link); one Next move button from simple rules. REFUEL KIT: each counted refuel unlocks the Central-month's members-only banner set for this site's own program (5 sizes, personalized server-side with @username + QR to the member's link; IAP: Promo tools card with Use in an IAP banner campaign; LinkSpin: Ads screen card with Load into my Banner Spin); kits stay usable after the month; streak month 3+ adds an animated GIF, month 6+ a BannerKitAI custom-banners credit (coming, entitlement saved). Reminders 5 days before, on the day, last call at the end of grace (email + on-site notice). The member's Refuel card (InstantAdPay Overview, LinkSpin Credits/Ads) shows refuel day, streak, next bonus, Pit Stop status. Either site alone keeps the streak (one-engine rates); both sites in one cycle = the bigger bonus; never say both are required. MEMBER GUIDE PAGE (public, 2026-10-24): /refuel on both sites (https://instantadpay.com/refuel and https://linkspin.app/refuel): the flow, the numbers, the member steps, leader coaching and FAQ; point members there for the full picture. Ad credits only, never cash; never promise income. No auto-billing: the member chooses every package.\n" : '- MONTHLY REFUEL STREAK: built but NOT switched on yet. If asked, say it is coming and nothing counts toward it today; do not quote bonus rates or dates.\n'; }
function refuelFact() { return REFUEL_ON() ? "- MONTHLY REFUEL STREAK (built 2026-10-24, switch refuelStreak): ONE streak per member across InstantAdPay and LinkSpin. Counted refuel = a NEW package of $20+ on InstantAdPay or $25+ on LinkSpin by one of the member's own positions. First one sets the member's own refuel day; next due 30 days after the last counted refuel; window opens 5 days before the due day; 5-day grace after it; Central time. Missing the grace resets the streak, except one free miss per 365 days. Bonus (purchased-grade ad credits on the site where bought, credit log 'Refuel streak'): one engine m1 +10%, m2 +15%, m3 +20%, m4+ +25%; both sites in the same cycle m1 +15%, m2 +20%, m3 +30%, m4+ +40% each (first site topped up to the both rate, difference only) plus a 100-credit Featured bonus on InstantAdPay at m4+ (purchased-grade credits, any format). Stacks on Five Dollar Friday / Wired Wednesday. Pit Stop: another $20+/$25+ package on a site already refueled this cycle, before the next window opens (the other site's first package in the cycle is the second engine instead) = half the current streak rate, once per site per cycle, not a counted refuel. Badges: Engine Started (first refuel), Refueled 3 / 6 / 12 months. ENGINE ROOM: unlocked by the first counted refuel (greyed 'Refuel to start your engine' before), IAP tab Engine Room + LinkSpin Ads screen panel, same data both sites: dials Fuel left (credits free + in campaigns on both sites vs this cycle's refuel credits incl. bonus, days left at the recent burn), Clicks this week (vs last week, clicks per 1,000 credits), Goals this month (conversion pixel conversions since the 1st Central vs the member's own goal); streak panel; warning lights (ads at 80%, ads out, refuel day coming, login slot open); six part lights (fuel, banner spin, spin link, page, testing, conversion tracking: green working, amber needs attention, grey not started with a Set it up link); one Next move button from simple rules. REFUEL KIT: each counted refuel unlocks the Central-month's members-only banner set for this site's own program (5 sizes, personalized server-side with @username + QR to the member's link; IAP: Promo tools card with Use in an IAP banner campaign; LinkSpin: Ads screen card with Load into my Banner Spin); kits stay usable after the month; streak month 3+ adds an animated GIF, month 6+ a BannerKitAI custom-banners credit (coming, entitlement saved). Reminders 5 days before, on the day, last call at the end of grace (email + on-site notice). The member's Refuel card (InstantAdPay Overview, LinkSpin Credits/Ads) shows refuel day, streak, next bonus, Pit Stop status. Either site alone keeps the streak (one-engine rates); both sites in one cycle = the bigger bonus; never say both are required. MEMBER GUIDE PAGE (public, 2026-10-24): /refuel on both sites (https://instantadpay.com/refuel and https://linkspin.app/refuel): the flow, the numbers, the member steps, leader coaching and FAQ; point members there for the full picture. Ad credits only, never cash; never promise income. No auto-billing: the member chooses every package. ROUTES (2026-10-25): LinkSpin menu item Refuel = https://linkspin.app/credits#refuel (the Refuel panel, scrolled to and highlighted); packages of $25+ there are marked counts for Refuel; https://linkspin.app/credits#buy = the package picker; https://linkspin.app/ads#engine = LinkSpin Engine Room. InstantAdPay Engine Room = https://instantadpay.com/my#engine; its Set up conversion tracking opens https://instantadpay.com/my#conversions (Campaigns > Conversion tracking card, same goals LinkSpin counts). Engine Room links that cross to LinkSpin (Banner Spin, spin link, page, testing, refuel LinkSpin) open LinkSpin with a note at the top naming the job, Step 1, a guide link and Back to InstantAdPay; same email signs in on both.\n" : '- MONTHLY REFUEL STREAK: built but NOT switched on yet. If asked, say it is coming and nothing counts toward it today; do not quote bonus rates or dates.\n'; }
const REFUEL_OFF_ANSWER = 'The Monthly Refuel streak (bonus ad credits for refueling every month, more when you refuel both InstantAdPay and LinkSpin) is built but not switched on yet, so nothing counts toward it today. The bonuses running now are Five Dollar Friday and Wired Wednesday on InstantAdPay. When the streak goes live, your Refuel card will show your refuel day.';
function systemPrompt(kbBlock) {
return `You are the assistant on LinkSpin (${SITE_URL}), a link rotator, page builder and advertising network for marketers, a Crypto Team Build Network property.
+29 -19
View File
@@ -11,9 +11,16 @@
const DAY = 86400000;
const n0 = v => (typeof v === 'number' && isFinite(v) ? v : Number(v) || 0);
const LINKS = {
iapBuy: 'https://instantadpay.com/my#buy', iapCampaigns: 'https://instantadpay.com/my#campaigns', iapTracking: 'https://instantadpay.com/my#campaigns',
lsBuy: 'https://linkspin.app/credits', lsAds: 'https://linkspin.app/ads', lsLinks: 'https://linkspin.app/links', lsPages: 'https://linkspin.app/pages', lsConv: 'https://linkspin.app/conversions',
iapBuy: 'https://instantadpay.com/my#buy', iapCampaigns: 'https://instantadpay.com/my#campaigns', iapTracking: 'https://instantadpay.com/my#conversions',
lsBuy: 'https://linkspin.app/credits#buy', lsAds: 'https://linkspin.app/ads', lsLinks: 'https://linkspin.app/links', lsBanner: 'https://linkspin.app/links#b', lsPages: 'https://linkspin.app/pages', lsConv: 'https://linkspin.app/conversions',
};
// 2026-10-25 (Marty: "the flow from InstantAdPay to LinkSpin is confusing"): every link points at the screen on the site the
// member is ON when that site can do the job (buy, campaigns, conversion goals: InstantAdPay's Campaigns > Conversion
// tracking card writes the same LinkSpin goals). Only LinkSpin-only tools (Banner Spin, spin links, pages) cross over, and
// engine-room.js tags those links with ?from=<site>&task=<key> so LinkSpin shows an arrival strip with the first step.
const linksFor = site => site === 'linkspin'
? { buy: LINKS.lsBuy, campaigns: LINKS.lsAds, tracking: LINKS.lsConv }
: { buy: LINKS.iapBuy, campaigns: LINKS.iapCampaigns, tracking: LINKS.iapTracking };
const ACTIVE = new Set(['active', 'paused']);
// credits a day across recent campaigns: what each delivered over the days it has run (30 at most), summed
@@ -26,7 +33,7 @@ function burnPerDay(camps, now) {
}
return b;
}
function part(state, label, note, link) { return { state, label, note, link }; }
function part(state, label, note, link, key) { return { state, label, note, link, key }; }
function build(o) {
const now = o.now || Date.now();
@@ -36,6 +43,7 @@ function build(o) {
const camps = sites.flatMap(f => (f.campaigns || []).map(c => Object.assign({ site: f.site }, c)));
const recent = camps.filter(c => ACTIVE.has(c.status) || now - n0(c.created) <= 30 * DAY || c.status === 'out');
const locked = !rf.started;
const here = o.site === 'linkspin' ? 'linkspin' : 'iap', L = linksFor(here);
// ---- dial 1: fuel left vs this cycle's refuel ----
const left = sites.reduce((s, f) => s + n0(f.credits && f.credits.available) + n0(f.credits && f.credits.inCampaigns), 0);
const cy = rf.cycle || null;
@@ -67,34 +75,36 @@ function build(o) {
];
// ---- the six parts ----
const P = (lsF && lsF.parts) || {};
const pFuel = !camps.length ? part('grey', 'Fuel', 'no ads yet', LINKS.iapCampaigns)
: out.length && !running.length ? part('amber', 'Fuel', 'nothing running', LINKS.iapCampaigns)
: low.length || (daysLeft != null && daysLeft < 5) ? part('amber', 'Fuel', daysLeft != null && daysLeft < 5 ? 'about ' + daysLeft + ' days left at your burn' : 'an ad is running low', LINKS.iapBuy)
: running.length ? part('green', 'Fuel', running.length + ' ad' + (running.length === 1 ? '' : 's') + ' running', LINKS.iapCampaigns) : part('amber', 'Fuel', 'nothing running', LINKS.iapCampaigns);
const pick = (k, label, link) => { const x = P[k]; return x ? part(x.state, label, x.note, link) : part('grey', label, lsF ? 'not set up' : 'LinkSpin did not answer', link); };
const parts = [pFuel, pick('bannerSpin', 'Banner spin', LINKS.lsLinks), pick('spinLink', 'Spin link', LINKS.lsLinks), pick('page', 'Page', LINKS.lsPages), pick('testing', 'Testing', LINKS.lsLinks),
lsF ? (n0(lsF.goalsCount) === 0 ? part('grey', 'Conversion tracking', 'no goal set', LINKS.lsConv) : n0(lsF.conv30) === 0 ? part('amber', 'Conversion tracking', 'no conversions tracked yet', LINKS.lsConv) : part('green', 'Conversion tracking', n0(lsF.conv30) + ' in 30 days', LINKS.lsConv))
: part('grey', 'Conversion tracking', 'LinkSpin did not answer', LINKS.iapTracking)];
const pFuel = !camps.length ? part('grey', 'Fuel', 'no ads yet', L.campaigns, 'ads')
: out.length && !running.length ? part('amber', 'Fuel', 'nothing running', L.campaigns, 'ads')
: low.length || (daysLeft != null && daysLeft < 5) ? part('amber', 'Fuel', daysLeft != null && daysLeft < 5 ? 'about ' + daysLeft + ' days left at your burn' : 'an ad is running low', L.buy, 'refuel')
: running.length ? part('green', 'Fuel', running.length + ' ad' + (running.length === 1 ? '' : 's') + ' running', L.campaigns, 'ads') : part('amber', 'Fuel', 'nothing running', L.campaigns, 'ads');
const pick = (k, label, link, key) => { const x = P[k]; return x ? part(x.state, label, x.note, link, key) : part('grey', label, lsF ? 'not set up' : 'LinkSpin did not answer', link, key); };
const parts = [pFuel, pick('bannerSpin', 'Banner spin', LINKS.lsBanner, 'bannerspin'), pick('spinLink', 'Spin link', LINKS.lsLinks, 'spinlink'), pick('page', 'Page', LINKS.lsPages, 'page'), pick('testing', 'Testing', LINKS.lsLinks, 'testing'),
lsF ? (n0(lsF.goalsCount) === 0 ? part('grey', 'Conversion tracking', 'no goal set', L.tracking, 'conversions') : n0(lsF.conv30) === 0 ? part('amber', 'Conversion tracking', 'no conversions tracked yet', L.tracking, 'conversions') : part('green', 'Conversion tracking', n0(lsF.conv30) + ' in 30 days', L.tracking, 'conversions'))
: part('grey', 'Conversion tracking', 'LinkSpin did not answer', L.tracking, 'conversions')];
// ---- one next move ----
const per1000 = c => n0(c.delivered) >= 200 ? n0(c.clicks) / n0(c.delivered) * 1000 : null;
const ranked = running.filter(c => per1000(c) != null).sort((a, b) => per1000(b) - per1000(a));
const linkFor = c => c.site === 'linkspin' ? LINKS.lsAds : LINKS.iapCampaigns;
const availAll = sites.reduce((s, f) => s + n0(f.credits && f.credits.available), 0);
let next;
if (locked) next = { key: 'start', label: 'Refuel to start your engine', why: 'Your first counted refuel ($' + (rf.minUsd ? rf.minUsd.iap : 20) + '+ here or $' + (rf.minUsd ? rf.minUsd.linkspin : 25) + '+ on LinkSpin) starts the streak and lights this room.', link: LINKS.iapBuy };
else if (rf.windowOpen) next = { key: 'refuel', label: 'Refuel now', why: 'Your refuel window is open: +' + rf.next.single + '% on one site, +' + rf.next.both + '% on each with both.', link: LINKS.iapBuy };
const mIap = rf.minUsd ? rf.minUsd.iap : 20, mLs = rf.minUsd ? rf.minUsd.linkspin : 25;
const firstWhy = here === 'linkspin' ? 'A package of $' + mLs + ' or more here (or $' + mIap + '+ on InstantAdPay) starts the streak and lights this room.' : 'A package of $' + mIap + ' or more here (or $' + mLs + '+ on LinkSpin) starts the streak and lights this room.';
if (locked) next = { key: 'start', label: 'Refuel to start your engine', why: firstWhy, link: L.buy, guide: '/refuel' };
else if (rf.windowOpen) next = { key: 'refuel', label: 'Refuel now', why: 'Your refuel window is open: +' + rf.next.single + '% on one site, +' + rf.next.both + '% on each with both. A $' + (here === 'linkspin' ? mLs : mIap) + '+ package here counts.', link: L.buy, guide: '/refuel' };
else if (out.length && !running.length && availAll >= 100) next = { key: 'relaunch', label: 'Relaunch an ad', why: 'Nothing is running and you have ' + Math.round(availAll).toLocaleString('en-US') + ' credits free.', link: linkFor(out[0]) };
else if (daysLeft != null && daysLeft < 5) next = { key: 'pitstop', label: 'Top up' + (rf.pitStop && (rf.pitStop.iap || rf.pitStop.linkspin) ? ' (Pit Stop +' + rf.pitStop.pct + '%)' : ''), why: 'About ' + daysLeft + ' days of fuel left at your current burn.', link: LINKS.iapBuy };
else if (daysLeft != null && daysLeft < 5) next = { key: 'pitstop', label: 'Top up' + (rf.pitStop && (rf.pitStop.iap || rf.pitStop.linkspin) ? ' (Pit Stop +' + rf.pitStop.pct + '%)' : ''), why: 'About ' + daysLeft + ' days of fuel left at your current burn.', link: L.buy };
else if (low.length) { const best = low.slice().sort((a, b) => (per1000(b) || 0) - (per1000(a) || 0))[0]; next = { key: 'topup', label: 'Top up the winner', why: '"' + (best.name || 'your ad') + '" is past 80% of its budget.', link: linkFor(best) }; }
else if (parts[5].state === 'grey') next = { key: 'tracking', label: 'Set up conversion tracking', why: 'Count signups and sales back to the ad that sent them.', link: parts[5].link };
else if (parts[1].state === 'grey') next = { key: 'bannerspin', label: 'Make a Banner Spin', why: 'Test up to 5 banners in one ad slot and let the winner show.', link: LINKS.lsLinks };
else if (parts[4].state !== 'green') next = { key: 'testing', label: 'Test A against B', why: 'Add a second page to your spin link so the rotation can pick a winner.', link: LINKS.lsLinks };
else if (parts[5].state === 'grey') next = { key: 'tracking', label: 'Set up conversion tracking', why: here === 'linkspin' ? 'Count signups and sales back to the ad that sent them. Step 1: add a goal, then paste its two snippets on your pages.' : 'Count signups and sales back to the ad that sent them. Step 1: add a goal under Campaigns > Conversion tracking, then paste its two snippets on your pages.', link: parts[5].link, guide: '/conversion-tracking' };
else if (parts[1].state === 'grey') next = { key: 'bannerspin', label: 'Make a Banner Spin', why: 'Test up to 5 banners in one ad slot and let the winner show.' + (here === 'linkspin' ? '' : ' Banner Spin is a LinkSpin tool: the same email signs you in there.'), link: LINKS.lsBanner };
else if (parts[4].state !== 'green') next = { key: 'testing', label: 'Test A against B', why: 'Add a second page to your spin link so the rotation can pick a winner.' + (here === 'linkspin' ? '' : ' Spin links live on LinkSpin: the same email signs you in there.'), link: LINKS.lsLinks };
else if (ranked.length >= 2 && per1000(ranked[0]) > per1000(ranked[ranked.length - 1]) * 1.5) { const worst = ranked[ranked.length - 1]; next = { key: 'cut', label: 'Cut the loser', why: '"' + (worst.name || 'an ad') + '" brings the fewest clicks per 1,000 credits. Pause it and move the credits to "' + (ranked[0].name || 'your best ad') + '".', link: linkFor(worst) }; }
else next = { key: 'cruise', label: 'Keep it running', why: 'Every part is lit. Check again on your refuel day.', link: LINKS.iapCampaigns };
else next = { key: 'cruise', label: 'Keep it running', why: 'Every part is lit. Check again on your refuel day.', link: L.campaigns };
return {
on: true, locked, fuel, clicks, goals,
streak: { active: !!rf.active, months: rf.streak || 0, best: rf.best || 0, refuelDay: rf.refuelDayLabel || null, graceEnd: rf.graceLabel || null, windowOpen: !!rf.windowOpen, next: rf.next || null, pitStop: rf.pitStop || null, freeMiss: rf.freeMiss || null, both: !!(cy && cy.both), note: streakNote(rf, cy) },
warnings, parts, next, sites: { iap: !!(o.iap && o.iap.ok), linkspin: !!(o.ls && o.ls.ok) }, at: now,
warnings, parts, next, site: here, sites: { iap: !!(o.iap && o.iap.ok), linkspin: !!(o.ls && o.ls.ok) }, at: now,
};
}
+3 -3
View File
@@ -74,9 +74,9 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/ads-screen.js?v=20261023q"></script>
<script src="/assets/fuel.js?v=20261024rg"></script>
<script src="/assets/engine-room.js?v=20261024rg"></script>
<script src="/assets/fuel.js?v=20261025ff"></script>
<script src="/assets/engine-room.js?v=20261025ff"></script>
</body>
</html>
+51 -6
View File
@@ -13,6 +13,7 @@ window.CR = (function () {
['zones', 'Zones', '/zones', '<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18"/>'],
['ads', 'Ads', '/ads', '<path d="M3 11l14-5v12L3 13v-2z"/><path d="M17 8a4 4 0 0 1 0 8"/>'],
['credits', 'Credits', '/credits', '<circle cx="12" cy="12" r="8"/><path d="M12 8v8M9.5 10.5h3.5a1.5 1.5 0 0 1 0 3H10a1.5 1.5 0 0 0 0 3h4.5"/>'],
['refuel', 'Refuel', '/credits#refuel', '<path d="M5 20V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v15"/><path d="M3.5 20h12"/><path d="M7 8h5"/><path d="M14 10h2a2 2 0 0 1 2 2v3.5a1.5 1.5 0 0 0 3 0V8l-3-3"/>'], // Monthly Refuel panel on Credits (Marty 2026-10-25: no refuel option in the menu)
['reports', 'Reports', '/reports', '<path d="M4 19V9M10 19V5M16 19v-8M22 19H2"/>'],
['conversions', 'Conversions', '/conversions', '<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="4"/><circle cx="12" cy="12" r="0.8"/>'], // conversion pixel goals (2026-10-23)
['team', 'Team', '/team', '<circle cx="9" cy="8" r="3"/><circle cx="17" cy="9" r="2.5"/><path d="M3 19c0-3 3-5 6-5s6 2 6 5M15 15c3 0 6 1.5 6 4"/>'],
@@ -26,8 +27,43 @@ window.CR = (function () {
];
// screens not built yet fall back to the classic dashboard pane so nothing is a dead end
const FALLBACK = {}; // the classic /my dashboard is retired (2026-10-08); its leftover panes live at /tools
const BUILT = new Set(['links', 'sources', 'pages', 'zones', 'ads', 'credits', 'reports', 'conversions', 'team', 'wallet', 'tools', 'promo', 'training', 'pipeline', 'profile', 'help']); // Training, Pipeline and Profile on the rail, not behind More (Marty 2026-10-11); Help = support tickets (2026-10-16)
const BUILT = new Set(['links', 'sources', 'pages', 'zones', 'ads', 'credits', 'refuel', 'reports', 'conversions', 'team', 'wallet', 'tools', 'promo', 'training', 'pipeline', 'profile', 'help']); // Training, Pipeline and Profile on the rail, not behind More (Marty 2026-10-11); Help = support tickets (2026-10-16)
let ME = null, toastT;
// Deep links (2026-10-25): /credits#refuel, /credits#buy and /ads#engine scroll to their panel once it has loaded (and any
// sign-in or sponsor pop-up is closed) and flash it, so a button that says "Refuel" lands ON the Refuel panel.
const ANCHOR = { refuel: 'rfPanel', buy: 'buyPanel', engine: 'erPanel', kit: 'rkPanel' };
function focusAnchor() {
const id = ANCHOR[location.hash.slice(1)]; if (!id) return;
const t0 = Date.now();
const tick = () => {
const el = $(id);
if (!el || el.hidden || !el.offsetParent || document.querySelector('.modal-back')) { if (Date.now() - t0 < 90000) setTimeout(tick, 400); return; }
el.scrollIntoView({ behavior: 'smooth', block: 'start' });
el.classList.remove('cr-flash'); void el.offsetWidth; el.classList.add('cr-flash');
// panels above it (packages, purchases) can still be loading and push it down, mostly on phones: settle once more
setTimeout(() => { const r = el.getBoundingClientRect(); if (Math.abs(r.top) > 60) el.scrollIntoView({ block: 'start' }); }, 1600);
};
setTimeout(tick, 200);
}
// Arrival strip (2026-10-25, Marty: "it took me to LinkSpin, but I really don't know how to pick up from there"): a link from
// InstantAdPay carries ?from=iap&task=<job>; the screen opens with one line naming the job, its first step, a guide and the way back.
const ARRIVE = {
refuel: ['refuel LinkSpin', 'pick a package of $25 or more (marked "counts for Refuel") under Buy a package, then press Buy. It counts toward the same streak as InstantAdPay.', '/refuel', 'How the Refuel streak works'],
conversions: ['set up conversion tracking', 'press Add a goal and name it, for example subscriber or sale. Then paste its two snippets on your pages.', '/conversion-tracking', 'Step-by-step setup guide'],
bannerspin: ['make a Banner Spin', 'press + New Banner Spin, pick a banner size and add up to 5 banners. LinkSpin keeps showing the one that gets clicked.'],
spinlink: ['make a spin link', 'press + New spin and paste the page you promote. You get one short link to use in your ads.'],
testing: ['test A against B', 'open your spin link and add a second page under Destinations (or a second banner to a Banner Spin). The rotation picks the winner.'],
page: ['build a page', 'press + New page, fill it in and publish it. Then add it to a spin link.'],
ads: ['check your LinkSpin ads', 'your LinkSpin ads are listed on this screen. Open the one you came for to top it up or relaunch it.'],
};
const qp = (() => { try { return new URLSearchParams(location.search); } catch (e) { return new URLSearchParams(''); } })();
const ARR = qp.get('from') === 'iap' ? (ARRIVE[qp.get('task')] || ['carry on from InstantAdPay', 'use the menu on the left. Everything here signs in with the same email.']) : null;
function arriveStrip() {
if (!ARR || $('crArrive')) return '';
if (!document.getElementById('crArriveCss')) { const st = document.createElement('style'); st.id = 'crArriveCss'; st.textContent = '.arrive{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;margin:12px 24px 0;padding:10px 14px;border:1px solid var(--sig,#ff6a1a);border-radius:8px;background:#FFF8F2;font-size:13.5px;line-height:1.45}.arrive .grow{flex:1 1 auto}.arrive button{border:0;background:none;font-size:18px;line-height:1;cursor:pointer;color:inherit;padding:0 2px}@media (max-width:900px){.arrive{margin:10px 16px 0}}.cr-flash{animation:crFlash 2.4s ease-out 1}@keyframes crFlash{0%,40%{box-shadow:0 0 0 4px rgba(255,106,26,.55)}100%{box-shadow:0 0 0 0 rgba(255,106,26,0)}}'; document.head.appendChild(st); }
return '<div class="arrive" id="crArrive" role="note"><span><b>You came from InstantAdPay to ' + esc(ARR[0]) + '.</b> <span id="crArriveSi">Sign in with the same email you use on InstantAdPay, then </span><b>Step 1:</b> ' + esc(ARR[1])
+ (ARR[2] ? ' <a href="' + ARR[2] + '" target="_blank" rel="noopener">' + esc(ARR[3]) + '</a>' : '') + '</span><span class="grow"></span><a href="https://instantadpay.com/my#engine">Back to InstantAdPay</a><button type="button" aria-label="Hide this note" id="crArriveX">&times;</button></div>';
}
// Expired session (Marty 2026-10-23: "told me to sign in but never redirected me"): sessions last 24 h, and a screen
// left open past that got 'Sign in first.' errors with no way forward. Any 401 from our API, or coming back to a tab
// whose session has lapsed, opens the in-shell sign-in once and reloads the screen after it.
@@ -61,19 +97,28 @@ window.CR = (function () {
if (document.getElementById('iapChat') || document.querySelector('script[src^="/assets/chat.js"]')) return;
const s = document.createElement('script'); s.src = '/assets/chat.js?v=20261018c'; s.defer = true; document.body.appendChild(s);
}
function railActive(o) { let a = o.active; if (a === 'credits' && location.hash === '#refuel') a = 'refuel'; return a; }
function mount(o) {
const page = $('page'); if (!page) return;
chat();
if (!document.getElementById('crFlashCss')) { const st = document.createElement('style'); st.id = 'crFlashCss'; st.textContent = '.cr-flash{animation:crFlash 2.4s ease-out 1}@keyframes crFlash{0%,40%{box-shadow:0 0 0 4px rgba(255,106,26,.55)}100%{box-shadow:0 0 0 0 rgba(255,106,26,0)}}'; document.head.appendChild(st); }
const act = railActive(o);
const app = document.createElement('div'); app.className = 'app'; let railWide = true; try { railWide = localStorage.getItem('cr.rail') !== 'narrow'; } catch (e) {} if (railWide) app.classList.add('wide'); // expanded by default (Marty 2026-10-08), the choice remembered per browser
app.innerHTML = '<nav class="rail" aria-label="LinkSpin"><a class="mark" href="/" aria-label="LinkSpin home" title="LinkSpin"></a>'
+ NAV.map(([k, label, href, svg, sec]) => '<a ' + (k === 'help' ? 'id="crHelp" ' : '') + 'href="' + (BUILT.has(k) ? href : FALLBACK[k]) + '"' + (k === o.active ? ' class="on' + (sec ? ' rsec' : '') + '" aria-current="page"' : (sec ? ' class="rsec"' : '')) + ' title="' + label + '" aria-label="' + label + '"><svg viewBox="0 0 24 24">' + svg + '</svg><span class="lbl">' + label + '</span></a>').join('')
+ NAV.map(([k, label, href, svg, sec]) => '<a ' + (k === 'help' ? 'id="crHelp" ' : '') + 'href="' + (BUILT.has(k) ? href : FALLBACK[k]) + '"' + (k === act ? ' class="on' + (sec ? ' rsec' : '') + '" aria-current="page"' : (sec ? ' class="rsec"' : '')) + ' title="' + label + '" aria-label="' + label + '"><svg viewBox="0 0 24 24">' + svg + '</svg><span class="lbl">' + label + '</span></a>').join('')
+ '<span class="sp"></span><button class="railtog" type="button" id="crRailTog" title="Collapse or expand the menu" aria-label="Collapse or expand the menu"><svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span class="lbl">Collapse</span></button></nav>'
+ '<div class="main"><div class="topbar"><div><div class="crumb">' + esc(o.crumb || 'Control room') + '</div><h1>' + esc(o.title || '') + '</h1></div><span class="readout" id="crSub">' + esc(o.sub || '') + '</span><span class="grow"></span><span id="crActions">' + (o.actions || '') + '</span><button class="who" type="button" id="crUserBtn" title="Account"><i id="crAv"></i><span id="crWho">Sign in</span></button></div>'
// pre-launch notice (Marty, 2026-10-17): open to everyone from today, official launch November 15
+ '<div class="prelaunch" role="note"><b>Pre-launch testing until November 15.</b> Everything is live and working, but features and screens may change while we test. Questions? Use <a href="/help">Help</a>.</div>'
+ '<div id="crBody"></div>'
+ arriveStrip() + '<div id="crBody"></div>'
+ '<div class="strip" id="crStrip"><span><span class="dot off" id="stDot"></span>rotator <b id="stHealth">checking</b></span><span>served today <b id="stServed">·</b></span><span>zones live <b id="stZones">·</b></span><span>network <b id="stNet">·</b></span><span class="grow"></span><span id="stClock"></span></div></div>';
page.parentNode.insertBefore(app, page); app.querySelector('#crBody').appendChild(page);
if ($('crArriveX')) $('crArriveX').addEventListener('click', () => { const a = $('crArrive'); if (a) a.remove(); });
// the rail's Refuel item while already on Credits: only the hash changes, so scroll by hand (and again on a repeat click)
const paintRail = () => { const a2 = railActive(o); app.querySelectorAll('.rail a[href]').forEach(x => { const k = x.getAttribute('href') === '/credits#refuel' ? 'refuel' : x.getAttribute('href') === '/credits' ? 'credits' : null; if (k) { x.classList.toggle('on', k === a2); if (k === a2) x.setAttribute('aria-current', 'page'); else x.removeAttribute('aria-current'); } }); };
app.querySelectorAll('.rail a[href="/credits#refuel"]').forEach(x => x.addEventListener('click', e => { if (location.pathname !== '/credits') return; e.preventDefault(); history.replaceState(null, '', location.pathname + location.search + '#refuel'); paintRail(); focusAnchor(); }));
window.addEventListener('hashchange', () => { paintRail(); focusAnchor(); });
focusAnchor();
$('crRailTog').addEventListener('click', () => { const wide = !app.classList.contains('wide'); app.classList.toggle('wide', wide); try { localStorage.setItem('cr.rail', wide ? 'wide' : 'narrow'); } catch (e) {} });
$('crUserBtn').addEventListener('click', async e => { e.preventDefault(); if (!ME || !ME.signedIn) return signInFlow(() => location.reload()); const v = await dialog({ title: ME.username ? '@' + ME.username : (ME.email || 'Account'), text: 'Signed in on LinkSpin. Your classic dashboard is still at /my.', ok: 'Sign out', no: 'Close', danger: true }); if (v) { try { await api('/api/auth/logout'); } catch (er) {} location.reload(); } });
clock(); setInterval(clock, 30000);
@@ -84,14 +129,14 @@ window.CR = (function () {
try { const s = await get('/api/my/strip'); $('stDot').className = 'dot' + (s.ok ? '' : ' off'); $('stHealth').textContent = s.ok ? 'healthy' : 'degraded'; $('stServed').textContent = fmt(s.served); $('stZones').textContent = fmt(s.zones); $('stNet').textContent = s.network ? 'on' : 'off'; }
catch (e) { $('stHealth').textContent = 'offline'; }
}
function whoPaint(m) { const w = $('crWho'), a = $('crAv'); if (!w) return; if (m && m.signedIn) { const name = m.username ? '@' + m.username : (m.email || '').split('@')[0]; w.textContent = name; a.textContent = (m.username || m.email || '?').replace(/^@/, '').slice(0, 2).toUpperCase(); } else { w.textContent = 'Sign in'; a.textContent = ''; } }
function whoPaint(m) { const si = $('crArriveSi'); if (si) si.hidden = !!(m && m.signedIn); const w = $('crWho'), a = $('crAv'); if (!w) return; if (m && m.signedIn) { const name = m.username ? '@' + m.username : (m.email || '').split('@')[0]; w.textContent = name; a.textContent = (m.username || m.email || '?').replace(/^@/, '').slice(0, 2).toUpperCase(); } else { w.textContent = 'Sign in'; a.textContent = ''; } }
const sub = t => { const s = $('crSub'); if (s) s.textContent = t; };
async function me(force) { if (ME && !force) return ME; try { ME = await (await fetch('/api/me', { headers: { Accept: 'application/json' } })).json(); } catch (e) { ME = { signedIn: false }; } return ME; }
// sign-in inside the shell: email -> six-digit code, on the same endpoints and guards as the dashboard.
const FTS = Date.now();
async function signInFlow(onReady) {
let host = $('crModalHost'); if (!host) { host = document.createElement('div'); host.id = 'crModalHost'; document.body.appendChild(host); }
host.innerHTML = '<div class="modal-back"><div class="modal" role="dialog" aria-modal="true"><h2>Sign in</h2><div class="ink2">Email first. We send a six-digit code; no password to remember. New here? The same box creates your account.</div>'
host.innerHTML = '<div class="modal-back"><div class="modal" role="dialog" aria-modal="true"><h2>Sign in</h2>' + (ARR ? '<div class="ink2" style="margin-bottom:6px"><b>Use the same email you use on InstantAdPay.</b> You land right back here to ' + esc(ARR[0]) + '.</div>' : '') + '<div class="ink2">Email first. We send a six-digit code; no password to remember. New here? The same box creates your account.</div>'
+ '<label class="lbl">Email<input class="field" id="siEmail" type="email" autocomplete="email" placeholder="you@example.com"></label>'
+ '<div id="siCodeRow" hidden><label class="lbl">Code from the email<input class="field mono" id="siCode" inputmode="numeric" maxlength="6" placeholder="123456"></label></div>'
+ '<div class="muted" id="siMsg"></div><div class="acts"><a class="btn" href="/tools">More tools</a><button class="btn pri" type="button" id="siGo">Send code</button></div></div></div>';
@@ -114,7 +159,7 @@ window.CR = (function () {
} else {
go.disabled = true; say('Checking…');
await api('/api/auth/email/verify', { email: email.value.trim(), code: code.value.trim() });
host.innerHTML = ''; ME = null; await me(true); toast('You are in'); onReady && onReady(ME);
host.innerHTML = ''; ME = null; await me(true); toast('You are in'); try { window.dispatchEvent(new Event('cr:signedin')); } catch (er) {} onReady && onReady(ME); // panels that loaded signed out (Refuel, Engine Room) reload on this
}
} catch (e) { go.disabled = false; say(e.message, true); }
}
+5 -1
View File
@@ -28,12 +28,16 @@
CR.tile({ k: 'Qualification', v: bc + ' of ' + (bc >= 5 ? 5 : bc >= 2 ? 5 : 2), note: bc >= 5 ? 'levels 2 and 3 open' : bc >= 2 ? 'level 2 open · 5 opens level 3' : 'buyers to open level 2' })
].join('');
}
// the Monthly Refuel threshold in cents once fuel.js has the member's refuel view (2026-10-25); 0 while the switch is off
const rfMin = () => { const v = window.FUEL && window.FUEL.refuel; return v && v.on && v.minUsd ? Math.round(Number(v.minUsd.linkspin) * 100) : 0; };
window.LSCredits = { repaint: () => { if (CAT && CAT.length) paintPkgs(); } };
function paintPkgs() {
const live = CAT.filter(p => p.active !== false && p.exists !== false);
if (!live.length) { $('pkgs').innerHTML = '<div class="muted">No packages are on sale right now.</div>'; return; }
if (!SEL) SEL = (live.find(p => p.priceCents === 2500) || live[0]).id;
$('pkgs').innerHTML = live.map(p => '<button type="button" class="pk' + (p.id === SEL ? ' on' : '') + '" data-id="' + p.id + '"><span class="k">' + esc(NAMES[p.priceCents] || 'Package') + '</span><span class="price">' + usd(p.priceCents) + '</span><span class="cr">' + fmt(p.creditAmount) + ' credits</span>'
+ (p.priceCents >= 2500 ? '<span class="tag ok">qualifies</span>' : '<span class="tag">does not qualify</span>') + '</button>').join('');
+ (p.priceCents >= 2500 ? '<span class="tag ok">qualifies</span>' : '<span class="tag">does not qualify</span>')
+ (rfMin() && p.priceCents >= rfMin() ? '<span class="tag ok" title="A package this size counts as your monthly refuel (or a Pit Stop when this cycle is already refueled here)">counts for Refuel</span>' : '') + '</button>').join('');
$('pkgs').querySelectorAll('.pk').forEach(b => b.addEventListener('click', () => { SEL = Number(b.dataset.id); paintPkgs(); paintQuote(); paintGoes(); }));
}
const sel = () => CAT.find(p => p.id === SEL);
+21 -6
View File
@@ -6,13 +6,23 @@
const host = document.getElementById(root.dataset.host || 'erPanel');
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
const n = v => Number(v || 0).toLocaleString('en-US');
const sameSite = url => { try { return new URL(url).host === location.host ? new URL(url).pathname + new URL(url).hash : url; } catch (e) { return url; } };
// a link on this site becomes a plain path; a link to the other site carries ?from=<this site>&task=<job> so the other
// site opens with an arrival strip naming the job and its first step (2026-10-25, Marty lost the thread on LinkSpin)
const TASK = { tracking: 'conversions', start: 'refuel', refuel: 'refuel', pitstop: 'refuel', bannerspin: 'bannerspin', testing: 'testing', relaunch: 'ads', topup: 'ads', cut: 'ads', cruise: 'ads' };
let FROM = 'iap';
const siteOf = u => /linkspin/i.test(u.host) ? 'linkspin' : 'iap'; // which site a link belongs to, by its host (also right on a local copy)
const go = (url, task) => { try { const u = new URL(url); if (u.host === location.host || siteOf(u) === FROM) return u.pathname + u.search + u.hash; if (task) { u.searchParams.set('from', FROM); u.searchParams.set('task', task); } return u.href; } catch (e) { return url; } };
// "Refuel LinkSpin this cycle..." gets a way there (2026-10-25): the other site's buy screen, tagged for its arrival strip
const otherBuy = note => { const m = /^Refuel (LinkSpin|InstantAdPay) /.exec(note || ''); if (!m) return '';
const url = m[1] === 'LinkSpin' ? 'https://linkspin.app/credits#refuel' : 'https://instantadpay.com/my#buy';
return ' <a href="' + esc(go(url, 'refuel')) + '">Refuel ' + m[1] + (ext(url) ? ' &#8599;' : '') + '</a>'; };
const ext = url => { try { const u = new URL(url); return u.host !== location.host && siteOf(u) !== FROM; } catch (e) { return false; } };
const css = '.er{display:grid;gap:14px}.er-locked{opacity:.45;filter:grayscale(1);pointer-events:none}.er-dials{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px}'
+ '.er-dial{border:1px solid rgba(127,127,127,.3);border-radius:10px;padding:10px 12px;text-align:center;min-width:0}.er-dial svg{width:100%;max-width:200px;height:auto;display:block;margin:0 auto}'
+ '.er-dial .v{font-size:22px;font-weight:700;margin-top:-6px}.er-dial .c{font-size:12px;opacity:.8}.er-row{display:flex;flex-wrap:wrap;gap:8px}'
+ '.er-light{display:flex;gap:6px;align-items:center;border:1px solid rgba(127,127,127,.3);border-radius:999px;padding:4px 10px;font-size:12.5px}.er-dot{width:10px;height:10px;border-radius:50%;background:rgba(127,127,127,.45);flex:none}'
+ '.er-dot.on{background:#e8a317}.er-dot.green{background:#2fa36b}.er-dot.amber{background:#e8a317}.er-dot.grey{background:rgba(127,127,127,.45)}.er-parts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:8px}'
+ '.er-part{border:1px solid rgba(127,127,127,.3);border-radius:8px;padding:8px 10px;font-size:13px;display:grid;gap:3px;min-width:0}.er-part b{display:flex;gap:6px;align-items:center}.er-next{border:1px solid rgba(127,127,127,.4);border-radius:10px;padding:12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}'
+ '.er-part{border:1px solid rgba(127,127,127,.3);border-radius:8px;padding:8px 10px;font-size:13px;display:grid;gap:3px;min-width:0}.er-part b{display:flex;flex-wrap:wrap;gap:2px 6px;align-items:center}.er-next{border:1px solid rgba(127,127,127,.4);border-radius:10px;padding:12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}'
+ '.er-next .w{flex:1 1 220px;font-size:13px}.er-h{font-size:12px;letter-spacing:.06em;text-transform:uppercase;opacity:.75;margin:0}.er-streak{font-size:13.5px;line-height:1.5}.er-goal{display:flex;gap:6px;align-items:center;justify-content:center;margin-top:6px;font-size:12px}.er-goal input{width:70px}';
if (!document.getElementById('erCss')) { const st = document.createElement('style'); st.id = 'erCss'; st.textContent = css; document.head.appendChild(st); }
// a plain 180-degree dial; pct null = no reading
@@ -35,13 +45,16 @@
+ 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).'
+ (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)
+ (typeof s.note === 'string' ? (s.note ? ' ' + esc(s.note) + otherBuy(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>';
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)
+ (p.state !== 'green' && p.link ? '<a href="' + esc(go(p.link, p.key)) + '">' + (p.state === 'grey' ? 'Set it up' : 'Fix it') + (ext(p.link) ? ' on ' + (FROM === 'iap' ? 'LinkSpin' : 'InstantAdPay') + ' &#8599;' : '') + '</a>' : '') + '</div>').join('') + '</div></div>';
const nextLink = go(d.next.link, TASK[d.next.key]);
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)
+ (d.next.guide ? '<br><a href="' + esc(d.next.guide) + '" target="_blank" rel="noopener" style="font-size:12.5px">' + (d.next.key === 'tracking' ? 'Step-by-step setup guide' : 'How the Refuel streak works') + '</a>' : '') + '</div>'
+ '<a class="btn' + (d.locked ? '' : ' pri') + '" href="' + esc(nextLink) + '">' + esc(d.next.label) + (ext(d.next.link) ? ' on ' + (FROM === 'iap' ? 'LinkSpin' : 'InstantAdPay') : '') + '</a></div>';
const how = d.next.guide === '/refuel' ? '' : '<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>';
}
@@ -52,6 +65,7 @@
if (!d || !d.on) { if (host) host.hidden = true; return; }
if (host) host.hidden = false;
if (d.error) { root.innerHTML = '<p class="small muted">' + esc(d.error) + '</p>'; return; }
FROM = d.site === 'linkspin' ? 'linkspin' : 'iap';
root.innerHTML = view(d);
const save = root.querySelector('[data-er-save]');
if (save) save.addEventListener('click', async () => {
@@ -63,4 +77,5 @@
}
window.ENGINE_ROOM = { load };
load(); setInterval(() => { if (!document.hidden) load(); }, 120000);
window.addEventListener('cr:signedin', () => load(true)); // LinkSpin's in-shell sign-in: the panel loaded signed out
})();
+13 -4
View File
@@ -5,7 +5,10 @@
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[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)
const HOW = '<p class="muted" style="margin:10px 0 0"><a href="/refuel" target="_blank" rel="noopener">How the Refuel streak works</a>' + (location.pathname === '/ads' ? '' : ' &middot; <a href="/ads#engine">Engine Room</a>') + '</p>'; // the member guide (2026-10-24); Engine Room link (2026-10-25)
// the one action, said plainly (2026-10-25): which package counts, and a button that lands on the package picker
const buyBtn = (v, label, pri) => '<p style="margin:0 0 8px">Any package of <b>$' + v.minUsd.linkspin + ' or more</b> here counts (marked <b>counts for Refuel</b> under Buy a package).</p>'
+ '<a class="btn' + (pri ? ' pri' : '') + '" href="/credits#buy" data-rf-buy>' + label + '</a>';
function site(name, s, minUsd) {
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 + '% &middot; ' + n(s.bonus) + ' bonus credits</b></div>'
@@ -16,17 +19,19 @@
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>' + HOW;
+ buyBtn(v, 'Buy a $' + v.minUsd.linkspin + '+ package to start', true) + HOW;
}
const c = v.cycle || {};
let h = v.windowOpen
? '<p style="margin:0 0 8px"><b>Your refuel window is open.</b> Refuel day <b>' + esc(v.refuelDayLabel) + '</b>, grace to ' + esc(v.graceLabel) + ' (Central). Next refuel: +' + v.next.single + '%, or +' + v.next.both + '% on each site with both.</p>'
: '<p style="margin:0 0 8px">Next refuel day <b>' + esc(v.refuelDayLabel) + '</b> (Central). Window opens ' + esc(v.opensLabel) + ', grace to ' + esc(v.graceLabel) + '.</p>';
if (c.month) h += '<div style="margin:0 0 8px">' + site('InstantAdPay', c.iap, v.minUsd.iap) + site('LinkSpin', c.linkspin, v.minUsd.linkspin) + '</div>';
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.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 + '%.'
+ (c.linkspin && c.linkspin.refueled ? ' <a href="https://instantadpay.com/my#buy" target="_blank" rel="noopener">Buy on InstantAdPay &#8599;</a>' : '') + '</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>' + HOW;
const lsDone = c.linkspin && c.linkspin.refueled;
return h + buyBtn(v, v.windowOpen ? 'Refuel now: buy a $' + v.minUsd.linkspin + '+ package' : lsDone ? 'Buy another package' : 'Buy a $' + v.minUsd.linkspin + '+ package', v.windowOpen || !lsDone) + HOW;
}
async function load() {
const panel = $('rfPanel'); if (!panel) return;
@@ -36,6 +41,9 @@
if (!v || !v.on) { panel.hidden = true; return; }
$('rfMeta').textContent = v.active ? 'streak: ' + v.streak + ' month' + (v.streak === 1 ? '' : 's') : 'shared with InstantAdPay';
$('rfBody').innerHTML = body(v); panel.hidden = false;
// on Credits the button just scrolls to the package picker (no reload); the picker then marks which packages count
panel.querySelectorAll('[data-rf-buy]').forEach(a => a.addEventListener('click', e => { if (location.pathname !== '/credits') return; e.preventDefault(); history.replaceState(null, '', location.pathname + location.search + '#buy'); window.dispatchEvent(new HashChangeEvent('hashchange')); }));
if (window.LSCredits) window.LSCredits.repaint();
} catch (e) { panel.hidden = true; }
}
window.FUEL.loadRefuel = load;
@@ -97,4 +105,5 @@
}
window.FUEL.loadKits = loadKits;
loadKits();
window.addEventListener('cr:signedin', () => { load(); loadKits(); }); // signed in from the shell's pop-up (arrivals from InstantAdPay)
})();
+1 -1
View File
@@ -68,7 +68,7 @@
<div id="goalReports"></div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/conversions.js?v=20261023a"></script>
</body>
</html>
+4 -4
View File
@@ -34,7 +34,7 @@
<div class="tiles" id="tiles"></div>
<div class="two">
<div style="display:grid;gap:16px;align-content:start">
<div class="panel" style="padding:0">
<div class="panel" id="buyPanel" style="padding:0">
<div class="ph"><h3>Buy a package</h3><span class="meta" id="buyMeta">priced in dollars · settled in POL at the live rate · one transaction</span></div>
<div style="padding:14px 16px 16px;display:grid;gap:14px">
<div class="pkgs" id="pkgs"><div class="muted">loading packages…</div></div>
@@ -83,8 +83,8 @@
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/wallet.js?v=20261021a"></script>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/credits-screen.js?v=20261019pos"></script>
<script src="/assets/fuel.js?v=20261024rg"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/credits-screen.js?v=20261025ff"></script>
<script src="/assets/fuel.js?v=20261025ff"></script>
</body>
</html>
+1 -1
View File
@@ -29,7 +29,7 @@
<div id="page">
<div class="body" id="helpBody"><div class="panel"><span class="muted">loading</span></div></div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/help-screen.js?v=20261016a"></script>
</body>
</html>
+1 -1
View File
@@ -252,7 +252,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/links.js?v=20261021t"></script>
<script src="/assets/banner-spin.js?v=20261020bs3"></script>
</body>
+1 -1
View File
@@ -1008,7 +1008,7 @@
</div>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/tools.js?v=20261011a"></script>
<script src="/assets/wallet.js?v=20261021a"></script>
<script src="/assets/promo.js?v=20261020bs3"></script>
+1 -1
View File
@@ -72,7 +72,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/pages-screen.js?v=20261021t"></script>
</body>
</html>
+1 -1
View File
@@ -89,7 +89,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/reports.js?v=20261020bs3"></script>
</body>
</html>
+1 -1
View File
@@ -123,7 +123,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/sources-screen.js?v=20261023a"></script>
</body>
</html>
+1 -1
View File
@@ -37,7 +37,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/team.js?v=20261020s"></script>
</body>
</html>
+1 -1
View File
@@ -31,7 +31,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/wallet-screen.js?v=20261023ov"></script>
</body>
</html>
+1 -1
View File
@@ -41,7 +41,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023c"></script>
<script src="/assets/cr-shell.js?v=20261025ff"></script>
<script src="/assets/zones-screen.js?v=20261010a"></script>
</body>
</html>
+1 -1
View File
@@ -3904,7 +3904,7 @@ const server = http.createServer(async (req, res) => {
if (!refuel.cfg().on) return json(res, 200, { on: false });
const [own, peer] = await Promise.all([engine.facts({ site: 'linkspin', adminMember, ads, coach, bannerspin, rotator, pages, convtrack }, s.email), engineFromIap(s.email, u.searchParams.get('fresh') === '1')]);
if (!peer || !peer.refuel) return json(res, 200, { on: true, error: 'InstantAdPay did not answer just now. Try again in a minute.' });
return json(res, 200, engine.build({ refuel: peer.refuel, iap: peer.facts, ls: own, goal: peer.refuel.goal }));
return json(res, 200, engine.build({ site: 'linkspin', refuel: peer.refuel, iap: peer.facts, ls: own, goal: peer.refuel.goal }));
}
if (p === '/api/my/engine/goal' && req.method === 'POST') {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });