Compare commits

...

37 Commits

Author SHA1 Message Date
martbost 68061284ef QA for the themes: contrast check in both themes, QA_THEME walks, theme-switch assertions
qa/theme-contrast.mjs (bash qa/run.sh theme) loads the public pages and the member area in light and dark with Playwright, samples the main text/background pairs (body and muted text, links, buttons, chips, tags, stage pills, table text, panel headings, fields) with composited ancestor backgrounds and gradient averages, injects one probe per variant so every pair is measured even when a page has no live example, and reports the ratio per pair with pass/fail at 4.5:1 (3:1 for large text). One account per theme, since the account value wins at sign-in. Result today: 2,413 pairs, 0 fails, worst 4.63:1.

qa/walk.mjs honours QA_THEME=light|dark|auto (localStorage set before the first navigation; screenshots carry a -<theme> suffix so both sets survive), asserts the topbar and Profile switch (applies at once, saves to the account, repaints the other control), and screenshots the public home, the member's wall and the join page from the local copy. Requests the page cancels by navigating away (net::ERR_ABORTED) no longer count as failures, and the local-only /api/qr 404 (no qrcode module in a checkout) is ignored for images. Both QA_THEME walks: 0 bugs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 10:57:58 -06:00
martbost b84eed3be5 Theme switch: auto | light | dark, stored in localStorage ls.theme and on the account, applied before first paint on every page
themehead.js is the one source of the tiny inline head script (and of AUTO_DEFAULT, the one constant Marty decides later: 0 = nothing stored keeps the page's current look, light for Control Room and public pages, dark for the sapphire pages; 1 = follow the device). The script sets data-theme on <html> from ls.theme (auto follows prefers-color-scheme and tracks changes live) and exposes window.LSTheme. tools/stamp-theme-head.cjs writes it into every static page before the first stylesheet with data-theme-base on <html>; blog, leaderboard, what's-new, the badge page, the unsubscribe page and the wall 404 read the module directly. The site CSP allows inline scripts by hash only, so themehead.CSP_HASH joins script-src (the script was silently blocked until then).

Account side: accounts.theme (JSON store and MySQL, alterSafe column), in the public account JSON and /api/me; POST /api/my/profile {theme} rides the existing profile save path and never touches the username. cr-shell.js renders a Light / Dark / Auto segmented control in the topbar of every Control Room screen and paints every .theme-seg on the page (the Profile pane gains an Appearance card with the same control); a click applies at once, saves locally and to the account when signed in; at sign-in the account value wins over the local one, and a local choice is pushed up when the account has none yet. view.html stops reading an undefined --bg so its light variant has a light stage. ?v= tags bumped on every changed stylesheet and script (20261101t / ls20261101t).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 10:44:40 -06:00
martbost 7c8f204f5a Light and dark themes as token sets (Marty 2026-11-01: a member asked for both, for vision-impaired readers and people who struggle with bright or dark screens)
cr.css and pub.css gain :root[data-theme="dark"]: deep navy workspace (#0B1424 ground, #142338 panels, #1B2D47 panel-2), near-white ink, readable muted, quiet lines, the blue accent and signal orange retuned so text on them and they on the ground clear WCAG AA 4.5:1 (accent-ink/sig-ink/ok-ink/bad-ink/on-ink tokens carry the text colour for each fill), soft fills as dark tints, flatter darker shadows; the chrome rail, topbar and strip stay as they are. site.css (the sapphire pages) gains :root[data-theme="light"]: light ground, white panels, dark ink, the same blue family darkened to read on white, the chrome headline gradient turned blue steel so it still shows.

Audit of stray literals: every raw hex/rgba that encoded a surface, text, border or soft fill in the five stylesheets now reads a token (new tokens: field-bg, btn-bg, btn-blue, panel-grad(-hi/-deep), ph-a/b, hl, grid-dot, bg-glow, row-hover, panel-glass, sh-lg, note-*, violet-*, *-line, chrome-hi/warm, mint-faint/soft-2/line/line-2/deep/pale, gold-*, amber-*, cyan-*, muted-soft, ink-faint, ground-soft, nav-bg, side-bg, pill-bg, glow). tools.css maps every site.css token onto a Control Room token (its hard-coded --ink and --mint-ink are gone), admin.css loses its white/slate literals. Stage and pipeline palettes get a lifted dark variant; .stg text mixes the stage colour with ink so 10.5px pills pass in both themes. Light-side tuning for AA: muted #596984, ok #0B7A52, warn #B23A0A, sig-2 #B8420A, and the orange primary button carries navy text (white on #FF6A1A was 2.9:1).

Scripts that draw UI read tokens: my.js charts take their colours from getComputedStyle at draw time (CH proxy), donut caption and rank/wallet/ready badges use var(--muted)/var(--gold)/var(--ok); admin.js, credits-screen.js, engine-room.js, common.js (wordmark stroke) and cr-shell.js (arrival strip) likewise. Left as literals on purpose: brand gradients on the orange primary buttons, glows and drop shadows, overlays (modal backdrops, the full-screen ad viewer), video/QR/banner-preview backings that must stay black or white, print styles, var() fallbacks, and the categorical stage colours themselves.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 10:44:20 -06:00
martbost 4c0a68cbdd Coach nudges never guess from a failed chain read, and the site owner is never coached (Marty 2026-10-31): a chain.member() failure cached null for 60 s, rungFor() then classed the member as "payouts on, no purchase" and mailed the rung-2 "See a payout land: your first package" nudge to the owner (memberId 1, 4 purchases, 7 buyers). describe() now reports unknown and stalled requires a known state; nudgeTick skips adminEmail.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-31 07:44:19 -05:00
martbost 12788e799f Policy test follows the new link-farm report wording (new / still watched / left the list)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-31 07:29:06 -05:00
martbost 58dcbf8cee Link-farm scan reports only changes: new candidates since the last run and accounts that left the list (wallet linked, bought, deleted), with the still-watched count; candidates carry firstSeen (Marty 2026-10-31: watch, do not delete yet)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-31 07:26:41 -05:00
martbost a24e90b590 Pages host (lookfirst.page) serves page-builder media too: /niches/<file> and /uploads/<id>.<ext>; the builder pages live on the pages host, not the link domains (Neville 2026-10-30)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-30 14:46:50 -05:00
martbost db4308c5fc Link domains serve page-builder media: /niches/<file> and /uploads/<id>.<ext> on the short link domains (Neville 2026-10-30: images showed in Preview on linkspin.app but 404ed on the live lookfirst.page link because the mini-site answered gone for every path but its own five)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-30 14:44:15 -05:00
martbost f69453648b Wall profile rendering: a purchase alone decides (a quarantined account that buys a package gets its bio and links back, as the quarantine notice promises)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-30 07:33:19 -05:00
martbost bdf1aab06c Link-farm hardening (2026-10-30 incident: 106 free accounts synced from InstantAdPay carried casino bios and website links; Google indexed the text through /wall pages)
Public walls: profile fields (bio, avatar, socials, intro video) render only for a paying member (memberId > 0 or a registered position), on /api/wall and in the OG image; a free account's wall shows the name, the line's ads and the join call. The meta/og description is a fixed site sentence with the handle, never the bio. Outbound profile links are rel="sponsored ugc noopener" target="_blank". A deleted or unknown name is a real 404 with X-Robots-Tag noindex (was a bare "Banner wall" page at 200, a soft 404 that stayed indexed).

Policy (prohibited.js, byte-for-byte copy of InstantAdPay's): bios may not carry a URL or a domain token ("Links go in the social fields, not the bio"); gambling, adult, pharma, weapons and link-selling terms (Unicode aware) are refused in bios, social URLs, line banner targets, wall offers and every campaign field, with the refusal logged. The registry ingest from InstantAdPay drops a bio with a link or a prohibited term instead of storing it; iapsync applies the same on the way out.

Quarantine rule: a brand-new free account (no wallet, no sponsor, under 24 h) whose first profile save plants a link is saved with profileQuarantined (JSON + MySQL column), never rendered publicly, and told "Your profile links will appear after your first ad package"; the admin member card shows the flag.

Daily link-farm scan (spamscan.js, same copy as InstantAdPay): in-app job at 06:30 Central, claimOnce per day, lists memberId-0 walletless accounts with a link plus a farm signal (prohibited term, sign-in over within 15 min, no sponsor), skips the spamScanAllow setting (seeded), writes DATA_DIR/wall-spam-scan.json and sends one "LinkSpin link-farm scan" Telegram to the private admin chat only when there are candidates. Admin > Members > Link-farm list: rows with "also on InstantAdPay" (local registry mirror), Delete selected (existing DELETE /api/admin/member, on-chain refused, no cascade) and Allow.

Terms section 9 "Prohibited content", bio hint in the profile editor, chatbot canned answer + kb-seed entry "What content is not allowed?", KNOWLEDGE_DATE 2026-10-30. Test: qa/profile-policy.test.cjs (unit + local copy, hash check against the InstantAdPay copies; runs in qa/run.sh member and policy).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-30 07:32:07 -05:00
martbost be38f454ef QA: LinkSpin's public walk targets linkspin.app (the instantadpay.com default was a copy-paste leftover, so the public run had been checking the wrong site)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-29 10:56:53 -05:00
martbost 86b60f493c Traffic guide rendered empty since 2026-10-28: a // comment inside the network filter one-liner swallowed the return and the closing brackets, so traffic-guide.js failed to parse (Marty saw it on his phone 2026-10-29). Comment moved out, ?v=20261029b. QA: node --check syntax gate on every script in every run.sh mode; /traffic-guide, /refuel and /conversion-tracking added to the public walk
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-29 10:51:46 -05:00
martbost 1e8addc801 Traffic guide (/traffic-guide): which ad formats convert for which offer, all 30 catalog networks with the formats they sell plus adult-heavy and strict-policy flags, ground rules; Sources screen gets a Traffic guide button, format tags in the New source picker (searchable by format) and a 'sells / best for' line on each source; chatbot answer + facts (Marty 2026-10-28: members asked what traffic suits which ads)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 07:30:28 -05:00
martbost 9ebbef2d21 Network rate 4:1 (Marty approved 2026-10-27, same as InstantAdPay): views off LinkSpin cost 1/synRateDivisor of the on-site rate, going forward
rates.synRateDivisor (default 4, Admin > Rates; 1 = the old rule). Network Ad Space impressions charge 1 credit per
impressionsPerCredit x N views; member campaigns shown in other members' zones on their own sites (zones.js serve,
offsite) are counted in the new synImps (not Views here) and charged one batch per N x the on-site batch (2 credits
per 40 banner views at N=4) through the same spend path, so burns follow what was charged. Fractions are exact (the
cumulative served count / the syn_batch counter carry the remainder). The budget is the limit: bookings, resume,
top-up and daily allowances are sized at the network rate, and a live ad booked at the old rate is topped up once.
Nothing already charged changes; zone owners keep earning as before. Ads screen + classic Campaigns show network and
partner-zone views marked at 1/4; chatbot canned answer + live AI fact; cache tags bumped.
QA: qa/run.sh nas (stop 9, ratio 10), loginqueue 13, refill 12, run.sh member passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 08:10:02 -05:00
martbost fd6f88cab7 Fix NAS stop trap on LinkSpin: snapshot true delivery before every stop, reconcile active ads only, restart stopped ads from the true count
The InstantAdPay 2026-09-17 fix was never ported. nas.deactivate zeroed `remaining` with no snapshot, so served =
assigned - remaining read the undelivered rest as delivered, and reconcileNas read EVERY status: a paused ad was
charged for its zeroed remainder (up to its budget) and stopped ads showed their whole allocation as network views.
Now: nas.deactivate returns the served count read before the stop; ads.stopNas persists it on pause, end and
exhaustion; reconcileNas only looks at active campaigns; resume/top-up of a stopped ad uses the new nas.restart
(re-bases assigned on the true count) instead of a plain top-up. QA: qa/nas-stop.test.cjs (9), loginqueue 13,
refill 12, run.sh member passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:56:56 -05:00
martbost 2d0413037d Holding tank on LinkSpin (ported from InstantAdPay 4645d56, Marty 2026-10-27): network sponsor ALIGNMENT first, the free activation held (never a purchase), 24-hour rotation, payouts switched on the moment someone is assigned
- Align first, every path (/api/me, /api/sponsor all intents incl. buy, carry.ensureOnChain via tank.gate, 15-min readyTick): a tank member (no sponsorRef, no member number, no resolvable cookie) whose email has a sponsor in the InstantAdPay registry rows, else a signed sponsor-facts call (3 s timeout, 10 min cache, one batch per tick), else the same wallet, is placed under that sponsor through accounts.setSponsorRef when the sponsor has a LinkSpin account; never a sponsor they were adopted/released/rescued away from, never a loop. Recorded in tank-ready.json, listed in Admin tank
- Hold ONLY the plain Switch on payouts (Marty: "I would never want to hold up a purchase ... they'll just pay number one"): the engine's wallet-link activation and seeding wait, /api/sponsor?intent=activate answers sponsorBlocked tankHold; intent=buy and /api/me never block (buys go ahead under #1 as before). A sponsor activated because someone below is buying is never held. Activate buttons now call intent=activate
- Ready badge + hours left (My line tank, Admin tank, Overview count); one shared-payments-topic line per newly ready member (digest when more than 3)
- 24-hour rotation through adopt(): own $25+ buy, fewer than 2 open, seen within 7 days, not company/#1, not a no-payout chain, not own downline; least recently auto-assigned first. Nobody eligible: keep holding, one admin alert. Never #1
- Payouts on at assignment (Marty approved 2026-10-27): adopted, auto-assigned or aligned member with a wallet is activated right away by carry.activateAssigned (strict: sponsor must be on the contract and not on a no-payout chain, never the fallback; retried every tick for 7 days); the auto-assign chat/email say "Your payouts are now on under @sponsor" with the Polygonscan link, a manual adoption gets a follow-up chat + email
- Deploy overlap: marks.js claims for the activation (per member per 10 min), the auto-assign, the ready post and the admin alert
- Cross-site: someone waiting in InstantAdPay's own tank (claimed account there, no sponsor, not a member there, wallet linked) is auto-assigned by InstantAdPay only (live sponsor-facts, registry fallback); LinkSpin defers and does not post them
- Chatbot: tank-hold canned answer, holding-tank answer + facts, KNOWLEDGE_DATE 2026-10-27; cache tags my.js / credits-screen.js / admin.js 20261027th
- QA: qa/tank-hold.test.mjs (unit with mocked clock + fake engine, then a local copy with a mock InstantAdPay and a browser check of Credits), qa/carry-activate.test.cjs (regression for the 10-22 scoping bug), run.sh tankhold + sponsorfollow; run.sh borrows InstantAdPay's node_modules when this checkout has none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:26:51 -05:00
martbost fd064b1db1 Fix carry.ensureOnChain: sponsorId/txHash/lastErr were declared inside the try but read after the finally, so every engine activation since a5c2c38 (2026-10-22) threw 'sponsorId is not defined' after the activateFor tx mined: member number not saved, notice not sent, in-flight flag stuck, and a buy whose sponsor needed activation fell back to #1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:12:51 -05:00
martbost c037923528 Remove every MoonPay mention and link (ZeroFox/MoonPay false-positive takedown, 2026-10-26)
- server.js: /api/moonpay-url endpoint deleted (MOONPAY_PUBLIC_KEY / MOONPAY_SECRET_KEY env and siteConfig().moonpayPublicKey no longer read)
- admin.js: moonpayPublicKey settings label dropped
- credits.html + credits-screen.js: "Buy POL with a card" button and handler removed
- my.js: openMoonpay() and the card-buy button removed; the New to crypto note now points to /wallets ("Wallet help")
- wallets.html + wallets.js: card section rewritten neutrally (any major exchange or on-ramp, POL on Polygon, your own address), wlMoonpay button logic, in-wallet note and MoonPay FAQ/disclaimer replaced
- chatbot.js: wallets canned answer, tags/regex and FACTS rewritten with no brand named
- kb-seed.js: f-moonpay-declined replaced by f-card-declined (the old seed is retired from kb.json on the next boot unless it was admin-edited)
- qa/kb-retrieval.cjs: case updated to f-card-declined
- cache tags bumped: credits-screen.js, my.js, wallets.js ?v=20261026a

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:04:32 -05:00
martbost 399a2bcc38 Sessions last 4 hours, same as InstantAdPay (Marty 2026-10-26: login ads get seen more often); SESSION_TTL_HOURS env, default 4; new sessions carry issued, legacy 24 h sessions are cut to issue time + 4 h
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:03:11 -05:00
martbost 98e3ed36d8 Conversion tracking fixes (Marty approved 2026-10-26): own clicks are tests on every click type, Banner Spin straight-to-page clicks carry lsclk
1. Own clicks: a goal owner's own click on ANY click type (LinkSpin/InstantAdPay ads, spin links, Banner Spins) is kept as a test, never counted, never fires a goal postback. Own = ad click flagged self for that owner, a spin-link / Banner Spin click marked at click time (signed in as the owner, or from an owner soft key: markOwnClick in server.js), or the clicking or converting browser's soft key is one the owner signs in from. auth.onSeen notes LinkSpin session soft keys (throttled, kept 31 days in convtrack.json S.own); /api/partner/clicks takes owners [{owner, sk, ts}] from InstantAdPay before the clicks, so IAP members' own browsers are known too. Linked positions share the owner's email. X-LS-Result adds ;self. partnerSummary returns selfTests for the IAP card. Conversions screen copy: test with Send a test conversion and the &test=1 page check, own clicks never count (conversions.js ?v=20261026a).
3. Banner Spin: a click whose target is a direct page (not a /r/ spin link) gets ?lsclk=<k click id> when the owner tracks goals (string insert like lsconv.withClickId: params kept, before #hash, an existing lsclk never replaced). convtrack.lookup resolves k ids through bannerspin.clickById; conversions record k:'bspin' with the Banner Spin, banner, page and source; report By Banner Spin, CSV site 'Banner Spin', postback ctx with its sub ids.
Guides: /conversion-tracking (Banner Spin straight to a page now counted, own clicks on every type are tests, By Banner Spin), /refuel tile. Chatbot CANNED + FACTS, KNOWLEDGE_DATE 2026-10-26.
QA: convpixel 77/77 (new: owner soft keys, own ad/spin/Banner Spin/IAP clicks as tests, stranger still counts, own-browser conversion, withClickId, Banner Spin lsclk + By Banner Spin + spin-link banner untouched, selfTests in the IAP summary, no postback for own clicks); lsid 31/31; fuel all pass (engine.js / engine-room.js / kit.js untouched, byte-identical with InstantAdPay); bannerspin 75/75; member walk 0 bugs; public 0 bugs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 06:19:54 -05:00
martbost 28192b61e9 Conversion tracking walkthrough video live (Marty approved 2026-10-26): on /conversion-tracking and the Training card
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 04:55:38 -05:00
martbost 837d4b6569 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>
2026-10-25 09:06:06 -05:00
martbost f38eec9a38 Support tickets are members-only (Marty 2026-10-24, after a throwaway-address 'pentest' ticket IAP-1012): signed-out support form + chatbot handoff need an email that belongs to an account on this site; inbound email opens NEW tickets only for member emails (replies to existing tickets still land)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:36:22 -05:00
martbost db46fc4a2b Conversion tracking member guide at /conversion-tracking (Marty, 2026-10-24: no training existed for the conversion pixel, live since 10-23)
Same content as InstantAdPay's guide in the pub.css look of /refuel, LinkSpin-first: Control Room > Conversions, spin links add lsclk once a goal exists, the 2 / 2b snippets, report columns (Spent, Clicks, Goals, Rate, Cost / goal), Address / Kept / Cookie / 24 h match, by spin link / page / source, CSV, postbacks on event goal, a Banner Spin banner pointed straight at a page is not matched (point it at a spin link), own AD clicks are tests while a sign-up through your own spin link counts. Flow drawn in HTML/CSS (works at 390 px). conversion-guide.js: copy buttons + new-tab links when framed.
Route + TRAFFIC_PAGES + sitemap; Training entry (catalog/training.json "conversion-guide", group "Track your results"); "How to set it up" link on the Conversions screen. Chatbot CANNED conversions answer + FACTS line point to the guide (KNOWLEDGE_DATE stays 2026-10-24).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:19:03 -05:00
martbost 93317d6ba0 Refuel guide: why-cards 2 x 2 on desktop
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:20:51 -05:00
martbost 9ce57ae1ff Refuel guide: the walkthrough video (Marty approved 2026-10-24) replaces the banner, plus a 'Why keep refueling' section (steady traffic, useful numbers, fresh creative, the climbing bonus); training card gets the video
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:17:20 -05:00
martbost e5fb985c6b 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>
2026-10-24 08:07:32 -05:00
martbost fee138bbc1 Chatbot: month-4 Twin Engine Featured bonus is 100 credits on InstantAdPay (Marty 2026-10-24)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 06:39:01 -05:00
martbost fc92b09796 Chatbot: Level 4 override is live (CANNED level4-override + FACTS line; start Mon 2026-10-26 00:00 CT, first payout Mon 2026-11-02 9 AM CT). overrideMode=live + overrideGoLive=1792990800000 set on the site, payer wallet funded (Marty, 2026-10-24).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 06:14:59 -05:00
martbost 018101f011 Engine Room panel on the LinkSpin Ads screen (Fuel Your Offers stage 4, Marty approved 2026-10-24): engine.js + engine-room.js are the same files as InstantAdPay's. LinkSpin's facts (credits, campaigns, clicks this week and last via coach.clicksSince, free login slots, conversion-pixel goals this month from the Central 1st via convtrack.countSince, conversions in 30 days, and the Banner Spin / spin link / page / testing part states from bannerspin, rotator and pages) are combined with InstantAdPay's facts and the streak from signed /api/partner/engine on InstantAdPay (cached a minute; when it does not answer the panel says so). LinkSpin answers /api/partner/engine for InstantAdPay's tab. /api/my/engine, /api/my/engine/goal (forwarded to InstantAdPay, where the goal lives with the streak). Hidden while refuelStreak is off; greyed "Refuel to start your engine" until the first counted refuel. Chatbot CANNED + FACTS cover it. qa/refuel-engine.test.cjs checks the shared files have not drifted from InstantAdPay's and runs its engine test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:55:12 -05:00
martbost 4749d711f4 Refuel Kit on LinkSpin (Fuel Your Offers stage 3, Marty approved 2026-10-24): kit.js (same file as InstantAdPay) with LinkSpin's own art, entitlement from InstantAdPay's streak record through refuel.status (view.kits: month -> streak month at unlock). Ads screen Refuel Kit panel (fuel.js?v=20261024kit): Make mine, Download, Copy image link, animated at a 3-month streak, and "Load into my Banner Spin" (kitspin.js): each Banner Spin size in the kit goes into one of the member's Banner Spins of that size with room, or a new one while the tier allows (the reason is shown when it does not); the personalized file is copied into uploads like a normal Banner Spin upload, labelled "Refuel Kit <month>", target = the member's own link; loading twice adds nothing twice; files over 150 KB are refused plainly. /kitimg/<hmac> public serving, admin Settings > Refuel Kit (upload, placeholder art, preview, release), raster copies of the LinkSpin placeholder banners (public/banners/linkspin-<size>.png, from the existing SVGs) for the placeholder kit. Behind the refuelStreak switch. Chatbot CANNED + FACTS mention the kit. qa/refuel-kit.test.cjs 5 checks against the real bannerspin.js. Note: qa kb retrieval has 2 pre-existing misses (spin links vs Banner Spin, PropellerAds postback), same before this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:44:40 -05:00
martbost 7bcde25116 Monthly Refuel streak, LinkSpin side (Fuel Your Offers stage 2, Marty approved 2026-10-24). The streak lives on InstantAdPay (one per member across both sites); refuel.js here reports each $25+ LinkSpin package (refuelMinLsCents) once per tx (claim rfev:<tx>, then a pending file in DATA_DIR/refuel-pending retried every minute until InstantAdPay answers), applies LinkSpin's grants and reminders from InstantAdPay's outbox (claim rfg:<ref> before applying, so two app copies or a lost ack never double-grant; grants are purchased-grade addEarned + a credit-log line + a notice), and relays the member's status for the Monthly Refuel panel on Credits and Ads (fuel.js) and the refill notice streak line. Linked positions count for their owner. Chatbot CANNED + FACTS follow the switch, KNOWLEDGE_DATE 2026-10-24. Admin /api/admin/refuel (+ /tick), member /api/my/refuel. MASTER SWITCH refuelStreak default '0': nothing reported, pulled or shown. qa/refuel.test.cjs 10 checks against InstantAdPay's real refuel.js in-process (both switches, cross-site both-engine top-up in both orders, two LinkSpin copies, InstantAdPay down, lost ack, reminders, status).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:29:00 -05:00
martbost ab4f1693df Refill notices on LinkSpin (Fuel Your Offers stage 1, Marty approved 2026-10-24): refill.js copied from InstantAdPay. Low (80% of budget delivered, refillLowPct), out, and idle (7 days after an unanswered out notice, 100+ credits free, nothing running): one email + one on-site notice per owner per pass, naming each ad and what it delivered, then the relaunch line (100+ credits free) or the /credits link, then the packages from the chain catalog and a streak-line hook for stage 2. Email skips drip unsubscribes and carries the unsubscribe link; the notice (kind notice) always goes. Every send is watched 45 days for purchase / relaunch / resumed / topup. marks.js: one-time claims shared by both app copies during a deploy (event_marks with a DB, exclusive file create on the shared volume without one); every send is claimed first. Settings refillNotices '1' (default on) + refillLowPct 80; admin GET /api/admin/refill, POST /run and /reset, an Overview card (admin-refill.js). qa/refill.test.cjs (12 checks incl. two app copies on one volume) + run.sh fuel mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:11:12 -05:00
martbost 7b3844b757 QA: convpixel test (unit, local e2e, browser + framed) and Conversions in the member walk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:10:48 -05:00
martbost b0f13e2a66 Chatbot + FAQ: conversion pixel canned answer and FACTS line (KNOWLEDGE_DATE 2026-10-23)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:10:48 -05:00
martbost 07379803d7 Control Room Conversions screen: goals, the two snippets, Send a test conversion, autoresponder advice, match-method breakdown, per-goal conversions and cost per goal by ad campaign (LinkSpin + InstantAdPay), spin link, page and source, CSV; rail entry, shell tag bumped; privacy page covers click ids, the landing tag and the pixel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:10:47 -05:00
martbost dd2244272b Conversion pixel engine (Marty approved 2026-10-23): goals with public pixel ids, click ids on every ad click (lsclk, 'a'+11 hex), spin links pass the ad click on, landing tag /t.js + goal pixel /cv.gif /cv.js matching url > stored > cookie > 24 h soft key, once per click, 30-day window, owner check, rate limits, goal postbacks (event 'goal'), member + signed partner APIs for InstantAdPay
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:10:46 -05:00
109 changed files with 6288 additions and 634 deletions
+13 -5
View File
@@ -36,9 +36,12 @@ const pub = a => a ? { email: a.email, sponsorRef: a.sponsorRef || '', code: a.c
username: a.username || null, memberId: a.memberId || 0, joinedVia: a.joinedVia || null, joinedRef: a.joinedRef || null,
lineBannerUrl: a.lineBannerUrl || null, lineTargetUrl: a.lineTargetUrl || null, wallOffers: a.wallOffers || null,
avatarUrl: a.avatarUrl || null, bio: a.bio || null, socials: a.socials || null,
profileQuarantined: !!a.profileQuarantined, // 2026-10-30: first profile save of a brand-new free account planted a link; stored, never rendered publicly (spamscan.js)
chatAvailable: a.chatAvailable === false ? false : true, lastSeen: a.lastSeen || 0,
theme: a.theme || null, // 2026-11-01 appearance: auto | light | dark, follows the member across browsers (cr-shell.js)
address: a.address || null, created: a.created } : null;
const USER_RE = /^[a-zA-Z0-9_]{3,20}$/;
const THEMES = new Set(['auto', 'light', 'dark']);
const normUser = u => String(u || '').trim().toLowerCase();
// ---- JSON fallback ----
@@ -116,16 +119,18 @@ const J = {
acct.wallOffers = json || null; this.save();
return { ok: true, account: pub(acct) };
},
async setProfile(e, avatarUrl, bio, socials) {
async setProfile(e, avatarUrl, bio, socials, quarantined) {
const acct = this.db.byEmail[e];
if (!acct) return { error: 'No such account.' };
if (avatarUrl !== undefined) acct.avatarUrl = avatarUrl || null;
if (bio !== undefined) acct.bio = bio || null;
if (socials !== undefined) acct.socials = socials || null;
if (quarantined !== undefined) acct.profileQuarantined = !!quarantined;
this.save();
return { ok: true, account: pub(acct) };
},
async touchSeen(e) { const a = this.db.byEmail[e]; if (a) { a.lastSeen = Date.now(); this.save(); } },
async setTheme(e, t) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.theme = THEMES.has(t) ? t : null; this.save(); return { ok: true, account: pub(a) }; },
async setChatAvailable(e, v) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.chatAvailable = !!v; this.save(); return { ok: true, available: !!v }; },
async getMutes(e) { const a = this.db.byEmail[e]; return (a && Array.isArray(a.chatMutes)) ? a.chatMutes : []; },
async setMute(owner, target, muted) {
@@ -229,8 +234,8 @@ const J = {
const rowPub = r => r ? pub({ email: r.email, sponsorRef: r.sponsor_ref, code: r.code,
username: r.username, memberId: r.member_id || 0, joinedVia: r.joined_via || null, joinedRef: r.joined_ref || null,
lineBannerUrl: r.line_banner_url, lineTargetUrl: r.line_target_url, wallOffers: r.wall_offers || null,
avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials,
chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0),
avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials, profileQuarantined: !!r.profile_quarantined,
chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0), theme: r.theme || null,
address: r.address, created: Number(r.created) }) : null;
const D = {
async signup(e, password, ref) {
@@ -284,13 +289,15 @@ const D = {
await db.q('UPDATE accounts SET wall_offers=? WHERE email=?', [json || null, e]);
return { ok: true, account: await this.byEmail(e) };
},
async setProfile(e, avatarUrl, bio, socials) {
async setProfile(e, avatarUrl, bio, socials, quarantined) {
if (avatarUrl !== undefined) await db.q('UPDATE accounts SET avatar_url=? WHERE email=?', [avatarUrl || null, e]);
if (bio !== undefined) await db.q('UPDATE accounts SET bio=? WHERE email=?', [bio || null, e]);
if (socials !== undefined) await db.q('UPDATE accounts SET socials=? WHERE email=?', [socials || null, e]);
if (quarantined !== undefined) await db.q('UPDATE accounts SET profile_quarantined=? WHERE email=?', [quarantined ? 1 : 0, e]);
return { ok: true, account: await this.byEmail(e) };
},
async touchSeen(e) { await db.q('UPDATE accounts SET last_seen=? WHERE email=?', [Date.now(), e]); },
async setTheme(e, t) { await db.q('UPDATE accounts SET theme=? WHERE email=?', [THEMES.has(t) ? t : null, e]); return { ok: true, account: await this.byEmail(e) }; },
async setChatAvailable(e, v) { await db.q('UPDATE accounts SET chat_available=? WHERE email=?', [v ? 1 : 0, e]); return { ok: true, available: !!v }; },
async getMutes(e) {
const r = await db.q('SELECT chat_mutes FROM accounts WHERE email=?', [e]);
@@ -488,8 +495,9 @@ module.exports = { init, signup, login, ensure, onChange, byEmail, byAddress, by
setUsername, setMemberId, namesForMembers, listByReferrer, downline, linkWallet, onWalletLinked, count,
setLineBanner: (e, b, t) => impl().setLineBanner(String(e || '').toLowerCase(), b, t),
setWallOffers: (e, j) => impl().setWallOffers(String(e || '').toLowerCase(), j),
setProfile: (e, a, bio, socials) => impl().setProfile(String(e || '').toLowerCase(), a, bio, socials).then(tap(String(e || '').toLowerCase())),
setProfile: (e, a, bio, socials, quarantined) => impl().setProfile(String(e || '').toLowerCase(), a, bio, socials, quarantined).then(tap(String(e || '').toLowerCase())),
touchSeen: e => impl().touchSeen(String(e || '').toLowerCase()),
setTheme: (e, t) => impl().setTheme(String(e || '').toLowerCase(), t), // appearance only: no onChange tap, InstantAdPay does not mirror it
adminSetAddress: (e, a) => impl().adminSetAddress(String(e || '').toLowerCase(), a ? normAddr(a) : null).then(tap(String(e || '').toLowerCase())),
positionByAddress: a => impl().positionByAddress(normAddr(a)),
removeAccount: e => impl().removeAccount(String(e || '').toLowerCase()),
BIN
View File
Binary file not shown.
+18 -5
View File
@@ -15,7 +15,14 @@ let IS_PROD = false;
let SITE = SITE_HOST;
const CHALLENGE_TTL = 10 * 60 * 1000;
const SESSION_TTL = 24 * 60 * 60 * 1000; // 24h — forces a daily re-login so the login ad shows each day
// Marty 2026-10-26: same as InstantAdPay, a session lasts 4 hours (SESSION_TTL_HOURS), then sign in again.
// Sessions minted under the old 24 h rule are cut back to issue time + the new length (cap below).
const SESSION_TTL = Number(process.env.SESSION_TTL_HOURS || 4) * 60 * 60 * 1000;
const LEGACY_TTL = 24 * 60 * 60 * 1000;
// new sessions carry `issued`; a stored session without it is a legacy 24 h one: its real end is issue time + SESSION_TTL
const sessEnd = s => (s.issued ? Number(s.expires) : Number(s.expires) - LEGACY_TTL + SESSION_TTL);
// MySQL mode has no issued column: cap anything with more than SESSION_TTL left (best effort; production uses the JSON store)
const capExp = exp => (Number(exp) - Date.now() > SESSION_TTL ? Number(exp) - LEGACY_TTL + SESSION_TTL : Number(exp));
const challenges = new Map(); // addressLower -> {message, exp}
// ---- JSON session fallback ----
@@ -38,13 +45,13 @@ const J = {
async mint(fields) {
const token = crypto.randomBytes(32).toString('hex');
this.sessions.set(token, Object.assign({ email: null, address: null, memberId: 0 }, fields,
{ expires: Date.now() + SESSION_TTL }));
{ issued: Date.now(), expires: Date.now() + SESSION_TTL }));
this.save();
return token;
},
async get(token) {
const s = this.sessions.get(token);
if (!s || s.expires < Date.now()) return null;
if (!s || sessEnd(s) < Date.now()) return null;
return Object.assign({ token }, s);
},
async update(token, fields) {
@@ -68,6 +75,7 @@ const D = {
const rows = await db.q('SELECT * FROM sessions WHERE token=? AND expires>?', [token, Date.now()]);
if (!rows.length) return null;
const r = rows[0];
if (capExp(r.expires) < Date.now()) return null;
return { token, email: r.email, address: r.address, memberId: r.member_id, expires: Number(r.expires) };
},
async update(token, fields) {
@@ -141,10 +149,15 @@ function sessionCookie(token) {
return `iap.sid=${encodeURIComponent(token)}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${SESSION_TTL / 1000}${IS_PROD ? '; Secure' : ''}`;
}
function clearCookie() { return 'iap.sid=; Path=/; HttpOnly; SameSite=Lax; Max-Age=0'; }
// onSeen (2026-10-26): told the email + request of every resolved session (conversion tracking keeps the soft keys a member
// signs in from, so their own clicks count as tests). Never throws into the caller.
let seenFn = null; function onSeen(fn) { seenFn = fn; }
async function fromRequest(req) {
const m = /(?:^|;\s*)iap\.sid=([^;]+)/.exec(req.headers.cookie || '');
if (!m) return null;
return impl().get(decodeURIComponent(m[1]));
const s = await impl().get(decodeURIComponent(m[1]));
if (s && s.email && seenFn) { try { seenFn(s.email, req); } catch (e) {} }
return s;
}
async function refreshMemberId(sess) {
if (!sess) return 0;
@@ -167,4 +180,4 @@ async function logout(req) {
if (s) await impl().drop(s.token);
}
module.exports = { init, makeChallenge, verifyChallenge, mintSession, updateSession, sessionCookie, clearCookie, fromRequest, refreshMemberId, logout };
module.exports = { init, makeChallenge, verifyChallenge, mintSession, updateSession, sessionCookie, clearCookie, fromRequest, onSeen, refreshMemberId, logout };
+19 -2
View File
@@ -21,6 +21,8 @@
// reloads count once per minute per banner. Clicks are rows like spin-link clicks, with the usual lsid click id
// ('k' + 11 hex, never valid hex so it can never collide with a rotator id), so joins / wallets / purchases and partner
// postbacks credit the banner (rotator.convert falls through to convert() here), and a traffic source's postback fires.
// Since 2026-10-26 a click that goes straight to a page also gets ?lsclk=<click id> when the owner tracks goals, so the
// conversion pixel (convtrack.js, clickById below) counts goals from Banner Spin banners that skip a spin link.
//
// Access. Members with at least one own package of $25 or more. Starter 2 Banner Spins x 5 banners; Builder (level 2
// open, 2 qualifying buyers) 5 x 15; Leader (level 3 open, 5 qualifying buyers) 10 x 25. Facts come from server.js
@@ -68,10 +70,14 @@ const J = { db: null, FILE: () => path.join(DATA_DIR, 'bannerspin.json'),
const C = { db: { v: 1, d: {} }, FILE: () => path.join(DATA_DIR, 'bannerspin-counts.json'),
read() { try { const x = JSON.parse(fs.readFileSync(this.FILE(), 'utf8')); return x && x.d ? x : { v: 1, d: {} }; } catch (e) { return { v: 1, d: {} }; } } };
let PENDING = { d: {} }, DIRTY = false, timer = null, lastPrune = 0;
// conversion pixel (2026-10-26): a click that goes straight to a page (not a spin link) gets ?lsclk=<this click id> when
// the owner tracks goals, the same rule spin links follow. server.js hands in the goal check and convtrack's string insert.
let WANTS_CLICK_ID = () => false, WITH_CLICK_ID = (u) => u;
function init(opts) {
DATA_DIR = opts.dataDir; UPLOADS_DIR = opts.uploadsDir || path.join(DATA_DIR, 'uploads'); rotator = opts.rotator || null; geo = opts.geo || null; SOURCES = opts.sources || null;
OWN_HOSTS = opts.ownHosts || OWN_HOSTS; FACTS = opts.facts || FACTS; ADMIN = norm(opts.adminEmail);
if (opts.wantsClickId) WANTS_CLICK_ID = opts.wantsClickId; if (opts.withClickId) WITH_CLICK_ID = opts.withClickId;
J.load(); C.db = C.read();
if (opts.schedule !== false) { timer = setInterval(() => { flush(); sweep(); }, FLUSH_MS); if (timer.unref) timer.unref(); }
}
@@ -324,8 +330,19 @@ async function click(code, req, reqHost) {
for (const [k, val] of Object.entries(q)) if (vals[k] == null) vals[k] = val;
url = url.replace(/\{([a-z0-9_]{1,24})\}/gi, (mm, k) => encodeURIComponent(vals[k.toLowerCase()] == null ? '' : vals[k.toLowerCase()]));
try { const t = new URL(url); if (OWN_HOSTS().includes(t.hostname.toLowerCase()) && !t.searchParams.has('lsid') && !/^\/r\//.test(t.pathname)) { t.searchParams.set('lsid', id); url = t.toString(); } } catch (e) {}
// straight to a page: the click id rides along for the landing tag (a spin-link target adds its own on the /r/ hop)
if (!bot) { let spinHop = false; try { spinHop = /^\/r\/[a-z0-9]{4,12}$/i.test(new URL(url).pathname); } catch (e) {} if (!spinHop) { try { if (WANTS_CLICK_ID(s.owner)) url = WITH_CLICK_ID(url, id); } catch (e) {} } }
}
return { url, lsid: id, banner: b, matched: m };
return { url, lsid: id, banner: b, matched: m, owner: s.owner };
}
// conversion pixel (2026-10-26): a Banner Spin click by id, with its Banner Spin, banner and where it went
function clickById(id) {
id = String(id || ''); if (!/^k[a-f0-9]{11}$/.test(id)) return null;
const list = J.db.clicks; let c = null; for (let i = list.length - 1; i >= 0; i--) if (list[i].id === id) { c = list[i]; break; }
if (!c) return null;
const s = J.db.spins.find(x => x.id === c.s); if (!s) return null;
const b = c.b ? s.banners.find(x => x.id === c.b) || null : null;
return { click: c, owner: s.owner, spin: { id: s.id, code: s.code, name: s.name || '' }, banner: b ? { id: b.id, label: b.label || '' } : null, destUrl: b && !b.link ? (b.target || '') : (b ? '' : (s.fallback || '')) };
}
// conversions (rotator.convert falls through to here for a 'k' click id): dedupe per click + event
async function convert(lsid, ev, facts) {
@@ -463,4 +480,4 @@ const rawSpins = () => J.db.spins;
const save = () => J.save();
function imageSource(img) { const m = LOCAL_IMG.exec(String(img || '')); return m ? { file: path.join(UPLOADS_DIR, m[1]) } : /^https:\/\//i.test(String(img || '')) ? { url: String(img) } : null; }
const _test = { notes: () => NOTES, flush, vkey, cacheFlag, winnerOf };
module.exports = { init, SIZES, TIERS, MAX_BYTES, tierFor, list, create, update, addBanner, updateBanner, noteImage, dims, image, script, click, convert, stats, summary, adminAll, adminSet, setGlobal, settings, imageRefs, totals, blankPng, readImage, flush, findMine, rawSpins, save, imageSource, live, _test };
module.exports = { init, SIZES, TIERS, MAX_BYTES, tierFor, list, create, update, addBanner, updateBanner, noteImage, dims, image, script, click, clickById, convert, stats, summary, adminAll, adminSet, setGlobal, settings, imageRefs, totals, blankPng, readImage, flush, findMine, rawSpins, save, imageSource, live, _test };
+5 -4
View File
@@ -4,6 +4,7 @@
// /sitemap.xml, /robots.txt. SEO per post: title, description, canonical, Open Graph, Twitter
// card, article dates, BlogPosting JSON-LD, breadcrumb JSON-LD, internal links, related posts.
const { SITE_URL } = require('./host');
const themehead = require('./themehead'); // light/dark theme head script (2026-11-01)
const fs = require('fs');
const path = require('path');
const db = require('./db');
@@ -97,19 +98,19 @@ async function bumpViews(slug) { try { await impl().bumpViews(slug); } catch (e)
function head(o) {
const url = SITE + o.path;
const img = o.image ? (o.image.startsWith('http') ? o.image : SITE + o.image) : SITE + '/banners/iap-hero-1200x630.png';
return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">'
return '<!doctype html><html lang="en"' + themehead.htmlAttr('dark') + '><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">'
+ '<title>' + esc(o.title) + '</title><meta name="description" content="' + esc(o.desc) + '"><link rel="canonical" href="' + esc(url) + '">'
+ '<meta name="robots" content="index,follow,max-image-preview:large"><meta name="theme-color" content="#043b2f">'
+ '<meta property="og:type" content="' + (o.article ? 'article' : 'website') + '"><meta property="og:site_name" content="LinkSpin"><meta property="og:title" content="' + esc(o.title) + '"><meta property="og:description" content="' + esc(o.desc) + '"><meta property="og:url" content="' + esc(url) + '"><meta property="og:image" content="' + esc(img) + '">'
+ (o.article ? '<meta property="article:published_time" content="' + new Date(o.article.publishedAt || o.article.created).toISOString() + '"><meta property="article:modified_time" content="' + new Date(o.article.updated).toISOString() + '"><meta property="article:author" content="' + esc(AUTHOR) + '">' + (o.article.tags || []).map(t => '<meta property="article:tag" content="' + esc(t) + '">').join('') : '')
+ '<meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="' + esc(o.title) + '"><meta name="twitter:description" content="' + esc(o.desc) + '"><meta name="twitter:image" content="' + esc(img) + '">'
+ '<link rel="alternate" type="application/rss+xml" title="LinkSpin blog" href="' + SITE + '/blog/feed.xml"><link rel="icon" type="image/png" href="/logo-icon.png">'
+ '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"><link rel="stylesheet" href="/assets/site.css?v=20260912b">'
+ '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">' + themehead.tag() + '<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">'
+ '<style>.bl{max-width:760px}.bl h1{font-size:clamp(30px,4.6vw,44px);line-height:1.12;margin:10px 0 12px}.bl .meta{color:var(--muted);font-size:14px;margin:0 0 22px}.bl .cover{width:100%;border-radius:14px;border:1px solid var(--line);margin:0 0 26px;display:block}.bl article{font-size:17.5px;line-height:1.7}.bl article p{margin:0 0 18px;max-width:68ch}.bl article h2{font-size:26px;margin:36px 0 12px}.bl article h3{font-size:20px;margin:28px 0 10px}.bl article ul,.bl article ol{margin:0 0 18px 22px;max-width:66ch}.bl article li{margin:6px 0}.bl article blockquote{border-left:4px solid var(--mint);margin:0 0 18px;padding:8px 18px;color:var(--muted);font-style:italic}.bl article img{max-width:100%;border-radius:12px;border:1px solid var(--line)}.bl article a{color:var(--mint)}.bl article pre{background:rgba(4,8,7,.6);border:1px solid var(--line);border-radius:10px;padding:14px;overflow:auto;font-size:14px}.bl article table{border-collapse:collapse;width:100%;font-size:15px}.bl article th,.bl article td{border-bottom:1px solid var(--line);padding:8px 10px;text-align:left}.tags a{display:inline-block;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--mint);border:1px solid rgba(67,232,195,.4);border-radius:999px;padding:3px 10px;margin:0 6px 6px 0;text-decoration:none}.post-card{display:block;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px 22px;margin:0 0 14px;color:inherit;text-decoration:none}.post-card:hover{border-color:var(--mint)}.post-card h2{font-size:22px;margin:0 0 6px}.post-card p{margin:0;color:var(--muted);font-size:15px;max-width:70ch}.post-card .meta{margin:8px 0 0;font-size:13px}.author{display:flex;gap:14px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:36px 0 0;background:var(--panel)}.author img{width:56px;height:56px;border-radius:50%;object-fit:cover}.author b{display:block}.author span{color:var(--muted);font-size:14px}.share a{margin-right:14px;font-size:14px}.pager{display:flex;justify-content:space-between;margin:26px 0}.related{margin-top:40px}.related h3{margin-bottom:10px}</style>'
+ '</head><body><div class="wrap bl">';
}
function tail() {
return '</div><script src="/assets/common.js?v=20260914a"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
return '</div><script src="/assets/common.js?v=20261101t"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
}
const authorBox = () => '<div class="author"><img src="/logo-icon.png" alt="LinkSpin"><div><b>' + AUTHOR + '</b><span>Founder of LinkSpin and the Crypto Team Build Network. Twenty-plus years of internet marketing, and a habit of writing down what actually worked.</span></div></div>';
const cardHtml = p => '<a class="post-card" href="/blog/' + esc(p.slug) + '">' + (p.cover ? '<img src="' + esc(p.cover) + '" alt="" loading="lazy" style="width:100%;border-radius:10px;margin:0 0 12px">' : '') + '<h2>' + esc(p.title) + '</h2><p>' + esc(p.excerpt) + '</p><p class="meta">' + fmtDate(p.publishedAt || p.created) + ' · ' + readMinutes(p.body) + ' min read' + (p.tags.length ? ' · ' + p.tags.map(esc).join(', ') : '') + '</p></a>';
@@ -153,7 +154,7 @@ function rss(posts) {
return '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>LinkSpin blog</title><link>' + SITE + '/blog</link><description>Coaching and teaching articles from Marty Bostick.</description>' + items + '</channel></rss>';
}
function sitemap(posts) {
const pages = ['/', '/blog', '/whats-new', '/leaderboard', '/ledger', '/contract', '/plays', '/wallets', '/earning', '/partners', '/publishers'];
const pages = ['/', '/blog', '/whats-new', '/leaderboard', '/ledger', '/contract', '/plays', '/wallets', '/earning', '/partners', '/publishers', '/refuel', '/conversion-tracking'];
const u = pages.map(p => '<url><loc>' + SITE + p + '</loc><changefreq>weekly</changefreq></url>').join('')
+ posts.map(p => '<url><loc>' + SITE + '/blog/' + p.slug + '</loc><lastmod>' + new Date(p.updated).toISOString().slice(0, 10) + '</lastmod><changefreq>monthly</changefreq></url>').join('');
return '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + u + '</urlset>';
+61 -15
View File
@@ -15,7 +15,7 @@ let ethers = null; try { ethers = require('ethers'); } catch (e) {}
const fs = require('fs');
const path = require('path');
let X = {}; // { dataDir, accounts, registry, chain, mailer, messages, siteConfig, adminEmail }
let X = {}; // { dataDir, accounts, registry, chain, mailer, messages, siteConfig, adminEmail, tankGate, claim, payoutBlocked, sendActivate + now (tests) }
const DAY = 86400000;
const ABI = ['function activateFor(address account, uint32 sponsorId) returns (uint32)', 'function engineSigner() view returns (address)'];
const norm = e => String(e || '').trim().toLowerCase();
@@ -145,27 +145,25 @@ async function ensureOnChain(acct, depth, why) {
if (acct.email && isHeld(acct.email)) await waitUnheld(acct.email);
if (acct.email) { try { const fresh = await X.accounts.byEmail(acct.email); if (fresh && fresh.address) acct = fresh; } catch (e) {} }
try { const id = await X.chain.memberIdByAccount(acct.address); if (id) { if (Number(acct.memberId) !== Number(id)) await X.accounts.setMemberId(acct.email, id).catch(() => {}); return id; } } catch (e) {}
if (!engineReady() || depth > 25) return 0;
// holding tank (2026-10-27, tank.gate): no sponsor here -> align to the network sponsor first (InstantAdPay knows one);
// nobody known and this is the member's OWN plain activation (wallet linked, admin seeding) -> held for an adopter, never
// bound under the fallback. A sponsor placed on the contract because someone below them is buying is never held.
if (!acct.sponsorRef && !(Number(acct.memberId) > 0) && X.tankGate) {
let g = null; try { g = await X.tankGate(acct, { own: depth === 0 && (why === 'wallet' || !!X.seeding) }); } catch (e) { g = null; }
if (g && g.aligned) { try { const fresh = await X.accounts.byEmail(acct.email); if (fresh) acct = fresh; } catch (e) {} }
else if (g && g.hold) { logEvent({ type: 'tankHold', email: acct.email, until: g.hold.until || null }); return 0; }
}
if (!sendReady() || depth > 25) return 0;
const me = norm(acct.email); inflight.add(me); let id = 0; // binding from here: the sponsor read below is the one the contract gets
let sponsorId = 0, txHash = null, lastErr = null; // read after the finally below, so declared out here (inside the try they were not defined there, 2026-10-22..27)
try {
let sponsorId = 0;
if (acct.sponsorRef) {
let sp = await X.accounts.byCode(acct.sponsorRef); if (!sp) sp = await X.accounts.byUsername(acct.sponsorRef);
if (sp && sp.address) sponsorId = await ensureOnChain(sp, depth + 1);
}
if (!sponsorId) sponsorId = Number((X.siteConfig && X.siteConfig().defaultSponsorId) || 1) || 1;
try { if (sponsorId > await X.chain.memberCount()) sponsorId = 0; } catch (e) {} // first member on a fresh contract: no catch position exists yet
// send with provider rotation; after ANY error re-read the chain first (2026-10-15 seed: six activations
// mined while a 403 on the follow-up read logged them as failures and skipped their notices)
let txHash = null, lastErr = null;
for (let attempt = 0; attempt < 3 && !id; attempt++) {
try {
const w = signer(attempt); const ctr = new ethers.Contract(X.chain.getConfig().contract, ABI, w);
const tx = await ctr.activateFor(acct.address, sponsorId, { gasLimit: 160000n }); txHash = tx.hash;
await tx.wait(1);
} catch (e) { lastErr = e; }
for (let k = 0; k < 4 && !id; k++) { try { id = Number(await X.chain.memberIdByAccount(acct.address)) || 0; } catch (e) {} if (!id) await sleep(3000); }
}
const sent = await (X.sendActivate || sendActivateFor)(acct.address, sponsorId); id = sent.id; txHash = sent.txHash; lastErr = sent.lastErr;
} finally { if (!id) inflight.delete(me); } // on success the flag stays until the member number is saved below
if (!id) { logEvent({ type: 'activateFailed', email: acct.email, error: String((lastErr && (lastErr.shortMessage || lastErr.message)) || 'not on-chain after send').slice(0, 160) }); return 0; }
logEvent({ type: 'activated', email: acct.email, id, sponsorId, tx: txHash });
@@ -176,6 +174,54 @@ async function ensureOnChain(acct, depth, why) {
await noticeActivated(acct, why);
return id;
}
// send with provider rotation; after ANY error re-read the chain first (2026-10-15 seed: six activations
// mined while a 403 on the follow-up read logged them as failures and skipped their notices)
async function sendActivateFor(address, sponsorId) {
let id = 0, txHash = null, lastErr = null;
for (let attempt = 0; attempt < 3 && !id; attempt++) {
try {
const w = signer(attempt); const ctr = new ethers.Contract(X.chain.getConfig().contract, ABI, w);
const tx = await ctr.activateFor(address, sponsorId, { gasLimit: 160000n }); txHash = tx.hash;
await tx.wait(1);
} catch (e) { lastErr = e; }
for (let k = 0; k < 4 && !id; k++) { try { id = Number(await X.chain.memberIdByAccount(address)) || 0; } catch (e) {} if (!id) await sleep(3000); }
}
return { id, txHash, lastErr };
}
const sendReady = () => !!X.sendActivate || engineReady();
// ---- holding tank: switch payouts on the moment a tank member gets a sponsor (Marty approved 2026-10-27) ----
// An adoption (manual or the 24-hour rotation) or a network alignment gives a held member a sponsor; with a wallet linked,
// the engine activates them right away UNDER THAT SPONSOR. Strict, unlike ensureOnChain: never the fallback position.
// - already on the contract: nothing sent ({ id, already })
// - the sponsor must be on the contract (the engine places a sponsor who has a wallet first, as ensureOnChain does) and not
// on a no-payout chain; otherwise nothing is sent and the caller retries on its next tick ({ error, retry })
// - one sender across app copies: a marks claim per member per 10-minute window (deploy overlap), plus the in-process flag
// Returns { id, tx, sponsorId, sponsorEmail } when this call activated them.
async function activateAssigned(email) {
let a = await X.accounts.byEmail(email); if (!a || !a.address) return { error: 'no wallet linked', retry: false };
if (isHeld(a.email)) { await waitUnheld(a.email); a = (await X.accounts.byEmail(email)) || a; }
let onId = 0; try { onId = Number(await X.chain.memberIdByAccount(a.address)) || 0; } catch (e) { return { error: 'chain read failed', retry: true }; }
if (onId) { if (Number(a.memberId) !== onId) await X.accounts.setMemberId(a.email, onId).catch(() => {}); return { id: onId, already: true }; }
if (!a.sponsorRef) return { error: 'no sponsor yet', retry: false };
let sp = await X.accounts.byCode(a.sponsorRef); if (!sp) sp = await X.accounts.byUsername(a.sponsorRef);
if (!sp) return { error: 'sponsor ' + a.sponsorRef + ' not found', retry: true };
if (!sp.address) return { error: 'sponsor has no wallet yet', retry: true };
if (!sendReady()) return { error: 'engine not configured', retry: true };
const me = norm(a.email); if (inflight.has(me)) return { error: 'activation already in flight', retry: true };
const sponsorId = await ensureOnChain(sp, 1);
if (!sponsorId) return { error: 'sponsor not on the contract yet', retry: true };
if (X.payoutBlocked && await Promise.resolve(X.payoutBlocked(sponsorId)).catch(() => true)) return { error: 'sponsor #' + sponsorId + ' is on a no-payout chain', retry: false };
if (X.claim && !(await Promise.resolve(X.claim('tankact:' + me + ':' + Math.floor((X.now ? X.now() : Date.now()) / 600000))).catch(() => false))) return { error: 'another app copy is sending it', retry: true };
inflight.add(me); let sent = { id: 0 };
try { sent = await (X.sendActivate || sendActivateFor)(a.address, sponsorId); }
finally { if (!sent.id) inflight.delete(me); }
if (!sent.id) { logEvent({ type: 'activateFailed', email: a.email, why: 'assigned', sponsorId, error: String((sent.lastErr && (sent.lastErr.shortMessage || sent.lastErr.message)) || 'not on-chain after send').slice(0, 160) }); return { error: 'activation failed', retry: true }; }
logEvent({ type: 'activated', email: a.email, id: sent.id, sponsorId, tx: sent.txHash, why: 'assigned' });
await X.accounts.setMemberId(a.email, sent.id).catch(() => {});
inflight.delete(me);
return { id: sent.id, tx: sent.txHash || null, sponsorId, sponsorEmail: sp.email };
}
async function noticeActivated(acct, why) {
const own = X.seeding || why === 'wallet'; // switched on because their own wallet arrived, not because someone below them bought
await tell(acct.email, own ? 'Your LinkSpin payouts are switched on' : 'We set up your LinkSpin position so you would not miss a payout',
@@ -224,4 +270,4 @@ async function seedAll(limit) {
}
function status() { const s = state(); return { engine: engineReady(), claims: Object.values(s.claims || {}), log: (s.log || []).slice(-50).reverse(), claimDays: claimDays() }; }
module.exports = { init, onJoin, resolveForChain, ensureOnChain, seedAll, status, engineReady, backfillMemberIds, hold, unhold, isHeld, isBinding };
module.exports = { init, onJoin, resolveForChain, ensureOnChain, activateAssigned, seedAll, status, engineReady, backfillMemberIds, hold, unhold, isHeld, isBinding };
+20
View File
@@ -5,5 +5,25 @@
"title": "Banner Spin: one banner slot, a whole campaign",
"desc": "Banner Spin gives you one image address and one click address that rotate up to 25 banners, each with its own target page or spin link. Put it in one banner slot on a traffic exchange, a safelist, a forum signature or your own site once, then change the banners from your Control Room whenever you like. Nobody has to update anything on their side.\n\nWho gets it. It is a free add-on that opens with your own package of $25 or more. Starter holds 2 Banner Spins with 5 banners each. Builder (level 2 open, 2 qualifying buyers) holds 5 with 15 each. Leader (level 3 open, 5 qualifying buyers) holds 10 with 25 each. If you drop below a tier, everything you built keeps serving; you just cannot add more until you are back.\n\nStep 1, name and size. Open Links, switch to Banner Spins and press New Banner Spin. Pick one size: a slot on an exchange has one size, so every banner in a Banner Spin should be that exact size (468x60, 728x90, 300x250, 125x125, 160x600, 120x600, 336x280, 250x250 or 320x50). Set a fallback page: that is where a click goes when we cannot tell which banner the visitor saw.\n\nStep 2, add banners. Upload a JPG, PNG or GIF (animated is fine, 150 KB at most) or paste an https image address. The builder previews it at real size and warns you when it is the wrong size. Pick where a click goes: any page, or one of your own spin links, so a banner can rotate pages behind it too.\n\nStep 3, weights and mode. A banner with weight 20 shows twice as often as one with 10. Random by weight picks again on every view. One per visitor shows the same person the same banner all day, which keeps a split test clean on exchanges that reload pages. You can also give the whole Banner Spin, or one banner, its own hours.\n\nStep 4, get the code. Open Get the code and copy the embed that fits the place: the image address plus click address for exchanges, safelists and downline builders; the HTML snippet for your own site or blog; the script tag wherever scripts are allowed (it writes the banner and its own link together, so every click lands on the right target); the forum code for signatures. Every link domain answers every code, so if one domain ever has trouble you swap only the domain.\n\nWhere it will not rotate. Paid ad networks copy your image to their own servers when you upload a creative, so it freezes on one banner there: upload real banners to them instead. Gmail and some mail apps fetch images once through their own proxy, so most email readers see one banner and their clicks go to the fallback. For email, use a Banner Spin with a single banner (still tracked) and swap it when you want a change.\n\nReading the numbers. The Stats tab and the Reports screen show views, unique viewers, clicks, click rate, match rate and conversions for every banner and every placement (the page your banner sits on), by day, country and device. Bots, link previews and servers are never counted as views; they are shown on their own line. A WINNER badge appears once two or more live banners have 1,000 views each and one leads on click rate. LinkSpin never changes your weights for you: raise the winner or pause the rest when you are ready. A placement marked CACHED copies banners to its own server, so the rotation is frozen there; spend your credits elsewhere.\n\nHealth checks. Every 30 minutes LinkSpin checks each live banner: the image must load as an image of the right size, and its target must not be dead or parked. Three failures in a row pause that banner and it comes back on its own after two clean checks. The last live banner in a Banner Spin is never paused. You see the status on every banner row.\n\nTeach it forward. When someone in your line buys their first $25 package, show them this lesson and help them build their first Banner Spin with two banners for the same offer. Two weeks of numbers tell them which banner to keep.",
"docUrl": "/links#b"
},
{
"id": "refuel-guide",
"group": "Fuel Your Offers",
"title": "Fuel Your Offers: how the Monthly Refuel streak works",
"desc": "Refuel your ads every month and the bonus climbs. A new package of $25 or more under Credits (or $20 or more on InstantAdPay) starts your streak and sets your own refuel day. Each monthly refuel inside your window (5 days before to 5 days after your refuel day) adds bonus ad credits: +10%, +15%, +20%, then +25% from month 4. Refuel both sites in the same cycle and both get +15%, +20%, +30%, then +40%. Either site alone keeps the streak going.\n\nThe guide walks through the whole flow with a diagram: Pit Stops, the one free miss a year, the Refuel Kit that loads into your Banner Spin, the Engine Room on Ads, and the reminders. Bonus credits buy ad delivery only; they are never cash.",
"docUrl": "/refuel",
"docLabel": "Read the guide",
"videoUrl": "https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/refuel-ls.mp4?v=20261024",
"posterUrl": "https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/refuel-ls.jpg?v=20261024"
},
{
"id": "conversion-guide",
"group": "Track your results",
"title": "Conversion tracking: see which ad, link and page bring sign-ups",
"desc": "Clicks tell you who looked. The conversion pixel tells you which ad, spin link, page and traffic source brought a subscriber or a sale, with a cost per goal in credits. It is free for every member.\n\nFour steps, one time: create a goal under Conversions (subscriber, sale), paste the landing tag on the page your traffic lands on, paste the goal pixel on your thank-you page, and send a test conversion. The guide has copy-paste examples for a plain HTML page, WordPress, page builders and Aweber or GetResponse thank-you pages, what to do when you cannot put code on the thank-you page, how to read the report (match methods, cost per goal, the 30-day window) and a troubleshooting checklist.",
"docUrl": "/conversion-tracking",
"docLabel": "Read the guide",
"videoUrl": "https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/conversion-tracking-ls.mp4?v=20261026",
"posterUrl": "https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/conversion-tracking-ls.jpg?v=20261026"
}
]
+48 -11
View File
File diff suppressed because one or more lines are too long
+10 -3
View File
@@ -56,12 +56,16 @@ async function member(id) {
const STALL_DAYS = 3;
async function describe(acct, now = Date.now()) {
const mm = await member(acct.memberId);
// unknown = the member is on chain but the read failed just now (member() swallows RPC errors and caches null for a
// minute); rungFor would call them "payouts on, no purchase" and the coach would mail a buyer the first-package nudge
// (2026-10-31: Marty, 4 purchases and 7 buyers, got "See a payout land"). Callers that mail must skip unknown.
const unknown = !!(acct.memberId && !mm);
const rung = rungFor(acct, mm);
const last = Math.max(acct.created || 0, acct.lastSeen || 0);
const quietDays = Math.floor((now - last) / DAY);
const stalled = rung < 6 && quietDays >= STALL_DAYS;
const stalled = !unknown && rung < 6 && quietDays >= STALL_DAYS;
const R = RUNGS[rung];
return { rung, label: R.label, next: R.next, say: R.say, quietDays, stalled, buyerCount: mm ? mm.buyerCount : 0,
return { rung, label: R.label, next: R.next, say: R.say, quietDays, stalled, unknown, buyerCount: mm ? mm.buyerCount : 0,
counted: !!(mm && mm.countedAsBuyer), joined: acct.created, lastSeen: acct.lastSeen || 0, onchainSponsorId: mm ? mm.sponsorId : null };
}
// coaching view for a sponsor: every direct, ladder rung, stalled flag, what to say
@@ -177,6 +181,8 @@ function clickSource(referer) {
} catch (e) { return 'unknown'; }
}
async function recordClick(campaignId, referer) { try { await impl().addClick(Number(campaignId), clickSource(referer), Date.now()); } catch (e) {} }
// clicks on these campaigns since a moment (the Engine Room's clicks-this-week dial, 2026-10-24)
async function clicksSince(campaignIds, since) { if (!campaignIds.length) return 0; const rows = await impl().clicksFor(campaignIds.map(Number)); return rows.filter(r => Number(r.ts) >= since).length; }
async function clickSources(campaignIds) {
const rows = await impl().clicksFor(campaignIds.map(Number));
const out = {};
@@ -219,6 +225,7 @@ async function nudgeTick() {
const all = await accounts.listAll(5000);
for (const acct of all) {
if (!acct.email || !acct.created || now - acct.created < STALL_DAYS * DAY) continue;
if (X.adminEmail && String(acct.email).toLowerCase() === String(X.adminEmail).toLowerCase()) continue; // the site owner is never coached (2026-10-31)
if (!acct.lastSeen || acct.joinedVia === 'carried' && !acct.lastSeen) continue; // never signed in here (carried-over shells from InstantAdPay): no coaching mail, ever (2026-10-11: Harvey got a nudge for a site he never joined)
const c = await describe(acct, now);
if (!c.stalled) continue;
@@ -292,4 +299,4 @@ function init(opts) { X = arguments[0] || {};
J.load();
}
async function viewsSince(since) { return impl().viewsSince(since); }
module.exports = { init, RUNGS, rungFor, describe, coachView, prospects, saveProspect, removeProspect, STATUSES, recordView, linkStats, nudgeTick, recordClick, clickSources, refHost, viewsSince };
module.exports = { init, RUNGS, rungFor, describe, coachView, prospects, saveProspect, removeProspect, STATUSES, recordView, linkStats, nudgeTick, recordClick, clickSources, clicksSince, refHost, viewsSince };
+308
View File
@@ -0,0 +1,308 @@
// Conversion pixel (Marty approved 2026-10-23, "Go with the conversion pixel"). LinkSpin is the single source of truth
// for goals and goal conversions, for its own members AND for InstantAdPay members (their LinkSpin shell account, same
// email, holds the goals; InstantAdPay reads and edits them over the signed partner call).
//
// - Goals: a member names a goal ("subscriber", "sale", optional default value). Each goal has a PUBLIC pixel id
// (px + 10 hex). It is not a secret: it can only ever count conversions for clicks its owner owns.
// - Ad clicks: every LinkSpin ad click (/api/ads/click, zone clicks) gets a click id 'a' + 11 hex; every InstantAdPay
// ad click is pushed here with its own id 'i' + 11 hex (/api/partner/clicks). Spin-link clicks keep the rotator's
// 10-hex lsid; a spin-link click that arrived through an ad carries that ad click as `ac` (rotator.js).
// - Landing tag (/t.js) stores the click id on the member's own site; the goal pixel (/cv.gif, /cv.js) reports it.
// Matching order: the click id in the URL > the landing tag's stored id > LinkSpin's cookie > the 24 h IP+UA soft key.
// The method that matched is kept on the conversion so Reports can say how solid each count is.
// - Rules: each goal counts once per click (per ROOT click: an ad click and the spin-link click it led to are one
// click), only within 30 days of a real click, only for clicks the pixel's owner owns (the ad's owner or the spin
// link's owner), per-pixel and per-IP rate limits. A test conversion is recorded apart and never counted. The goal
// owner's own click (any type: ad, spin link, Banner Spin) is kept as a test, never counted (2026-10-26).
// - Banner Spin clicks ('k' + 11 hex) that go straight to a page carry lsclk too since 2026-10-26 (bannerspin.js).
// Storage: DATA_DIR/convtrack.json (JSON in both modes, like rotator.json / postbacks.json), debounced writes.
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const DAY = 86400000, WINDOW_MS = 30 * DAY, SOFT_MS = 24 * 3600000, MAX_GOALS = 20;
const MAX_CLICKS = 300000, MAX_CONV = 100000;
let FILE = null, S = null, dirty = false, rotator = null, bannerspin = null, campaignOf = async () => null;
function load() {
if (S) return S;
try { S = JSON.parse(fs.readFileSync(FILE, 'utf8')); } catch (e) { S = null; }
if (!S || typeof S !== 'object') S = {};
S.v = 1; S.goals = S.goals || {}; S.clicks = S.clicks || {}; S.soft = S.soft || {}; S.conv = Array.isArray(S.conv) ? S.conv : []; S.camps = S.camps || {}; S.tests = S.tests || {};
S.own = S.own || {}; S.selfIds = S.selfIds || {}; // own-click tests (2026-10-26): soft key -> { owner email: last seen }, click id -> marked at
return S;
}
function save() { dirty = true; }
function flush() { if (!dirty || !S || !FILE) return; dirty = false; try { fs.writeFileSync(FILE + '.tmp', JSON.stringify(S)); fs.renameSync(FILE + '.tmp', FILE); } catch (e) { console.error('convtrack save', e.message); } }
function init(opts) {
FILE = path.join(opts.dataDir, 'convtrack.json'); rotator = opts.rotator || null; bannerspin = opts.bannerspin || null; if (opts.campaignOf) campaignOf = opts.campaignOf;
S = null; load();
if (!opts.noTimers) { setInterval(flush, 3000).unref(); setInterval(prune, 3600000).unref(); }
}
const norm = e => String(e || '').trim().toLowerCase();
const isPx = v => /^px[a-f0-9]{10}$/.test(String(v || ''));
const isClickId = v => /^[a-z0-9]{6,24}$/i.test(String(v || ''));
const isAdId = v => /^[ai][a-f0-9]{11}$/.test(String(v || ''));
const cleanName = v => { const s = String(v == null ? '' : v).trim().toLowerCase().replace(/\s+/g, '_'); return /^[a-z0-9_-]{1,32}$/.test(s) ? s : ''; };
const cleanValue = v => { if (v === '' || v == null) return 0; const n = Number(v); return Number.isFinite(n) && n >= 0 ? Math.min(Math.round(n * 100) / 100, 100000) : 0; };
const newPx = () => { for (;;) { const id = 'px' + crypto.randomBytes(5).toString('hex'); if (!load().goals[id]) return id; } };
const newAdClickId = () => 'a' + crypto.randomBytes(6).toString('hex').slice(0, 11);
function ipOf(req) { return String(req.headers['x-forwarded-for'] || (req.socket && req.socket.remoteAddress) || '').split(',')[0].trim(); }
// the soft key: InstantAdPay computes exactly the same thing for its ad clicks (contract 2026-10-23)
function softKey(req) { return 's:' + crypto.createHash('sha256').update(ipOf(req) + '|' + String(req.headers['user-agent'] || '')).digest('hex').slice(0, 20); }
// ── own clicks are tests, on every click type (Marty approved 2026-10-26) ───────────────────────────────────────
// A member clicking their OWN ad, spin link or Banner Spin and converting is a test, never a count. Known by: the click
// was made while signed in as the owner (ads), or the clicking / converting browser's soft key is one the owner has been
// seen signed in from (LinkSpin sessions, noted by auth.js; InstantAdPay sessions, pushed with its clicks). Linked
// positions sit on the owner's own email, so they are the owner here too. Soft keys kept 31 days (the click window).
const OWN_MS = WINDOW_MS + DAY, ownNoted = new Map();
const isSk = sk => /^s:[a-f0-9]{20}$/.test(String(sk || ''));
function noteOwner(email, sk, ts) {
const e = norm(email); if (!e || e.length > 190 || !isSk(sk)) return false;
const at = Math.min(Number(ts) || Date.now(), Date.now()); const k = e + '|' + sk;
if ((ownNoted.get(k) || 0) > at - 600000) return false; ownNoted.set(k, at); if (ownNoted.size > 20000) ownNoted.clear();
const st = load(); const m = st.own[sk] = st.own[sk] || {};
if (!(m[e] >= at)) m[e] = at;
const keys = Object.keys(m); if (keys.length > 8) { keys.sort((a, b) => m[a] - m[b]); for (const x of keys.slice(0, keys.length - 8)) delete m[x]; }
save(); return true;
}
function noteSession(email, req) { try { return noteOwner(email, softKey(req)); } catch (e) { return false; } }
// InstantAdPay's pushed rows: [{ owner, sk, ts }] (its members' own sessions)
function importOwners(rows) { let n = 0; for (const r of (Array.isArray(rows) ? rows.slice(0, 2000) : [])) if (r && noteOwner(r.owner, r.sk, r.ts)) n++; return n; }
function isOwnerSk(owner, sk) { const m = isSk(sk) && load().own[sk]; const t = m && m[norm(owner)]; return !!(t && Date.now() - t <= OWN_MS); }
// spin-link and Banner Spin clicks: marked when the owner made them (signed in on this host, or from an owner soft key)
function markSelfClick(id, owner, req, sessionEmail) {
if (!isClickId(id) || !owner) return false;
const mine = (sessionEmail && norm(sessionEmail) === norm(owner)) || isOwnerSk(owner, softKey(req));
if (mine) { load().selfIds[id] = Date.now(); save(); }
return !!mine;
}
// ── goals ───────────────────────────────────────────────────────────────────────────────────────────────────────
function pubGoal(g) { return { px: g.px, name: g.name, value: g.value || 0, created: g.created, lastTest: (load().tests[g.px] || 0) || null }; }
function goalsOf(owner) { const o = norm(owner); return Object.values(load().goals).filter(g => g.owner === o).sort((a, b) => a.created - b.created); }
function goal(px) { return load().goals[String(px || '')] || null; }
function createGoal(owner, body) {
const o = norm(owner); if (!o) return { error: 'Sign in first.' };
const name = cleanName(body && body.name); if (!name) return { error: 'Name the goal with letters, numbers, - or _ (for example subscriber or sale), up to 32.' };
const mine = goalsOf(o);
if (mine.length >= MAX_GOALS) return { error: 'Up to ' + MAX_GOALS + ' goals per account. Remove one first.' };
if (mine.some(g => g.name === name)) return { error: 'You already have a goal called ' + name + '.' };
const g = { px: newPx(), owner: o, name, value: cleanValue(body && body.value), created: Date.now() };
load().goals[g.px] = g; save(); flush(); return { ok: true, goal: pubGoal(g) };
}
function updateGoal(owner, px, body) {
const g = goal(px); if (!g || g.owner !== norm(owner)) return { error: 'No such goal.' };
if (body.remove) { delete load().goals[g.px]; delete load().tests[g.px]; save(); flush(); return { ok: true, removed: true }; } // its past conversions stay in the log (the reports show them under the name)
if (body.name != null) { const n = cleanName(body.name); if (!n) return { error: 'Name the goal with letters, numbers, - or _ , up to 32.' }; if (goalsOf(g.owner).some(x => x.px !== g.px && x.name === n)) return { error: 'You already have a goal called ' + n + '.' }; g.name = n; }
if (body.value != null) g.value = cleanValue(body.value);
save(); flush(); return { ok: true, goal: pubGoal(g) };
}
// ── clicks ──────────────────────────────────────────────────────────────────────────────────────────────────────
function noteSoft(sk, id, owner, ts) {
if (!sk || !/^s:[a-f0-9]{20}$/.test(sk) || !id) return;
const st = load(); const now = ts || Date.now();
const list = (st.soft[sk] || []).filter(x => now - x[1] <= SOFT_MS && x[0] !== id);
list.push([id, now, norm(owner)]); st.soft[sk] = list.slice(-6); save();
}
// a LinkSpin ad click (banner, text, zone). Returns the click id to append to the target.
function recordAdClick(camp, req, extra) {
if (!camp || !camp.id) return null;
const st = load(); const id = newAdClickId(); const ua = String(req.headers['user-agent'] || '');
const sk = softKey(req);
let pl = String((extra && extra.placement) || ''); if (!pl) { try { const r = new URL(String(req.headers.referer || '')); pl = (r.hostname.replace(/^www\./, '') + r.pathname).slice(0, 80); } catch (e) {} }
st.clicks[id] = { id, k: 'ad', camp: Number(camp.id), cname: String(camp.name || camp.title || '').slice(0, 80), type: camp.type || '', owner: norm(camp.owner), ts: Date.now(), sk,
c: (extra && extra.country) || '', dv: /mobile|android|iphone|ipad/i.test(ua) ? 'mobile' : 'desktop', pl, self: (extra && extra.self) || isOwnerSk(camp.owner, sk) ? 1 : undefined, target: String(camp.targetUrl || '').slice(0, 300) };
noteSoft(sk, id, camp.owner); trimClicks(); save();
return id;
}
// InstantAdPay pushes its ad clicks (signed partner call); an upsert by id, so a row sent twice is harmless
function importClicks(rows) {
const st = load(); let n = 0;
for (const r of (Array.isArray(rows) ? rows.slice(0, 500) : [])) {
const id = String(r && r.id || ''); if (!/^i[a-f0-9]{11}$/.test(id)) continue;
const owner = norm(r.owner); if (!owner || owner.length > 190) continue;
const ts = Number(r.ts) || Date.now(); if (ts > Date.now() + 600000 || Date.now() - ts > WINDOW_MS) continue;
const sk = /^s:[a-f0-9]{20}$/.test(String(r.sk || '')) ? String(r.sk) : '';
const had = !!st.clicks[id];
st.clicks[id] = { id, k: 'iap', camp: Number(r.camp) || 0, cname: String(r.cname || '').slice(0, 80), type: String(r.type || '').slice(0, 12), owner, ts, sk,
c: String(r.c || '').toUpperCase().replace(/[^A-Z]/g, '').slice(0, 2), dv: r.dv === 'mobile' ? 'mobile' : 'desktop', pl: String(r.pl || '').slice(0, 80), self: r.self || isOwnerSk(owner, sk) ? 1 : undefined, target: String(r.target || '').slice(0, 300) };
if (r.camp) { const key = 'iap:' + Number(r.camp); const cur = st.camps[key] || {}; if (!cur.ts || ts >= cur.ts) st.camps[key] = { owner, name: String(r.cname || '').slice(0, 80), spent: Math.max(0, Number(r.spent) || 0), ts }; }
if (!had && sk) noteSoft(sk, id, owner, ts);
n++;
}
if (n) { trimClicks(); save(); }
return n;
}
function trimClicks() {
const st = load(); const keys = Object.keys(st.clicks); if (keys.length <= MAX_CLICKS) return;
keys.sort((a, b) => st.clicks[a].ts - st.clicks[b].ts); for (const k of keys.slice(0, keys.length - Math.floor(MAX_CLICKS * 0.8))) delete st.clicks[k];
}
function prune() {
const st = load(); const now = Date.now();
for (const k in st.clicks) if (now - st.clicks[k].ts > WINDOW_MS + DAY) delete st.clicks[k];
for (const k in st.soft) { const l = st.soft[k].filter(x => now - x[1] <= SOFT_MS); if (l.length) st.soft[k] = l; else delete st.soft[k]; }
for (const k in st.camps) if (now - st.camps[k].ts > 400 * DAY) delete st.camps[k];
for (const k in st.selfIds) if (now - st.selfIds[k] > OWN_MS) delete st.selfIds[k];
for (const k in st.own) { const m = st.own[k]; for (const e in m) if (now - m[e] > OWN_MS) delete m[e]; if (!Object.keys(m).length) delete st.own[k]; }
if (st.conv.length > MAX_CONV) st.conv = st.conv.slice(-Math.floor(MAX_CONV * 0.8));
save(); flush();
}
// What a click id is, who owns it, where it came from. Spin-link clicks live in rotator.json.
function lookup(id) {
id = String(id || ''); if (!isClickId(id)) return null;
const st = load();
const ad = st.clicks[id];
if (ad) return { id, root: id, ts: ad.ts, owners: [ad.owner], ad };
if (rotator && rotator.hitById && id[0] !== 'k') { // spin-link ids are 10 hex, never 'k' (that is Banner Spin's)
const h = rotator.hitById(id); if (!h || !h.hit || h.hit.bot) return null;
const via = h.hit.ac && st.clicks[h.hit.ac] ? st.clicks[h.hit.ac] : null;
return { id, root: via ? via.id : id, ts: via ? Math.min(via.ts, h.hit.ts) : h.hit.ts, owners: [h.owner].concat(via ? [via.owner] : []), ad: via, spin: h };
}
// a Banner Spin click ('k' + 11 hex) that went straight to a page (2026-10-26: those now carry lsclk too)
if (bannerspin && bannerspin.clickById && id[0] === 'k') {
const b = bannerspin.clickById(id); if (!b || !b.click || b.click.bot) return null;
return { id, root: id, ts: b.click.ts, owners: [b.owner], bspin: b };
}
return null;
}
// ── the goal pixel ─────────────────────────────────────────────────────────────────────────────────────────────
const RL = { px: new Map(), ip: new Map() };
function rateOk(map, key, max, ms) { const now = Date.now(); const a = (map.get(key) || []).filter(t => now - t < ms); if (a.length >= max) { map.set(key, a); return false; } a.push(now); map.set(key, a); if (map.size > 50000) map.clear(); return true; }
setInterval(() => { const now = Date.now(); for (const m of [RL.px, RL.ip]) for (const [k, a] of m) if (!a.some(t => now - t < 3600000)) m.delete(k); }, 600000).unref();
const LIMITS = { pxPerMin: 60, pxPerHour: 1000, ipPerMin: 20 };
// q: { px, goal, value, c (click id from the page), m ('url'|'stored', who found it), test }
// cookies: { 'ls.clk', 'ls.click' }. Returns { result, method?, conv? } where result is counted | dup | nomatch | unknown | limited | test | refused
function record(q, req, cookies) {
const g = goal(q.px); if (!g) return { result: 'unknown' };
const sk = softKey(req); const ip = sk; // the soft key doubles as the per-visitor rate key (no raw IP held)
if (!rateOk(RL.ip, ip, LIMITS.ipPerMin, 60000)) return { result: 'limited' };
if (!rateOk(RL.px, g.px + ':m', LIMITS.pxPerMin, 60000) || !rateOk(RL.px, g.px + ':h', LIMITS.pxPerHour, 3600000)) return { result: 'limited' };
if (q.test) { load().tests[g.px] = Date.now(); save(); return { result: 'test', at: load().tests[g.px] }; }
const now = Date.now(); let refused = 0;
const tryId = (id, method) => {
const L = lookup(id); if (!L) return null;
if (!L.owners.includes(g.owner)) { refused++; return null; } // someone else's click: never counted for this pixel
if (now - L.ts > WINDOW_MS) return null;
return Object.assign(L, { method });
};
let hit = null;
if (isClickId(q.c)) hit = tryId(q.c, q.m === 'stored' ? 'stored' : 'url');
if (!hit) for (const ck of ['ls.clk', 'ls.click']) { const v = cookies && cookies[ck]; if (!hit && isClickId(v)) hit = tryId(v, 'cookie'); }
if (!hit) { const list = (load().soft[sk] || []).filter(x => x[2] === g.owner && now - x[1] <= SOFT_MS).sort((a, b) => b[1] - a[1]); for (const x of list) { hit = tryId(x[0], 'soft'); if (hit) break; } }
if (!hit) return { result: refused ? 'refused' : 'nomatch' };
const st = load();
if (st.conv.some(c => c.px === g.px && (c.root === hit.root || c.click === hit.id || c.root === hit.id))) return { result: 'dup', method: hit.method };
const ad = hit.ad, sp = hit.spin, bs = hit.bspin;
const value = q.value != null && q.value !== '' ? cleanValue(q.value) : (g.value || 0);
// the goal owner's own click, on ANY click type (ad, spin link, Banner Spin): kept as a test, never in the counts.
// Own = the ad click was flagged self for this owner, the spin / Banner Spin click was marked at click time, or the
// clicking or converting browser is one the owner has been seen signed in from (2026-10-26).
const self = (ad && ad.self && ad.owner === g.owner) || st.selfIds[hit.id] || st.selfIds[hit.root] || isOwnerSk(g.owner, sk) || (ad && ad.sk && isOwnerSk(g.owner, ad.sk)) ? 1 : undefined;
const conv = { id: crypto.randomBytes(6).toString('hex'), ts: now, px: g.px, goal: g.name, owner: g.owner, click: hit.id, root: hit.root, method: hit.method, value,
k: ad ? ad.k : (bs ? 'bspin' : 'spin'), camp: ad ? ad.camp : undefined, cname: ad ? ad.cname : undefined, ctype: ad ? ad.type : undefined,
rot: sp ? sp.rotation.id : undefined, rcode: sp ? sp.rotation.code : undefined, rname: sp ? sp.rotation.name : undefined,
bs: bs ? bs.spin.id : undefined, bcode: bs ? bs.spin.code : undefined, bname: bs ? bs.spin.name : undefined, bban: bs && bs.banner ? bs.banner.id : undefined,
dest: sp ? sp.destUrl : (bs ? bs.destUrl : (ad ? ad.target : undefined)), sr: sp ? (sp.hit.sr || undefined) : (bs ? (bs.click.sr || undefined) : undefined), src: sp ? sp.hit.s : (bs ? (bs.click.h || 'direct') : (ad ? ad.pl : undefined)),
c: (sp ? sp.hit.c : (bs ? bs.click.c : ad && ad.c)) || '', dv: (sp ? sp.hit.dv : (bs ? bs.click.dv : ad && ad.dv)) || '', self };
for (const k of Object.keys(conv)) if (conv[k] === undefined) delete conv[k];
st.conv.push(conv); save();
return { result: 'counted', method: hit.method, conv, hit };
}
// the postback context for a counted conversion (postbacks.fire)
function postbackCtx(r) {
const c = r.conv, sp = r.hit && r.hit.spin, bs = r.hit && r.hit.bspin;
return { q: sp ? (sp.hit.q || {}) : (bs ? (bs.click.q || {}) : {}), source: c.src || '', country: c.c || '', device: c.dv || '', lsid: c.click, code: c.rcode || c.bcode || '', sourceId: c.sr || '', payout: c.value || 0, currency: 'USD', label: c.goal };
}
// the landing tag's beacon: it saw a click id on the member's page. Returns the id when it is a real click of the pixel's owner.
function landing(px, id, req) {
const g = goal(px); if (!g || !isClickId(id)) return null;
if (!rateOk(RL.ip, softKey(req) + ':t', 60, 60000)) return null;
const L = lookup(id); if (!L || !L.owners.includes(g.owner) || Date.now() - L.ts > WINDOW_MS) return null;
noteSoft(softKey(req), id, g.owner); return id;
}
// ── reports ─────────────────────────────────────────────────────────────────────────────────────────────────────
// per goal: totals, match methods, and breakdowns by ad campaign (LinkSpin + InstantAdPay), spin link, destination
// and traffic source. Cost per goal on ad campaigns = the campaign's credits spent / its conversions of that goal.
async function report(owner, days, opts) {
const o = norm(owner); const since = Date.now() - (Math.max(1, Math.min(400, Number(days) || 30))) * DAY;
const goals = goalsOf(o); const st = load();
const conv = st.conv.filter(c => c.owner === o && c.ts >= since && !c.self);
const selfTests = st.conv.filter(c => c.owner === o && c.ts >= since && c.self).length;
const methods = { url: 0, stored: 0, cookie: 0, soft: 0 };
const byGoal = {};
const at = (gname) => (byGoal[gname] = byGoal[gname] || { goal: gname, n: 0, value: 0, methods: { url: 0, stored: 0, cookie: 0, soft: 0 }, campaigns: {}, links: {}, banners: {}, dests: {}, sources: {} });
for (const c of conv) {
const G = at(c.goal); G.n++; G.value += c.value || 0; G.methods[c.method] = (G.methods[c.method] || 0) + 1; methods[c.method] = (methods[c.method] || 0) + 1;
if (c.camp) { const key = (c.k === 'iap' ? 'iap:' : 'ls:') + c.camp; const x = G.campaigns[key] = G.campaigns[key] || { key, site: c.k === 'iap' ? 'InstantAdPay' : 'LinkSpin', id: c.camp, name: c.cname || '', n: 0, value: 0 }; x.n++; x.value += c.value || 0; }
if (c.rot) { const x = G.links[c.rot] = G.links[c.rot] || { id: c.rot, code: c.rcode, name: c.rname || '', n: 0, value: 0 }; x.n++; x.value += c.value || 0; }
if (c.bs) { const x = G.banners[c.bs] = G.banners[c.bs] || { id: c.bs, code: c.bcode, name: c.bname || '', n: 0, value: 0 }; x.n++; x.value += c.value || 0; }
if (c.dest) { let d = c.dest; try { const u = new URL(c.dest); d = u.hostname.replace(/^www\./, '') + u.pathname.replace(/\/$/, ''); } catch (e) {} const x = G.dests[d] = G.dests[d] || { k: d, n: 0 }; x.n++; }
{ const key = c.sr ? 'src:' + c.sr : (c.src || '(direct)'); const x = G.sources[key] = G.sources[key] || { k: key, sourceId: c.sr || '', n: 0 }; x.n++; }
}
// clicks per ad campaign in the same window, and the cost basis
const clicksBy = {}; for (const k in st.clicks) { const a = st.clicks[k]; if (a.owner !== o || a.ts < since || a.self) continue; const key = (a.k === 'iap' ? 'iap:' : 'ls:') + a.camp; clicksBy[key] = (clicksBy[key] || 0) + 1; }
const meta = (opts && opts.sourceMeta) || {};
const out = [];
for (const gname of new Set(goals.map(g => g.name).concat(Object.keys(byGoal)))) {
const G = byGoal[gname] || at(gname);
const campaigns = [];
for (const x of Object.values(G.campaigns)) {
let spent = null, asOf = null;
if (x.site === 'LinkSpin') { try { const cp = await campaignOf(x.id); if (cp && norm(cp.owner) === o) { spent = Number(cp.spent || 0) + Number(cp.accrued || 0); if (!x.name) x.name = cp.name || ''; } } catch (e) {} }
else { const cm = st.camps['iap:' + x.id]; if (cm && cm.owner === o) { spent = cm.spent; asOf = cm.ts; if (!x.name) x.name = cm.name; } }
campaigns.push(Object.assign(x, { clicks: clicksBy[x.key] || 0, spent, spentAsOf: asOf, costPer: spent != null && x.n ? Math.round(spent / x.n * 100) / 100 : null, rate: clicksBy[x.key] ? Math.round(x.n / clicksBy[x.key] * 1000) / 10 : null }));
}
campaigns.sort((a, b) => b.n - a.n);
const sources = Object.values(G.sources).map(x => Object.assign(x, { name: x.sourceId ? ((meta[x.sourceId] || {}).name || 'Deleted source') : x.k })).sort((a, b) => b.n - a.n).slice(0, 15);
const g = goals.find(y => y.name === gname);
out.push({ goal: gname, px: g ? g.px : null, removed: !g, n: G.n, value: Math.round(G.value * 100) / 100, methods: G.methods, campaigns,
links: Object.values(G.links).sort((a, b) => b.n - a.n).slice(0, 15), banners: Object.values(G.banners).sort((a, b) => b.n - a.n).slice(0, 15), dests: Object.values(G.dests).sort((a, b) => b.n - a.n).slice(0, 15), sources });
}
return { days: Number(days) || 30, goals: goals.map(g => Object.assign(pubGoal(g), { conv: conv.filter(c => c.px === g.px).length, lastAt: (conv.filter(c => c.px === g.px).pop() || {}).ts || null })),
byGoal: out, methods, total: conv.length, selfTests };
}
// InstantAdPay's view: goals + per IAP campaign conversions (and clicks) for this owner
// goal conversions (not the owner's own tests) since a moment, for the Engine Room's goals dial (2026-10-24)
function countSince(owner, since) { const o = norm(owner); return load().conv.filter(c => c.owner === o && c.ts >= since && !c.self).length; }
function partnerSummary(owner, days) {
const o = norm(owner); const since = Date.now() - (Math.max(1, Math.min(90, Number(days) || 30))) * DAY; const st = load();
const conv = st.conv.filter(c => c.owner === o && c.ts >= since && !c.self);
const byCampaign = {};
for (const k in st.clicks) { const a = st.clicks[k]; if (a.k !== 'iap' || a.owner !== o || a.ts < since || a.self) continue; const b = byCampaign[a.camp] = byCampaign[a.camp] || { clicks: 0, conv: {}, value: {} }; b.clicks++; }
for (const c of conv) if (c.k === 'iap' && c.camp) { const b = byCampaign[c.camp] = byCampaign[c.camp] || { clicks: 0, conv: {}, value: {} }; b.conv[c.px] = (b.conv[c.px] || 0) + 1; b.value[c.px] = Math.round(((b.value[c.px] || 0) + (c.value || 0)) * 100) / 100; }
const methods = { url: 0, stored: 0, cookie: 0, soft: 0 }; for (const c of conv) methods[c.method] = (methods[c.method] || 0) + 1;
const goals = goalsOf(o).map(g => { const mine = conv.filter(c => c.px === g.px); return Object.assign(pubGoal(g), { conv: mine.length, convDays: Number(days) || 30, lastAt: mine.length ? mine[mine.length - 1].ts : null }); });
const selfTests = st.conv.filter(c => c.owner === o && c.ts >= since && c.self).length; // own clicks, kept as tests (InstantAdPay shows "N from your own clicks")
return { ok: true, goals, byCampaign, methods, selfTests };
}
function csv(owner, days) {
const o = norm(owner); const since = Date.now() - (Math.max(1, Math.min(400, Number(days) || 30))) * DAY;
const esc = v => { const s = v == null ? '' : String(v); return /[",\n]/.test(s) || /^[=+\-@]/.test(s) ? '"' + (/^[=+\-@]/.test(s) ? "'" : '') + s.replace(/"/g, '""') + '"' : s; };
const ctFmt = new Intl.DateTimeFormat('en-CA', { timeZone: 'America/Chicago', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', hour12: false });
const lines = ['time_central,goal,value,match_method,site,campaign_id,campaign,spin_link,destination,source,country,device,click_id'];
for (const c of load().conv) if (c.owner === o && c.ts >= since && !c.self) lines.push([ctFmt.format(new Date(c.ts)).replace(',', ''), c.goal, c.value || 0, c.method, c.k === 'iap' ? 'InstantAdPay' : (c.k === 'ad' ? 'LinkSpin ad' : (c.k === 'bspin' ? 'Banner Spin' : 'Spin link')), c.camp || '', c.cname || '', c.rcode || (c.bcode ? 'c/' + c.bcode : ''), c.dest || '', c.src || '', c.c || '', c.dv || '', c.click].map(esc).join(','));
return lines.join('\n') + '\n';
}
// "Send a test conversion" from a screen (InstantAdPay's partner call, or the Control Room when it cannot load the image)
function testGoal(owner, px) { const g = goal(px); if (!g || g.owner !== norm(owner)) return { error: 'No such goal.' }; load().tests[g.px] = Date.now(); save(); flush(); return { ok: true, at: load().tests[g.px] }; }
function adminCounts() { const st = load(); return { goals: Object.keys(st.goals).length, clicks: Object.keys(st.clicks).length, conversions: st.conv.length }; }
// append lsclk=<id> the way InstantAdPay's lsconv.withClickId does: string insert (every existing param keeps its exact
// encoding), before any #hash, an lsclk already there never replaced, a URL that does not parse goes out unchanged
function withClickId(target, id) {
const t = String(target || '');
let u; try { u = new URL(t); } catch (e) { return t; }
if (!/^https?:$/.test(u.protocol) || u.searchParams.has('lsclk') || !isClickId(id)) return t;
const hashAt = t.indexOf('#'); const base = hashAt >= 0 ? t.slice(0, hashAt) : t; const hash = hashAt >= 0 ? t.slice(hashAt) : '';
const sep = base.includes('?') ? (/[?&]$/.test(base) ? '' : '&') : '?';
return base + sep + 'lsclk=' + encodeURIComponent(id) + hash;
}
module.exports = { noteOwner, noteSession, importOwners, isOwnerSk, markSelfClick, withClickId, countSince, init, flush, prune, softKey, isPx, isClickId, isAdId, cleanName, cleanValue, goalsOf, goal, createGoal, updateGoal, recordAdClick, importClicks, lookup, record, postbackCtx, landing, report, partnerSummary, csv, adminCounts, testGoal, LIMITS, WINDOW_MS, SOFT_MS };
+4
View File
@@ -90,6 +90,8 @@ async function bootstrap() {
await alterSafe('ALTER TABLE accounts ADD COLUMN socials VARCHAR(1200) NULL'); // JSON {platform:url}
await alterSafe('ALTER TABLE accounts ADD COLUMN line_banner_url VARCHAR(500) NULL');
await alterSafe('ALTER TABLE accounts ADD COLUMN line_target_url VARCHAR(500) NULL');
await alterSafe('ALTER TABLE accounts ADD COLUMN profile_quarantined TINYINT NOT NULL DEFAULT 0');
await alterSafe('ALTER TABLE accounts ADD COLUMN theme VARCHAR(8) NULL'); // 2026-11-01 appearance: auto | light | dark // 2026-10-30 link-farm rule: first profile save of a new free account carried a link (spamscan.js)
await q(`CREATE TABLE IF NOT EXISTS daily_views (
email VARCHAR(190) NOT NULL,
day CHAR(10) NOT NULL,
@@ -120,6 +122,8 @@ async function bootstrap() {
await alterSafe('ALTER TABLE campaigns ADD COLUMN height INT NULL'); // banner size (IAB) → also NAS height
await alterSafe('ALTER TABLE campaigns ADD COLUMN nas_ad_id INT NULL'); // syndicated NAS sponsorads.ID
await alterSafe('ALTER TABLE campaigns ADD COLUMN nas_served INT NOT NULL DEFAULT 0'); // NAS impressions already reconciled into spend
await alterSafe('ALTER TABLE campaigns ADD COLUMN syn_imps INT NOT NULL DEFAULT 0'); // views in other members' zones (charged at 1/synRateDivisor)
await alterSafe('ALTER TABLE campaigns ADD COLUMN syn_batch INT NOT NULL DEFAULT 0'); // partner-zone views toward the next 1/N batch
await alterSafe('ALTER TABLE campaigns ADD COLUMN expires BIGINT NULL'); // featured rotation end time
await alterSafe('ALTER TABLE campaigns ADD COLUMN starts BIGINT NULL'); // featured run start (booked day); any type: scheduled start
await q(`CREATE TABLE IF NOT EXISTS camp_hours (
+158
View File
@@ -0,0 +1,158 @@
// The Engine Room (Fuel Your Offers stage 4, Marty approved the build 2026-10-24). The SAME file ships in InstantAdPay and
// LinkSpin. Each site gathers its OWN facts (facts shape below) and answers the other's signed /api/partner/engine call
// with them; build() turns both sites' facts + the refuel streak (InstantAdPay is its source of truth) + the member's goal
// into one plain dashboard: three dials, the streak panel, warning lights, six part lights and one "next move".
//
// facts (per site): { site: 'iap'|'linkspin', ok, credits: { available, inCampaigns }, campaigns: [{ id, name, type, status,
// budget, delivered, clicks, created }], clicksWeek, loginFree, buyUrl, adsUrl,
// LinkSpin only: goalsMonth, goalsCount, conv30, parts: { bannerSpin, spinLink, page, testing } each { state, note } }
// Everything is credits and counts. Nothing here is money or a promise.
'use strict';
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#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
function burnPerDay(camps, now) {
let b = 0;
for (const c of camps) {
const age = Math.max(1, Math.min(30, (now - n0(c.created)) / DAY));
if (c.status !== 'active' && now - n0(c.created) > 30 * DAY) continue;
b += n0(c.delivered) / age;
}
return b;
}
function part(state, label, note, link, key) { return { state, label, note, link, key }; }
function build(o) {
const now = o.now || Date.now();
const rf = o.refuel || { on: false };
if (!rf.on) return { on: false };
const sites = [o.iap, o.ls].filter(f => f && f.ok);
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;
const refuelCredits = cy ? ['iap', 'linkspin'].reduce((s, k) => s + (cy[k] && cy[k].refueled ? n0(cy[k].credits) + n0(cy[k].bonus) : 0), 0) : 0;
const burn = burnPerDay(recent, now);
const daysLeft = burn > 0 ? Math.floor(left / burn) : null;
const fuel = { left: Math.round(left), refuelCredits: Math.round(refuelCredits), pct: refuelCredits > 0 ? Math.max(0, Math.min(100, Math.round(left / refuelCredits * 100))) : null,
burnPerDay: Math.round(burn), daysLeft, label: 'Fuel left' };
// ---- dial 2: clicks this week, and per 1,000 credits on recent campaigns ----
const clicksWeek = sites.reduce((s, f) => s + n0(f.clicksWeek), 0), clicksPrev = sites.reduce((s, f) => s + n0(f.clicksPrevWeek), 0);
const del = recent.reduce((s, c) => s + n0(c.delivered), 0), clk = recent.reduce((s, c) => s + n0(c.clicks), 0);
// the dial reads this week against last week: half way = the same as last week
const clicks = { week: clicksWeek, prevWeek: clicksPrev, pct: clicksPrev > 0 ? Math.min(100, Math.round(clicksWeek / (2 * clicksPrev) * 100)) : null, per1000: del >= 100 ? Math.round(clk / del * 1000 * 10) / 10 : null, label: 'Clicks this week' };
// ---- dial 3: goals this month (conversion pixel, LinkSpin keeps it for both sites) vs the member's own goal ----
const lsF = o.ls && o.ls.ok ? o.ls : null;
const goalTarget = Math.max(0, Math.round(n0(o.goal))) || null;
const goals = { month: lsF ? n0(lsF.goalsMonth) : null, target: goalTarget, pct: goalTarget && lsF ? Math.min(100, Math.round(n0(lsF.goalsMonth) / goalTarget * 100)) : null, tracking: lsF ? n0(lsF.goalsCount) > 0 : null, label: 'Goals this month' };
// ---- warning lights ----
const low = camps.filter(c => c.status === 'active' && n0(c.budget) > 0 && n0(c.delivered) >= n0(c.budget) * 0.8);
const out = camps.filter(c => c.status === 'out' && now - n0(c.created) <= 60 * DAY);
const running = camps.filter(c => c.status === 'active');
const refuelSoon = rf.active && rf.daysToRefuel != null && rf.daysToRefuel <= 5;
const loginFree = sites.filter(f => n0(f.loginFree) > 0).map(f => f.site);
const warnings = [
{ key: 'low', on: low.length > 0, label: 'Ads at 80%', note: low.length ? low.length + ' ad' + (low.length === 1 ? ' is' : 's are') + ' past 80% of budget' : 'none running low' },
{ key: 'out', on: out.length > 0, label: 'Ads out', note: out.length ? out.length + ' ad' + (out.length === 1 ? '' : 's') + ' finished delivering' + (running.length ? '' : ', nothing running now') : 'none out' },
{ key: 'refuel', on: !!refuelSoon, label: 'Refuel day coming', note: rf.active ? (rf.windowOpen ? 'window open: refuel day ' + rf.refuelDayLabel : 'refuel day ' + rf.refuelDayLabel) : 'no refuel day yet' },
{ key: 'login', on: loginFree.length > 0, label: 'Login slot open', note: loginFree.length ? 'a login-ad slot is free on ' + loginFree.map(s => s === 'iap' ? 'InstantAdPay' : 'LinkSpin').join(' and ') : 'all login slots taken' },
];
// ---- the six parts ----
const P = (lsF && lsF.parts) || {};
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;
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: 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: 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: 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, site: here, sites: { iap: !!(o.iap && o.iap.ok), linkspin: !!(o.ls && o.ls.ok) }, at: now,
};
}
// this site's own facts for one member. d: { site, adminMember, ads, coach, now?, bannerspin?, rotator?, pages?, convtrack? }
const monthStartCT = now => { const day = new Date(now).toLocaleDateString('en-CA', { timeZone: 'America/Chicago' }); const [y, m] = day.split('-').map(Number);
for (const off of [5, 6]) { const ts = Date.UTC(y, m - 1, 1, off); const t = new Date(ts); if (t.toLocaleDateString('en-CA', { timeZone: 'America/Chicago' }) === day.slice(0, 8) + '01' && Number(t.toLocaleString('en-US', { timeZone: 'America/Chicago', hour: 'numeric', hour12: false })) % 24 === 0) return ts; } return Date.UTC(y, m - 1, 1, 6); };
async function facts(d, email) {
const now = d.now || Date.now(); const e = String(email || '').toLowerCase();
const out = { site: d.site, ok: true, credits: { available: 0, inCampaigns: 0 }, campaigns: [], clicksWeek: 0, loginFree: 0 };
try { const v = await d.adminMember.view(e); if (v && v.credits) out.credits = { available: n0(v.credits.available), inCampaigns: n0(v.credits.inCampaigns) }; } catch (er) {}
let list = []; try { list = (await d.ads.listCampaigns(e)).filter(c => !c.house && c.type !== 'game'); } catch (er) {}
out.campaigns = list.map(c => ({ id: c.id, name: c.name || null, type: c.type, status: c.status, budget: n0(c.budget), delivered: n0(c.spent), clicks: n0(c.clicks), created: n0(c.created) }));
try { out.clicksWeek = await d.coach.clicksSince(list.map(c => c.id), now - 7 * DAY); out.clicksPrevWeek = Math.max(0, (await d.coach.clicksSince(list.map(c => c.id), now - 14 * DAY)) - out.clicksWeek); } catch (er) {}
try { out.loginFree = n0((await d.ads.loginSlots()).free); } catch (er) {}
if (d.site === 'linkspin') {
const since30 = now - 30 * DAY;
try { out.goalsCount = d.convtrack.goalsOf(e).length; out.goalsMonth = d.convtrack.countSince(e, monthStartCT(now)); out.conv30 = d.convtrack.countSince(e, since30); } catch (er) { out.goalsCount = 0; out.goalsMonth = 0; out.conv30 = 0; }
const parts = {};
let spins = [], rots = [], pgs = [];
try { spins = await d.bannerspin.list(e); } catch (er) {}
try { rots = await d.rotator.list(e); } catch (er) {}
try { pgs = await d.pages.list(e); } catch (er) {}
const liveB = s => s.banners.filter(b => b.active && !b.adminOff);
if (!spins.length) parts.bannerSpin = { state: 'grey', note: 'not set up' };
else { const seen = spins.filter(s => !s.paused && s.imps30 > 0); parts.bannerSpin = seen.length ? { state: 'green', note: seen.reduce((n, s) => n + s.imps30, 0).toLocaleString('en-US') + ' views in 30 days' } : { state: 'amber', note: 'no views yet' }; }
if (!rots.length) parts.spinLink = { state: 'grey', note: 'not set up' };
else { const w = rots.reduce((n, r) => n + n0(r.hits7), 0); parts.spinLink = w > 0 ? { state: 'green', note: w.toLocaleString('en-US') + ' clicks this week' } : { state: 'amber', note: 'no clicks this week' }; }
const pub = pgs.filter(p => p.status === 'published');
parts.page = !pgs.length ? { state: 'grey', note: 'not set up' } : !pub.length ? { state: 'amber', note: 'draft only, not published' } : pub.some(p => n0(p.views) > 0) ? { state: 'green', note: pub.length + ' published' } : { state: 'amber', note: 'published, no views yet' };
const rotTest = rots.some(r => !r.paused && r.destinations.filter(x => x.active).length >= 2);
const rotTraffic = rots.some(r => !r.paused && r.destinations.filter(x => x.active && x.hits7 > 0).length >= 2);
const bsTest = spins.some(s => !s.paused && liveB(s).length >= 2);
const bsTraffic = spins.some(s => !s.paused && liveB(s).filter(b => b.imps30 > 0).length >= 2);
parts.testing = rotTraffic || bsTraffic ? { state: 'green', note: 'two or more versions getting traffic' } : rotTest || bsTest ? { state: 'amber', note: 'two versions set up, waiting for traffic' } : (rots.length || spins.length) ? { state: 'amber', note: 'only one version: add a second to test' } : { state: 'grey', note: 'not set up' };
out.parts = parts;
}
return out;
}
// the streak panel's one line about the next refuel (2026-10-24): once BOTH sites are refueled this cycle it says so,
// and only a cycle with one site done asks for the other one, by name
function streakNote(rf, cy) {
const nx = rf && rf.next; if (!rf || !rf.active || !nx) return '';
if (rf.windowOpen) return 'Window open: next refuel +' + nx.single + '% (+' + nx.both + '% on each with both).';
const iapDone = !!(cy && cy.iap && cy.iap.refueled), lsDone = !!(cy && cy.linkspin && cy.linkspin.refueled);
if ((cy && cy.both) || (iapDone && lsDone)) return 'Both engines fueled this cycle: +' + (nx.secondEngine || (cy.iap && cy.iap.pct) || 0) + '% on each.';
if (nx.secondEngine) return 'Refuel ' + (iapDone ? 'LinkSpin' : 'InstantAdPay') + ' this cycle for +' + nx.secondEngine + '% on both.';
return '';
}
module.exports = { streakNote, build, facts, burnPerDay, monthStartCT, LINKS };
+5 -2
View File
@@ -30,6 +30,7 @@
// Until InstantAdPay answers proto 2, the hash of a row carrying the new facts is not recorded (sent again later).
'use strict';
const SF = require('./sponsorfollow');
const prohibited = require('./prohibited'); // 2026-10-30: a profile that fails the policy never leaves this site
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
@@ -52,10 +53,12 @@ function save() { try { fs.writeFileSync(FILE(), JSON.stringify(load())); } catc
function init(deps) { R = deps; load(); } // { dataDir, accounts, registry, host, follow (sponsorfollow store), tank: () => tank }
const PUBLIC = () => String(process.env.PUBLIC_URL || ('https://' + (R.host || 'linkspin.app'))).replace(/\/+$/, '');
function profileOf(a) {
let socials = null; try { socials = a.socials ? (typeof a.socials === 'string' ? JSON.parse(a.socials) : a.socials) : null; } catch (e) { socials = null; }
if (a.profileQuarantined) return null; // quarantined (link planted on a brand-new free account): stays here, unseen, until Marty decides
const cp = prohibited.cleanProfile({ avatarUrl: a.avatarUrl, bio: a.bio, socials: a.socials }, 'LinkSpin'); // policy applied on the way out too
const socials = cp.socials;
const av = String(a.avatarUrl || '').trim();
const avatarUrl = !av ? null : /^https:\/\//i.test(av) ? av : av.startsWith('/') ? PUBLIC() + av : null;
const bio = String(a.bio || '').trim().slice(0, 600) || null;
const bio = cp.bio;
if (!avatarUrl && !bio && !(socials && Object.keys(socials).length)) return null;
return { avatarUrl, bio, socials: socials && Object.keys(socials).length ? socials : null };
}
+13 -5
View File
@@ -13,6 +13,10 @@ const FAQ = [
questions: ['I am already on InstantAdPay, do I start over?', 'Will my InstantAdPay sponsor be my sponsor here?', 'Can I sign in with my InstantAdPay email?'],
tags: ['instantadpay', 'sponsor', 'carry-over', 'team', 'network'],
answer: 'Sign in with the email you use on InstantAdPay and your sponsor is placed for you before you buy anything: the same people above you, the same people below you, the same wallet. LinkSpin is a second property to build on, with tools you will use every day.' },
{ id: 'f-conversion-pixel', title: 'How do I count sign-ups and sales from my ads?', source: 'faq',
questions: ['How do I count sign-ups from my ads?', 'How do I see cost per lead?', 'Where do I put the conversion pixel?', 'My autoresponder has its own thank-you page, can I still track?'],
tags: ['conversion pixel', 'goal', 'cost per goal', 'thank-you page', 'aweber', 'getresponse'],
answer: 'Open Conversions in your Control Room (' + SITE_URL + '/conversions) and add a goal, for example subscriber. Paste the landing tag once on your landing page and the goal pixel on your thank-you page, then press Send a test conversion. From then on each click on your ads and spin links that reaches the goal counts once, within 30 days of the click, with its cost per goal by campaign. If Aweber, GetResponse or another provider shows its own thank-you page, set its thank-you redirect to a page on your own site that carries the pixel. InstantAdPay members find the same goals under Campaigns > Conversion tracking.' },
{ id: 'f-new-here', title: 'New here: where to start', source: 'faq',
questions: ['I am new, where do I start?', 'What should I do first?', 'How do I get started?'],
tags: ['getting started', 'new member', 'first steps'],
@@ -21,10 +25,10 @@ const FAQ = [
questions: ['How much POL do I need?', 'How much POL for fees?', 'What does a package cost in POL?'],
tags: ['pol', 'fees', 'gas', 'buy packages'],
answer: 'The Credits screen shows the live POL cost of each package. Have that plus 2 or 3 POL for network fees; there is no other cost. Trust Wallet users should keep about double, because Trust blocks a purchase that spends most of the wallet.' },
{ id: 'f-moonpay-declined', title: 'MoonPay declined my card', source: 'faq',
questions: ['Why did MoonPay decline my card?', 'My card was refused buying POL', 'MoonPay will not take my payment'],
tags: ['moonpay', 'card', 'declined', 'buy pol'],
answer: 'Some banks block crypto purchases. Try a different card, Apple Pay or Google Pay, or buy POL on an exchange and withdraw it to your own wallet on the Polygon network. MoonPay is an independent provider with its own fees, limits and a first-time ID check (minimum order usually around $30).' },
{ id: 'f-card-declined', title: 'My card was declined buying POL', source: 'faq',
questions: ['Why was my card declined buying POL?', 'My card was refused buying POL', 'The on-ramp will not take my payment'],
tags: ['card', 'declined', 'buy pol', 'on-ramp'],
answer: 'Some banks block crypto purchases. Try a different card, Apple Pay or Google Pay, or another major exchange or on-ramp, then send the POL to your own wallet on the Polygon network. Whichever provider you use has its own ID checks, fees and limits; LinkSpin is never in the middle of that payment.' },
{ id: 'f-same-wallet-positions', title: 'One wallet, one position', source: 'faq',
questions: ['Can I use the same wallet for more than one position?', 'How do I add positions for Qualified Start?'],
tags: ['wallet', 'position', 'qualified start', 'metamask'],
@@ -52,6 +56,10 @@ const FAQ = [
{ id: 'f-recovery-phrase', title: 'Recovery phrase and scam safety', source: 'faq',
questions: ['Someone asked for my recovery phrase', 'Will support ever ask for my private key?', 'Someone messaged me asking for money'],
tags: ['recovery phrase', 'private key', 'scam', 'security'],
answer: 'Never share your recovery phrase (the 12 or 24 words) or private key with anyone: whoever has them has your money. Nobody from LinkSpin will ever ask for them, and the site never sees them. If someone does ask, do not reply, and tell support through Help at ' + SITE_URL + '/help.' }
answer: 'Never share your recovery phrase (the 12 or 24 words) or private key with anyone: whoever has them has your money. Nobody from LinkSpin will ever ask for them, and the site never sees them. If someone does ask, do not reply, and tell support through Help at ' + SITE_URL + '/help.' },
{ id: 'f-prohibited-content', title: 'What content is not allowed?', source: 'faq',
questions: ['What content is not allowed?', 'Can I put a link in my bio?', 'Why was my bio refused?', 'Can I promote a casino or CBD offer?', 'What is link farming?'],
tags: ['prohibited content', 'rules', 'bio', 'links', 'gambling', 'adult', 'link farm', 'terms'],
answer: 'Not allowed anywhere on LinkSpin, in ads, campaigns, line banners, wall offers, bios and social links: gambling, casinos, betting, lotteries and sweepstakes; adult or sexual content; drugs and prescription pharmaceuticals; weapons; hate or harassment; malware, phishing and counterfeit goods; misleading financial promises. The bio is text only, no links and no domain names; links go in the social fields of your profile. Your bio, avatar and social links show on your public wall once you have bought a package; a free account\'s wall shows the name, the line\'s ads and the join button. Accounts created to place links in profile fields (link farming) are removed without notice, with their profile text. Full list: ' + SITE_URL + '/terms#prohibited' },
];
module.exports = { FAQ };
+218
View File
@@ -0,0 +1,218 @@
// The Refuel Kit (Fuel Your Offers stage 3, Marty approved the build 2026-10-24). The SAME file ships in InstantAdPay and
// LinkSpin; each site keeps ITS OWN program's kits (InstantAdPay art promotes InstantAdPay, LinkSpin art promotes
// LinkSpin, never mixed).
//
// A kit is one month's members-only banner set: { month 'YYYY-MM', theme, released, sizes 728x90 300x250 468x60 160x600
// 1200x630 } with one base image per size, stored as data in DATA_DIR/kits/ (kits.json + <month>/<size>.<ext>).
// Admin uploads the base art and previews the personalization; nothing here generates art (real art is Marty's).
//
// Who gets which kit: a counted refuel (the streak in refuel.js, InstantAdPay is the source of truth) unlocks the kit
// of the Central-time month it landed in. The entitlement arrives as { months: { 'YYYY-MM': streakMonthAtUnlock } }
// from opts.entitled(email). Kits stay usable after their month; missing a refuel only stops NEW kits.
// streak month 3+ at unlock an animated GIF version of each banner size
// streak month 6+ at unlock a "custom banners" credit for BannerKitAI: the entitlement and a note only, no integration
//
// Personalized on the server per member: their @username and a QR code to their own link are drawn onto each banner
// with ffmpeg (the badge renderer's approach). Rendered files are cached in DATA_DIR/kits/out/<hash>.<ext> and served
// publicly at /kitimg/<hash>.<ext> (ad networks and IAP banner campaigns load them by URL); the hash is an HMAC of
// member + kit + size + variant + base-art version, so it cannot be guessed and changes when the art changes.
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const { spawn } = require('child_process');
const SIZES = { '728x90': [728, 90], '300x250': [300, 250], '468x60': [468, 60], '160x600': [160, 600], '1200x630': [1200, 630] };
const ORDER = ['728x90', '300x250', '468x60', '160x600', '1200x630'];
// where the QR and the name go on each size: q = QR box (x, y, side), t = name (x expr, y expr, font px)
const LAYOUT = {
'728x90': { q: ['W-84', 6, 78], t: ['W-96-tw', 'H-30', 18] },
'468x60': { q: ['W-58', 4, 52], t: ['W-68-tw', 'H-24', 14] },
'300x250': { q: ['W-82', 'H-82', 76], t: ['8', 'H-30', 16] },
'160x600': { q: ['(W-120)/2', 'H-128', 120], t: ['(W-tw)/2', 'H-160', 16] },
'1200x630': { q: ['W-212', 'H-212', 182], t: ['32', 'H-66', 34] },
};
let X = {}, DIR = null, OUT = null, FILE = null, SALT = null;
const MONTH_RE = /^\d{4}-(0[1-9]|1[0-2])$/;
const norm = e => String(e || '').trim().toLowerCase();
function init(opts) {
X = opts || {}; DIR = path.join(X.dataDir, 'kits'); OUT = path.join(DIR, 'out'); FILE = path.join(DIR, 'kits.json');
try { fs.mkdirSync(OUT, { recursive: true }); } catch (e) {}
const sf = path.join(DIR, 'salt'); try { SALT = fs.readFileSync(sf, 'utf8').trim(); } catch (e) {}
if (!SALT) { SALT = crypto.randomBytes(16).toString('hex'); try { fs.writeFileSync(sf, SALT, { flag: 'wx' }); } catch (e) { try { SALT = fs.readFileSync(sf, 'utf8').trim(); } catch (er) {} } }
}
const program = () => X.program === 'linkspin' ? 'linkspin' : 'iap';
const brand = () => program() === 'linkspin' ? 'LinkSpin' : 'InstantAdPay';
function load() { try { const s = JSON.parse(fs.readFileSync(FILE, 'utf8')); s.kits = s.kits || {}; s.credits = s.credits || {}; return s; } catch (e) { return { kits: {}, credits: {} }; } }
function save(s) { const tmp = FILE + '.' + process.pid + '.tmp'; fs.writeFileSync(tmp, JSON.stringify(s, null, 1)); fs.renameSync(tmp, FILE); }
const ctMonth = ts => new Date(ts || Date.now()).toLocaleDateString('en-CA', { timeZone: 'America/Chicago' }).slice(0, 7);
const monthLabel = m => new Date(Date.UTC(Number(m.slice(0, 4)), Number(m.slice(5, 7)) - 1, 15)).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' });
// ---- admin: the kits ---------------------------------------------------------------------------------
function baseFile(month, size) {
const d = path.join(DIR, month);
for (const ext of ['png', 'jpg', 'gif']) { const f = path.join(d, size + '.' + ext); if (fs.existsSync(f)) return f; }
return null;
}
function kitView(k) {
const sizes = ORDER.map(s => { const f = baseFile(k.month, s); return { size: s, ready: !!f, v: f ? Math.round(fs.statSync(f).mtimeMs) : 0 }; });
return { month: k.month, label: monthLabel(k.month), theme: k.theme || '', released: !!k.released, program: program(), sizes, complete: sizes.every(x => x.ready), updated: k.updated || 0 };
}
function listKits() { const s = load(); return Object.values(s.kits).sort((a, b) => b.month.localeCompare(a.month)).map(kitView); }
function saveKit(b) {
const month = String(b.month || ''); if (!MONTH_RE.test(month)) return { error: 'Month as YYYY-MM.' };
const s = load(); const k = s.kits[month] || { month, theme: '', released: false, created: Date.now() };
if (b.theme != null) k.theme = String(b.theme).trim().slice(0, 80);
if (b.released != null) {
if (b.released && !kitView(k).complete) return { error: 'Upload all five sizes before releasing the kit.' };
k.released = !!b.released;
}
if (b.remove) { delete s.kits[month]; save(s); return { ok: true, removed: true }; }
k.updated = Date.now(); s.kits[month] = k; save(s);
return { ok: true, kit: kitView(k) };
}
const MAGIC = { png: b => b[0] === 0x89 && b[1] === 0x50, jpg: b => b[0] === 0xff && b[1] === 0xd8, gif: b => b.slice(0, 3).toString() === 'GIF' };
function uploadBase(month, size, buf, mime) {
if (!MONTH_RE.test(String(month))) return { error: 'Month as YYYY-MM.' };
if (!SIZES[size]) return { error: 'Size must be one of ' + ORDER.join(', ') + '.' };
const ext = { 'image/png': 'png', 'image/jpeg': 'jpg', 'image/gif': 'gif' }[String(mime || '').split(';')[0].trim()];
if (!ext || !buf || buf.length < 32 || !MAGIC[ext](buf)) return { error: 'Use a PNG, JPG or GIF file.' };
const d = path.join(DIR, month); fs.mkdirSync(d, { recursive: true });
for (const e of ['png', 'jpg', 'gif']) { try { fs.unlinkSync(path.join(d, size + '.' + e)); } catch (er) {} }
fs.writeFileSync(path.join(d, size + '.' + ext), buf);
const s = load(); if (!s.kits[month]) s.kits[month] = { month, theme: '', released: false, created: Date.now() }; s.kits[month].updated = Date.now(); save(s);
return { ok: true, kit: kitView(s.kits[month]) };
}
// placeholder art for tests and previews: the program's existing banners from public/banners (no paid image APIs)
function usePlaceholder(month) {
const pre = program() === 'linkspin' ? 'linkspin-' : 'iap-';
const pick = { '728x90': [pre + '728x90.png'], '300x250': [pre + '300x250.png'], '468x60': [pre + '468x60.png'], '160x600': [pre + '160x600.png'],
'1200x630': program() === 'linkspin' ? ['linkspin-og-1200x630.png'] : ['iap-hero-1200x630.png', 'iap-advertise-earn-1200x630.jpg'] };
const done = [];
for (const size of ORDER) {
const f = pick[size].map(n => path.join(X.publicDir, 'banners', n)).find(p => fs.existsSync(p)); if (!f) continue;
const buf = fs.readFileSync(f); const r = uploadBase(month, size, buf, /\.jpg$/.test(f) ? 'image/jpeg' : 'image/png'); if (r.ok) done.push(size);
}
return { ok: true, sizes: done, kit: kitView(load().kits[month] || { month }) };
}
// ---- the renderer ---------------------------------------------------------------------------------------
let FONT;
function font() {
if (FONT !== undefined) return FONT;
FONT = process.env.BADGE_FONT || null; if (FONT) return FONT;
const walk = d => { let ents = []; try { ents = fs.readdirSync(d, { withFileTypes: true }); } catch (e) { return null; } for (const e of ents) { const f = path.join(d, e.name); if (e.isDirectory()) { const r = walk(f); if (r) return r; } else if (/bold\.ttf$/i.test(e.name) || /DejaVuSans-Bold\.ttf$/.test(e.name)) return f; } return null; };
for (const d of ['/usr/share/fonts', '/usr/local/share/fonts']) { const r = walk(d); if (r) { FONT = r; break; } }
if (!FONT && process.platform === 'win32' && fs.existsSync('C:/Windows/Fonts/arialbd.ttf')) FONT = 'C:/Windows/Fonts/arialbd.ttf';
return FONT;
}
const ffText = t => String(t).replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/:/g, '\\:').replace(/%/g, '%%');
function run(args, cwd) {
return new Promise(resolve => {
const p = spawn(X.ffmpeg || 'ffmpeg', args, { stdio: ['ignore', 'pipe', 'pipe'], cwd });
const out = []; let err = '';
p.stdout.on('data', c => out.push(c)); p.stderr.on('data', c => { err += c; });
p.on('error', e => resolve({ code: -1, err: e.message })); p.on('close', code => resolve({ code, out: Buffer.concat(out), err }));
});
}
// one personalized banner: base scaled to the exact size, QR (white quiet zone) and @name on a dark box
async function renderStill(base, size, name, link, stage, outFile) {
const [W, H] = SIZES[size]; const L = LAYOUT[size]; const F = font();
if (!F) return { error: 'No font for the renderer.' };
const qr = X.qrcode || require('qrcode'); // opts.qrcode: a test copy without node_modules
const qrFile = outFile + '.qr.png';
await qr.toFile(qrFile, link, { margin: 1, width: L.q[2], errorCorrectionLevel: 'M', color: { dark: '#000000', light: '#ffffff' } });
const winPath = /:/.test(F); const fontFile = winPath ? path.basename(F) : F;
const ex = v => String(v).replace(/W/g, String(W)).replace(/H/g, String(H));
const tx = String(L.t[0]).replace(/W/g, String(W)).replace(/tw/g, 'text_w'); const ty = ex(L.t[1]);
const showName = stage !== 0, showQr = stage === undefined || stage === 2;
const chain = ['[0:v]scale=' + W + ':' + H + ':flags=lanczos,setsar=1[b]'];
let last = 'b';
if (showQr) { chain.push('[1:v]scale=' + L.q[2] + ':' + L.q[2] + '[q]'); chain.push('[' + last + '][q]overlay=x=' + ex(L.q[0]) + ':y=' + ex(L.q[1]) + '[o]'); last = 'o'; }
if (showName && name) { chain.push('[' + last + ']drawtext=fontfile=' + fontFile + ":text='" + ffText(name) + "':fontcolor=white:fontsize=" + L.t[2] + ':box=1:boxcolor=0x0b1418@0.72:boxborderw=6:x=' + tx + ':y=' + ty + '[n]'); last = 'n'; }
const args = ['-v', 'error', '-y', '-i', path.resolve(base), '-i', path.resolve(qrFile), '-filter_complex', chain.join(';'), '-map', '[' + last + ']', '-frames:v', '1'];
if (/\.jpg$/.test(outFile)) args.push('-q:v', '3');
args.push(path.resolve(outFile));
const r = await run(args, winPath ? path.dirname(F) : undefined);
try { fs.unlinkSync(qrFile); } catch (e) {}
if (r.code !== 0 || !fs.existsSync(outFile)) return { error: 'Render failed: ' + String(r.err || '').slice(0, 200) };
return { ok: true };
}
// the animated version (streak month 3+): the banner, then the name, then the name and the QR, looping
async function renderGif(base, size, name, link, outFile) {
const frames = [0, 1, 2].map(i => outFile + '.f' + i + '.png');
for (let i = 0; i < 3; i++) { const r = await renderStill(base, size, name, link, i, frames[i]); if (r.error) return r; }
const list = outFile + '.txt';
fs.writeFileSync(list, frames.map((f, i) => "file '" + path.resolve(f).replace(/\\/g, '/') + "'\nduration " + (i === 2 ? 3 : 1)).join('\n') + "\nfile '" + path.resolve(frames[2]).replace(/\\/g, '/') + "'\n");
const r = await run(['-v', 'error', '-y', '-f', 'concat', '-safe', '0', '-i', list, '-filter_complex', 'split[a][b];[a]palettegen=max_colors=96[p];[b][p]paletteuse=dither=bayer', '-loop', '0', path.resolve(outFile)]);
for (const f of frames.concat(list)) { try { fs.unlinkSync(f); } catch (e) {} }
if (r.code !== 0 || !fs.existsSync(outFile)) return { error: 'GIF render failed: ' + String(r.err || '').slice(0, 200) };
return { ok: true };
}
const hashOf = (email, month, size, variant, v) => crypto.createHmac('sha256', SALT).update([norm(email), program(), month, size, variant, v].join('|')).digest('hex').slice(0, 28);
function indexFile() { return path.join(OUT, 'index.json'); }
function noteIndex(h, meta) { let ix = {}; try { ix = JSON.parse(fs.readFileSync(indexFile(), 'utf8')); } catch (e) {} ix[h] = meta; const tmp = indexFile() + '.' + process.pid + '.tmp'; fs.writeFileSync(tmp, JSON.stringify(ix)); fs.renameSync(tmp, indexFile()); }
// render (or reuse) one personalized file; returns { url, file, size, variant, w, h, bytes }
async function personal(who, month, size, variant) {
const base = baseFile(month, size); if (!base) return { error: 'That kit has no ' + size + ' art yet.' };
const v = Math.round(fs.statSync(base).mtimeMs);
const ext = variant === 'gif' ? 'gif' : size === '1200x630' ? 'jpg' : 'png';
const h = hashOf(who.email, month, size, variant, v + '|' + who.name + '|' + who.link);
const out = path.join(OUT, h + '.' + ext);
if (!fs.existsSync(out)) {
const tmp = path.join(OUT, h + '.' + process.pid + '.' + Date.now() + '.' + ext);
let r; try { r = variant === 'gif' ? await renderGif(base, size, who.name, who.link, tmp) : await renderStill(base, size, who.name, who.link, undefined, tmp); } catch (e) { r = { error: 'The banner renderer is not available: ' + e.message }; }
if (r.error) return r;
try { fs.renameSync(tmp, out); } catch (e) { try { fs.unlinkSync(tmp); } catch (er) {} }
noteIndex(h, { email: norm(who.email), month, size, variant, ts: Date.now() });
}
const [w, hh] = SIZES[size];
return { ok: true, url: '/kitimg/' + h + '.' + ext, abs: String(X.siteUrl || '').replace(/\/+$/, '') + '/kitimg/' + h + '.' + ext, file: out, size, variant, w, h: hh, bytes: fs.statSync(out).size, ext };
}
// public serving: only files already rendered for an entitled member
function servePath(name) { const m = /^([a-f0-9]{28})\.(png|jpg|gif)$/.exec(String(name || '')); if (!m) return null; const f = path.join(OUT, m[0]); return fs.existsSync(f) ? { file: f, mime: { png: 'image/png', jpg: 'image/jpeg', gif: 'image/gif' }[m[2]] } : null; }
// ---- the member ------------------------------------------------------------------------------------------
async function whoOf(email) {
const w = await X.linkFor(norm(email)); if (!w || !w.link) return null;
return { email: norm(email), name: w.username ? '@' + w.username : '', link: w.link };
}
async function myKits(email) {
const ent = (await X.entitled(norm(email)).catch(() => null)) || null;
if (!ent || !ent.on) return { on: false };
const s = load(); const months = ent.months || {};
const nowMonth = String(ent.today || '').slice(0, 7) || ctMonth(); // a kit released early still waits for its month
const kits = Object.values(s.kits).filter(k => k.released && k.month <= nowMonth).sort((a, b) => b.month.localeCompare(a.month)).slice(0, 12).map(k => {
const streakAt = months[k.month] || 0; const unlocked = streakAt > 0;
return Object.assign(kitView(k), { unlocked, streakAt, gif: unlocked && streakAt >= 3, custom: unlocked && streakAt >= 6 });
});
// the BannerKitAI "custom banners" credit: an entitlement on record, nothing more yet
const customMonths = Object.entries(months).filter(([, k]) => k >= 6).map(([m]) => m);
if (customMonths.length) {
const e = norm(email); const have = s.credits[e] || {}; let changed = false;
for (const m of customMonths) if (!have[m]) { have[m] = { ts: Date.now(), used: false }; changed = true; }
if (changed) { s.credits[e] = have; save(s); }
}
const credits = Object.entries((s.credits[norm(email)] || {})).map(([m, c]) => ({ month: m, used: !!c.used }));
const cur = nowMonth; const who = await whoOf(email).catch(() => null);
return { on: true, program: program(), brand: brand(), link: who ? who.link : null, name: who ? who.name : null, current: cur, currentLabel: monthLabel(cur), unlockedCurrent: !!months[cur],
kits, customCredits: credits, customNote: credits.length ? 'Custom banners made for your own offer with BannerKitAI are coming. Your credit is saved on your account and will be honored when it opens.' : null,
nextRefuel: ent.nextRefuel || null };
}
async function renderFor(email, month, size, variant) {
const mk = await myKits(email); if (!mk.on) return { error: 'The Refuel Kit is not switched on.' };
const k = mk.kits.find(x => x.month === month); if (!k) return { error: 'No such kit.' };
if (!k.unlocked) return { error: 'Your next counted refuel unlocks this kit.' };
if (!SIZES[size]) return { error: 'No such size.' };
if (variant === 'gif' && !k.gif) return { error: 'The animated version comes with a 3-month streak.' };
const who = await whoOf(email); if (!who) return { error: 'Set a username first, so your banners carry your own link.' };
return personal(who, month, size, variant === 'gif' ? 'gif' : 'still');
}
async function preview(month, size, username, variant) {
const link = String(X.siteUrl || '').replace(/\/+$/, '') + '/join/' + (username || 'yourname');
const who = { email: 'preview@' + program(), name: '@' + (username || 'yourname'), link };
return personal(who, month, size, variant === 'gif' ? 'gif' : 'still');
}
module.exports = { init, SIZES, ORDER, LAYOUT, listKits, saveKit, uploadBase, usePlaceholder, myKits, renderFor, preview, servePath, ctMonth, monthLabel, font };
+61
View File
@@ -0,0 +1,61 @@
// "Load into my Banner Spin" for the Refuel Kit (2026-10-24). Each Banner Spin size in an unlocked kit goes into one of the
// member's Banner Spins of that size that has room, or into a new Banner Spin when the member's tier allows one more.
// The banner is the member's own personalized file (copied into uploads like a normal Banner Spin upload, so health checks,
// moderation and Member content treat it the same), labelled "Refuel Kit <month>", the target their own link.
// Loading the same kit twice does not add it twice.
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
async function load(d) { // { kit, bannerspin, content, uploadsDir, email, month, variant, sizes }
const { kit, bannerspin, email, month } = d;
const mk = await kit.myKits(email); const k = mk.on && mk.kits.find(x => x.month === month);
if (!k) return { error: 'No such kit.' };
if (!k.unlocked) return { error: 'Your next counted refuel unlocks this kit.' };
const t = await bannerspin.tierFor(email); if (!t.ok) return { error: t.reason, status: 403 };
const want = Array.isArray(d.sizes) && d.sizes.length ? d.sizes.map(String) : k.sizes.filter(x => x.ready).map(x => x.size);
const label = 'Refuel Kit ' + month; const results = [];
for (const size of want.filter(z => bannerspin.SIZES[z] && k.sizes.some(x => x.size === z && x.ready))) {
const mine = await bannerspin.list(email);
const has = mine.find(x => x.size === size && x.banners.some(b => b.label === label));
if (has) { results.push({ size, spinId: has.id, spin: has.name, already: true }); continue; }
const r = await kit.renderFor(email, month, size, d.variant === 'gif' && k.gif ? 'gif' : 'still');
if (r.error) { results.push({ size, error: r.error }); continue; }
if (r.bytes > bannerspin.MAX_BYTES) { results.push({ size, error: 'The ' + size + ' file is over 150 KB, so Banner Spin cannot take it. Use the still version.' }); continue; }
let spin = mine.find(x => x.size === size && x.banners.length < t.banners && !x.adminOff), created = false;
if (!spin) { const c = await bannerspin.create(email, { name: 'Refuel Kit ' + size, size, fallback: mk.link || '' }); if (c.error) { results.push(Object.assign({ size, error: c.error }, mine.length >= t.spins ? { full: true } : {})); continue; } spin = c.spin; created = true; }
const name = crypto.randomBytes(12).toString('hex') + '.' + r.ext;
fs.writeFileSync(path.join(d.uploadsDir, name), fs.readFileSync(r.file));
const mime = { png: 'image/png', jpg: 'image/jpeg', gif: 'image/gif' }[r.ext];
try { if (d.content) d.content.noteUpload(name, email, r.bytes, mime, ''); } catch (e) {}
bannerspin.noteImage(email, name, r.w, r.h, r.bytes, mime);
const add = await bannerspin.addBanner(email, spin.id, { image: '/uploads/' + name, target: mk.link, label });
results.push(add.error ? { size, error: add.error } : { size, spinId: spin.id, spin: spin.name, created });
}
return { ok: true, results, message: summary(results, t) };
}
// one plain sentence set for the member (2026-10-24): what loaded, what did not and why, and what to do about it. A Starter
// tier holds 2 Banner Spins, so a full kit loads two sizes; that is the rule, and the message has to say so up front.
const join = a => a.length <= 1 ? a.join('') : a.slice(0, -1).join(', ') + ' and ' + a[a.length - 1];
function summary(results, t) {
const ok = results.filter(x => !x.error), full = results.filter(x => x.error && x.full), bad = results.filter(x => x.error && !x.full);
const out = [];
if (ok.length) out.push('Loaded: ' + join(ok.map(x => x.size + (x.already ? ' (already in "' + x.spin + '")' : x.created ? ' (new Banner Spin "' + x.spin + '")' : ' (added to "' + x.spin + '")'))) + '.');
if (full.length) out.push('Not loaded: ' + join(full.map(x => x.size)) + '. Your ' + t.label + ' tier holds ' + t.spins + ' Banner Spins, one size each, and they are all in use. Nothing is broken: pick the sizes you want most and load those, or delete a Banner Spin under Links to make room.'
+ (t.next ? ' ' + t.next.label + ' (' + t.next.need + ') holds ' + t.next.spins + '.' : ''));
for (const x of bad) out.push(x.size + ': ' + x.error);
if (!results.length) out.push('Pick at least one size to load.');
return out.join(' ');
}
// what the Refuel Kit panel needs to pre-pick sizes: the tier, Banner Spins in use, and the sizes that fit (sizes with a
// Banner Spin that has room first, then new ones in order of use: 728x90, 300x250, 468x60, 160x600)
const PREFER = ['728x90', '300x250', '468x60', '160x600'];
async function room(email, bannerspin) {
const t = await bannerspin.tierFor(email); if (!t.ok) return { ok: false, reason: t.reason };
const mine = await bannerspin.list(email); const sizes = PREFER.filter(z => bannerspin.SIZES[z]);
const fits = sizes.filter(z => mine.some(x => x.size === z && x.banners.length < t.banners && !x.adminOff));
let free = Math.max(0, t.spins - mine.length); const suggested = sizes.filter(z => fits.includes(z) || (free > 0 && free-- > 0));
return { ok: true, tier: t.label, spins: t.spins, used: mine.length, next: t.next, sizes, suggested, all: suggested.length >= sizes.length };
}
module.exports = { load, room, summary };
+4 -3
View File
@@ -4,6 +4,7 @@
// on Central time: week = Monday 00:00 to Sunday 23:59, month = calendar month. Winners are recorded at
// rollover (checked hourly), announced to Telegram, and credit prizes are granted automatically.
const { SITE_HOST, SITE_URL } = require('./host');
const themehead = require('./themehead'); // light/dark theme head script (2026-11-01)
const fs = require('fs');
const path = require('path');
let R = null; // { chain, accounts, ads, dataDir, siteConfig, notify(text), pushFeed(ev) }
@@ -131,8 +132,8 @@ async function renderPage() {
+ (v.top.length ? v.top.map(r => '<tr><td>' + r.rank + '</td><td><b>' + esc(r.name) + '</b></td><td>' + r.sales + '</td><td>$' + r.usd.toLocaleString() + '</td><td>' + r.buyers + '</td><td>' + r.joins + '</td></tr>').join('') : '<tr><td colspan="6" class="muted">No sales yet in this period.</td></tr>') + '</table>';
const fmtD = ts => new Date(ts).toLocaleDateString('en-US', { timeZone: TZ, month: 'short', day: 'numeric' });
const desc = 'Who is selling the most ad packages on LinkSpin this week and this month. Weekly and monthly referral contest standings, read from the chain.';
let h = '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Leaderboard | LinkSpin</title><meta name="description" content="' + esc(desc) + '"><link rel="canonical" href="' + SITE_URL + '/leaderboard"><meta property="og:title" content="LinkSpin leaderboard"><meta property="og:description" content="' + esc(desc) + '"><meta property="og:image" content="' + SITE_URL + '/banners/iap-hero-1200x630.png"><meta name="twitter:card" content="summary_large_image">'
+ '<link rel="icon" type="image/png" href="/logo-icon.png"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"><link rel="stylesheet" href="/assets/site.css?v=20260913a">'
let h = '<!doctype html><html lang="en"' + themehead.htmlAttr('dark') + '><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Leaderboard | LinkSpin</title><meta name="description" content="' + esc(desc) + '"><link rel="canonical" href="' + SITE_URL + '/leaderboard"><meta property="og:title" content="LinkSpin leaderboard"><meta property="og:description" content="' + esc(desc) + '"><meta property="og:image" content="' + SITE_URL + '/banners/iap-hero-1200x630.png"><meta name="twitter:card" content="summary_large_image">'
+ '<link rel="icon" type="image/png" href="/logo-icon.png"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">' + themehead.tag() + '<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">'
+ '<style>.lbw{max-width:860px}.lb{width:100%;border-collapse:collapse;margin:8px 0 26px;font-variant-numeric:tabular-nums}.lb th{text-align:left;color:var(--muted);font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:8px 10px;border-bottom:1px solid var(--line)}.lb td{padding:10px;border-bottom:1px solid var(--line)}.lb tr:first-child + tr td:first-child{color:#ffd15c;font-weight:800}.prize{border-left:4px solid var(--mint);background:rgba(67,232,195,.07);padding:12px 16px;border-radius:0 12px 12px 0;margin:0 0 18px}.win{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:0 0 10px}</style></head><body><div class="wrap lbw">'
+ '<section class="hero" style="padding:56px 0 8px"><p class="eyebrow">Referral contest</p><h1>Leaderboard: <em>who is selling</em>.</h1><p class="lead">Ranked by ad packages sold to other people (your own positions never count, and the company account is not a contestant). Read from the chain, updated live. Weeks run Monday to Sunday, Central time.</p></section>';
h += '<h2 style="font-size:24px;margin:0 0 4px">' + week.label + ' <span class="muted small">' + fmtD(week.start) + ' to Sunday</span></h2>' + (week.prize ? '<div class="prize"><b>Weekly prizes:</b> ' + esc(week.prize) + '</div>' : '') + table(week);
@@ -141,7 +142,7 @@ async function renderPage() {
const w = winners();
if (w.length) h += '<h2 style="font-size:24px;margin:0 0 10px">Past winners</h2>' + w.slice(0, 12).map(x => '<div class="win"><b>' + (x.kind === 'week' ? 'Week of ' : 'Month of ') + fmtD(x.start) + '</b>: ' + (x.top[0] ? esc(x.top[0].name) + ' (' + x.top[0].sales + ' sold, $' + x.top[0].usd + ')' : 'no sales') + (x.granted && x.granted.length ? ' · awarded: ' + x.granted.map(g => esc(g.name) + ' +' + g.credits.toLocaleString()).join(', ') : (x.prize ? ' · prize ' + esc(x.prize) : '')) + '</div>').join('');
h += '<p class="muted small" style="margin-top:30px">Sales are $ of packages bought by members you directly sponsor. Prizes are advertising credits or packages, never cash. No income is guaranteed.</p>';
h += '</div><script src="/assets/common.js?v=20260914a"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
h += '</div><script src="/assets/common.js?v=20261101t"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
return h;
}
module.exports = { init, view, compute, renderPage, rolloverTick, winners, periodBounds };
+62
View File
@@ -0,0 +1,62 @@
// One-time claims shared by every running copy of the app (same idea as InstantAdPay's marks.js, 2026-10-24).
//
// Why: a Coolify deploy starts the new container and only stops the old one once the new one is healthy, so for
// about half a minute two copies of this app run side by side. Anything deduped in process memory or in a JSON
// file that each copy rewrites from its own memory can fire twice (InstantAdPay, 2026-09-25: two emails and a
// doubled Friday bonus). `claim(key)` is true for exactly one caller across all copies, false for everyone else.
//
// With a database: a row in event_marks that only one INSERT can win. Without one (LinkSpin production runs on
// the JSON store): an exclusive file create (open with 'wx') in DATA_DIR/marks/. Both copies mount the same
// volume, and O_EXCL creation is atomic on it, so exactly one copy gets the file. Marks older than 60 days are
// pruned: every event they guard has long since been handled.
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
let db = null, DIR = null;
const local = new Set();
function init(deps) {
db = deps && deps.db;
DIR = deps && deps.dataDir ? path.join(deps.dataDir, 'marks') : null;
if (DIR) { try { fs.mkdirSync(DIR, { recursive: true }); } catch (e) {} }
}
const dbOn = () => !!(db && db.enabled && db.enabled());
async function ensureTable() {
if (!dbOn()) return;
await db.q('CREATE TABLE IF NOT EXISTS event_marks (k VARCHAR(160) PRIMARY KEY, ts BIGINT NOT NULL) ENGINE=InnoDB');
}
const fileOf = key => path.join(DIR, crypto.createHash('sha1').update(key).digest('hex') + '.m');
// true = this caller owns the key; false = someone (possibly another copy of the app) already does.
async function claim(key) {
key = String(key).slice(0, 160);
if (dbOn()) {
try {
const r = await db.q('INSERT IGNORE INTO event_marks (k, ts) VALUES (?, ?)', [key, Date.now()]);
return !!(r && r.affectedRows === 1);
} catch (e) { console.error('marks: claim fell back to the file for ' + key + ': ' + e.message); }
}
if (DIR) {
try { const fd = fs.openSync(fileOf(key), 'wx'); try { fs.writeSync(fd, key + '\n' + Date.now()); } finally { fs.closeSync(fd); } return true; }
catch (e) { if (e.code === 'EEXIST') return false; console.error('marks: file claim failed for ' + key + ': ' + e.message); }
}
if (local.has(key)) return false; local.add(key); return true;
}
// whether a key was already claimed (read only, never claims)
async function has(key) {
key = String(key).slice(0, 160);
if (dbOn()) { try { const r = await db.q('SELECT 1 FROM event_marks WHERE k=?', [key]); return r.length > 0; } catch (e) {} }
if (DIR) return fs.existsSync(fileOf(key));
return local.has(key);
}
async function prune() {
const cut = Date.now() - 60 * 86400000;
if (dbOn()) { try { await db.q('DELETE FROM event_marks WHERE ts < ?', [cut]); } catch (e) {} }
if (DIR) { try { for (const f of fs.readdirSync(DIR)) { const p = path.join(DIR, f); try { if (fs.statSync(p).mtimeMs < cut) fs.unlinkSync(p); } catch (e) {} } } catch (e) {} }
}
module.exports = { init, ensureTable, claim, has, prune };
+14 -1
View File
@@ -102,9 +102,22 @@ async function readServed(nasAdId) {
}
// stop a syndicated ad (budget spent, paused, or expired) — remaining:0 halts serving.
// THE TRAP (InstantAdPay, found 2026-09-17, ported here 2026-10-27): NAS has no stop flag, so a stop zeroes `remaining`, and
// served = assigned - remaining then reads the undelivered rest as DELIVERED. The true figure is captured BEFORE the stop
// and returned; callers persist it (ads.stopNas) and never reconcile a stopped ad again.
async function deactivate(nasAdId) {
if (!enabled()) return { skipped: 'flag-off' };
let served = null;
try { const s = await readServed(nasAdId); if (s) served = s.served; } catch (e) {}
await q('UPDATE sponsorads SET remaining=0, EDate=NOW() WHERE ID=?', [Number(nasAdId)]);
return { ok: true, served };
}
// restart a STOPPED ad with `addImpressions` more, re-basing `assigned` on the TRUE served count recorded at the stop
// (a plain topUp would leave the zeroed remainder counted as served)
async function restart(nasAdId, trueServed, addImpressions, days) {
if (!enabled()) return { skipped: 'flag-off' };
const add = Math.max(0, Math.floor(Number(addImpressions) || 0)), base = Math.max(0, Math.floor(Number(trueServed) || 0));
await q('UPDATE sponsorads SET assigned=?, remaining=?, approved=1, EDate=DATE_ADD(NOW(), INTERVAL ? DAY) WHERE ID=?', [base + add, add, Number(days || 30), Number(nasAdId)]);
return { ok: true };
}
@@ -131,4 +144,4 @@ async function topUp(nasAdId, addImpressions, days) {
return { ok: true };
}
module.exports = { setClickUrl, updateCreative, enabled, pushCampaign, readServed, deactivate, topUp, impressionsPerCredit, nasKind };
module.exports = { setClickUrl, updateCreative, enabled, pushCampaign, readServed, deactivate, restart, topUp, impressionsPerCredit, nasKind };
+4 -3
View File
@@ -17,7 +17,7 @@ const J = { db: null, FILE: () => path.join(DATA_DIR, 'postbacks.json'),
save() { try { fs.writeFileSync(this.FILE(), JSON.stringify(this.db)); } catch (e) {} } };
function init(opts) { DATA_DIR = opts.dataDir; ownHosts = opts.ownHosts || (() => []); rotator = opts.rotator; SOURCES = opts.sources || null; J.load(); }
const norm = e => String(e || '').trim().toLowerCase();
const EVENTS = ['join', 'lead', 'wallet', 'purchase', 'external'];
const EVENTS = ['join', 'lead', 'wallet', 'purchase', 'external', 'goal']; // 'goal' = any conversion-pixel goal (2026-10-23); {event} carries the goal's name
const MACRO = /\{([a-z0-9_]{1,24})\}/gi;
function isPrivateIp(ip) {
@@ -102,7 +102,8 @@ async function fire(owner, event, ctx) {
const q = (ctx.q || {});
const vals = { clickid: q.clickid || q.cid || q.click_id || q.external_id || q.visitor_id || '', subid: q.subid || q.sub_id || q.s1 || '', s1: q.s1 || q.sub1 || '', s2: q.s2 || q.sub2 || '', s3: q.s3 || q.sub3 || '', s4: q.s4 || q.sub4 || '', s5: q.s5 || q.sub5 || '', source: ctx.source || '', event, payout: ctx.payout != null ? ctx.payout : '', currency: ctx.currency || 'USD', txid: ctx.txid || '', lsid: ctx.lsid || '', code: ctx.code || '', country: ctx.country || '', device: ctx.device || '' };
for (const [k, v] of Object.entries(q)) if (/^(utm_[a-z]+|sub\d|s\d|aff_sub\d?|t\d|cost|zone|placement|site|campaign|creative|banner|keyword|geo|os|browser|carrier|format)$/.test(k) && vals[k] == null) vals[k] = v;
for (const p of J.db.items.filter(x => x.owner === o && x.enabled && x.events.includes(event))) {
const listens = evs => (evs || []).includes(event) || (!!ctx.goal && (evs || []).includes('goal'));
for (const p of J.db.items.filter(x => x.owner === o && x.enabled && listens(x.events))) {
if (!rateOk(o)) break;
const url = fill(p.url, vals);
let r = await deliver(p, url, Object.assign({}, ctx, { event }));
@@ -112,7 +113,7 @@ async function fire(owner, event, ctx) {
// the traffic source that sent this click (and only that one) hears about it through its own postback
if (ctx.sourceId && SOURCES) {
const s = SOURCES.forFire(o, ctx.sourceId);
if (s && (s.events || []).includes(event) && rateOk(o)) {
if (s && listens(s.events) && rateOk(o)) {
const url = fill(s.postbackUrl, vals);
let r = await deliver(s, url, Object.assign({}, ctx, { event, viaSource: s.id }));
if (!r.ok && !ctx.test) { await new Promise(res => setTimeout(res, 4000)); r = await deliver(s, url, Object.assign({}, ctx, { event, viaSource: s.id })); }
+108
View File
@@ -0,0 +1,108 @@
// Prohibited-content policy, one module shared by InstantAdPay and LinkSpin (keep the two copies identical).
// 2026-10-30: an SEO backlink farm opened 106 free accounts, each with a casino or local-business bio and a
// website link, and Google indexed that text under our domains through the public walls. Rules (Marty):
// - profile fields are not a free backlink: a bio may not carry a URL or a domain-looking token;
// - gambling, adult, pharma, weapons and link-selling terms are refused in every member-set text field
// (bio, social links, line banner, wall offers, campaign names, headlines, copy and target URLs);
// - case-insensitive and Unicode aware (NFC, lower-cased, letter/number boundaries, so "Essex" never hits "sex").
// Pure functions, no state, no dependencies.
'use strict';
// One entry per term or phrase; spaces match any run of whitespace. Grouped for the Terms page and the admin.
const LIST = {
gambling: ['casino', 'casinos', 'cassino', 'cassinos', 'slots', 'slot gacor', 'betting', 'sportsbook', 'sportsbooks', 'bookmaker', 'bookmakers', 'bookie',
'lottery', 'lotteries', 'lotto', 'poker', 'baccarat', 'roulette', 'blackjack', 'jackpot', 'togel', 'judi', 'judi online', 'apostas', 'apuestas',
'nổ hũ', 'cá cược', 'đổi thưởng', 'xổ số', 'kèo', 'nhà cái', 'soi kèo', 'game bài', 'tài xỉu', 'bắn cá'],
adult: ['porn', 'porno', 'pornography', 'sex', 'sexy', 'escort', 'escorts', 'erotic', 'erotica', 'xxx', 'onlyfans', 'nude', 'nudes', 'hentai', 'cam girl', 'cam girls', 'sex cam', 'hookup', 'hookups'],
pharma: ['viagra', 'cialis', 'levitra', 'pharmacy', 'pharmacies', 'prescription', 'prescriptions', 'steroids', 'anabolic', 'cannabis', 'marijuana', 'weed', 'cbd', 'kratom', 'opioid', 'opioids',
'xanax', 'adderall', 'tramadol', 'oxycodone', 'ketamine', 'cocaine', 'mdma', 'psilocybin', 'vape', 'vaping'],
weapons: ['firearm', 'firearms', 'guns', 'gun shop', 'gun store', 'ammunition', 'ammo', 'rifle', 'rifles', 'pistol', 'pistols', 'handgun', 'handguns', 'silencer', 'suppressor', 'explosives'],
linkfarm: ['backlink', 'backlinks', 'seo service', 'seo services', 'seo agency', 'link building', 'link-building', 'guest post', 'guest posts', 'guest posting', 'pbn', 'buy links', 'sell links', 'dofollow']
};
const ALL = Object.values(LIST).reduce((a, b) => a.concat(b), []);
const esc = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const ZW = /[​-‏⁠]/g; // zero-width joiners hide nothing
const strip = s => String(s == null ? '' : s).normalize('NFC').replace(ZW, '');
const norm = s => strip(s).toLowerCase();
// Boundary = anything that is not a letter or a number (works for every script, unlike \b).
const TERM_RE = new RegExp('(?<![\\p{L}\\p{N}])(?:' + ALL.map(t => esc(norm(t)).replace(/\s+/g, '\\s+')).join('|') + ')(?![\\p{L}\\p{N}])', 'u');
// Common gTLDs plus the ccTLDs link farms actually use. A short two-letter list keeps "Mr.Li" style text out of it.
const TLDS = 'com|net|org|info|biz|io|co|app|xyz|me|tv|us|uk|vn|de|fr|ru|in|id|br|es|it|nl|ca|au|eu|ch|at|be|pt|pl|cz|se|no|fi|dk|ie|nz|za|ng|ke|eg|tr|ua|il|ae|sa|pk|bd|lk|np|kh|la|mm|my|sg|ph|th|jp|kr|cn|tw|hk|mx|ar|cl|pe|to|ly|cc|gg|ai|pw|ws|tk|ml|ga|cf|gq|su|'
+ 'site|online|store|shop|club|top|pro|live|link|page|dev|fun|vip|one|tech|space|website|cloud|digital|agency|company|email|news|blog|life|world|today|zone|guru|ninja|game|games|team|network|money|cash|gold|bid|trade|win|bet|casino|poker|mobi|name|tel|travel|jobs|pics|photo|video|press|media|art|design|studio|capital|finance|exchange|solutions|services|systems|tools|works|center|group|global|international|institute|academy|school|education|university|church|community|social|chat|dating|love|wiki|review|reviews|directory|guide|help|support|rocks|ventures|holdings|partners|limited|ltd|llc|inc|asia|africa|london|nyc|tokyo|berlin|paris|best|buzz|click|host|hosting|lol|monster|wtf|ooo|icu|sbs|cfd|cyou|rest|bar|cam|surf|run|fit|health|care|dog|cat|pet|pets|wine|beer|vodka|bio|eco|green|energy|solar|car|cars|auto|bike|tires|taxi|limo|rent|rentals|house|homes|realty|estate|land|city|town|place|map|earth|fund|loans|credit|insure|legal|law|lawyer|attorney|tax|accountant|consulting|marketing|promo|sale|deals|discount|coupons|gift|gifts|toys|baby|kids|mom|family|wedding|party|events|tickets|show|theater|film|movie|music|band|dance|yoga|golf|football|soccer|hockey|tennis|racing';
// Schemes and www. are matched in any case; a bare domain token (or an email address) only with its TLD in lower case, so a
// missed space after a period ("ads.One day") is not mistaken for a link while real spam domains (typed lower case) are caught.
const SCHEME_RE = /(?:https?:\/\/|ftp:\/\/|(?<![\p{L}\p{N}])www\.)/iu;
const DOMAIN_RE = new RegExp('(?<![\\p{L}\\p{N}])[\\p{L}\\p{N}-]{1,63}(?:\\.[\\p{L}\\p{N}-]{1,63})*\\.(?:' + TLDS + ')(?![\\p{L}\\p{N}])', 'u');
// The matching prohibited term, or null.
function match(text) { const m = TERM_RE.exec(norm(text)); return m ? m[0].replace(/\s+/g, ' ') : null; }
// True when the text carries a URL or a domain-looking token (http(s)://, www., word.tld).
function hasUrl(text) { const t = strip(text); return SCHEME_RE.test(t) || DOMAIN_RE.test(t); }
const BIO_LINK_MSG = 'Links go in the social fields, not the bio.';
const blockedMsg = site => 'That content is not allowed on ' + (site || 'InstantAdPay/LinkSpin') + ' profiles (see Terms).';
const blockedAdMsg = site => 'That content is not allowed on ' + (site || 'InstantAdPay/LinkSpin') + ' (see Terms, Prohibited content).';
// Bio rule: no links, no prohibited terms. Returns { ok: true } or { error, reason }.
function checkBio(bio, site) {
const t = String(bio || '');
if (!t.trim()) return { ok: true };
if (hasUrl(t)) return { error: BIO_LINK_MSG, reason: 'url' };
const term = match(t);
if (term) return { error: blockedMsg(site), reason: 'term:' + term };
return { ok: true };
}
// Any other member-set text (social URL, banner target, campaign name, headline, copy): prohibited terms only.
// Pass profile: true for profile fields (the message names profiles), else the ad message is used.
function checkText(text, site, opts) {
const term = match(text);
if (!term) return { ok: true };
return { error: (opts && opts.profile) ? blockedMsg(site) : blockedAdMsg(site), reason: 'term:' + term };
}
// Several fields at once: { name: value, ... } -> first failure, with the field named in `field`.
function checkFields(fields, site, opts) {
for (const k of Object.keys(fields || {})) {
const v = fields[k]; if (v == null || v === '') continue;
const r = checkText(Array.isArray(v) ? v.join(' ') : String(v), site, opts);
if (r.error) return Object.assign({ field: k }, r);
}
return { ok: true };
}
// Profile ingest (registry sync from the other property, or a saved profile replayed): the parts of a profile that may be
// stored. A bio with a link or a prohibited term is dropped (null); a social URL carrying a prohibited term is dropped.
function cleanProfile(pf, site) {
const out = { avatarUrl: null, bio: null, socials: null, dropped: [] };
if (!pf || typeof pf !== 'object') return out;
const av = String(pf.avatarUrl || '').trim(); if (/^https:\/\/[^\s]+$/i.test(av) && av.length <= 300) out.avatarUrl = av;
const bio = String(pf.bio || '').trim().slice(0, 600);
if (bio) { const r = checkBio(bio, site); if (r.ok) out.bio = bio; else out.dropped.push('bio:' + r.reason); }
const src = pf.socials && typeof pf.socials === 'object' ? pf.socials : (typeof pf.socials === 'string' ? safeJson(pf.socials) : null);
if (src) {
const c = {};
for (const k of Object.keys(src)) {
const v = String(src[k] || '').trim(); if (!v) continue;
const r = checkText(v, site, { profile: true }); if (r.ok) c[k] = v; else out.dropped.push('socials.' + k + ':' + r.reason);
}
if (Object.keys(c).length) out.socials = c;
}
return out;
}
function safeJson(s) { try { const o = JSON.parse(s); return o && typeof o === 'object' ? o : null; } catch (e) { return null; } }
// Terms-page wording, one line per group (kept here so both sites say the same thing).
const POLICY = [
'gambling, casinos, betting, lotteries and sweepstakes',
'adult or sexual content',
'drugs and prescription pharmaceuticals',
'weapons',
'hate or harassment',
'malware, phishing and counterfeit goods',
'misleading financial promises',
'accounts created to place links in profile fields (link farming), which are removed without notice together with their profile text'
];
// One log line per refusal, with the email masked (never the text itself at full length).
function logRefusal(where, email, r) {
try { console.log('prohibited-content refused', where, String(email || '-').replace(/^(.).*(@.*)$/, '$1***$2'), r && r.field ? 'field=' + r.field : '', r && r.reason ? r.reason : ''); } catch (e) {}
}
module.exports = { LIST, ALL, POLICY, match, hasUrl, checkBio, checkText, checkFields, cleanProfile, logRefusal, BIO_LINK_MSG, blockedMsg, blockedAdMsg };
+30 -7
View File
@@ -1,15 +1,16 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="noindex,nofollow">
<title>Admin | LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<style>@import url("/assets/site.css?v=ls20260916a") layer(legacy);</style>
<link rel="stylesheet" href="/assets/tools.css?v=20261018pc2">
<link rel="stylesheet" href="/assets/admin.css?v=20261018a">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>@import url("/assets/site.css?v=ls20261101t") layer(legacy);</style>
<link rel="stylesheet" href="/assets/tools.css?v=20261101t">
<link rel="stylesheet" href="/assets/admin.css?v=20261101t">
</head>
<body>
<div id="page">
@@ -90,6 +91,11 @@
<div id="ovChain" class="small">…</div>
</div>
</div>
<div class="card">
<div class="card-head"><h3>Refill notices</h3><span class="sub" id="rfSub">low, out and idle ads: one message per owner</span></div>
<div id="rfBox" class="small muted">&hellip;</div>
<p style="margin:10px 0 0"><button class="btn small sec" id="rfRun" type="button">Send the next batch now</button></p>
</div>
<div class="card">
<div class="card-head"><h3>Quick actions</h3></div>
<p style="display:flex;gap:10px;flex-wrap:wrap;margin:0">
@@ -228,6 +234,12 @@
<p class="small muted">Sponsor = the token the account joined under (username, share code, or member #). Editing it re-points free referrals and future purchases. On-chain sponsorship is permanent once activated.</p>
<div class="tablewrap"><table class="adm-table" id="memTable"></table></div>
</div>
<div class="card" id="spamCard">
<div class="card-head"><h3>Link-farm list</h3><span class="sub" id="spamSub">daily scan at 06:30 Central</span></div>
<p class="small muted">Free accounts (no package, no wallet) that carry a link plus a farm signal: a prohibited term in the profile, a sign-in that ended within 15 minutes of the sign-up, or no sponsor. Nothing is deleted on its own. Delete uses the normal member delete (on-chain members are refused) and never touches InstantAdPay; the "also on InstantAdPay" column is there so you can decide. Allow keeps an email off this list for good.</p>
<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0 0 10px"><button class="btn small" id="spamRun" type="button">Scan now</button><button class="btn small sec" id="spamDelete" type="button">Delete selected</button><span class="small muted" id="spamAllow"></span></p>
<div class="tablewrap"><table class="adm-table" id="spamTable"></table></div>
</div>
</div>
<div class="pane" id="pane-content" hidden>
@@ -475,6 +487,17 @@
</div>
</div>
<div class="pane" id="pane-settings" hidden>
<div class="card" id="kitCard">
<div class="card-head"><h3>Refuel Kit</h3><span class="sub" id="kitSub">monthly members-only banners: unlocked by a counted refuel (needs refuelStreak on)</span></div>
<p class="small muted">Five base images per month for this site's own program: 728x90, 300x250, 468x60, 160x600, 1200x630. Each member's @name and a QR to their own link are drawn on top: keep the right end clear on 728x90 and 468x60 (QR) with room for the name left of it, the bottom-right corner on 300x250 and 1200x630, and the bottom 170 px on 160x600. No income claims in any banner. Release on the 1st; a member unlocks the month's kit with their next counted refuel.</p>
<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center"><input id="kitMonth" placeholder="YYYY-MM" style="max-width:110px"><input id="kitTheme" placeholder="Theme (e.g. Harvest)" style="max-width:240px">
<button class="btn small" id="kitSave" type="button">Save kit</button><button class="btn small sec" id="kitPlaceholder" type="button">Use placeholder art (public/banners)</button></p>
<div id="kitSizes"></div>
<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:10px">Preview <select id="kitPrevSize"></select><input id="kitPrevName" placeholder="username" style="max-width:160px"><label class="small"><input type="checkbox" id="kitPrevGif" style="width:auto"> animated</label><button class="btn small sec" id="kitPreview" type="button">Preview</button></p>
<div id="kitPrevBox"></div>
<div id="kitList" class="small"></div>
<div id="kitBox"></div>
</div>
<div class="card">
<div class="card-head"><h3>Follow-up emails</h3><span class="sub" id="dripSub">sent to every new free member, hours after sign-up</span></div>
<p class="small muted">One card per email. Placeholders fill in per reader: click a chip to drop it where your cursor is.
@@ -517,8 +540,8 @@
</div>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/admin-kb.js?v=20261020kb"></script>
<script src="/assets/admin.js?v=20261023ov"></script><script src="/assets/admin-sponsorcheck.js?v=20261022sc"></script>
<script src="/assets/admin.js?v=20261101t"></script><script src="/assets/admin-sponsorcheck.js?v=20261022sc"></script><script src="/assets/admin-refill.js?v=20261024rf"></script><script src="/assets/admin-kits.js?v=20261024kit"></script>
</body>
</html>
+10 -4
View File
@@ -1,12 +1,13 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Ads · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
/* layout by the space the screen really has (rail expanded or collapsed), not the viewport: the campaign table squeezed
its first column to a word, then a letter, per line once the rail and the side cards took the width (tester, 2026-10-18) */
@@ -33,6 +34,7 @@
<div id="page">
<div class="body">
<div class="tiles" id="tiles"></div>
<div class="panel" id="erPanel" hidden style="padding:0;margin-bottom:16px"><div class="ph"><h3>Engine Room</h3><span class="meta">LinkSpin and InstantAdPay at a glance</span></div><div style="padding:12px 16px 14px" id="erRoot" data-host="erPanel" aria-live="polite"></div></div>
<div class="panel" id="composer" hidden>
<h2 id="cmpTitle">New ad</h2>
<div class="seg" id="typeChips"><button class="chip on" type="button" data-t="banner">Banner</button><button class="chip" type="button" data-t="text">Text ad</button><button class="chip" type="button" data-t="login">Login ad</button></div>
@@ -64,6 +66,8 @@
<div class="two">
<div class="tbl cl"><div class="hd"><span>Campaign</span><span>Creative</span><span>Budget</span><span class="r">Views</span><span class="r">Clicks</span><span>Status</span><span></span></div><div id="rows"></div><div class="ft" id="foot"></div></div>
<div class="side">
<div class="panel" id="rfPanel" hidden style="padding:0" aria-live="polite"><div class="ph"><h3>Monthly Refuel</h3><span class="meta" id="rfMeta"></span></div><div style="padding:12px 16px 14px;font-size:13px" class="ink2" id="rfBody"></div></div>
<div class="panel" id="rkPanel" hidden style="padding:0" aria-live="polite"><div class="ph"><h3>Refuel Kit</h3><span class="meta">members-only banners</span></div><div style="padding:12px 16px 14px;font-size:13px" class="ink2" id="rkBody"></div></div>
<div class="panel"><h2>Earn credits</h2><div class="gauge" id="earnGauge"><i></i><i></i><i></i><i></i><i></i></div><div class="muted" id="earnLine" style="margin-top:8px">loading</div><div style="display:flex;gap:8px;flex-wrap:wrap;margin-top:12px"><button class="btn blue" type="button" id="earnNext">View an ad</button><button class="btn" type="button" id="earnClaim" hidden>Claim</button></div><div class="muted" id="earnNote" style="margin-top:8px"></div></div>
<div class="panel"><h2>Where your ads run</h2><div class="where ink2"><div><b>Banner</b><span>the ad viewer here, every member zone on outside sites, and the partner network</span></div><div><b>Text</b><span>the ad viewer and the partner network</span></div><div><b>Login</b><span id="loginWhere">full screen to every member right after they sign in, for a flat 30-day slot of purchased credits</span></div></div><div class="muted" id="rateLine" style="margin-top:10px"></div></div>
<div class="panel" hidden><h2>Credit activity</h2><div id="creditLog" class="ink2" style="font-size:13px"></div></div>
@@ -71,7 +75,9 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/ads-screen.js?v=20261023q"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/ads-screen.js?v=20261027nr"></script>
<script src="/assets/fuel.js?v=20261025ff"></script>
<script src="/assets/engine-room.js?v=20261101t"></script>
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
// Admin > Settings > Refuel Kit (2026-10-24). The SAME file ships in InstantAdPay and LinkSpin. Upload one month's base art
// (five sizes, this site's own program), preview the personalization (@name + QR to the member's link), then release it.
// Keep the QR corner and the name strip clear in the art (see the layout note on the card).
(function () {
const $ = id => document.getElementById(id);
if (!$('kitBox')) return;
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
const say = m => { $('kitSub').textContent = m; };
const api = async (url, opt) => { const r = await fetch(url, Object.assign({ cache: 'no-store' }, opt || {})); const j = await r.json().catch(() => ({})); if (!r.ok || j.error) throw new Error(j.error || ('HTTP ' + r.status)); return j; };
const post = (url, body) => api(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body || {}) });
const nextMonth = () => { const d = new Date(); const ct = new Date(d.toLocaleString('en-US', { timeZone: 'America/Chicago' })); ct.setDate(1); ct.setMonth(ct.getMonth() + 1); return ct.getFullYear() + '-' + String(ct.getMonth() + 1).padStart(2, '0'); };
let sizes = [];
async function load() {
try {
const d = await api('/api/admin/kits'); sizes = d.sizes;
if (!$('kitMonth').value) $('kitMonth').value = nextMonth();
$('kitList').innerHTML = d.kits.length ? d.kits.map(k => '<div style="border:1px solid var(--line,#ccd);border-radius:8px;padding:10px;margin:8px 0">'
+ '<b>' + esc(k.label) + '</b> ' + (k.theme ? '&middot; ' + esc(k.theme) + ' ' : '') + '<span class="small muted">(' + esc(k.month) + ')</span> '
+ (k.released ? '<span class="badge">released</span>' : '<span class="badge amber">draft</span>') + '<div class="small" style="margin:6px 0">'
+ k.sizes.map(s => s.size + ': ' + (s.ready ? 'ready' : '<b>missing</b>')).join(' &middot; ') + '</div>'
+ '<div style="display:flex;gap:6px;flex-wrap:wrap"><button class="btn small sec" type="button" data-kedit="' + esc(k.month) + '" data-theme="' + esc(k.theme) + '">Edit</button>'
+ '<button class="btn small' + (k.released ? ' sec' : '') + '" type="button" data-krel="' + esc(k.month) + '" data-on="' + (k.released ? '0' : '1') + '"' + (!k.complete && !k.released ? ' disabled title="upload all five sizes first"' : '') + '>' + (k.released ? 'Unrelease' : 'Release to members') + '</button></div></div>').join('') : '<p class="small muted">No kits yet.</p>';
$('kitList').querySelectorAll('[data-kedit]').forEach(b => b.addEventListener('click', () => { $('kitMonth').value = b.dataset.kedit; $('kitTheme').value = b.dataset.theme; say('editing ' + b.dataset.kedit); }));
$('kitList').querySelectorAll('[data-krel]').forEach(b => b.addEventListener('click', async () => { try { await post('/api/admin/kits', { month: b.dataset.krel, released: b.dataset.on === '1' }); load(); } catch (e) { say(e.message); } }));
$('kitSizes').innerHTML = sizes.map(s => '<label class="small" style="display:block;margin:4px 0">' + s + ' <input type="file" accept="image/png,image/jpeg,image/gif" data-ksize="' + s + '"></label>').join('');
$('kitSizes').querySelectorAll('[data-ksize]').forEach(inp => inp.addEventListener('change', async () => {
const f = inp.files && inp.files[0]; if (!f) return; const m = $('kitMonth').value.trim();
try { await api('/api/admin/kits/upload?month=' + encodeURIComponent(m) + '&size=' + inp.dataset.ksize, { method: 'POST', headers: { 'Content-Type': f.type }, body: f }); say(inp.dataset.ksize + ' uploaded for ' + m); load(); } catch (e) { say(e.message); }
}));
$('kitPrevSize').innerHTML = sizes.map(s => '<option>' + s + '</option>').join('');
} catch (e) { say('Could not load: ' + e.message); }
}
$('kitSave').addEventListener('click', async () => { try { await post('/api/admin/kits', { month: $('kitMonth').value.trim(), theme: $('kitTheme').value }); say('saved'); load(); } catch (e) { say(e.message); } });
$('kitPlaceholder').addEventListener('click', async () => { try { const r = await post('/api/admin/kits/placeholder', { month: $('kitMonth').value.trim() }); say('placeholder art: ' + r.sizes.join(', ')); load(); } catch (e) { say(e.message); } });
$('kitPreview').addEventListener('click', () => {
const q = 'month=' + encodeURIComponent($('kitMonth').value.trim()) + '&size=' + encodeURIComponent($('kitPrevSize').value) + '&username=' + encodeURIComponent($('kitPrevName').value || 'yourname') + ($('kitPrevGif').checked ? '&variant=gif' : '') + '&t=' + Date.now();
$('kitPrevBox').innerHTML = '<img alt="preview" style="max-width:100%;border:1px solid #ccd" src="/api/admin/kits/preview?' + q + '">';
});
load();
})();
+29
View File
@@ -0,0 +1,29 @@
// Admin > Overview > Refill notices (2026-10-24): who was told their ads ran low, ran out or sat idle, and what they did next.
(function () {
const $ = id => document.getElementById(id);
if (!$('rfBox')) return;
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
const ct = ts => new Date(Number(ts)).toLocaleString('en-US', { timeZone: 'America/Chicago', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) + ' CT';
const STATE = { low: 'running low', out: 'out of credits', idle: 'idle a week' };
async function load() {
try {
const r = await (await fetch('/api/admin/refill', { cache: 'no-store' })).json();
if (r.error) throw new Error(r.error);
const t = r.totals || {};
$('rfSub').textContent = (r.enabled ? 'on' : 'OFF (site setting refillNotices)') + ', low at ' + r.lowPct + '% delivered';
const st = Object.entries(r.byState || {}).map(([k, v]) => esc(STATE[k] || k) + ': ' + v.sent + ' sent, ' + v.converted + ' acted').join(' &middot; ');
const kinds = Object.entries(r.byKind || {}).map(([k, v]) => esc(k) + ' ' + v).join(', ');
$('rfBox').innerHTML = '<p class="small" style="margin:0 0 8px"><b>' + (t.sent || 0) + '</b> sent (' + (t.emailed || 0) + ' emailed), <b>' + (t.converted || 0) + '</b> acted on it (' + (t.ratePct || 0) + '%)'
+ (t.purchasesUsd ? ', $' + t.purchasesUsd + ' in packages after a notice' : '') + (t.medianHours != null ? ', median ' + t.medianHours + ' h' : '') + '</p>'
+ '<p class="small muted" style="margin:0 0 8px">' + st + (kinds ? '<br>' + kinds : '') + '</p>'
+ ((r.recent || []).length ? '<div class="tbl-wrap"><table class="tbl small"><tr><th>When</th><th>Owner</th><th>State</th><th>Ads</th><th>Credits then</th><th>Next</th></tr>'
+ r.recent.slice(0, 20).map(x => '<tr><td>' + esc(ct(x.at)) + '</td><td>' + esc(x.owner) + '</td><td>' + esc(STATE[x.state] || x.state) + (x.emailed ? '' : ' <span class="muted">(on-site only)</span>') + '</td><td>' + esc((x.names || []).join(', ')) + '</td><td>' + Number(x.credits || 0).toLocaleString() + '</td><td>' + (x.converted ? esc(x.converted.kind) + ' after ' + x.converted.hours + ' h' : '<span class="muted">nothing yet</span>') + '</td></tr>').join('') + '</table></div>' : '<p class="small muted">Nothing sent yet.</p>');
} catch (e) { $('rfBox').textContent = 'Could not load: ' + e.message; }
}
$('rfRun') && $('rfRun').addEventListener('click', async () => {
$('rfRun').disabled = true;
try { const r = await (await fetch('/api/admin/refill/run', { method: 'POST', cache: 'no-store' })).json(); $('rfSub').textContent = 'pass done: ' + (r.sent || 0) + ' sent'; } catch (e) {}
$('rfRun').disabled = false; load();
});
load();
})();
+15 -15
View File
@@ -25,7 +25,7 @@
.adm .rail .nb.on{background:rgba(31,111,235,.22);color:#fff}
.adm .rail .nb.on::before{content:"";position:absolute;left:-10px;top:10px;bottom:10px;width:3px;border-radius:0 3px 3px 0;background:var(--sig)}
.adm .rail .nb .lbl{display:none;white-space:nowrap}
.adm .rail .nb .pill{position:absolute;top:4px;right:4px;margin:0;min-width:16px;height:16px;border-radius:8px;background:var(--sig);color:#fff;font:700 10px/16px var(--mono);padding:0 4px;text-align:center}
.adm .rail .nb .pill{position:absolute;top:4px;right:4px;margin:0;min-width:16px;height:16px;border-radius:8px;background:var(--sig);color:var(--sig-ink);font:700 10px/16px var(--mono);padding:0 4px;text-align:center}
.app.wide .rail .nb{width:auto;justify-content:flex-start;gap:12px;padding:0 10px}
.app.wide .rail .nb .lbl{display:inline}
.app.wide .rail .nb .pill{position:static;margin-left:auto}
@@ -47,8 +47,8 @@
.adm .pane>.grid:first-child{margin-top:0}
.adm .card p{margin:0 0 10px} .adm .card p:last-child{margin-bottom:0}
.adm .card h3+p,.adm .card-head+p{margin-top:6px}
.adm .bo-content .btn:not(.sec):not(.ghost):not(.pri){background:linear-gradient(180deg,#3A83F0,var(--accent));color:#fff;border-color:var(--accent-hi);box-shadow:0 8px 18px -10px rgba(31,111,235,.9),0 1px 0 rgba(255,255,255,.3) inset}
.adm .bo-content .btn:not(.sec):not(.ghost):not(.pri):hover{background:linear-gradient(180deg,#4A8FF3,#2A77ED)}
.adm .bo-content .btn:not(.sec):not(.ghost):not(.pri){background:var(--btn-blue);color:var(--accent-ink);border-color:var(--accent-hi);box-shadow:0 8px 18px -10px rgba(31,111,235,.9),0 1px 0 rgba(255,255,255,.3) inset}
.adm .bo-content .btn:not(.sec):not(.ghost):not(.pri):hover{filter:brightness(1.06)}
.adm .btn.small.ghost{background:transparent;box-shadow:none;border-color:transparent;color:var(--accent-hi)}
.adm .btn.small.ghost:hover{border-color:var(--line-strong)}
.adm .btn.sec:hover{border-color:var(--accent);color:var(--accent-hi)}
@@ -58,10 +58,10 @@
.adm .adm-form label.small{display:block;margin-bottom:4px}
.adm .small{font-size:12.5px}
.adm .card .sub{color:var(--muted)}
.adm .badge.amber{background:var(--warn-soft);color:var(--warn);border-color:rgba(194,65,12,.35)}
.adm .badge.amber{background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line)}
.adm code{font-family:var(--mono);font-size:11.5px;background:var(--panel-2);border:1px solid var(--line);border-radius:4px;padding:1px 5px;color:var(--ink)}
.adm pre.small{background:var(--panel-2)!important;color:var(--ink);font-family:var(--mono);font-size:12px}
.adm #memHits{background:#fff}
.adm #memHits{background:var(--panel)}
.adm #memHits button:hover{background:var(--accent-soft)}
.adm .statx .nv{font-size:26px}
.adm .chip.flat{margin-top:6px}
@@ -78,29 +78,29 @@
.adm-table td.act,.adm-table th:last-child{width:1%;white-space:nowrap}
.adm-table td:first-child{overflow-wrap:anywhere}
.adm-table th,.adm-table td{padding:8px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line);font-size:13px;color:var(--ink)}
.adm-table tr:hover td{background:rgba(31,111,235,.04)}
.adm-table tr:hover td{background:var(--row-hover)}
.adm-table td.when{white-space:nowrap}
.adm-table th{color:var(--muted);font-family:var(--mono);font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;background:var(--panel-2)}
.adm-table .act{white-space:nowrap}
.adm-table .act button,.adm-table .act .btn{margin-right:6px}
.adm-table a{color:var(--accent-hi)}
.tablewrap{border:1px solid var(--line);border-radius:8px;background:#fff;overflow-x:auto}
.tablewrap{border:1px solid var(--line);border-radius:8px;background:var(--panel);overflow-x:auto}
.tablewrap:empty,.tablewrap:has(> table:empty){display:none}
/* status pills */
.st{display:inline-block;border-radius:4px;padding:1px 7px;font:700 10px var(--mono);letter-spacing:.06em;text-transform:uppercase;border:1px solid var(--line-strong);color:var(--ink-2);background:var(--panel-2)}
.st.active,.st.running,.st.released,.st.done{background:var(--ok-soft);color:var(--ok);border-color:rgba(14,138,92,.4)}
.st.paused,.st.pending,.st.queued,.st.draft{background:var(--warn-soft);color:var(--warn);border-color:rgba(194,65,12,.4)}
.st.active,.st.running,.st.released,.st.done{background:var(--ok-soft);color:var(--ok);border-color:var(--ok-line)}
.st.paused,.st.pending,.st.queued,.st.draft{background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line)}
.st.out,.st.ended,.st.finished{background:var(--panel-2);color:var(--muted);border-color:var(--line-strong)}
.st.rejected,.st.burned,.st.failed{background:var(--bad-soft);color:var(--bad);border-color:rgba(185,28,28,.4)}
.house-tag{display:inline-block;white-space:nowrap;overflow-wrap:normal;word-break:normal;border:1px solid rgba(109,74,255,.45);color:#6D4AFF;background:#EEE9FF;border-radius:4px;padding:0 6px;font:700 10px var(--mono);letter-spacing:.06em;text-transform:uppercase;margin-left:6px;vertical-align:middle}
.st.rejected,.st.burned,.st.failed{background:var(--bad-soft);color:var(--bad);border-color:var(--bad-line)}
.house-tag{display:inline-block;white-space:nowrap;overflow-wrap:normal;word-break:normal;border:1px solid var(--violet-line);color:var(--violet);background:var(--violet-soft);border-radius:4px;padding:0 6px;font:700 10px var(--mono);letter-spacing:.06em;text-transform:uppercase;margin-left:6px;vertical-align:middle}
/* forms */
.adm-form p{margin:0 0 10px}
.trunc{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:bottom}
textarea.json{font-family:var(--mono);font-size:12px;width:100%;min-height:260px}
.ph-chips{display:inline-flex;gap:6px;flex-wrap:wrap;margin-left:6px;vertical-align:middle}
.ph-chips .chip-t{padding:2px 10px;font-size:11px;font-family:var(--mono);text-transform:none;letter-spacing:0;cursor:pointer;background:#fff}
.ph-chips .chip-t{padding:2px 10px;font-size:11px;font-family:var(--mono);text-transform:none;letter-spacing:0;cursor:pointer;background:var(--panel)}
.drip-steps{display:grid;gap:12px}
.drip-step{border:1px solid var(--line);border-radius:8px;padding:14px 16px;background:var(--panel-2)}
.drip-step .ds-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
@@ -112,7 +112,7 @@ textarea.json{font-family:var(--mono);font-size:12px;width:100%;min-height:260px
.drip-step .ds-tools .btn{padding:4px 10px;font-size:11px}
.drip-step input.ds-subject{width:100%;margin-bottom:8px;font-weight:700}
.drip-step textarea.ds-body{width:100%;min-height:200px;font-size:13px;line-height:1.5}
.drip-step input,.drip-step textarea{background:#fff}
.drip-step input,.drip-step textarea{background:var(--field-bg)}
.rates-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px 22px}
.rates-form .rf{display:flex;flex-direction:column;gap:4px}
.rates-form .rf label{font-size:12.5px;font-weight:700;color:var(--ink)}
@@ -145,14 +145,14 @@ textarea.json{font-family:var(--mono);font-size:12px;width:100%;min-height:260px
.ct-filters .ct-chk input{width:auto;margin:0}
.ct-hosts{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:0 0 10px}
.ct-hosts .chip-t{font-family:var(--mono);text-transform:none;letter-spacing:0;font-size:11px}
.ct-hosts .chip-t.bad{border-color:rgba(185,28,28,.5);color:var(--bad);background:var(--bad-soft)}
.ct-hosts .chip-t.bad{border-color:var(--bad-line);color:var(--bad);background:var(--bad-soft)}
.ct-table .ct-type{font:700 10.5px var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--accent-hi);white-space:nowrap}
.ct-table .ct-title{font-weight:700;margin:0 0 3px;overflow-wrap:anywhere}
.ct-table td{overflow-wrap:anywhere}
.ct-table .ct-l{font-size:12.5px;color:var(--ink-2);margin:2px 0;line-height:1.45}
.ct-table .ct-flags{margin:2px 0 4px;display:flex;gap:4px;flex-wrap:wrap}
.ct-table .ct-flags .st{text-transform:none;letter-spacing:0;font-family:var(--body);font-size:11px}
.ct-table tr.ct-flagged td{background:rgba(185,28,28,.035)}
.ct-table tr.ct-flagged td{background:color-mix(in srgb,var(--bad) 5%,transparent)}
.ct-table .ct-nums div{white-space:nowrap}
.ct-table td[data-l="Status"] .st{white-space:nowrap}
.ct-table .ct-mem{font-weight:700}
+37 -5
View File
@@ -296,12 +296,18 @@
async function loadTank() {
try {
const r = await (await fetch('/api/admin/tank')).json(); if (r.error) return;
$('tankAdmSub').textContent = r.waiting.length + ' waiting · cap ' + r.cap + ' open per adopter · ' + r.ttlDays + '-day window';
$('tankWait').innerHTML = '<tr><th>Waiting</th><th>Email</th><th>Joined</th><th>Last sign-in</th></tr>' + (r.waiting.length ? r.waiting.map(w => '<tr><td>' + esc(w.name) + '</td><td>' + esc(w.email) + '</td><td class="when">' + when(w.joined) + '</td><td class="when">' + (w.lastSeen ? when(w.lastSeen) : '<span class="muted">never</span>') + '</td></tr>').join('') : '<tr><td colspan="4" class="muted">empty</td></tr>');
const nReady = r.waiting.filter(w => w.ready).length;
$('tankAdmSub').textContent = r.waiting.length + ' waiting' + (nReady ? ' (' + nReady + ' ready to activate)' : '') + ' · cap ' + r.cap + ' open per adopter · ' + r.ttlDays + '-day window · ready members: the free activation is held ' + (r.holdHours || 24) + ' h (a purchase never is), then auto-assigned in rotation';
// ready = wallet linked: the plain activation is held (never the company) until someone adopts them or the 24-hour safety net assigns them (2026-10-27)
const left = w => { const ms = (w.holdUntil || 0) - Date.now(); if (ms <= 0) return 'assigning now'; const m = Math.round(ms / 60000); return (m >= 60 ? Math.floor(m / 60) + ' h ' + (m % 60) + ' min' : m + ' min') + ' left'; };
const rb = w => w.ready ? ' <span class="badge" style="background:var(--ok-soft);border-color:var(--ok);color:var(--ok)">Ready to activate · ' + left(w) + '</span>' : '';
$('tankWait').innerHTML = '<tr><th>Waiting</th><th>Email</th><th>Joined</th><th>Last sign-in</th></tr>' + (r.waiting.length ? r.waiting.map(w => '<tr><td>' + esc(w.name) + rb(w) + '</td><td>' + esc(w.email) + '</td><td class="when">' + when(w.joined) + '</td><td class="when">' + (w.lastSeen ? when(w.lastSeen) : '<span class="muted">never</span>') + '</td></tr>').join('') : '<tr><td colspan="4" class="muted">empty</td></tr>')
+ ((r.aligned || []).length ? '<tr><th colspan="4">Aligned to their network sponsor (InstantAdPay) instead of the tank</th></tr>' + r.aligned.slice(0, 15).map(x => '<tr><td>' + esc(x.email) + '</td><td>' + esc(x.toName || x.to) + '</td><td class="when">' + when(x.at) + '</td><td class="muted">' + esc(x.via || '') + '</td></tr>').join('') : '');
$('tankAdopt').innerHTML = '<tr><th>Member</th><th>Adopted by</th><th>When</th><th>Window ends</th><th>Status</th></tr>' + (r.adoptions.length ? r.adoptions.map(a => '<tr><td>' + esc(a.adopteeName) + '</td><td>' + esc(a.adopterName) + '</td><td class="when">' + when(a.ts) + '</td><td class="when">' + (a.status === 'released' ? '' : when(a.expires)) + '</td><td>' + esc(a.status) + '</td></tr>').join('') : '<tr><td colspan="5" class="muted">none yet</td></tr>');
} catch (e) {}
}
async function loadMembers() {
loadSpamScan().catch(() => {});
loadTank();
const r = await api('/api/admin/members');
allMembers = r.members || [];
@@ -320,6 +326,31 @@
+ '<td class="act"><button class="btn small sec" data-mcopen="' + esc(a.email) + '">Open</button> <button class="btn small sec" data-spon="' + esc(a.email) + '" data-cur="' + esc(a.sponsorRef || '') + '">Sponsor</button></td></tr>').join('');
}
$('memFilter').addEventListener('input', drawMembers);
// Link-farm list (2026-10-30): the daily scan's candidates; Delete selected = one DELETE /api/admin/member per email (on-chain refused); Allow = spamScanAllow
async function loadSpamScan() {
let v; try { v = await api('/api/admin/spamscan'); } catch (e) { return; }
const last = v.last || {}; const rows = last.candidates || [];
$('spamSub').textContent = last.at ? (rows.length + ' candidate' + (rows.length === 1 ? '' : 's') + ' \u00B7 scanned ' + when(last.at) + (last.manual ? ' (manual)' : '') + ' \u00B7 ' + (last.scanned || 0) + ' accounts, ' + (last.skipped || 0) + ' allowlisted') : 'no scan yet (daily at 06:30 Central)';
$('spamAllow').textContent = 'Allowlist: ' + ((v.allow || []).join(', ') || 'empty');
$('spamTable').innerHTML = '<tr><th></th><th>Account</th><th>Joined</th><th>Sponsor</th><th>First link</th><th>Why</th><th>Also on ' + esc(v.otherSite || 'the other site') + '</th><th></th></tr>'
+ (rows.length ? rows.map(c => '<tr><td><input type="checkbox" data-spamsel="' + esc(c.email) + '"></td><td>' + (c.username ? '<b>@' + esc(c.username) + '</b><br>' : '') + '<span class="small">' + esc(c.email) + '</span>' + (c.quarantined ? ' <span class="badge amber">quarantined</span>' : '') + '</td>'
+ '<td class="small muted when">' + when(c.created) + '</td><td class="small">' + esc(c.sponsorName || 'none') + '</td><td class="small mono" style="max-width:260px;overflow:hidden;text-overflow:ellipsis" title="' + esc((c.links || []).join(' ')) + '">' + esc(c.firstLink || '') + '</td>'
+ '<td class="small">' + esc((c.reasons || []).join(', ')) + '</td><td class="small">' + (c.alsoOn === true ? 'yes' : c.alsoOn === false ? 'no' : 'unknown') + '</td>'
+ '<td class="act"><button class="btn small sec" data-mcopen="' + esc(c.email) + '">Open</button> <button class="btn small sec" data-spamallow="' + esc(c.email) + '">Allow</button></td></tr>').join('') : '<tr><td colspan="8" class="muted small">Nothing to review.</td></tr>');
}
$('spamRun').addEventListener('click', busy($('spamRun'), async () => { await api('/api/admin/spamscan/run', {}); await loadSpamScan(); IAP.status('Scan done.', 'ok'); }));
$('spamDelete').addEventListener('click', busy($('spamDelete'), async () => {
const sel = [...document.querySelectorAll('[data-spamsel]:checked')].map(x => x.dataset.spamsel);
if (!sel.length) { IAP.status('Tick the accounts to delete first.', 'bad'); return; }
if (!await IAP.confirmBox('Delete ' + sel.length + ' account' + (sel.length === 1 ? '' : 's') + ' with their profile text? On-chain members are refused. InstantAdPay is not touched.', { title: 'Delete selected', ok: 'Delete', cancel: 'Cancel' })) return;
let ok = 0, bad = 0; for (const e of sel) { try { await api('/api/admin/member?email=' + encodeURIComponent(e), undefined, 'DELETE'); ok++; } catch (err) { bad++; } }
IAP.status(ok + ' deleted' + (bad ? ', ' + bad + ' refused' : '') + '.', bad ? 'bad' : 'ok');
await api('/api/admin/spamscan/run', {}).catch(() => {}); await loadSpamScan(); loadMembers().catch(() => {});
}));
document.addEventListener('click', async e => {
const b = e.target.closest('[data-spamallow]'); if (!b) return;
try { await api('/api/admin/spamscan/allow', { email: b.dataset.spamallow }); IAP.status('Allowed ' + b.dataset.spamallow + '.', 'ok'); await api('/api/admin/spamscan/run', {}).catch(() => {}); loadSpamScan(); } catch (err) { IAP.status(err.message, 'bad'); }
});
document.addEventListener('click', async e => {
const b = e.target.closest('[data-spon]'); if (!b) return;
const v = await IAP.ask({ title: 'Sponsor for ' + b.dataset.spon, text: 'Username, share code, or member #. Leave blank to clear.', value: b.dataset.cur, ok: 'Save' });
@@ -347,7 +378,7 @@
mcCur = d; const a = d.account; $('memHits').hidden = true;
$('memCard').hidden = false; document.querySelectorAll('#pane-members > .card').forEach(c => { if (c.id !== 'memCard' && c.id !== 'memSearchCard') c.hidden = true; });
$('mcName').textContent = (a.username ? '@' + a.username : a.email) + (a.memberId ? ' · member #' + a.memberId : ' · free member');
$('mcSub').textContent = 'joined ' + when(a.created) + ' · last seen ' + ago(a.lastSeen);
$('mcSub').textContent = 'joined ' + when(a.created) + ' · last seen ' + ago(a.lastSeen) + (a.profileQuarantined ? ' · PROFILE QUARANTINED (link planted on a brand-new free account; not shown publicly)' : '');
$('mcWall').hidden = !a.username; if (a.username) $('mcWall').href = '/wall/' + a.username;
const ch = d.chain, cr = d.credits, t = d.totals;
const level = ch && !ch.readError ? (ch.buyerCount >= 5 ? 'level 3 (5+ buyers)' : ch.buyerCount >= 2 ? 'level 2 (2 buyers)' : 'level 1') : '';
@@ -697,7 +728,7 @@
const ago = t => t ? new Date(t).toLocaleString() : 'never';
const mark = v => v === 'clean' ? '<span style="color:var(--ok,#2e9b5a)">clean</span>' : v === 'flagged' || v === 'listed' ? '<b style="color:var(--bad)">' + v + '</b>' : /^ok:/.test(v || '') ? '<span style="color:var(--ok,#2e9b5a)">answered ' + esc(v.slice(3)) + '</span>' : '<span class="muted">unknown</span>';
$('dmTable').innerHTML = '<tr><th>Domain</th><th>Channel</th><th>Safe Browsing</th><th>URIBL</th><th>SURBL</th><th>Reach</th><th>Status</th><th>Last check</th><th></th></tr>'
+ (list.length ? list.map(x => '<tr' + (x.burned ? ' style="background:rgba(192,57,43,.08)"' : '') + '><td><b>' + esc(x.host) + '</b></td>'
+ (list.length ? list.map(x => '<tr' + (x.burned ? ' style="background:var(--bad-soft)"' : '') + '><td><b>' + esc(x.host) + '</b></td>'
+ '<td><select data-dmch="' + esc(x.host) + '">' + (d.channels || []).map(c => '<option value="' + c + '"' + (c === x.channel ? ' selected' : '') + '>' + esc(d.labels[c] || c) + '</option>').join('') + '</select><br><span class="muted small">' + esc(d.notes[x.channel] || '') + '</span></td>'
+ '<td>' + mark(x.gsb) + '</td><td>' + mark(x.uribl) + '</td><td>' + mark(x.surbl) + '</td><td>' + mark(x.reach) + '</td>'
+ '<td>' + (x.burned ? '<b style="color:var(--bad)">BURNED</b><br><span class="muted small">' + esc(x.reason || '') + (x.burnedAt ? ' · ' + ago(x.burnedAt) : '') + '</span>' : x.channel === 'reserve' ? '<span class="muted">held in reserve</span>' : '<span style="color:var(--ok,#2e9b5a)">live</span>') + '</td>'
@@ -1007,6 +1038,7 @@
loginCreditsPerDay: ['Login ad: legacy credits per day', 'only for old login ads with no end date (none since slots)'],
loginDwellSeconds: ['Login ad: seconds shown', 'full-screen interstitial after sign-in'],
burnBatchMin: ['On-chain burn batch (credits)', 'accrued spend is burned once it reaches this'],
synRateDivisor: ['Network rate divisor (N)', 'partner-network (NAS) views and member ads in other members zones cost 1/N of the on-site rate; 1 = same rate; whole numbers'],
welcomeCredits: ['Welcome credits', 'granted after the welcome tour'],
dailyViewTarget: ['Daily view set (ads)', 'ads a member views for the daily claim'],
dailyClaimCredits: ['Daily claim (credits)', 'paid when the set is complete'],
@@ -1060,7 +1092,7 @@
}));
// site settings: key / value rows; booleans as checkboxes, numbers stay numbers
const SITE_META = { noPayoutIds: 'No-payout positions (member #s, comma): linkage only, no buys from them, no joins routed under them', siteName: 'Site name', tagline: 'Tagline', rehearsal: 'Testnet rehearsal banner', defaultSponsorId: 'Fallback sponsor (member #)', walletConnectProjectId: 'WalletConnect project id', moonpayPublicKey: 'MoonPay public key', telegramBotToken: 'Telegram proof feed: bot token', telegramChatId: 'Telegram proof feed: chat id', telegramTopicId: 'Telegram proof feed: topic id (optional)', telegramEvents: 'Telegram proof feed: events (payouts | payouts+purchases | all)', telegramCtaUrl: 'Telegram proof feed: join link under each post', aiCreditsPerGen: 'AI Copy Engine: credits per generation after the free allowance', aiFreeSurge: 'AI Copy Engine: free generations a month at Surge', aiFreeCircuit: 'AI Copy Engine: free generations a month at Circuit', aiFreeNexus: 'AI Copy Engine: free generations a month at Nexus', snapshotEnabled: 'Daily growth snapshot to Telegram (1/0)', snapshotHourUtc: 'Daily growth snapshot: hour (UTC; 14 = 9 AM Central)', snapshotTargets: 'Daily growth snapshot: targets (feed = proof channel, echo = shared payments topic; comma list)', pipelineMode: 'Pipeline board: off (coming soon card) | preview (admin account only) | on (everyone)', pipelineEta: 'Pipeline: opening date shown on the coming-soon card (e.g. Sep 28)', memberWeeklyEmail: 'Weekly member email to everyone active (1) or only sponsors with a line (0)', leaderboardWeeklyPrize: 'Leaderboard: weekly prize text (optional; blank shows the credit ladder)', leaderboardMonthlyPrize: 'Leaderboard: monthly prize text (optional)', leaderboardWeeklyCredits: 'Leaderboard: weekly credits for 1st,2nd,3rd… (e.g. 1000,500,250; blank = none)', leaderboardMonthlyCredits: 'Leaderboard: monthly credits for 1st,2nd,3rd… (e.g. 5000,2500,1000)', leaderboardAnnounceGeneral: 'Leaderboard: announce winners in the main group too (1/0)', telegramEchoChatId: 'Telegram echo (shared payments topic): chat id', telegramEchoTopicId: 'Telegram echo: topic id', telegramEchoEvents: 'Telegram echo: events (payouts | payouts+purchases | all)', legacyCreditsAdvertiser: 'Legacy welcome credits: former advertisers', legacyCreditsEarner: 'Legacy welcome credits: former earners', pnlFixedMonthlyUsd: 'P&L: fixed monthly cost (USD)', campaignEditFee: 'Ad edits: credits per edit after the first, free one on each ad (0 = always free)' };
const SITE_META = { noPayoutIds: 'No-payout positions (member #s, comma): linkage only, no buys from them, no joins routed under them', siteName: 'Site name', tagline: 'Tagline', rehearsal: 'Testnet rehearsal banner', defaultSponsorId: 'Fallback sponsor (member #)', walletConnectProjectId: 'WalletConnect project id', telegramBotToken: 'Telegram proof feed: bot token', telegramChatId: 'Telegram proof feed: chat id', telegramTopicId: 'Telegram proof feed: topic id (optional)', telegramEvents: 'Telegram proof feed: events (payouts | payouts+purchases | all)', telegramCtaUrl: 'Telegram proof feed: join link under each post', aiCreditsPerGen: 'AI Copy Engine: credits per generation after the free allowance', aiFreeSurge: 'AI Copy Engine: free generations a month at Surge', aiFreeCircuit: 'AI Copy Engine: free generations a month at Circuit', aiFreeNexus: 'AI Copy Engine: free generations a month at Nexus', snapshotEnabled: 'Daily growth snapshot to Telegram (1/0)', snapshotHourUtc: 'Daily growth snapshot: hour (UTC; 14 = 9 AM Central)', snapshotTargets: 'Daily growth snapshot: targets (feed = proof channel, echo = shared payments topic; comma list)', pipelineMode: 'Pipeline board: off (coming soon card) | preview (admin account only) | on (everyone)', pipelineEta: 'Pipeline: opening date shown on the coming-soon card (e.g. Sep 28)', memberWeeklyEmail: 'Weekly member email to everyone active (1) or only sponsors with a line (0)', leaderboardWeeklyPrize: 'Leaderboard: weekly prize text (optional; blank shows the credit ladder)', leaderboardMonthlyPrize: 'Leaderboard: monthly prize text (optional)', leaderboardWeeklyCredits: 'Leaderboard: weekly credits for 1st,2nd,3rd… (e.g. 1000,500,250; blank = none)', leaderboardMonthlyCredits: 'Leaderboard: monthly credits for 1st,2nd,3rd… (e.g. 5000,2500,1000)', leaderboardAnnounceGeneral: 'Leaderboard: announce winners in the main group too (1/0)', telegramEchoChatId: 'Telegram echo (shared payments topic): chat id', telegramEchoTopicId: 'Telegram echo: topic id', telegramEchoEvents: 'Telegram echo: events (payouts | payouts+purchases | all)', legacyCreditsAdvertiser: 'Legacy welcome credits: former advertisers', legacyCreditsEarner: 'Legacy welcome credits: former earners', pnlFixedMonthlyUsd: 'P&L: fixed monthly cost (USD)', campaignEditFee: 'Ad edits: credits per edit after the first, free one on each ad (0 = always free)' };
function drawSite() {
const wrap = $('siteForm');
wrap.innerHTML = Object.entries(siteObj).map(([k, v]) => '<div class="kv-row"><span class="k" title="' + esc(k) + '">' + esc(SITE_META[k] || humanize(k)) + '</span>'
+7 -4
View File
@@ -22,7 +22,10 @@
try { [D, EARN] = await Promise.all([CR.get('/api/my/campaigns'), CR.get('/api/my/earn')]); } catch (e) { CR.sub('could not load'); return; }
const cs = D.campaigns || []; const live = cs.filter(c => c.status === 'active');
{ const sel = $('fAud'); if (sel) { const keep = sel.value; sel.innerHTML = '<option value="">Everyone</option>' + (D.audiences || []).map(a => '<option value="' + a.id + '">' + esc(a.name) + ' (' + fmt(a.size30) + ')</option>').join(''); sel.value = keep; sel.onchange = () => { $('fAudModeRow').hidden = !sel.value; }; } }
const views = cs.reduce((n, c) => n + (c.imps || 0) + (c.impsNas || 0), 0);
const views = cs.reduce((n, c) => n + (c.imps || 0) + (c.impsNas || 0) + (c.impsSyn || 0), 0);
const synN = Math.max(1, Math.floor(Number(D.rates && D.rates.synRateDivisor) || 1)); // network rate (Marty, 2026-10-27, 4:1)
const offTxt = c => (c.impsNas ? '<br><span class="muted" style="font-size:11px">+' + fmt(c.impsNas) + ' network' + (synN > 1 ? ' at 1/' + synN : '') + '</span>' : '')
+ (c.impsSyn ? '<br><span class="muted" style="font-size:11px">+' + fmt(c.impsSyn) + ' partner zones' + (synN > 1 ? ' at 1/' + synN : '') + '</span>' : '');
CR.sub(live.length + ' live · ' + fmt(D.availableCredits) + ' credits available');
const hours = new Array(24).fill(0); Object.values(D.hours || {}).forEach(a => (a || []).forEach((n, i) => { hours[i] += Number(n) || 0; })); // last 7 days by UTC hour, all campaigns
const week = hours.reduce((a, b) => a + b, 0);
@@ -32,7 +35,7 @@
CR.tile({ k: 'Views delivered', v: fmt(views), series: week ? hours : null, note: week ? fmt(week) + ' in 7 days, by hour' : '' }),
CR.tile({ k: 'Today\'s viewing', v: EARN.views + ' / ' + EARN.target, note: EARN.streakDay > 1 ? 'streak day ' + EARN.streakDay : '' })].join('');
const r = D.rates || {};
$('rateLine').textContent = 'Rates: ' + r.bannerCreditsPerBatch + ' credits per ' + r.bannerBatch + ' banner views, ' + r.textCreditsPerBatch + ' per ' + r.textBatch + ' text views, ' + fmt(slotInfo().credits) + ' purchased credits for a ' + slotInfo().days + '-day login slot (' + (slotInfo().free ? slotInfo().free + ' of ' + slotInfo().max + ' open' : 'all ' + slotInfo().max + ' taken' + (slotInfo().queued ? ', ' + slotInfo().queued + ' in line' : '') + ', reserve the next one') + '). Viewing pays ' + EARN.claimCredits + ' credits for ' + EARN.target + ' timed views a day.';
$('rateLine').textContent = 'Rates: ' + r.bannerCreditsPerBatch + ' credits per ' + r.bannerBatch + ' banner views, ' + r.textCreditsPerBatch + ' per ' + r.textBatch + ' text views' + (synN > 1 ? ' here (views on the partner network and in other members\u2019 zones cost 1/' + synN + ' of that)' : '') + ', ' + fmt(slotInfo().credits) + ' purchased credits for a ' + slotInfo().days + '-day login slot (' + (slotInfo().free ? slotInfo().free + ' of ' + slotInfo().max + ' open' : 'all ' + slotInfo().max + ' taken' + (slotInfo().queued ? ', ' + slotInfo().queued + ' in line' : '') + ', reserve the next one') + '). Viewing pays ' + EARN.claimCredits + ' credits for ' + EARN.target + ' timed views a day.';
// traffic-light status (2026-10-20): live green, running low amber (80%+ of the budget spent), out red, paused grey
const stKey = c => c.status === 'queued' ? 'queued' : c.status === 'cancelled' ? 'cancelled' : c.scheduled ? 'sched' : c.status === 'active' ? (c.type !== 'login' && c.budget > 0 && c.spent / c.budget >= 0.8 ? 'low' : 'live') : c.status === 'paused' ? 'paused' : c.status === 'out' ? 'out' : c.status === 'done' ? 'ended' : '';
const ST_LABEL = { queued: 'In line', cancelled: 'Cancelled, refunded', sched: 'Scheduled', live: 'Live', low: 'Running low', paused: 'Paused', out: 'Out of credits', ended: 'Ended' };
@@ -40,14 +43,14 @@
const QM = {}; (D.loginQueue || []).forEach(q => { QM[q.id] = q; });
const qCell = c => { const q = QM[c.id]; return '<span class="muted">full page<br><span style="font-size:12px"><b>#' + (q ? q.place : '?') + ' in line</b>, paid' + (q && q.estStartCt ? '<br>' + (q.estStartCt === 'any minute now' ? 'starts any minute now' : 'est. start ' + esc(q.estStartCt) + ' CT (an estimate)') : '') + '</span></span>'; };
const cr = c => c.status === 'queued' ? qCell(c) : c.status === 'cancelled' ? '<span class="muted">full page<br><span style="font-size:12px">' + fmt(c.refunded || 0) + ' credits refunded</span></span>' : c.type === 'banner' ? (c.imageUrl ? '<img class="thumb" src="' + esc(c.imageUrl) + '" alt="">' : '') + '<span class="mono muted" style="font-size:11px">' + c.width + 'x' + c.height + '</span>' : c.type === 'text' ? '<b>' + esc(c.title) + '</b><br><span class="muted" style="font-size:12px">' + esc(c.body || '') + '</span>' : '<span class="muted">full page' + (c.type === 'login' && c.expires ? '<br><span style="font-size:12px">' + (c.expires > Date.now() ? 'slot ends ' : 'ended ') + new Date(c.expires).toLocaleDateString(undefined, { month: 'short', day: 'numeric' }) + '</span>' : '') + '</span>';
$('rows').innerHTML = cs.length ? cs.map(c => '<div class="rw st-row" data-st="' + stKey(c) + '"><div><b>' + esc(c.name) + '</b> <span class="tag t">' + esc(c.type) + '</span>' + (c.audience ? ' <span class="tag plain" title="audience">' + esc((((D && D.audiences) || []).find(a => a.id === c.audience) || {}).name || 'audience') + (c.audienceMode === 'exclude' ? ' · excluded' : '') + '</span>' : '') + '<br><span class="mono muted" style="font-size:11px">#' + c.id + ' · ' + esc(host(c.targetUrl)) + (c.geo ? ' · tiers ' + esc(c.geo) : '') + (c.dailyCap ? ' · cap ' + c.dailyCap + '/day' : '') + '</span></div><div>' + cr(c) + '</div><div><span class="num">' + fmt(c.status === 'cancelled' ? 0 : c.spent) + '</span><span class="muted"> / ' + fmt(c.budget) + (c.status === 'queued' ? ' paid' : '') + '</span><div class="bar st"><i style="width:' + (c.status === 'cancelled' ? 0 : Math.min(100, Math.round(100 * c.spent / Math.max(1, c.budget)))) + '%"></i></div></div><span class="r num">' + fmt(c.imps) + (c.impsNas ? '<br><span class="muted" style="font-size:11px">+' + fmt(c.impsNas) + ' network</span>' : '') + '</span><span class="r num">' + fmt(c.clicks) + '</span><span>' + st(c) + '</span><span style="display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap">'
$('rows').innerHTML = cs.length ? cs.map(c => '<div class="rw st-row" data-st="' + stKey(c) + '"><div><b>' + esc(c.name) + '</b> <span class="tag t">' + esc(c.type) + '</span>' + (c.audience ? ' <span class="tag plain" title="audience">' + esc((((D && D.audiences) || []).find(a => a.id === c.audience) || {}).name || 'audience') + (c.audienceMode === 'exclude' ? ' · excluded' : '') + '</span>' : '') + '<br><span class="mono muted" style="font-size:11px">#' + c.id + ' · ' + esc(host(c.targetUrl)) + (c.geo ? ' · tiers ' + esc(c.geo) : '') + (c.dailyCap ? ' · cap ' + c.dailyCap + '/day' : '') + '</span></div><div>' + cr(c) + '</div><div><span class="num">' + fmt(c.status === 'cancelled' ? 0 : c.spent) + '</span><span class="muted"> / ' + fmt(c.budget) + (c.status === 'queued' ? ' paid' : '') + '</span><div class="bar st"><i style="width:' + (c.status === 'cancelled' ? 0 : Math.min(100, Math.round(100 * c.spent / Math.max(1, c.budget)))) + '%"></i></div></div><span class="r num">' + fmt(c.imps) + offTxt(c) + '</span><span class="r num">' + fmt(c.clicks) + '</span><span>' + st(c) + '</span><span style="display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap">'
+ (c.status === 'active' ? '<button class="btn sm" type="button" data-pause="' + c.id + '">Pause</button>' : c.status === 'paused' ? '<button class="btn sm" type="button" data-resume="' + c.id + '">Resume</button>' : '')
+ (['active', 'paused', 'out'].includes(c.status) && c.type !== 'login' ? '<button class="btn sm" type="button" data-top="' + c.id + '">Top up</button>' : '')
+ (c.status === 'queued' ? '<button class="btn sm" type="button" data-qcancel="' + c.id + '" title="Leave the line: the ' + fmt(c.budget) + ' credits you paid come back in full">Cancel and refund</button>' : '')
+ (!['done', 'cancelled'].includes(c.status) ? '<button class="btn sm" type="button" data-edit="' + c.id + '" title="' + (c.edits ? 'Edit the link, ' + (c.type === 'banner' ? 'image' : c.type === 'text' ? 'text' : 'name') + ' (' + fmt(D.editFee) + ' credits)' : 'Fix the link, ' + (c.type === 'banner' ? 'image' : c.type === 'text' ? 'text' : 'name') + ' (first edit free)') + '">Edit</button>' : '') + '</span></div>').join('')
: '<div class="rw"><span class="muted">No ads yet. Launch one: a banner, a text ad or a login-ad slot.</span></div>';
if (D.gauntletPending) $('earnNote').insertAdjacentHTML('afterend', '<div class="muted" style="margin-top:8px">Your welcome credits unlock after the short welcome tour on <a href="/tools">the classic dashboard</a>.</div>');
$('foot').textContent = 'views = timed views in the ad viewer plus member zones; network = the partner ad network · a paused ad keeps its credits · unspent credits return when an ad ends';
$('foot').textContent = 'views = views here on LinkSpin; network = the partner ad network; partner zones = other members\u2019 zones on their own sites' + (synN > 1 ? ' (network and partner-zone views cost 1/' + synN + ' of the rate here, so ' + synN + ' of them cost what 1 view here does)' : '') + ' · a paused ad keeps its credits · unspent credits return when an ad ends';
$('rows').querySelectorAll('[data-pause]').forEach(b => b.addEventListener('click', () => act('/api/my/campaigns/' + b.dataset.pause + '/pause')));
$('rows').querySelectorAll('[data-resume]').forEach(b => b.addEventListener('click', () => act('/api/my/campaigns/' + b.dataset.resume + '/resume')));
$('rows').querySelectorAll('[data-top]').forEach(b => b.addEventListener('click', async () => { const v = await dialog({ title: 'Top up #' + b.dataset.top, text: 'Add credits to this ad. You have ' + fmt(D.availableCredits) + ' available.', fields: [{ k: 'credits', label: 'Credits to add', value: '25', mono: true }], ok: 'Add' }); if (!v) return; try { await api('/api/my/campaigns/' + b.dataset.top + '/topup', { credits: Number(v.credits) }); toast('Topped up.'); load(); } catch (e) { toast(e.message, true); } }));
+1 -1
View File
@@ -27,7 +27,7 @@ window.IAP = (function () {
const c = await getConfig();
const nav = document.createElement('nav');
nav.innerHTML = '<div class="wrap">'
+ '<span class="logo-wrap"><a class="logo" href="/"><span class="wordmark"><svg viewBox="0 0 24 24" fill="none" stroke="#8cc8ff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12a8 8 0 0 1 14-5.3"/><path d="M18 3v4h-4"/><path d="M20 12a8 8 0 0 1-14 5.3"/><path d="M6 21v-4h4"/></svg>Link<b>Spin</b></span></a><span class="byline">Brought to you by the <b>Crypto Team Build Network</b></span></span>'
+ '<span class="logo-wrap"><a class="logo" href="/"><span class="wordmark"><svg viewBox="0 0 24 24" fill="none" style="stroke:var(--mint-hi)" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12a8 8 0 0 1 14-5.3"/><path d="M18 3v4h-4"/><path d="M20 12a8 8 0 0 1-14 5.3"/><path d="M6 21v-4h4"/></svg>Link<b>Spin</b></span></a><span class="byline">Brought to you by the <b>Crypto Team Build Network</b></span></span>'
+ '<span class="links">'
+ '<a href="/#how" data-p="home">How it works</a>'
+ '<a href="/#packages" data-p="pricing">Ad packages</a>'
+27
View File
@@ -0,0 +1,27 @@
// Conversion tracking guide (/conversion-tracking, 2026-10-24): the Copy buttons on the code examples, and inside a
// traffic-exchange frame (session and sponsor cookies are dropped there) sign-in, join, Control Room and off-site links
// open in a new tab, /join carrying the ?ref= this page was opened with (same rule as refuel-guide.js).
(function () {
function flash(b, t) { var o = b.getAttribute('data-label') || b.textContent; b.setAttribute('data-label', o); b.textContent = t; setTimeout(function () { b.textContent = o; }, 1600); }
document.querySelectorAll('[data-copy]').forEach(function (b) {
b.addEventListener('click', function () {
var box = b.closest('.cg-code'); var pre = box && box.querySelector('pre'); if (!pre) return;
var text = pre.textContent;
var fallback = function () {
try { var r = document.createRange(); r.selectNodeContents(pre); var s = window.getSelection(); s.removeAllRanges(); s.addRange(r); var ok = document.execCommand && document.execCommand('copy'); flash(b, ok ? 'Copied' : 'Selected'); }
catch (e) { flash(b, 'Select and copy'); }
};
try { if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(text).then(function () { flash(b, 'Copied'); }, fallback); else fallback(); } catch (e) { fallback(); }
});
});
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|sources|conversions|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'; }
});
})();
+71
View File
@@ -0,0 +1,71 @@
// LinkSpin Conversions (conversion pixel, 2026-10-23): goals + pixel ids, the two snippets, a test button, and per goal the
// conversions and cost per goal by ad campaign (LinkSpin and InstantAdPay), spin link, destination and traffic source.
(function () {
const $ = id => document.getElementById(id); const esc = CR.esc, fmt = CR.fmt;
let RANGE = 30, D = null, PICK = '';
CR.mount({ active: 'conversions', title: 'Conversions', sub: 'loading', actions: '<span style="display:inline-flex;gap:8px;align-items:center"><div class="range" id="range"><button type="button" data-d="7">7d</button><button type="button" data-d="30" class="on">30d</button><button type="button" data-d="90">90d</button></div> <a class="btn" id="csvBtn" href="/api/my/conversions.csv?days=30">CSV</a></span>' });
$('range').querySelectorAll('button').forEach(b => b.addEventListener('click', () => { RANGE = Number(b.dataset.d); $('range').querySelectorAll('button').forEach(x => x.classList.toggle('on', x === b)); $('csvBtn').href = '/api/my/conversions.csv?days=' + RANGE; load(); }));
const ago = ts => { if (!ts) return 'never'; const m = Math.round((Date.now() - ts) / 60000); return m < 1 ? 'just now' : m < 60 ? m + ' min ago' : m < 1440 ? Math.round(m / 60) + ' h ago' : Math.round(m / 1440) + ' d ago'; };
const money = v => v ? '$' + Number(v).toFixed(2) : '';
const METH = [['url', 'Address'], ['stored', 'Kept'], ['cookie', 'Cookie'], ['soft', '24 h match']];
function snippets() {
const g = (D.goals || []).find(x => x.px === PICK) || (D.goals || [])[0];
const base = D.base || ('https://' + (D.host || 'linkspin.app'));
if (!g) { ['snTag', 'snImg', 'snJs'].forEach(k => { $(k).textContent = 'Add a goal first. Its snippets show here.'; }); $('testBtn').disabled = true; $('testNote').textContent = ''; return; }
$('testBtn').disabled = false;
$('snTag').textContent = '<script async src="' + base + '/t.js?px=' + g.px + '"></script>';
$('snImg').textContent = '<img src="' + base + '/cv.gif?px=' + g.px + '&goal=' + g.name + '" width="1" height="1" alt="" style="display:none">';
$('snJs').textContent = '<script async src="' + base + '/cv.js?px=' + g.px + '&goal=' + g.name + '"></script>';
$('testNote').textContent = g.lastTest ? 'Last test received ' + ago(g.lastTest) : 'No test received yet';
}
function paint() {
const goals = D.goals || [];
CR.sub(RANGE + ' days · ' + goals.length + ' goal' + (goals.length === 1 ? '' : 's') + ' · ' + fmt(D.total || 0) + ' counted');
$('goalRows').innerHTML = goals.length ? goals.map(g => '<div class="rw"><span><b>' + esc(g.name) + '</b><span class="muted" style="display:block;font-size:11px">last ' + esc(ago(g.lastAt)) + (g.lastTest ? ' · test ' + esc(ago(g.lastTest)) : '') + '</span></span><span class="mono">' + esc(g.px) + '</span><span class="r num">' + (g.value ? esc(money(g.value)) : '<span class="muted">none</span>') + '</span><span class="r num">' + fmt(g.conv) + '</span><span class="r"><button class="btn sm" type="button" data-pick="' + g.px + '">Snippets</button> <button class="btn sm" type="button" data-edit="' + g.px + '">Edit</button> <button class="btn sm" type="button" data-del="' + g.px + '">Remove</button></span></div>').join('')
: '<div class="rw"><span class="muted">No goals yet. Add one, for example <b>subscriber</b> or <b>sale</b>.</span><span></span><span></span><span></span><span></span></div>';
if (!goals.some(g => g.px === PICK)) PICK = goals.length ? goals[0].px : '';
$('goalPick').innerHTML = goals.map(g => '<option value="' + g.px + '"' + (g.px === PICK ? ' selected' : '') + '>' + esc(g.name) + '</option>').join('');
snippets();
const m = D.methods || {}; const tot = METH.reduce((n, [k]) => n + (m[k] || 0), 0);
$('methRows').innerHTML = METH.map(([k, label]) => '<div class="m"><span class="k">' + label + '</span><span class="v">' + fmt(m[k] || 0) + '</span><span class="muted mono" style="font-size:11px">' + (tot ? Math.round((m[k] || 0) / tot * 100) + '%' : '·') + '</span></div>').join('');
$('totalNote').textContent = D.selfTests ? D.selfTests + ' from your own clicks (ads, spin links, Banner Spins), kept as tests and left out' : '';
$('goalReports').innerHTML = (D.byGoal || []).filter(G => G.n || !G.removed).map(G => {
const camp = G.campaigns.length ? G.campaigns.map(c => '<div class="rw"><span>' + esc(c.name || ('Campaign #' + c.id)) + '<span class="muted" style="display:block;font-size:11px">' + esc(c.site) + ' #' + c.id + (c.spentAsOf ? ' · spend as of ' + esc(ago(c.spentAsOf)) : '') + '</span></span><span class="r num">' + (c.spent != null ? fmt(c.spent) + ' cr' : '·') + '</span><span class="r num">' + fmt(c.clicks) + '</span><span class="r num">' + fmt(c.n) + '</span><span class="r num">' + (c.rate != null ? c.rate + '%' : '·') + '</span><span class="r num">' + (c.costPer != null ? fmt(c.costPer) + ' cr' : '·') + '</span></div>').join('') : '<div class="rw"><span class="muted">No ad campaign conversions for this goal yet.</span><span></span><span></span><span></span><span></span><span></span></div>';
const lst = (rows, f) => rows && rows.length ? rows.map(x => '<div class="rw"><span style="overflow-wrap:anywhere">' + f(x) + '</span><span class="r num">' + fmt(x.n) + '</span></div>').join('') : '<div class="rw"><span class="muted">nothing yet</span><span></span></div>';
const gm = G.methods || {};
return '<div class="sec">Goal: ' + esc(G.goal) + (G.removed ? ' (removed)' : '') + ' · ' + fmt(G.n) + ' counted' + (G.value ? ' · ' + esc(money(G.value)) : '') + ' · ' + METH.map(([k, l]) => l + ' ' + fmt(gm[k] || 0)).join(', ') + '</div>'
+ '<div class="panel"><h2>By ad campaign</h2><div class="tbl camps"><div class="hd"><span>Campaign</span><span class="r">Spent</span><span class="r">Clicks</span><span class="r">Goals</span><span class="r">Rate</span><span class="r">Cost / goal</span></div>' + camp + '</div><div class="muted" style="margin-top:8px">Cost per goal = the credits the campaign has spent so far / its conversions of this goal, in that site\'s ad credits. Clicks and goals are for the range above; spend is the campaign\'s total.</div></div>'
+ '<div class="two"><div class="panel"><h2>By spin link</h2><div class="tbl lst"><div class="hd"><span>Link</span><span class="r">Goals</span></div>' + lst(G.links, x => esc(x.name || x.code) + ' <span class="pill">/r/' + esc(x.code) + '</span>') + '</div></div>'
+ '<div class="panel"><h2>By destination page</h2><div class="tbl lst"><div class="hd"><span>Page</span><span class="r">Goals</span></div>' + lst(G.dests, x => '<span class="mono">' + esc(x.k) + '</span>') + '</div></div></div>'
+ '<div class="panel"><h2>By Banner Spin</h2><div class="tbl lst"><div class="hd"><span>Banner Spin</span><span class="r">Goals</span></div>' + lst(G.banners, x => esc(x.name || x.code) + ' <span class="pill">/c/' + esc(x.code) + '</span>') + '</div><div class="muted" style="margin-top:8px">Banners that point straight at a page. A banner that points at a spin link is counted under that spin link.</div></div>'
+ '<div class="panel"><h2>By traffic source</h2><div class="tbl lst"><div class="hd"><span>Source</span><span class="r">Goals</span></div>' + lst(G.sources, x => esc(x.name)) + '</div><div class="muted" style="margin-top:8px">A named source is one you set up under <a href="/sources">Sources</a>; otherwise it is the referring site or the ad placement.</div></div>';
}).join('');
$('goalRows').querySelectorAll('[data-pick]').forEach(b => b.addEventListener('click', () => { PICK = b.dataset.pick; $('goalPick').value = PICK; snippets(); $('snTag').scrollIntoView({ behavior: 'smooth', block: 'center' }); }));
$('goalRows').querySelectorAll('[data-edit]').forEach(b => b.addEventListener('click', () => goalForm(goals.find(g => g.px === b.dataset.edit))));
$('goalRows').querySelectorAll('[data-del]').forEach(b => b.addEventListener('click', async () => {
if (!await CR.dialog({ title: 'Remove this goal?', text: 'Its pixel stops counting at once. Conversions already counted stay in your reports.', ok: 'Remove', danger: true })) return;
try { await CR.api('/api/my/conversions/goals/' + b.dataset.del, { remove: true }); CR.toast('Goal removed'); load(); } catch (e) { CR.toast(e.message, true); }
}));
}
async function goalForm(g) {
const v = await CR.dialog({ title: g ? 'Edit goal' : 'Add a goal', text: 'One word for what you count, like subscriber or sale. The default value is optional, in US dollars, used when the pixel carries none.',
fields: [{ k: 'name', label: 'Goal name', value: g ? g.name : '', placeholder: 'subscriber', max: 32 }, { k: 'value', label: 'Default value (optional)', value: g && g.value ? String(g.value) : '', placeholder: '0.00', max: 10 }], ok: g ? 'Save' : 'Add goal' });
if (!v) return;
try { const r = g ? await CR.api('/api/my/conversions/goals/' + g.px, v) : await CR.api('/api/my/conversions/goals', v); if (r.goal) PICK = r.goal.px; CR.toast(g ? 'Saved' : 'Goal added. Its snippets are ready below.'); load(); } catch (e) { CR.toast(e.message, true); }
}
$('addGoal').addEventListener('click', () => goalForm(null));
$('goalPick').addEventListener('change', () => { PICK = $('goalPick').value; snippets(); });
document.querySelectorAll('[data-copy]').forEach(b => b.addEventListener('click', () => CR.copy($(b.dataset.copy).textContent)));
// the test loads the real image pixel, the same request a thank-you page makes; it is recorded apart and never counted
$('testBtn').addEventListener('click', async () => {
const px = PICK; if (!px) return; $('testBtn').disabled = true; $('testNote').textContent = 'Sending...';
let ok = false; try { const r = await fetch('/cv.gif?px=' + px + '&test=1&r=' + Date.now(), { cache: 'no-store' }); ok = r.ok && /^test/.test(r.headers.get('X-LS-Result') || ''); } catch (e) {}
if (!ok) { try { await CR.api('/api/my/conversions/goals/' + px, { test: true }); ok = true; } catch (e) {} }
CR.toast(ok ? 'Test received. Your pixel id works.' : 'The test did not arrive. Try again in a minute.', !ok); $('testBtn').disabled = false; load();
});
async function load() {
try { D = await CR.get('/api/my/conversions?days=' + RANGE); } catch (e) { CR.sub('could not load'); return; }
paint();
}
CR.requireSession(load);
})();
+66 -8
View File
@@ -13,7 +13,9 @@ 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"/>'],
['wallet', 'Wallet', '/wallet', '<rect x="3" y="6" width="18" height="12" rx="2"/><path d="M16 12h3"/>'],
['promo', 'Promo tools', '/tools#promo', '<path d="M7 10s5-1 9-5v14c-4-4-9-5-9-5H5a2 2 0 0 1-2-2v0a2 2 0 0 1 2-2h2z"/><path d="M8 15l1 5h2l-1-5"/>'],
@@ -25,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', '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:var(--sig-soft,#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.
@@ -60,22 +97,32 @@ 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>'
+ '<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>' + themeSeg('crTheme') + '<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);
paintTheme();
}
// status strip: the clock ticks locally (Central); the readouts come from /api/my/strip once the member is known
function clock() { const c = $('stClock'); if (!c) return; try { c.textContent = new Date().toLocaleTimeString('en-US', { timeZone: 'America/Chicago', hour: 'numeric', minute: '2-digit' }) + ' CT'; } catch (e) { c.textContent = ''; } }
@@ -83,14 +130,25 @@ 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; };
// ── appearance (2026-11-01): Light / Dark / Auto. The head script (themehead.js) owns window.LSTheme and localStorage
// ls.theme; this paints every .theme-seg on the page, saves the choice to the account when signed in, and at sign-in lets
// the account value win over the local one (a local choice is pushed up when the account has none yet).
const THEMES = [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']];
function themeSeg(id) { return '<span class="seg theme-seg"' + (id ? ' id="' + id + '"' : '') + ' role="group" aria-label="Theme">' + THEMES.map(([k, l]) => '<button type="button" data-theme="' + k + '" title="' + l + ' theme">' + l + '</button>').join('') + '</span>'; }
function storedTheme() { try { const v = localStorage.getItem('ls.theme'); return v === 'light' || v === 'dark' || v === 'auto' ? v : null; } catch (e) { return null; } }
function paintTheme() { const c = window.LSTheme ? LSTheme.get() : 'light'; document.querySelectorAll('.theme-seg [data-theme]').forEach(b => { const on = b.dataset.theme === c; b.classList.toggle('on', on); b.setAttribute('aria-pressed', on ? 'true' : 'false'); }); }
function themeSync(m) { if (!window.LSTheme) return; const acct = m && m.signedIn && (m.theme === 'light' || m.theme === 'dark' || m.theme === 'auto') ? m.theme : null; const local = storedTheme(); if (acct) { if (acct !== local) LSTheme.set(acct, true); } else if (m && m.signedIn && local) api('/api/my/profile', { theme: local }).catch(() => {}); paintTheme(); }
document.addEventListener('click', e => { const b = e.target.closest && e.target.closest('.theme-seg [data-theme]'); if (!b || !window.LSTheme) return; const v = b.dataset.theme; LSTheme.set(v); if (ME && ME.signedIn) api('/api/my/profile', { theme: v }).catch(() => {}); });
window.addEventListener('ls-theme', paintTheme);
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', paintTheme); else paintTheme();
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>';
@@ -113,7 +171,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); }
}
@@ -161,7 +219,7 @@ window.CR = (function () {
if (!b) { b = document.createElement('b'); b.className = 'rbadge'; a.appendChild(b); }
b.textContent = n > 9 ? '9+' : String(n); a.title = 'Help: ' + n + ' new repl' + (n === 1 ? 'y' : 'ies'); return n;
}
async function requireSession(onReady) { let m = await me(); whoPaint(m); if (m && m.signedIn) { strip(); helpBadge(); m = await ensureUsername(m); await loginAd(); return onReady(m); } signInFlow(async r => { whoPaint(r); strip(); helpBadge(); await loginAd(); onReady(r); }); }
async function requireSession(onReady) { let m = await me(); whoPaint(m); themeSync(m); if (m && m.signedIn) { strip(); helpBadge(); m = await ensureUsername(m); await loginAd(); return onReady(m); } signInFlow(async r => { whoPaint(r); themeSync(r); strip(); helpBadge(); await loginAd(); onReady(r); }); }
// tiles with a sparkline and a delta chip (Instrument scheme, 2026-09-29): series = numbers oldest first
function sparkline(series) {
const s = (series || []).map(Number); if (s.length < 2 || !s.some(Boolean)) return '';
+80 -44
View File
@@ -4,21 +4,48 @@
scheme so every screen keeps working; only the values and the chrome changed. */
:root{
--bg:#E9EEF5; --rail:#F3F6FB; --panel:#FFFFFF; --panel-2:#F3F6FB; --line:#CDD7E5; --line-strong:#AEBED4;
--ink:#0F1B2E; --ink-2:#324361; --muted:#66768F;
--accent:#1F6FEB; --accent-hi:#0B4BB3; --accent-ink:#FFFFFF; --accent-dim:#7CB2FF; --accent-soft:#E1ECFC;
--sig:#FF6A1A; --sig-2:#D9530A; --sig-soft:#FFE9DC;
--ok:#0E8A5C; --ok-soft:#DDF4E8; --warn:#C2410C; --warn-soft:#FFE7D8; --bad:#B91C1C; --bad-soft:#FBE0E0; --hi-row:#FFF3EA;
--chrome:#0B1424; --chrome-2:#101D33; --chrome-ink:#EEF3FA; --chrome-sub:#8CA2C4; --chrome-line:#1E2E4A; --inset:#0F1B2E;
--sh:0 10px 24px -18px rgba(15,27,46,.45),0 1px 0 rgba(255,255,255,.9) inset;
--ink:#0F1B2E; --ink-2:#324361; --muted:#596984;
--accent:#1F6FEB; --accent-hi:#0B4BB3; --accent-ink:#FFFFFF; --accent-dim:#7CB2FF; --accent-pale:#A9CBFA; --accent-soft:#E1ECFC;
--sig:#FF6A1A; --sig-2:#B8420A; --sig-soft:#FFE9DC; --sig-ink:#0F1B2E; --sig-line:rgba(255,106,26,.45);
--ok:#0B7A52; --ok-soft:#DDF4E8; --ok-ink:#FFFFFF; --ok-line:rgba(11,122,82,.4); --warn:#B23A0A; --warn-soft:#FFE7D8; --warn-line:rgba(178,58,10,.4);
--bad:#B91C1C; --bad-soft:#FBE0E0; --bad-ink:#FFFFFF; --bad-line:rgba(185,28,28,.4); --hi-row:#FFF3EA;
--violet:#6D4AFF; --violet-soft:#EEE9FF; --violet-line:rgba(109,74,255,.45);
--note-bg:#FFFBEB; --note-soft:#FEF3C7; --note-line:#F59E0B; --note-ink:#92400E;
--chrome:#0B1424; --chrome-2:#101D33; --chrome-ink:#EEF3FA; --chrome-sub:#8CA2C4; --chrome-line:#1E2E4A; --chrome-hi:#8CC8FF; --chrome-warm:#FFB37D; --inset:#0F1B2E;
--on-ink:#FFFFFF; --field-bg:#FFFFFF; --panel-glass:rgba(255,255,255,.55); --row-hover:rgba(31,111,235,.04);
--btn-bg:linear-gradient(180deg,#FFFFFF,#F3F6FB); --btn-blue:linear-gradient(180deg,#2A74EC,#1559CC);
--panel-grad:linear-gradient(180deg,#FFFFFF,#F6F8FC); --panel-grad-hi:linear-gradient(180deg,#FFFFFF,#EEF4FE); --ph-a:#EEF2F9; --ph-b:#F5F7FC;
--hl:rgba(255,255,255,.9); --grid-dot:rgba(31,111,235,.20); --bg-glow:rgba(255,255,255,.6);
--sh:0 10px 24px -18px rgba(15,27,46,.45),0 1px 0 rgba(255,255,255,.9) inset; --sh-lg:0 30px 60px -30px rgba(15,27,46,.6);
/* aliases some screens reached for */
--line2:var(--line-strong); --accent2:var(--accent-hi); --ink2:var(--ink-2);
--display:"Rajdhani","Segoe UI",system-ui,sans-serif; --body:"Manrope","Segoe UI",system-ui,sans-serif; --mono:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
--r:7px;
color-scheme:light;
}
/* Dark workspace (2026-11-01: a member asked for light and dark, for vision-impaired readers and for people who
struggle with bright or with dark screens). Same token names; the chrome rail, topbar and strip stay as they are.
The head script (themehead.js) sets data-theme from localStorage ls.theme / the account; auto follows the device. */
:root[data-theme="dark"]{
--bg:#0B1424; --rail:#101D33; --panel:#142338; --panel-2:#1B2D47; --line:#273B5C; --line-strong:#3A5580;
--ink:#EEF3FA; --ink-2:#C5D2E6; --muted:#97A9C6;
--accent:#4D8DF7; --accent-hi:#8CC0FF; --accent-ink:#0B1424; --accent-dim:#3D6FC4; --accent-pale:#2E5699; --accent-soft:#1B325A;
--sig:#FF7A32; --sig-2:#FFA06A; --sig-soft:#3B2416; --sig-ink:#0B1424; --sig-line:rgba(255,122,50,.45);
--ok:#3FCF92; --ok-soft:#12352A; --ok-ink:#0B1424; --ok-line:rgba(63,207,146,.4); --warn:#F7A35E; --warn-soft:#3D2716; --warn-line:rgba(247,163,94,.4);
--bad:#FF8080; --bad-soft:#44202A; --bad-ink:#0B1424; --bad-line:rgba(255,128,128,.4); --hi-row:#2B2119;
--violet:#B19CFF; --violet-soft:#2A2350; --violet-line:rgba(177,156,255,.45);
--note-bg:#2A2410; --note-soft:#3B3014; --note-line:#B7791F; --note-ink:#F5C462;
--inset:#06101E;
--on-ink:#0B1424; --field-bg:#0F1B2E; --panel-glass:rgba(20,35,56,.6); --row-hover:rgba(140,192,255,.06);
--btn-bg:linear-gradient(180deg,#1E3150,#172743); --btn-blue:linear-gradient(180deg,#8CC0FF,#5A96F5);
--panel-grad:linear-gradient(180deg,#162741,#122035); --panel-grad-hi:linear-gradient(180deg,#172A47,#15284A); --ph-a:#182A45; --ph-b:#1B2E4B;
--hl:rgba(255,255,255,.05); --grid-dot:rgba(140,192,255,.10); --bg-glow:rgba(31,111,235,.12);
--sh:0 10px 24px -18px rgba(0,0,0,.85),0 1px 0 rgba(255,255,255,.04) inset; --sh-lg:0 30px 60px -30px rgba(0,0,0,.9);
color-scheme:dark;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);background-image:radial-gradient(circle,rgba(31,111,235,.20) 1px,transparent 1.3px),radial-gradient(120% 60% at 50% 0%,rgba(255,255,255,.6),transparent 60%);background-size:18px 18px,100% 100%;background-attachment:fixed;color:var(--ink);font-family:var(--body);font-size:13px;line-height:1.45}
body{margin:0;background:var(--bg);background-image:radial-gradient(circle,var(--grid-dot) 1px,transparent 1.3px),radial-gradient(120% 60% at 50% 0%,var(--bg-glow),transparent 60%);background-size:18px 18px,100% 100%;background-attachment:fixed;color:var(--ink);font-family:var(--body);font-size:13px;line-height:1.45}
a{color:var(--accent-hi)} a:hover{color:var(--accent)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--sig);outline-offset:2px}
@@ -61,40 +88,40 @@ button,input,select,textarea{font:inherit;color:inherit}
.topbar .readout{font-family:var(--mono);font-size:11px;color:var(--chrome-sub);letter-spacing:.02em;padding-left:14px;border-left:1px solid var(--chrome-line)}
.topbar .grow{flex:1}
.topbar .who{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:12px;color:var(--chrome-ink);padding:4px 10px 4px 5px;border:1px solid var(--chrome-line);border-radius:999px;background:transparent;cursor:pointer}
.topbar .who i{width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent-dim));display:grid;place-items:center;font:700 9px var(--mono);color:#fff;font-style:normal}
.topbar .who i{width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent-dim));display:grid;place-items:center;font:700 9px var(--mono);color:var(--accent-ink);font-style:normal}
.topbar .who:hover{border-color:var(--chrome-sub)}
.topbar .btn{color:var(--ink)}
.prelaunch{padding:9px 22px;background:#fff4d6;color:#4a3500;border-bottom:1px solid #f0d58a;font-size:13.5px;line-height:1.4}.prelaunch b{color:#2e2100}.prelaunch a{color:#7a4f00;font-weight:600}
.prelaunch{padding:9px 22px;background:var(--note-soft);color:var(--note-ink);border-bottom:1px solid var(--note-line);font-size:13.5px;line-height:1.4}.prelaunch b{color:var(--ink)}.prelaunch a{color:var(--note-ink);font-weight:600}
.strip{display:flex;gap:22px;align-items:center;padding:8px 22px;margin-top:auto;background:var(--chrome);color:var(--chrome-sub);font-family:var(--mono);font-size:11px;letter-spacing:.03em;border-top:1px solid var(--chrome-line)}
.strip b{color:var(--chrome-ink);font-weight:700}
.strip .dot{width:7px;height:7px;border-radius:50%;background:var(--ok);display:inline-block;margin-right:7px;box-shadow:0 0 0 3px rgba(14,138,92,.22);animation:crpulse 2.4s ease-in-out infinite}
.strip .dot{width:7px;height:7px;border-radius:50%;background:var(--ok);display:inline-block;margin-right:7px;box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 22%,transparent);animation:crpulse 2.4s ease-in-out infinite}
.strip .dot.off{background:var(--muted);animation:none;box-shadow:none}
.strip .sig{color:var(--sig)} .strip .grow{flex:1}
@keyframes crpulse{0%,100%{box-shadow:0 0 0 3px rgba(14,138,92,.22)}50%{box-shadow:0 0 0 5px rgba(14,138,92,.08)}}
@keyframes crpulse{0%,100%{box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 22%,transparent)}50%{box-shadow:0 0 0 5px color-mix(in srgb,var(--ok) 8%,transparent)}}
/* controls */
.btn{background:linear-gradient(180deg,#FFFFFF,#F3F6FB);color:var(--ink);border:1px solid var(--line-strong);border-radius:var(--r);padding:6px 12px;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap;box-shadow:0 1px 0 rgba(255,255,255,.9) inset,0 1px 2px rgba(15,27,46,.08);text-decoration:none;display:inline-flex;align-items:center;gap:6px;justify-content:center}
.btn{background:var(--btn-bg);color:var(--ink);border:1px solid var(--line-strong);border-radius:var(--r);padding:6px 12px;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap;box-shadow:0 1px 0 var(--hl) inset,0 1px 2px rgba(15,27,46,.08);text-decoration:none;display:inline-flex;align-items:center;gap:6px;justify-content:center}
.btn:hover{border-color:var(--accent)}
.btn.pri{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;background:linear-gradient(180deg,#FF7A32,var(--sig));color:#fff;border-color:var(--sig-2);padding:6px 13px;box-shadow:0 8px 18px -10px rgba(255,106,26,.9),0 1px 0 rgba(255,255,255,.35) inset}
.btn.pri{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;background:linear-gradient(180deg,#FF7A32,var(--sig));color:var(--sig-ink);border-color:var(--sig-2);padding:6px 13px;box-shadow:0 8px 18px -10px rgba(255,106,26,.9),0 1px 0 rgba(255,255,255,.35) inset}
.btn.pri:hover{background:linear-gradient(180deg,#FF8A48,#FF6A1A);border-color:var(--sig-2)}
.btn.blue{background:linear-gradient(180deg,#3A83F0,var(--accent));color:#fff;border-color:var(--accent-hi);box-shadow:0 8px 18px -10px rgba(31,111,235,.9),0 1px 0 rgba(255,255,255,.3) inset}
.btn.blue{background:var(--btn-blue);color:var(--accent-ink);border-color:var(--accent-hi);box-shadow:0 8px 18px -10px rgba(31,111,235,.9),0 1px 0 rgba(255,255,255,.3) inset}
.btn.sm{padding:4px 9px;font-size:11px}
.btn.ghost{background:transparent;box-shadow:none}
.btn.danger:hover{border-color:var(--bad);color:var(--bad)}
.btn.pri.danger{background:linear-gradient(180deg,#D93030,var(--bad));border-color:#991B1B}
.btn.pri.danger{background:linear-gradient(180deg,#D93030,var(--bad));border-color:#991B1B;color:var(--bad-ink)}
.btn[disabled]{opacity:.5;cursor:default}
.field{background:#fff;border:1px solid var(--line-strong);border-radius:6px;padding:7px 10px;color:var(--ink);width:100%;min-width:0;box-shadow:0 1px 2px rgba(15,27,46,.06) inset}
.field:focus{border-color:var(--sig);outline:none;box-shadow:0 0 0 3px rgba(255,106,26,.18)}
.field{background:var(--field-bg);border:1px solid var(--line-strong);border-radius:6px;padding:7px 10px;color:var(--ink);width:100%;min-width:0;box-shadow:0 1px 2px rgba(15,27,46,.06) inset}
.field:focus{border-color:var(--sig);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--sig) 18%,transparent)}
.field.mono{font-size:12px}
select.field{appearance:auto}
label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.code{font-family:var(--mono);font-size:12px;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;padding:6px 10px;color:#8CC8FF;overflow-wrap:anywhere}
.code{font-family:var(--mono);font-size:12px;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;padding:6px 10px;color:var(--chrome-hi);overflow-wrap:anywhere}
.led{display:inline-flex;align-items:baseline;gap:8px;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;padding:7px 12px;color:var(--chrome-sub);font-family:var(--mono);font-size:11px}
.led b{font-family:var(--display);font-size:20px;line-height:1;color:var(--sig);letter-spacing:.04em;font-variant-numeric:tabular-nums}
/* tiles */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.tile{position:relative;background:linear-gradient(180deg,#FFFFFF,#F6F8FC);border:1px solid var(--line);border-radius:8px;padding:12px 14px;display:grid;gap:3px;box-shadow:var(--sh)}
.tile{position:relative;background:var(--panel-grad);border:1px solid var(--line);border-radius:8px;padding:12px 14px;display:grid;gap:3px;box-shadow:var(--sh)}
.tile::before,.tile::after{content:"";position:absolute;width:11px;height:11px;border:1.5px solid var(--line-strong);pointer-events:none}
.tile::before{top:5px;left:5px;border-right:0;border-bottom:0} .tile::after{bottom:5px;right:5px;border-left:0;border-top:0}
.tile .k{display:flex;align-items:center;gap:8px;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}
@@ -102,7 +129,7 @@ label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.
.tile .v{font-family:var(--display);font-weight:700;font-size:30px;line-height:1.05;letter-spacing:.02em;font-variant-numeric:tabular-nums;color:var(--ink)}
.tile .row{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;min-width:0}
.tile .v small{font-family:var(--mono);font-size:12px;font-weight:500;color:var(--muted);margin-left:4px;letter-spacing:0}
.tile.hi{background:linear-gradient(180deg,#FFFFFF,#EEF4FE)} .tile.hi::before,.tile.hi::after{border-color:var(--sig)} .tile.hi .k::before{background:var(--sig)} .tile.hi .v{color:var(--accent-hi)}
.tile.hi{background:var(--panel-grad-hi)} .tile.hi::before,.tile.hi::after{border-color:var(--sig)} .tile.hi .k::before{background:var(--sig)} .tile.hi .v{color:var(--accent-hi)}
.tile .delta{justify-self:start;font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.04em;color:var(--ok);background:var(--ok-soft);border-radius:4px;padding:2px 6px;margin-top:2px}
.tile .delta.flat{color:var(--muted);background:var(--panel-2)}
.tile .delta.down{color:var(--warn);background:var(--warn-soft)}
@@ -110,31 +137,31 @@ label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.
/* tags + chips */
.tag{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border:1px solid var(--line-strong);border-radius:4px;padding:1px 7px;white-space:nowrap;color:var(--ink-2);background:var(--panel-2);vertical-align:middle}
.tag::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--line-strong);flex:none}
.tag.ok{color:var(--ok);border-color:rgba(14,138,92,.4);background:var(--ok-soft)} .tag.ok::before{background:var(--ok);box-shadow:0 0 0 2px rgba(14,138,92,.2)}
.tag.warn{color:var(--warn);border-color:rgba(194,65,12,.4);background:var(--warn-soft)} .tag.warn::before{background:var(--warn)}
.tag.bad{color:var(--bad);border-color:rgba(185,28,28,.4);background:var(--bad-soft)} .tag.bad::before{background:var(--bad)}
.tag.ok{color:var(--ok);border-color:var(--ok-line);background:var(--ok-soft)} .tag.ok::before{background:var(--ok);box-shadow:0 0 0 2px color-mix(in srgb,var(--ok) 20%,transparent)}
.tag.warn{color:var(--warn);border-color:var(--warn-line);background:var(--warn-soft)} .tag.warn::before{background:var(--warn)}
.tag.bad{color:var(--bad);border-color:var(--bad-line);background:var(--bad-soft)} .tag.bad::before{background:var(--bad)}
.tag.dim{color:var(--muted)}
.tag.t,.tag.plain{color:var(--accent-hi);border-color:var(--accent-soft);background:var(--accent-soft)} .tag.t::before,.tag.plain::before{display:none}
.dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:currentColor;margin-right:6px;vertical-align:middle}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{font-size:11px;font-weight:700;color:var(--ink-2);border:1px solid var(--line-strong);border-radius:999px;padding:3px 10px;cursor:pointer;background:#fff}
.chip{font-size:11px;font-weight:700;color:var(--ink-2);border:1px solid var(--line-strong);border-radius:999px;padding:3px 10px;cursor:pointer;background:var(--panel)}
.chip.on{border-color:var(--accent);color:var(--accent-hi);background:var(--accent-soft)}
.seg{display:inline-flex;border:1px solid var(--line-strong);border-radius:8px;overflow:hidden;background:var(--panel-2)}
.seg button{background:transparent;border:0;border-right:1px solid var(--line-strong);padding:7px 13px;font-weight:700;font-size:12px;color:var(--ink-2);cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.seg button:last-child{border-right:0} .seg button.on{background:var(--ink);color:#fff}
.seg button:last-child{border-right:0} .seg button.on{background:var(--ink);color:var(--on-ink)}
/* tables + panels */
.tbl{border:1px solid var(--line);border-radius:8px;background:var(--panel);overflow:hidden;box-shadow:var(--sh)}
.tbl .hd,.tbl .rw{display:grid;gap:12px;padding:10px 16px;align-items:center}
.tbl .hd{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);border-bottom:1px solid var(--line);background:var(--panel-2)}
.tbl .rw{position:relative;border-bottom:1px solid var(--line)} .tbl .rw:last-child{border-bottom:0}
.tbl .rw:hover{background:rgba(31,111,235,.04)}
.tbl .rw:hover{background:var(--row-hover)}
.tbl .rw.on,.tbl .rw.hi-row{background:var(--hi-row)} .tbl .rw.on::before,.tbl .rw.hi-row::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--sig)}
/* an empty-state row (one muted note) spans every column instead of wrapping inside the first */
.tbl .rw > .muted:only-child{grid-column:1/-1}
.tbl .ft{padding:9px 16px;border-top:1px solid var(--line);font-family:var(--mono);font-size:10.5px;color:var(--muted);background:var(--panel-2);letter-spacing:.02em}
.r{text-align:right}
.ph{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(135deg,#EEF2F9 0 6px,#F5F7FC 6px 12px)}
.ph{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(135deg,var(--ph-a) 0 6px,var(--ph-b) 6px 12px)}
.ph h2,.ph h3{font-family:var(--display);font-size:14px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;margin:0;display:flex;align-items:center;gap:8px}
.ph h2::before,.ph h3::before{content:"";width:8px;height:8px;background:var(--sig);transform:rotate(45deg);display:inline-block;flex:none}
.ph .meta{font-family:var(--mono);font-size:10.5px;color:var(--muted);letter-spacing:.04em;text-align:right}
@@ -142,7 +169,7 @@ label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.
.split{display:flex;height:6px;border-radius:3px;overflow:hidden;background:var(--line)} .split i{display:block;height:100%} .split .a{background:var(--accent)} .split .b{background:var(--accent-dim)} .split .c{background:var(--sig)}
.prog{height:10px;background:var(--line);border-radius:5px;overflow:hidden} .prog i{display:block;height:100%;background:linear-gradient(90deg,var(--accent-hi),var(--accent) 70%,var(--sig))}
.gauge{display:grid;grid-template-columns:repeat(5,1fr);gap:5px} .gauge i{display:block;height:12px;border-radius:2px;background:var(--line);border:1px solid var(--line-strong)}
.gauge i.on{background:linear-gradient(180deg,#3A83F0,var(--accent));border-color:var(--accent-hi);box-shadow:0 0 8px rgba(31,111,235,.45)}
.gauge i.on{background:var(--btn-blue);border-color:var(--accent-hi);box-shadow:0 0 8px color-mix(in srgb,var(--accent) 45%,transparent)}
.tabs{display:flex;gap:4px} .tabs button{background:transparent;border:1px solid transparent;border-radius:var(--r);color:var(--muted);font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:6px 12px;cursor:pointer}
.tabs button.on{background:var(--panel);border-color:var(--accent);color:var(--accent-hi);box-shadow:0 1px 2px rgba(15,27,46,.08)}
@@ -153,21 +180,21 @@ label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.
.panel h2::before{content:"";width:8px;height:8px;background:var(--sig);transform:rotate(45deg);display:inline-block;flex:none}
/* tiny charts: gradient bars, glow on the peak */
.bars{display:grid;gap:3px;align-items:end;height:120px;border-bottom:1px solid var(--line-strong);background:repeating-linear-gradient(180deg,transparent 0 29px,rgba(31,111,235,.08) 29px 30px)}
.bars{display:grid;gap:3px;align-items:end;height:120px;border-bottom:1px solid var(--line-strong);background:repeating-linear-gradient(180deg,transparent 0 29px,color-mix(in srgb,var(--accent) 10%,transparent) 29px 30px)}
.bars i{display:block;width:100%;max-width:56px;justify-self:center;background:linear-gradient(180deg,var(--accent),var(--accent-hi));min-height:1px;border-radius:2px 2px 0 0}
.bars i.dim{background:linear-gradient(180deg,var(--accent-dim),#A9CBFA)}
.bars i.dim{background:linear-gradient(180deg,var(--accent-dim),var(--accent-pale))}
.bars i.hi{background:linear-gradient(180deg,#FF8A48,var(--sig));box-shadow:0 -4px 12px -4px rgba(255,106,26,.6)}
.axis{display:flex;justify-content:space-between;font-family:var(--mono);font-size:10px;color:var(--muted)}
.spark{display:flex;gap:1px;align-items:end;height:12px} .spark i{display:block;width:5px;background:linear-gradient(180deg,var(--accent-dim),#A9CBFA);border-radius:1px 1px 0 0} .spark i.hi{background:linear-gradient(180deg,var(--accent),var(--accent-hi))}
.sparkline{width:74px;height:26px;display:block} .sparkline polyline{fill:none;stroke:var(--accent);stroke-width:1.6;stroke-linejoin:round} .sparkline .fill{fill:rgba(31,111,235,.12);stroke:none}
.tile.hi .sparkline polyline{stroke:var(--sig)} .tile.hi .sparkline .fill{fill:rgba(255,106,26,.12)}
.spark{display:flex;gap:1px;align-items:end;height:12px} .spark i{display:block;width:5px;background:linear-gradient(180deg,var(--accent-dim),var(--accent-pale));border-radius:1px 1px 0 0} .spark i.hi{background:linear-gradient(180deg,var(--accent),var(--accent-hi))}
.sparkline{width:74px;height:26px;display:block} .sparkline polyline{fill:none;stroke:var(--accent);stroke-width:1.6;stroke-linejoin:round} .sparkline .fill{fill:color-mix(in srgb,var(--accent) 12%,transparent);stroke:none}
.tile.hi .sparkline polyline{stroke:var(--sig)} .tile.hi .sparkline .fill{fill:color-mix(in srgb,var(--sig) 12%,transparent)}
/* toast + modal */
.toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);background:var(--chrome);color:var(--chrome-ink);border:1px solid var(--chrome-line);border-left:3px solid var(--ok);padding:9px 14px;border-radius:6px;font-size:12px;font-weight:600;opacity:0;transition:opacity .2s;pointer-events:none;z-index:50;box-shadow:0 12px 30px -12px rgba(15,27,46,.6)}
.toast.bad{border-left-color:var(--sig)}
.toast.on{opacity:1}
.modal-back{position:fixed;inset:0;background:rgba(11,20,36,.55);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;padding:16px;z-index:40}
.modal{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:18px;width:min(520px,100%);display:grid;gap:12px;box-shadow:0 30px 60px -30px rgba(15,27,46,.6)}
.modal{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:18px;width:min(520px,100%);display:grid;gap:12px;box-shadow:var(--sh-lg)}
.modal h2{font-family:var(--display);font-size:20px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin:0;display:flex;align-items:center;gap:8px}
.modal h2::before{content:"";width:8px;height:8px;background:var(--sig);transform:rotate(45deg);display:inline-block}
.modal .acts{display:flex;justify-content:flex-end;gap:8px}
@@ -189,20 +216,20 @@ label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.
/* JetBrains Mono joins "//" into a ligature that reads as a missing slash in URLs (Marty 2026-10-07): no ligatures anywhere */
body,input,textarea,button,code,.mono{font-variant-ligatures:none;font-feature-settings:"liga" 0,"calt" 0}
/* chat widget on Control Room screens (2026-10-18: the bubble only lived on the retired /my dashboard) */
#iapChatBtn{position:fixed;right:20px;bottom:44px;z-index:60;width:56px;height:56px;border-radius:50%;border:0;background:var(--accent,#3b9dff);color:#fff;font-size:24px;cursor:pointer;box-shadow:0 8px 28px rgba(20,60,140,.35)}
#iapChatBtn{position:fixed;right:20px;bottom:44px;z-index:60;width:56px;height:56px;border-radius:50%;border:0;background:var(--accent,#3b9dff);color:var(--accent-ink,#fff);font-size:24px;cursor:pointer;box-shadow:0 8px 28px rgba(20,60,140,.35)}
#iapChatBtn:hover{transform:scale(1.06)}
#iapChatPanel{position:fixed;right:20px;bottom:112px;z-index:60;width:min(360px,calc(100vw - 40px));background:#fff;color:var(--ink,#14213d);border:1px solid var(--line-strong,#c9d3e3);border-radius:16px;overflow:hidden;box-shadow:0 24px 60px rgba(10,20,50,.28);display:flex;flex-direction:column}
#iapChatPanel{position:fixed;right:20px;bottom:112px;z-index:60;width:min(360px,calc(100vw - 40px));background:var(--panel,#fff);color:var(--ink,#14213d);border:1px solid var(--line-strong,#c9d3e3);border-radius:16px;overflow:hidden;box-shadow:0 24px 60px rgba(10,20,50,.28);display:flex;flex-direction:column}
#iapChatPanel .ch-head{padding:14px 16px;border-bottom:1px solid var(--line,#e2e8f2);font-family:var(--display,inherit);position:relative;font-weight:700}
#iapChatPanel .ch-head .ch-sub{display:block;font-size:12px;font-weight:400;color:var(--muted,#64748b)}
#iapChatClose{position:absolute;right:10px;top:10px;background:transparent;border:0;color:var(--muted,#64748b);font-size:22px;cursor:pointer;line-height:1}
#iapChatPanel .ch-msgs{padding:14px;overflow-y:auto;max-height:340px;display:flex;flex-direction:column;gap:10px}
#iapChatPanel .ch-m{border-radius:12px;padding:9px 13px;font-size:13.5px;line-height:1.5;max-width:86%}
#iapChatPanel .ch-m.bot{background:rgba(59,157,255,.08);border:1px solid rgba(59,157,255,.22);align-self:flex-start}
#iapChatPanel .ch-m.me{background:#f1f4f9;border:1px solid var(--line,#e2e8f2);align-self:flex-end}
#iapChatPanel .ch-m.bot{background:var(--accent-soft);border:1px solid var(--accent-dim);align-self:flex-start}
#iapChatPanel .ch-m.me{background:var(--panel-2);border:1px solid var(--line,#e2e8f2);align-self:flex-end}
#iapChatPanel .ch-m a{word-break:break-all}
#iapChatPanel .ch-input{display:flex;gap:8px;padding:11px;border-top:1px solid var(--line,#e2e8f2)}
#iapChatPanel .ch-input input{flex:1;min-width:0;padding:9px 11px;border:1px solid var(--line-strong,#c9d3e3);border-radius:10px;font:inherit}
#iapChatPanel .ch-input button{background:var(--accent,#3b9dff);color:#fff;border:0;border-radius:10px;padding:0 16px;font-weight:700;cursor:pointer}
#iapChatPanel .ch-input input{flex:1;min-width:0;padding:9px 11px;border:1px solid var(--line-strong,#c9d3e3);border-radius:10px;font:inherit;background:var(--field-bg);color:var(--ink)}
#iapChatPanel .ch-input button{background:var(--accent,#3b9dff);color:var(--accent-ink,#fff);border:0;border-radius:10px;padding:0 16px;font-weight:700;cursor:pointer}
/* Stage + status colour (Orlando via Marty 2026-10-20): the Pipeline board's stage colours carried to Team rows, and a
matching traffic-light for ad status. --st drives the row stripe, the pill and the chip dot. */
@@ -211,11 +238,20 @@ body,input,textarea,button,code,.mono{font-variant-ligatures:none;font-feature-s
[data-st="bought"]{--st:#16a34a} [data-st="building"]{--st:#b7791f} [data-st="quiet"]{--st:#d97706}
[data-st="live"]{--st:#16a34a} [data-st="low"]{--st:#d97706} [data-st="out"]{--st:#dc2626} [data-st="paused"]{--st:#64748b} [data-st="sched"]{--st:#2563eb} [data-st="ended"]{--st:#94a3b8}
.tbl .rw.st-row{box-shadow:inset 4px 0 0 var(--st)}
.tbl .rw.st-row.stalled{background:#fffbeb}
.stg{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;border-radius:999px;padding:2px 9px;color:var(--st);background:color-mix(in srgb,var(--st) 11%,#fff);border:1px solid color-mix(in srgb,var(--st) 38%,#fff)}
.tbl .rw.st-row.stalled{background:var(--note-bg)}
.stg{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;border-radius:999px;padding:2px 9px;color:color-mix(in srgb,var(--st) 72%,var(--ink));background:color-mix(in srgb,var(--st) 11%,var(--panel));border:1px solid color-mix(in srgb,var(--st) 38%,var(--panel))}
.stg::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--st);flex:none}
.stg.quiet{margin-top:4px;color:#92400e;background:#fef3c7;border-color:#f59e0b}
.stg.quiet{margin-top:4px;color:var(--note-ink);background:var(--note-soft);border-color:var(--note-line)}
.chip[data-st]{display:inline-flex;align-items:center;gap:6px}
.chip[data-st]::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--st);flex:none}
.chip[data-st].on{border-color:var(--st);color:#0f172a;background:color-mix(in srgb,var(--st) 13%,#fff)}
.chip[data-st].on{border-color:var(--st);color:var(--ink);background:color-mix(in srgb,var(--st) 13%,var(--panel))}
.bar.st i{background:var(--st)}
/* dark theme: the stage / status palette lifted so 10.5px pill text still clears 4.5:1 on dark panels */
:root[data-theme="dark"] [data-st]{--st:#8E9FB8}
:root[data-theme="dark"] [data-st="joined"],:root[data-theme="dark"] [data-st="sched"]{--st:#7AAAFF} :root[data-theme="dark"] [data-st="wallet"]{--st:#4FC3E6} :root[data-theme="dark"] [data-st="payouts"]{--st:#FF9A5C}
:root[data-theme="dark"] [data-st="bought"],:root[data-theme="dark"] [data-st="live"]{--st:#4CCB7A} :root[data-theme="dark"] [data-st="building"]{--st:#D9A441} :root[data-theme="dark"] [data-st="quiet"],:root[data-theme="dark"] [data-st="low"]{--st:#F0B44A}
:root[data-theme="dark"] [data-st="out"]{--st:#FF7B7B} :root[data-theme="dark"] [data-st="paused"]{--st:#8E9FB8} :root[data-theme="dark"] [data-st="ended"]{--st:#6F7F99}
/* theme switch (Light / Dark / Auto) in the topbar and on the Profile pane */
.theme-seg button{min-width:0}
.topbar .theme-seg{background:transparent;border-color:var(--chrome-line)} .topbar .theme-seg button{color:var(--chrome-sub);border-color:var(--chrome-line);padding:5px 10px;font-size:11px} .topbar .theme-seg button:hover{color:var(--chrome-ink)} .topbar .theme-seg button.on{background:var(--accent);color:var(--accent-ink)}
@media (max-width:760px){.topbar .theme-seg button{padding:5px 8px}}
+16 -8
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);
@@ -78,6 +82,7 @@
$('walletBox').innerHTML = addr
? '<div class="code" style="display:block">' + esc(addr) + '</div>'
+ (on ? '<div class="ok"><span class="dot"></span>Payouts on. Every package your people buy pays this wallet in the same transaction.</div>'
: ME.tankHold ? '<div class="ink2" id="tankHoldNote" style="font-size:13px;color:var(--ok)">' + esc(tankHoldText(ME.tankHold)) + '</div>' // held for an adopter: no activate button
: '<div class="ink2" style="font-size:13px">Linked, but payouts are off until this wallet is on the contract. Buying a package does that. So does the free activation below (gas only).</div><div class="acts"><button class="btn blue" type="button" id="activateBtn">Switch on payouts (free)</button></div>')
+ '<div class="acts"><a class="btn sm" href="' + esc((CFG && CFG.explorer) || 'https://polygonscan.com') + '/address/' + esc(addr) + '" target="_blank" rel="noopener">Open on the explorer</a><button class="btn sm" type="button" id="switchBtn">Switch account</button><button class="btn sm" type="button" id="dropBtn">Disconnect</button></div>'
+ posBlock()
@@ -141,8 +146,17 @@
}
async function guard(btn, fn) { if (btn.disabled) return; btn.disabled = true; try { await fn(); } catch (e) { CR.toast((e && e.message) || 'Something went wrong.', true); } finally { btn.disabled = false; } }
// holding tank (2026-10-27): no sponsor yet, so the free Switch on payouts waits for an adopter (24 hours at most).
// A purchase is never held: buying goes ahead as before.
const holdLeft = ms => { const m = Math.max(1, Math.round(ms / 60000)); const h = Math.floor(m / 60); return h ? h + ' h ' + (m % 60) + ' min' : m + ' min'; };
function tankHoldText(h) {
let t = "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours).";
if (h && h.until) { const ms = h.until - Date.now(); t += ms > 0 ? ' Time left: ' + holdLeft(ms) + '.' : ' Any minute now.'; }
return t;
}
// a named sponsor that cannot be paid right now: hold the transaction and say why (never credit the company by default)
function holdText(sp) {
if (sp.sponsorBlocked === 'tankHold') return tankHoldText(sp.tankHold); // the free activation only (intent=activate), never a buy
const who = sp.sponsorName ? ('@' + String(sp.sponsorName).replace(/^@/, '')) : 'your sponsor';
if (sp.sponsorBlocked === 'claim' && sp.claim) return (sp.claim.nobody ? 'Nobody above you on LinkSpin has a wallet yet, so there is no one for the contract to pay. ' : who + ' has not linked a wallet on LinkSpin yet. ') + 'Your first purchase waits until ' + (sp.claim.deadline ? new Date(sp.claim.deadline).toLocaleDateString() : 'they do') + ', then it goes ahead with the nearest member above who has one. Nothing was charged.';
if (sp.sponsorBlocked === 'notActivated') return who + ' has not switched on payouts yet, so this purchase would credit the company instead of them. Ask them to switch on payouts first (one free transaction).';
@@ -151,7 +165,7 @@
}
async function linkWallet() { CR.toast('Check your wallet for the free link signature…'); await IAPWallet.signIn(); CR.toast('Wallet linked. Earnings pay there from now on.'); await load(); }
async function activate() {
const sp = await CR.get('/api/sponsor?intent=buy'); if (sp.sponsorBlocked) { $('holdBox').textContent = holdText(sp); $('holdBox').hidden = false; return; }
const sp = await CR.get('/api/sponsor?intent=activate'); if (sp.sponsorBlocked) { $('holdBox').textContent = holdText(sp); $('holdBox').hidden = false; if (sp.sponsorBlocked === 'tankHold') { ME.tankHold = sp.tankHold || {}; paintWallet(); } return; }
CR.toast('Confirm the free activation in your wallet…');
const r = await IAPWallet.activate(sp.sponsorId || 0);
if (!r.receipt || r.receipt.status !== '0x1') throw new Error('Transaction reverted. Check the explorer.');
@@ -194,12 +208,6 @@
}
$('buyBtn').addEventListener('click', () => guard($('buyBtn'), buy));
$('buyFrom').addEventListener('change', () => { FROM = $('buyFrom').value || 'main'; paintFrom(); paintQuote(); });
$('cardBtn').addEventListener('click', () => guard($('cardBtn'), async () => {
const p = sel(); const need = p && p.costWei ? Math.max(10, Math.ceil(Number(BigInt(p.costWei) / 1000000000000000000n)) + 3) : 30;
const q = '/api/moonpay-url?pol=' + need + (ME && ME.address ? '&address=' + encodeURIComponent(ME.address) : '');
const r = await CR.get(q); if (!r.url) throw new Error('The card on-ramp is not available right now.');
window.open(r.url, '_blank', 'noopener'); CR.toast('MoonPay opened in a new tab. POL lands straight in your own wallet.');
}));
async function load() {
try { [CFG, ME] = await Promise.all([CR.get('/api/config'), CR.me(true)]); } catch (e) { CR.sub('could not load'); return; }
+81
View File
@@ -0,0 +1,81 @@
// The Engine Room (2026-10-24). The SAME file ships in InstantAdPay (Members > Engine Room) and LinkSpin (Ads screen panel).
// Plain dials, real numbers, colour only for warnings. Renders into #erRoot from /api/my/engine; hidden while the
// refuelStreak switch is off. Unlocked by the first counted refuel, greyed "Refuel to start your engine" until then.
(function () {
const root = document.getElementById('erRoot'); if (!root) return;
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');
// 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:var(--warn,#e8a317)}.er-dot.green{background:var(--ok,#2fa36b)}.er-dot.amber{background:var(--warn,#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;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
function dial(pct, value, caption, aria, warn) {
const p = pct == null ? 0 : Math.max(0, Math.min(100, pct));
const a = Math.PI * (1 - p / 100); const x = 100 + 80 * Math.cos(a), y = 100 - 80 * Math.sin(a);
const col = warn ? 'var(--warn,#e8a317)' : 'currentColor';
return '<div class="er-dial" role="img" aria-label="' + esc(aria) + '"><svg viewBox="0 0 200 112" aria-hidden="true"><path d="M20 100 A80 80 0 0 1 180 100" fill="none" stroke="rgba(127,127,127,.3)" stroke-width="14" stroke-linecap="round"/>'
+ (pct == null ? '' : '<path d="M20 100 A80 80 0 0 1 ' + x.toFixed(1) + ' ' + y.toFixed(1) + '" fill="none" stroke="' + col + '" stroke-width="14" stroke-linecap="round"/>') + '</svg>'
+ '<div class="v">' + esc(value) + '</div><div class="c">' + caption + '</div></div>';
}
function view(d) {
const f = d.fuel, c = d.clicks, g = d.goals, s = d.streak;
const fuelCap = (f.refuelCredits ? n(f.left) + ' of ' + n(f.refuelCredits) + ' credits this cycle' : n(f.left) + ' credits on both sites') + (f.daysLeft != null ? '<br>about ' + n(f.daysLeft) + ' days at your burn (' + n(f.burnPerDay) + ' a day)' : '');
const fuelAria = 'Fuel left: ' + n(f.left) + ' credits' + (f.pct != null ? ', ' + f.pct + ' percent of this cycle’s refuel' : '') + (f.daysLeft != null ? ', about ' + f.daysLeft + ' days at your current burn' : '');
const clickCap = (c.prevWeek ? 'last week: ' + n(c.prevWeek) + ' (half way = the same)<br>' : '') + (c.per1000 != null ? n(c.per1000) + ' clicks per 1,000 credits' : 'clicks per 1,000 credits: not enough delivery yet') + '<br>all ads, both sites';
const goalCap = (g.month == null ? 'LinkSpin did not answer' : g.tracking ? (g.target ? 'goal: ' + n(g.target) + ' this month' : 'set a goal for the month') : 'set up conversion tracking') + '<span class="er-goal"><label>goal <input type="number" min="0" max="100000" data-er-goal value="' + (g.target || '') + '" aria-label="Your goal for this month"></label><button class="btn small sec" type="button" data-er-save>Save</button></span>';
const dials = '<div class="er-dials">'
+ dial(f.pct, f.pct != null ? f.pct + '%' : n(f.left), 'Fuel left<br>' + fuelCap, fuelAria, f.daysLeft != null && f.daysLeft < 5)
+ 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) + 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(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>';
}
async function load(fresh) {
try {
const d = await (await fetch('/api/my/engine' + (fresh ? '?fresh=1' : ''), { cache: 'no-store' })).json();
window.FUEL = window.FUEL || {}; window.FUEL.engine = d;
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 () => {
const v = root.querySelector('[data-er-goal]').value; save.disabled = true;
try { const r = await (await fetch('/api/my/engine/goal', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ goal: Number(v) || 0 }) })).json(); if (r.error) throw new Error(r.error); load(true); }
catch (e) { save.disabled = false; save.textContent = 'Try again'; }
});
} catch (e) { if (host) host.hidden = true; }
}
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
})();
+109
View File
@@ -0,0 +1,109 @@
// Fuel Your Offers (2026-10-24), LinkSpin: the Monthly Refuel panel on Credits and Ads. The streak lives on InstantAdPay
// and is shared by both sites; /api/my/refuel relays InstantAdPay's view. Hidden while the refuelStreak switch is off.
(function () {
const $ = id => document.getElementById(id);
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>' + (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>'
: 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>'
+ 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 + '%.'
+ (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>';
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;
try {
const v = await (await fetch('/api/my/refuel', { cache: 'no-store' })).json();
window.FUEL.refuel = v;
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;
load(); setInterval(load, 300000);
// ---- 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 ? ' &middot; ' + 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>'
+ '<div style="display:grid;gap:8px">' + k.sizes.filter(s => s.ready).map(s => '<div data-kcell data-month="' + esc(k.month) + '" data-size="' + s.size + '" style="border:1px solid var(--line);border-radius:6px;padding:8px;min-width:0">'
+ '<div style="display:flex;justify-content:space-between;gap:6px;align-items:center"><span class="mono" style="font-size:11px">' + s.size + '</span><button class="btn" type="button" data-kmake>Make mine</button></div><div data-kimg style="margin-top:6px"></div></div>').join('') + '</div>';
}
async function loadKits() {
const panel = $('rkPanel'); if (!panel) return;
try {
const d = await (await fetch('/api/my/kits', { cache: 'no-store' })).json();
if (!d || !d.on || !d.kits || !d.kits.length) { panel.hidden = true; return; }
$('rkBody').innerHTML = d.kits.slice(0, 3).map(k => '<div style="margin-bottom:14px">' + kitHtml(k, d) + '</div>').join('')
+ (d.customNote ? '<p class="muted"><b>Custom banners credit:</b> ' + esc(d.customNote) + '</p>' : '') + '<p class="muted" style="margin:0">Ad credits buy delivery only. No banner may promise income.</p>';
panel.hidden = false;
panel.querySelectorAll('[data-kbs]').forEach(b => b.addEventListener('click', async () => {
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 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;
}));
panel.querySelectorAll('[data-kmake]').forEach(b => b.addEventListener('click', async () => {
const cell = b.closest('[data-kcell]'); b.disabled = true;
try {
const g = panel.querySelector('[data-kgif="' + cell.dataset.month + '"]');
const r = await post('/api/my/kits/render', { month: cell.dataset.month, size: cell.dataset.size, variant: g && g.checked && cell.dataset.size !== '1200x630' ? 'gif' : 'still' });
cell.querySelector('[data-kimg]').innerHTML = '<img src="' + esc(r.url) + '" alt="Your ' + esc(r.size) + ' Refuel Kit banner" style="max-width:100%;height:auto;display:block"><div style="display:flex;gap:6px;flex-wrap:wrap;margin-top:6px"><a class="btn" href="' + esc(r.url) + '" download>Download</a><button class="btn" type="button" data-kcopy="' + esc(r.abs) + '">Copy image link</button></div>';
const c = cell.querySelector('[data-kcopy]'); c.addEventListener('click', () => { try { navigator.clipboard.writeText(c.dataset.kcopy); c.textContent = 'Copied'; } catch (e) {} });
} catch (e) { cell.querySelector('[data-kimg]').textContent = e.message; }
b.disabled = false;
}));
} catch (e) { panel.hidden = true; }
}
window.FUEL.loadKits = loadKits;
loadKits();
window.addEventListener('cr:signedin', () => { load(); loadKits(); }); // signed in from the shell's pop-up (arrivals from InstantAdPay)
})();
+38 -37
View File
@@ -26,7 +26,17 @@
return r;
}
// holding tank (2026-10-27): no sponsor yet, so the free Switch on payouts waits for an adopter (24 hours at most).
// A purchase is never held: buying goes ahead as before.
const holdLeft = ms => { const m = Math.max(1, Math.round(ms / 60000)); const h = Math.floor(m / 60); return h ? h + ' h ' + (m % 60) + ' min' : m + ' min'; };
function tankHoldText(h) {
let t = "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours).";
if (h && h.until) { const ms = h.until - Date.now(); t += ms > 0 ? ' Time left: ' + holdLeft(ms) + '.' : ' Any minute now.'; }
return t;
}
let TANK_HOLD = null;
function nextMove(d) {
if (TANK_HOLD && d.address && !d.memberId) return tankHoldText(TANK_HOLD);
if (!d.address) return 'Grab your link below and start sharing today. Then link your wallet (one free signature) so every payment can lock to you before your people start buying.';
if (!d.memberId) return 'Your wallet is linked. Switch on payouts above (one free transaction) and every purchase in your line pays you the moment it happens.';
if (d.buyerCount === 0) return 'Payouts are on and your link is live. Your next milestone: your first buyer of $25 or more. Every direct pays you 50 percent from their very first package.';
@@ -227,7 +237,8 @@
}
// ── overview v3 charts: hand-rolled SVG/CSS, real data only ──
const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
const CH = { mint: '#3b9dff', cyan: '#54ccff', violet: '#9d7dff', amber: '#ffb238', track: 'rgba(139,166,156,.18)' };
// chart colours come from the live theme tokens (2026-11-01): read at draw time so a theme switch repaints correctly
const CH = new Proxy({}, { get: (_, k) => { const cs = getComputedStyle(document.documentElement); const v = { mint: '--mint', cyan: '--cyan', violet: '--violet', amber: '--amber', track: '--muted-soft' }[k]; return (v && cs.getPropertyValue(v).trim()) || { mint: '#3b9dff', cyan: '#54ccff', violet: '#9d7dff', amber: '#ffb238', track: 'rgba(139,166,156,.18)' }[k]; } });
function bars(el, xel, data) { // data: [{v,label,tip,alt}]
if (!el) return;
const max = Math.max(1, ...data.map(d => d.v));
@@ -249,7 +260,7 @@
off -= len;
}
out += '<text x="21" y="20.5" text-anchor="middle" fill="currentColor" font-size="6.5" font-weight="800" class="donut-center">' + esc(center.big) + '</text>'
+ '<text x="21" y="26.5" text-anchor="middle" fill="#8ba69c" font-size="3.1">' + esc(center.small) + '</text>';
+ '<text x="21" y="26.5" text-anchor="middle" style="fill:var(--muted)" font-size="3.1">' + esc(center.small) + '</text>';
el.innerHTML = out;
}
function legend(el, rows) {
@@ -467,7 +478,7 @@
const r = await (await fetch('/api/leaderboard?period=week')).json();
const esc = t => String(t == null ? '' : t).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
let h = r.prize ? '<p style="margin:0 0 8px"><b>Prize this week:</b> ' + esc(r.prize) + '</p>' : '';
h += r.top.length ? '<table style="width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums">' + r.top.slice(0, 5).map(x => '<tr><td style="padding:3px 0;width:26px;color:' + (x.rank === 1 ? '#ffd15c' : 'var(--muted)') + '">' + x.rank + '</td><td style="padding:3px 0"><b>' + esc(x.name) + '</b></td><td style="padding:3px 0;text-align:right">' + x.sales + ' sold · $' + x.usd + '</td></tr>').join('') + '</table>'
h += r.top.length ? '<table style="width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums">' + r.top.slice(0, 5).map(x => '<tr><td style="padding:3px 0;width:26px;color:' + (x.rank === 1 ? 'var(--gold)' : 'var(--muted)') + '">' + x.rank + '</td><td style="padding:3px 0"><b>' + esc(x.name) + '</b></td><td style="padding:3px 0;text-align:right">' + x.sales + ' sold · $' + x.usd + '</td></tr>').join('') + '</table>'
: '<p class="muted" style="margin:0">No packages sold yet this week. First sale takes the top spot.</p>';
h += r.me ? '<p style="margin:8px 0 0">You: <b>#' + r.me.rank + '</b> · ' + r.me.sales + ' sold · $' + r.me.usd + '</p>' : '<p class="muted" style="margin:8px 0 0">You: no sales yet this week. Sales are $25+ packages bought by people you sponsor.</p>';
h += '<p style="margin:6px 0 0"><a href="/leaderboard" target="_blank" rel="noopener" style="color:var(--mint)">Full leaderboard: week, month, all time →</a></p>';
@@ -498,8 +509,9 @@
payouts: ['Switch on payouts', 'One small transaction registers your wallet with the contract so commissions can reach it. Buying any package does this automatically.', 'Activate payouts', () => jumpTo('wallet', 'activateBtn')],
package: ['Your first package', 'From $10. The $25 package is the one that counts you as a qualifying buyer for your sponsor and unlocks adopting from the holding tank.', 'See packages', () => jumpTo('buy', null)]
}[cur.k];
$('gsNow').innerHTML = '<p><b>Next: ' + copy[0] + '</b>' + copy[1] + (cur.k === 'wallet' ? ' <a href="/wallets" target="_blank" rel="noopener" style="color:var(--mint)">Wallet guide</a>' : '') + '</p><button type="button" class="btn" id="gsGo">' + copy[2] + '</button>';
$('gsGo').addEventListener('click', copy[3]);
if (cur.k === 'payouts' && TANK_HOLD) { copy[0] = 'Matching you with a sponsor'; copy[1] = tankHoldText(TANK_HOLD); copy[2] = null; } // no activate button while held
$('gsNow').innerHTML = '<p><b>Next: ' + copy[0] + '</b>' + copy[1] + (cur.k === 'wallet' ? ' <a href="/wallets" target="_blank" rel="noopener" style="color:var(--mint)">Wallet guide</a>' : '') + '</p>' + (copy[2] ? '<button type="button" class="btn" id="gsGo">' + copy[2] + '</button>' : '');
if (copy[2]) $('gsGo').addEventListener('click', copy[3]);
card.hidden = false;
}
function jumpTo(pane, id) {
@@ -600,7 +612,8 @@
tn.hidden = !(tw && tw.count);
if (tw && tw.count) tn.innerHTML = '<b>' + tw.count + (tw.count === 1 ? ' person is' : ' people are') + ' waiting for a sponsor in the holding tank</b> \u00b7 '
+ tw.names.map(esc).join(', ') + (tw.count > tw.names.length ? ' and more' : '') + '. <a href="#line">Adopt them from My line</a>'
+ (tw.eligible ? '.' : ' (you need your own $25 package first).');
+ (tw.eligible ? '.' : ' (you need your own $25 package first).')
+ (tw.ready ? ' <b style="color:var(--ok)">' + tw.ready + ' of them ' + (tw.ready === 1 ? 'has' : 'have') + ' linked a wallet and ' + (tw.ready === 1 ? 'is' : 'are') + ' ready to switch on payouts.</b>' : '');
}
} catch (e) {}
if (d.username) { // wall link rides the username
@@ -697,6 +710,7 @@
else if (!render.waiting) { render.waiting = true; window.addEventListener('ls:session', () => { render.waiting = false; render(); }, { once: true }); }
}
if (!signedIn) return;
TANK_HOLD = (!me.memberId && me.tankHold) || null;
if ($('adminLink')) $('adminLink').hidden = !me.isAdmin; // admin portal link, only for ADMIN_EMAIL
// REQUIRED first step (Marty, 2026-09-12): no username, nothing else. The modal cannot be
// skipped or dismissed; it resolves only when a username is saved, then the area renders.
@@ -722,17 +736,20 @@
const who = [];
if (me.email) who.push(me.email);
// members kept asking whether the wallet was really connected (Marty, 2026-09-12): say it, with a green check
if (me.address) who.push('<span style="display:inline-flex;align-items:center;gap:8px"><span aria-hidden="true" style="display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:#22c55e;color:#04140a;font-weight:900;font-size:13px;line-height:1">&#10003;</span><b style="color:#22c55e">Wallet connected</b> <span class="mono">' + me.address.slice(0, 8) + '…' + me.address.slice(-6) + '</span></span>');
if (me.address) who.push('<span style="display:inline-flex;align-items:center;gap:8px"><span aria-hidden="true" style="display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--ok);color:var(--ok-ink);font-weight:900;font-size:13px;line-height:1">&#10003;</span><b style="color:var(--ok)">Wallet connected</b> <span class="mono">' + me.address.slice(0, 8) + '…' + me.address.slice(-6) + '</span></span>');
else who.push('<span style="display:inline-flex;align-items:center;gap:8px"><span aria-hidden="true" style="display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;border:2px solid var(--muted);color:var(--muted);font-weight:900;font-size:12px;line-height:1">!</span><b>No wallet connected yet</b> <span class="muted">(link one below)</span></span>');
if (me.memberId) who.push('on-chain <b>member #' + me.memberId + '</b>'
+ (me.onchainSponsorId ? ', sponsored by #' + me.onchainSponsorId : ''));
else if (me.sponsorId) who.push('invited by member #' + me.sponsorId);
else if (me.sponsorId && !TANK_HOLD) who.push('invited by member #' + me.sponsorId);
$('posLine').innerHTML = who.join('<br>');
$('creditLine').textContent = (me.credits || 0).toLocaleString();
loadPositions(me);
$('linkCard').hidden = !!me.address;
$('activateCard').hidden = !(me.address && !me.memberId);
{ let hn = $('tankHoldNote'); // held for an adopter: say so, and no activate button
if (!hn) { hn = document.createElement('p'); hn.id = 'tankHoldNote'; hn.className = 'small'; hn.style.cssText = 'margin:8px 0 0;color:var(--ok)'; $('activateBtn').insertAdjacentElement('beforebegin', hn); }
hn.hidden = !TANK_HOLD; hn.textContent = TANK_HOLD ? tankHoldText(TANK_HOLD) : ''; $('activateBtn').hidden = !!TANK_HOLD; }
$('activityArea').hidden = !me.memberId;
$('campGate').hidden = true; // earned credits fund campaigns for everyone
$('campaignCard').hidden = false;
@@ -815,12 +832,13 @@
if (!r.campaigns.length) { el.innerHTML = '<p class="muted small">No campaigns yet. Launch your first below.</p>'; return; }
const tbl = document.createElement('div');
tbl.className = 'tablewrap';
tbl.innerHTML = '<table class="camp-table"><thead><tr><th>Name</th><th>Type</th><th class="num">Views here</th><th class="num" title="Impressions delivered by Network Ad Space across the wider network (banner and text ads only)">Network views</th><th class="num">Clicks</th>'
const synN = Math.max(1, Math.floor(Number(r.rates && r.rates.synRateDivisor) || 1)); // network rate (Marty, 2026-10-27, 4:1)
tbl.innerHTML = '<table class="camp-table"><thead><tr><th>Name</th><th>Type</th><th class="num">Views here</th><th class="num" title="Impressions on the partner ad network plus views in other members\u2019 zones on their own sites (banner and text ads)' + (synN > 1 ? ', at 1/' + synN + ' of the rate here' : '') + '">Network views</th><th class="num">Clicks</th>'
+ '<th class="num">Spent</th><th class="num">Budget</th><th>Status</th><th></th></tr></thead><tbody>'
+ r.campaigns.map(c => '<tr><td data-l="Campaign"><b>' + c.name + '</b>' + hourBars(r.hours && r.hours[c.id]) + geoLine(r.geo && r.geo[c.id]) + '</td>'
+ '<td data-l="Type">' + c.type + (c.type === 'banner' && c.width ? ' <span class="muted small">' + c.width + '×' + c.height + '</span>' : '') + (c.dailyCap ? ' <span class="muted small" title="daily cap: ' + c.dailyCap + ' credits, ' + (c.daySpent || 0) + ' spent today">cap ' + c.dailyCap + '/day</span>' : '') + (c.geo ? ' <span class="muted small" title="shown only to viewers in these country tiers">tier ' + esc(c.geo.replace(/,/g, '+')) + '</span>' : '') + schedChips(c) + '</td>'
+ '<td class="num" data-l="Views here">' + c.imps.toLocaleString() + '</td>'
+ '<td class="num" data-l="Network views">' + (['banner', 'text'].includes(c.type) ? (c.impsNas || 0).toLocaleString() : '<span class="muted small" title="only banner and text ads syndicate to the network">n/a</span>') + '</td>'
+ '<td class="num" data-l="Network views">' + (['banner', 'text'].includes(c.type) ? ((c.impsNas || 0) + (c.impsSyn || 0)).toLocaleString() + (synN > 1 && (c.impsNas || c.impsSyn) ? ' <span class="muted small">at 1/' + synN + '</span>' : '') : '<span class="muted small" title="only banner and text ads syndicate to the network">n/a</span>') + '</td>'
+ '<td class="num" data-l="Clicks">' + c.clicks + (r.clickSources && r.clickSources[c.id] ? '<div class="muted small clk-src" title="where the clicks happened">' + Object.entries(r.clickSources[c.id]).sort((a, b) => b[1] - a[1]).map(([k, v]) => '<span>' + esc(k) + ' ' + v + '</span>').join('') + (c.impsNas ? ' · network: see Network views' : '') + '</div>' : '') + '</td>'
+ '<td class="num" data-l="Spent">' + c.spent + '</td><td class="num" data-l="Budget">' + c.budget + '</td>'
+ '<td data-l="Status">' + (c.status === 'out' ? '<span class="badge amber">budget spent</span>' : c.status === 'done' ? '<span class="muted">ended</span>' : c.scheduled ? '<span class="badge">scheduled</span>' : c.status) + '</td>'
@@ -1265,7 +1283,8 @@
$('tankMine').querySelectorAll('[data-tchat]').forEach(b => b.addEventListener('click', () => openConvo(b.dataset.tchat, b.dataset.tname)));
$('tankMine').querySelectorAll('[data-pif]').forEach(b => b.addEventListener('click', () => pif(b.dataset.pif, b.dataset.pname, b.dataset.paddr)));
if (!r.waiting.length) { el.innerHTML = '<p class="muted small">The tank is empty. Anyone who joins from the public site without a sponsor lands here.</p>'; return; }
el.innerHTML = r.waiting.map(w => '<div class="lin-row"><span class="nm">' + esc(w.name) + '</span>'
const readyBadge = w => w.ready ? ' <span class="badge" style="background:var(--ok-soft);border-color:var(--ok);color:var(--ok)" title="Wallet linked. If nobody adopts them, the site assigns them to the next eligible adopter when the time runs out.">Ready to activate \u00b7 ' + (w.holdUntil > Date.now() ? holdLeft(w.holdUntil - Date.now()) + ' left' : 'assigning now') + '</span>' : '';
el.innerHTML = r.waiting.slice().sort((a, b) => (b.ready ? 1 : 0) - (a.ready ? 1 : 0)).map(w => '<div class="lin-row"><span class="nm">' + esc(w.name) + readyBadge(w) + '</span>'
+ '<span class="em">joined ' + ago(w.joined) + '</span>'
+ '<span class="dt">last sign-in: <b>' + ago(w.lastSeen) + '</b></span>'
+ (r.eligible ? '<button class="btn small" type="button" data-adopt="' + esc(w.username || w.email) + '" data-aname="' + esc(w.name) + '">Adopt</button>' : '') + '</div>').join('');
@@ -1915,23 +1934,6 @@
// ── in-dashboard package buying ──
const PKG = { 1: 'Micro', 2: 'Activation', 3: 'Builder', 4: 'Growth', 5: 'Leader' };
// Card on-ramp: buy POL with a card via MoonPay, delivered to the buyer's own
// wallet. Signed + wallet-prefilled once MoonPay keys are set; generic page
// otherwise. The site never touches funds — MoonPay is merchant of record.
async function openMoonpay(pol) {
try {
let addr = '';
try { const me = await (await fetch('/api/me')).json(); addr = me.address || ''; } catch (e) {}
const q = '/api/moonpay-url?pol=' + encodeURIComponent(pol || '') + (addr ? '&address=' + encodeURIComponent(addr) : '');
const r = await (await fetch(q)).json();
if (r && r.url) {
window.open(r.url, '_blank', 'noopener');
IAP.status(r.signed
? 'MoonPay opened in a new tab with your wallet address pre-filled. Choose POL on Polygon, finish the purchase, then come back and buy your package.'
: 'MoonPay opened in a new tab. Choose POL on the Polygon network and paste your own wallet address as the destination, then come back.', 'ok');
}
} catch (e) { IAP.status('Could not open MoonPay: ' + ((e && e.message) || e), 'bad'); }
}
// ── linked positions (Qualified Start) ──
const short = a => a ? a.slice(0, 6) + '…' + a.slice(-4) : '';
let noPayoutAddrs = new Set(); // positions the site refuses to buy from (see siteConfig.noPayoutIds)
@@ -2072,15 +2074,12 @@
} catch (e) { IAP.status('Purchase failed: ' + ((e && e.message) || e), 'bad'); }
finally { b.disabled = false; }
}));
// brand new to crypto? buy POL with a card, sent straight to the wallet
const builder = products.find(p => p.priceCents === 5000) || products[products.length - 1];
const needPol = (builder && builder.costWei) ? Math.max(30, Math.ceil(Number(builder.costWei) / 1e18) + 3) : 30;
// brand new to crypto? point to the wallet guide (buy POL on any exchange or on-ramp, send it to your own wallet)
const cta = document.createElement('div');
cta.style.cssText = 'grid-column:1/-1;margin-top:10px;text-align:center';
cta.innerHTML = '<p class="muted small" style="margin:0 0 8px">New to crypto? Buy POL with a debit or credit card, Apple Pay, or Google Pay. It lands straight in your own wallet, and this site never touches your money.</p>'
+ '<button class="btn small sec" id="moonpayBtn" type="button">💳 Buy POL with a card</button> <a class="btn small sec" href="/wallets" target="_blank" rel="noopener">Wallet and MoonPay guide</a>';
cta.innerHTML = '<p class="muted small" style="margin:0 0 8px">New to crypto? Buy POL with a card on any major exchange or on-ramp, then send it to your own wallet on the Polygon network. This site never touches your money.</p>'
+ '<a class="btn small sec" href="/wallets" target="_blank" rel="noopener">Wallet help</a>';
wrap.appendChild(cta);
const mb = $('moonpayBtn'); if (mb) mb.addEventListener('click', () => openMoonpay(needPol));
} catch (e) {}
}
loadBuyTiles();
@@ -2288,10 +2287,12 @@
if (sp.sponsorBlocked === 'claim' && sp.claim) return (sp.claim.nobody ? 'Nobody above you on LinkSpin has a wallet yet, so there is no one for the contract to pay. ' : who + ' has not linked a wallet on LinkSpin yet. They have until ' + new Date(sp.claim.deadline).toLocaleString() + ' to do it, and we have told them. ') + 'You can use everything else meanwhile; your purchase waits so it pays the right person.';
if (sp.sponsorBlocked === 'notActivated') return who + ' has not switched on payouts yet, so this purchase would credit the company instead of them. Ask them to switch on payouts (Wallet tab, one free transaction), then try again.';
if (sp.sponsorBlocked === 'rpc') return 'Could not confirm your sponsor on the chain just now. Try again in a minute; nothing was charged.';
if (sp.sponsorBlocked === 'tankHold') return tankHoldText(sp.tankHold);
return 'Your sponsor link could not be matched to a member. Send a ticket from Help (/help) before buying so ' + who + ' gets credit.';
}
$('activateBtn').addEventListener('click', busy($('activateBtn'), async () => {
const me = await (await fetch('/api/sponsor?intent=buy')).json();
const me = await (await fetch('/api/sponsor?intent=activate')).json(); // the free activation: a tank member waits for an adopter (a buy never does)
if (me.sponsorBlocked === 'tankHold') { TANK_HOLD = me.tankHold || {}; IAP.status(tankHoldText(me.tankHold), 'ok'); await render(); return; }
if (me.sponsorBlocked) { IAP.status(sponsorHoldText(me), 'bad'); return; }
IAP.status('Confirm the free activation in your wallet…');
const r = await IAPWallet.activate(me.sponsorId || 0);
@@ -2448,7 +2449,7 @@
for (const p of SOCIALS) body.socials[p] = ($('soc-' + p) && $('soc-' + p).value.trim()) || '';
if (pfAvatar) body.avatarUrl = pfAvatar;
const r = await api('/api/my/profile-details', body);
IAP.status('Profile saved.', 'ok');
IAP.status(r.notice ? 'Profile saved. ' + r.notice : 'Profile saved.', 'ok');
if (r.account) fillProfileDetails(r.account);
}));
$('lbUploadBtn').addEventListener('click', () => $('lbFile').click());
@@ -2692,7 +2693,7 @@
(function () {
const btn = document.getElementById('promoApply'), inp = document.getElementById('promoCode'), msg = document.getElementById('promoMsg');
if (!btn || !inp) return;
const say = (t, ok) => { msg.hidden = false; msg.textContent = t; msg.style.color = ok ? 'var(--mint)' : '#ff8a8a'; };
const say = (t, ok) => { msg.hidden = false; msg.textContent = t; msg.style.color = ok ? 'var(--mint)' : 'var(--bad)'; };
const go = async () => {
const code = inp.value.trim(); if (!code) { say('Enter a promo code.', false); return; }
btn.disabled = true;
+42 -23
View File
@@ -4,18 +4,37 @@
InstantAdPay clone (sapphire glow, mint, circuit texture) is in here. */
:root{
--bg:#E9EEF5; --panel:#FFFFFF; --panel-2:#F3F6FB; --line:#CDD7E5; --line-strong:#AEBED4;
--ink:#0F1B2E; --ink-2:#324361; --muted:#66768F;
--accent:#1F6FEB; --accent-hi:#0B4BB3; --accent-dim:#7CB2FF; --accent-soft:#E1ECFC;
--sig:#FF6A1A; --sig-2:#D9530A; --sig-soft:#FFE9DC;
--ok:#0E8A5C; --ok-soft:#DDF4E8; --warn:#C2410C; --warn-soft:#FFE7D8; --bad:#B91C1C; --hi-row:#FFF3EA;
--chrome:#0B1424; --chrome-2:#101D33; --chrome-ink:#EEF3FA; --chrome-sub:#8CA2C4; --chrome-line:#1E2E4A; --inset:#0F1B2E;
--ink:#0F1B2E; --ink-2:#324361; --muted:#596984;
--accent:#1F6FEB; --accent-hi:#0B4BB3; --accent-ink:#FFFFFF; --accent-dim:#7CB2FF; --accent-soft:#E1ECFC;
--sig:#FF6A1A; --sig-2:#B8420A; --sig-soft:#FFE9DC; --sig-ink:#0F1B2E; --sig-line:rgba(255,106,26,.45);
--ok:#0B7A52; --ok-soft:#DDF4E8; --ok-ink:#FFFFFF; --ok-line:rgba(11,122,82,.4); --warn:#B23A0A; --warn-soft:#FFE7D8; --warn-line:rgba(178,58,10,.4);
--bad:#B91C1C; --bad-soft:#FBE0E0; --hi-row:#FFF3EA;
--chrome:#0B1424; --chrome-2:#101D33; --chrome-ink:#EEF3FA; --chrome-sub:#8CA2C4; --chrome-line:#1E2E4A; --chrome-hi:#8CC8FF; --chrome-warm:#FFB37D; --inset:#0F1B2E;
--on-ink:#FFFFFF; --field-bg:#FFFFFF; --btn-bg:linear-gradient(180deg,#FFFFFF,#F3F6FB); --btn-blue:linear-gradient(180deg,#2A74EC,#1559CC);
--panel-grad:linear-gradient(180deg,#FFFFFF,#F6F8FC); --panel-grad-hi:linear-gradient(180deg,#FFFFFF,#EEF4FE); --ph-a:#EEF2F9; --ph-b:#F5F7FC;
--hl:rgba(255,255,255,.9); --grid-dot:rgba(31,111,235,.20); --bg-glow:rgba(255,255,255,.6);
--sh:0 10px 24px -18px rgba(15,27,46,.45),0 1px 0 rgba(255,255,255,.9) inset;
--display:"Rajdhani","Segoe UI",system-ui,sans-serif; --body:"Manrope","Segoe UI",system-ui,sans-serif; --mono:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
color-scheme:light;
}
/* dark variant (2026-11-01), same values as cr.css so the public pages and the Control Room match */
:root[data-theme="dark"]{
--bg:#0B1424; --panel:#142338; --panel-2:#1B2D47; --line:#273B5C; --line-strong:#3A5580;
--ink:#EEF3FA; --ink-2:#C5D2E6; --muted:#97A9C6;
--accent:#4D8DF7; --accent-hi:#8CC0FF; --accent-ink:#0B1424; --accent-dim:#3D6FC4; --accent-soft:#1B325A;
--sig:#FF7A32; --sig-2:#FFA06A; --sig-soft:#3B2416; --sig-ink:#0B1424; --sig-line:rgba(255,122,50,.45);
--ok:#3FCF92; --ok-soft:#12352A; --ok-ink:#0B1424; --ok-line:rgba(63,207,146,.4); --warn:#F7A35E; --warn-soft:#3D2716; --warn-line:rgba(247,163,94,.4);
--bad:#FF8080; --bad-soft:#44202A; --hi-row:#2B2119;
--inset:#06101E;
--on-ink:#0B1424; --field-bg:#0F1B2E; --btn-bg:linear-gradient(180deg,#1E3150,#172743); --btn-blue:linear-gradient(180deg,#8CC0FF,#5A96F5);
--panel-grad:linear-gradient(180deg,#162741,#122035); --panel-grad-hi:linear-gradient(180deg,#172A47,#15284A); --ph-a:#182A45; --ph-b:#1B2E4B;
--hl:rgba(255,255,255,.05); --grid-dot:rgba(140,192,255,.10); --bg-glow:rgba(31,111,235,.12);
--sh:0 10px 24px -18px rgba(0,0,0,.85),0 1px 0 rgba(255,255,255,.04) inset;
color-scheme:dark;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:var(--bg);background-image:radial-gradient(circle,rgba(31,111,235,.20) 1px,transparent 1.3px),radial-gradient(120% 60% at 50% 0%,rgba(255,255,255,.6),transparent 60%);background-size:18px 18px,100% 100%;background-attachment:fixed;color:var(--ink);font:15px/1.5 var(--body)}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:var(--bg);background-image:radial-gradient(circle,var(--grid-dot) 1px,transparent 1.3px),radial-gradient(120% 60% at 50% 0%,var(--bg-glow),transparent 60%);background-size:18px 18px,100% 100%;background-attachment:fixed;color:var(--ink);font:15px/1.5 var(--body)}
a{color:var(--accent-hi)} a:hover{color:var(--accent)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--sig);outline-offset:2px}
@@ -34,7 +53,7 @@ button,input,select,textarea{font:inherit;color:inherit}
.brand .mark{position:relative;width:26px;height:26px;border-radius:50%;border:3px solid var(--accent);border-right-color:transparent;display:inline-block;flex:none}
.brand .mark::after{content:"";position:absolute;right:-5px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--sig);box-shadow:0 0 0 3px rgba(255,106,26,.25)}
.brand .word{font-family:var(--display);font-weight:700;font-size:22px;letter-spacing:.12em;text-transform:uppercase}
.brand .word b{color:#8CC8FF;font-weight:700}
.brand .word b{color:var(--chrome-hi);font-weight:700}
.nav{display:flex;gap:18px;flex-wrap:wrap;margin-left:12px}
.nav a{color:var(--chrome-sub);text-decoration:none;font-weight:700;font-size:13px;padding:6px 0}
.nav a:hover{color:var(--chrome-ink)}
@@ -44,38 +63,38 @@ button,input,select,textarea{font:inherit;color:inherit}
.foot a{color:var(--chrome-sub);text-decoration:none}
.foot a:hover{color:var(--chrome-ink)}
.foot .word{font-family:var(--display);font-weight:700;font-size:16px;letter-spacing:.12em;text-transform:uppercase;color:var(--chrome-ink)}
.foot .word b{color:#8CC8FF}
.foot .word b{color:var(--chrome-hi)}
/* controls */
.btn{font:700 13px var(--body);letter-spacing:.04em;padding:10px 16px;border-radius:7px;border:1px solid var(--line-strong);background:linear-gradient(180deg,#FFFFFF,#F3F6FB);color:var(--ink);display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;cursor:pointer;min-height:44px;box-shadow:0 1px 0 rgba(255,255,255,.9) inset,0 1px 2px rgba(15,27,46,.08);white-space:nowrap}
.btn{font:700 13px var(--body);letter-spacing:.04em;padding:10px 16px;border-radius:7px;border:1px solid var(--line-strong);background:var(--btn-bg);color:var(--ink);display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;cursor:pointer;min-height:44px;box-shadow:0 1px 0 var(--hl) inset,0 1px 2px rgba(15,27,46,.08);white-space:nowrap}
.btn:hover{border-color:var(--accent);color:var(--ink)}
.btn.pri{font-family:var(--display);font-size:16px;letter-spacing:.08em;text-transform:uppercase;background:linear-gradient(180deg,#FF7A32,var(--sig));border-color:var(--sig-2);color:#fff;box-shadow:0 8px 18px -10px rgba(255,106,26,.9),0 1px 0 rgba(255,255,255,.35) inset}
.btn.pri:hover{background:linear-gradient(180deg,#FF8A48,var(--sig));color:#fff}
.btn.blue{background:linear-gradient(180deg,#3A83F0,var(--accent));border-color:var(--accent-hi);color:#fff;box-shadow:0 8px 18px -10px rgba(31,111,235,.9),0 1px 0 rgba(255,255,255,.3) inset}
.btn.blue:hover{color:#fff}
.btn.pri{font-family:var(--display);font-size:16px;letter-spacing:.08em;text-transform:uppercase;background:linear-gradient(180deg,#FF7A32,var(--sig));border-color:var(--sig-2);color:var(--sig-ink);box-shadow:0 8px 18px -10px rgba(255,106,26,.9),0 1px 0 rgba(255,255,255,.35) inset}
.btn.pri:hover{background:linear-gradient(180deg,#FF8A48,var(--sig));color:var(--sig-ink)}
.btn.blue{background:var(--btn-blue);border-color:var(--accent-hi);color:var(--accent-ink);box-shadow:0 8px 18px -10px rgba(31,111,235,.9),0 1px 0 rgba(255,255,255,.3) inset}
.btn.blue:hover{color:var(--accent-ink)}
.btn.ghost{background:transparent;box-shadow:none;border-color:var(--chrome-line);color:var(--chrome-ink)}
.btn.ghost:hover{color:#fff;border-color:var(--chrome-sub)}
.btn[disabled]{opacity:.55;cursor:default}
.field{border:1px solid var(--line-strong);border-radius:6px;padding:10px 12px;background:#FFF;font:500 13px var(--mono);color:var(--ink);box-shadow:0 1px 2px rgba(15,27,46,.06) inset;width:100%;min-height:44px}
.field:focus{border-color:var(--sig);outline:none;box-shadow:0 0 0 3px rgba(255,106,26,.18)}
.field{border:1px solid var(--line-strong);border-radius:6px;padding:10px 12px;background:var(--field-bg);font:500 13px var(--mono);color:var(--ink);box-shadow:0 1px 2px rgba(15,27,46,.06) inset;width:100%;min-height:44px}
.field:focus{border-color:var(--sig);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--sig) 18%,transparent)}
.lbl{display:grid;gap:5px;font:700 10.5px var(--body);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.led{display:inline-flex;align-items:baseline;gap:10px;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;padding:10px 14px;color:var(--chrome-sub);font:500 12px var(--mono);max-width:100%;overflow-wrap:anywhere}
.led b{font-family:var(--display);font-size:22px;line-height:1;color:var(--sig);letter-spacing:.04em;font-weight:700}
.led .k{font-size:10px;letter-spacing:.1em;text-transform:uppercase}
.tag{display:inline-flex;align-items:center;gap:5px;font:700 10px var(--mono);letter-spacing:.06em;text-transform:uppercase;padding:3px 8px;border-radius:4px;border:1px solid var(--line-strong);color:var(--ink-2);background:var(--panel-2)}
.tag.ok{border-color:rgba(14,138,92,.4);color:var(--ok);background:var(--ok-soft)}
.tag.warn{border-color:rgba(194,65,12,.4);color:var(--warn);background:var(--warn-soft)}
.tag.ok{border-color:var(--ok-line);color:var(--ok);background:var(--ok-soft)}
.tag.warn{border-color:var(--warn-line);color:var(--warn);background:var(--warn-soft)}
.tag.t{border-color:var(--accent-soft);background:var(--accent-soft);color:var(--accent-hi)}
.note{font-size:12px;color:var(--muted);line-height:1.5}
.err{font-size:13px;color:var(--bad);font-weight:700}
/* surfaces */
.tile,.panel{position:relative;background:linear-gradient(180deg,#FFFFFF,#F6F8FC);border:1px solid var(--line);border-radius:8px;box-shadow:var(--sh);min-width:0}
.tile,.panel{position:relative;background:var(--panel-grad);border:1px solid var(--line);border-radius:8px;box-shadow:var(--sh);min-width:0}
.panel{background:var(--panel)}
.tile::before,.tile::after{content:"";position:absolute;width:11px;height:11px;border:1.5px solid var(--line-strong);pointer-events:none}
.tile::before{top:5px;left:5px;border-right:0;border-bottom:0}.tile::after{bottom:5px;right:5px;border-left:0;border-top:0}
.tile.hi{background:linear-gradient(180deg,#FFFFFF,#EEF4FE)}.tile.hi::before,.tile.hi::after{border-color:var(--sig)}
.ph{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(135deg,#EEF2F9 0 6px,#F5F7FC 6px 12px);border-radius:8px 8px 0 0}
.tile.hi{background:var(--panel-grad-hi)}.tile.hi::before,.tile.hi::after{border-color:var(--sig)}
.ph{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(135deg,var(--ph-a) 0 6px,var(--ph-b) 6px 12px);border-radius:8px 8px 0 0}
.ph h3,.ph h2{font-family:var(--display);font-weight:700;font-size:14px;letter-spacing:.1em;text-transform:uppercase;margin:0;display:flex;align-items:center;gap:8px}
.ph h3::before,.ph h2::before{content:"";width:8px;height:8px;background:var(--sig);transform:rotate(45deg);display:inline-block;flex:none}
.ph .meta{font:500 10.5px var(--mono);color:var(--muted);letter-spacing:.04em}
@@ -84,9 +103,9 @@ button,input,select,textarea{font:inherit;color:inherit}
.split{display:flex;height:14px;border-radius:4px;overflow:hidden;background:var(--line)}.split i{display:block;height:100%}
.ico{width:22px;height:22px;stroke:var(--accent);fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
.check{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--ink-2)}
.dot{width:7px;height:7px;border-radius:50%;background:var(--ok);display:inline-block;margin-right:8px;box-shadow:0 0 0 3px rgba(14,138,92,.22);animation:pulse 2.4s ease-in-out infinite}
.dot{width:7px;height:7px;border-radius:50%;background:var(--ok);display:inline-block;margin-right:8px;box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 22%,transparent);animation:pulse 2.4s ease-in-out infinite}
.dot.off{background:var(--muted);animation:none;box-shadow:none}
@keyframes pulse{0%,100%{box-shadow:0 0 0 3px rgba(14,138,92,.22)}50%{box-shadow:0 0 0 5px rgba(14,138,92,.08)}}
@keyframes pulse{0%,100%{box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 22%,transparent)}50%{box-shadow:0 0 0 5px color-mix(in srgb,var(--ok) 8%,transparent)}}
@media (prefers-reduced-motion:reduce){.dot{animation:none}}
/* page sections */
@@ -126,7 +145,7 @@ button,input,select,textarea{font:inherit;color:inherit}
.pkg.hi .price{color:var(--accent-hi)}
.pkg .cr{font-size:12px;color:var(--ink-2)}
.ledger{background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;color:var(--chrome-sub);font:500 11px var(--mono);padding:10px 12px;line-height:1.6;overflow-x:auto}
.ledger .b{color:#8CC8FF}.ledger .s{color:var(--sig)}
.ledger .b{color:var(--chrome-hi)}.ledger .s{color:var(--sig)}
.amts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:6px}
.amts div{display:flex;gap:10px;align-items:baseline}
.amts .n{font:700 22px var(--mono)}
+15
View File
@@ -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'; }
});
})();
+141 -108
View File
@@ -26,7 +26,7 @@ a:hover{text-decoration:underline}
.wrap{max-width:1100px;margin:0 auto;padding:0 22px}
h1,h2,h3{font-family:var(--disp);letter-spacing:-.015em}
/* ── nav: capsule pill ─────────────────────────────── */
nav{position:sticky;top:0;z-index:10;background:rgba(4,8,7,.7);backdrop-filter:blur(16px);
nav{position:sticky;top:0;z-index:10;background:var(--nav-bg);backdrop-filter:blur(16px);
-webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--line)}
nav .wrap{display:flex;align-items:center;gap:20px;min-height:66px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px}
.logo{font-family:var(--disp);font-weight:800;font-size:20px;color:var(--ink)}
@@ -36,13 +36,13 @@ nav .wrap{display:flex;align-items:center;gap:20px;min-height:66px;flex-wrap:wra
.byline b{color:var(--ink);font-weight:600}
.bo-side .byline{padding:4px 8px 10px;white-space:normal}
@media (max-width:560px){nav .byline{font-size:9.5px}}
nav .links{display:flex;gap:4px;flex:1;flex-wrap:wrap;background:rgba(16,28,24,.7);border:1px solid var(--line);
nav .links{display:flex;gap:4px;flex:1;flex-wrap:wrap;background:var(--pill-bg);border:1px solid var(--line);
border-radius:999px;padding:5px 8px;width:fit-content;flex:0 1 auto;margin:0 auto}
nav .links a{color:var(--muted);font-size:13.5px;font-weight:600;padding:7px 14px;border-radius:999px}
nav .links a:hover{color:var(--ink);text-decoration:none}
nav .links a.active{color:var(--mint);background:rgba(59,157,255,.1)}
nav .links a.active{color:var(--mint);background:var(--mint-soft)}
#navWallet{font-size:13px;margin-left:auto}
.rehearsal{background:rgba(59,157,255,.07);border-bottom:1px solid var(--line);color:var(--muted);
.rehearsal{background:var(--mint-faint);border-bottom:1px solid var(--line);color:var(--muted);
text-align:center;font-size:12.5px;padding:7px 12px}
.rehearsal b{color:var(--mint)}
/* ── buttons ───────────────────────────────────────── */
@@ -50,8 +50,8 @@ nav .links a.active{color:var(--mint);background:rgba(59,157,255,.1)}
padding:13px 26px;font-weight:700;font-size:15px;cursor:pointer;font-family:var(--disp);
box-shadow:0 4px 30px rgba(59,157,255,.35);transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.btn:hover{transform:translateY(-2px);background:var(--mint-hi);box-shadow:0 8px 44px rgba(59,157,255,.5);text-decoration:none}
.btn.sec{background:transparent;color:var(--mint);border:1px solid rgba(59,157,255,.6);box-shadow:none}
.btn.sec:hover{background:rgba(59,157,255,.08);box-shadow:0 4px 26px rgba(59,157,255,.2)}
.btn.sec{background:transparent;color:var(--mint);border:1px solid var(--mint-line-2);box-shadow:none}
.btn.sec:hover{background:var(--mint-faint);box-shadow:0 4px 26px rgba(59,157,255,.2)}
.btn.small{padding:8px 17px;font-size:13px}
.btn:disabled{opacity:.45;cursor:default;transform:none;box-shadow:none}
/* ── hero: centered, light-trail set-piece ─────────── */
@@ -68,7 +68,7 @@ nav .links a.active{color:var(--mint);background:rgba(59,157,255,.1)}
.arc2{fill:none;stroke:url(#arcGrad);stroke-width:3;stroke-linecap:round;filter:url(#arcGlow);opacity:.8}
/* falling glow streaks */
.streak{position:absolute;top:-140px;width:1.5px;height:110px;pointer-events:none;
background:linear-gradient(180deg,transparent,rgba(143,251,227,.8));border-radius:2px;opacity:0}
background:linear-gradient(180deg,transparent,var(--mint-hi));border-radius:2px;opacity:0}
@media(prefers-reduced-motion:no-preference){
.streak{animation:fall 7s linear infinite}
@keyframes fall{0%{transform:translateY(0);opacity:0}12%{opacity:.7}55%{opacity:.5}75%{transform:translateY(72vh);opacity:0}100%{transform:translateY(72vh);opacity:0}}
@@ -85,7 +85,7 @@ section{padding:64px 0 8px}
.cmp{width:100%;border-collapse:separate;border-spacing:0;font-size:15px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.cmp th,.cmp td{padding:13px 16px;border-bottom:1px solid var(--line);vertical-align:top;text-align:left}
.cmp th{font-family:var(--disp);font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.cmp th:last-child,.cmp td:last-child{color:var(--ink);background:rgba(59,157,255,.06)}
.cmp th:last-child,.cmp td:last-child{color:var(--ink);background:var(--mint-faint)}
.cmp td:first-child{font-weight:700;white-space:nowrap}
.cmp td:nth-child(2){color:var(--muted)}
.cmp tr:last-child td{border-bottom:0}
@@ -99,11 +99,11 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
/* icon-plate feature cards */
.plates{display:grid;gap:16px;grid-template-columns:1fr}
@media(min-width:760px){.plates{grid-template-columns:1fr 1fr 1fr}}
.platecard{background:linear-gradient(170deg,rgba(22,38,32,.6),rgba(10,18,15,.7));border:1px solid var(--line);
.platecard{background:var(--panel-grad);border:1px solid var(--line);
border-radius:var(--radius);padding:26px 22px;text-align:center;transition:border-color .2s ease,transform .2s ease}
.platecard:hover{border-color:var(--line-strong);transform:translateY(-4px)}
.plate{width:88px;height:88px;margin:0 auto 18px;border-radius:22px;display:grid;place-items:center;
background:linear-gradient(160deg,#12241e,#0a1411);border:1px solid var(--line-strong);
background:var(--panel-grad-deep);border:1px solid var(--line-strong);
box-shadow:0 0 34px rgba(59,157,255,.15),inset 0 1px 0 rgba(143,251,227,.15)}
.plate svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.platecard p{color:var(--muted);font-size:14px;margin:0}
@@ -115,15 +115,15 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.flankitem .plate svg{width:24px;height:24px}
.flankitem p{color:var(--muted);font-size:13.5px;margin:0}
/* ledger mockup frame */
.mockup{background:linear-gradient(170deg,#0e1c17,#080f0c);border:1px solid var(--line-strong);border-radius:20px;
.mockup{background:var(--panel-grad-deep);border:1px solid var(--line-strong);border-radius:20px;
box-shadow:0 30px 80px rgba(0,0,0,.6),0 0 60px rgba(59,157,255,.08);overflow:hidden}
.mockup .bar{display:flex;gap:6px;align-items:center;padding:11px 14px;border-bottom:1px solid var(--line)}
.mockup .bar i{width:9px;height:9px;border-radius:50%;background:#1e3a31;display:inline-block}
.mockup .bar .addr{font-family:var(--mono);font-size:11px;color:var(--muted);margin-left:8px;background:rgba(4,8,7,.6);
.mockup .bar i{width:9px;height:9px;border-radius:50%;background:var(--line-strong);display:inline-block}
.mockup .bar .addr{font-family:var(--mono);font-size:11px;color:var(--muted);margin-left:8px;background:var(--ground-soft);
border-radius:999px;padding:3px 12px}
.mockup .body{padding:6px 0}
.mockup .mrow{display:flex;justify-content:space-between;gap:10px;padding:9px 16px;font-family:var(--mono);
font-size:12px;border-bottom:1px solid rgba(84,150,128,.08)}
font-size:12px;border-bottom:1px solid var(--line)}
.mockup .mrow span:last-child{color:var(--mint)}
.mockup .mrow.dim span:last-child{color:var(--muted)}
/* 2-col story block: iso illustration + checklist */
@@ -133,24 +133,24 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.checks li{padding:7px 0 7px 30px;position:relative;color:var(--muted);font-size:14.5px}
.checks li::before{content:"✓";position:absolute;left:0;top:6px;width:20px;height:20px;border-radius:50%;
background:var(--mint-soft);color:var(--mint);font-size:12px;font-weight:700;display:grid;place-items:center;
border:1px solid rgba(59,157,255,.35)}
border:1px solid var(--mint-line)}
.chips{display:flex;gap:8px;margin:14px 0 4px;flex-wrap:wrap}
.chip-t{border:1px solid var(--line-strong);border-radius:999px;padding:5px 16px;font-size:12.5px;color:var(--muted);font-family:var(--disp);font-weight:600}
.chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)}
.iso{filter:drop-shadow(0 24px 50px rgba(0,0,0,.5))}
/* level cycler: light the paying generation */
#genViz .edge path{stroke:#22523f;transition:stroke .5s ease}
#genViz .node-o{fill:#122e25;stroke:#2f6b55;stroke-width:1.3;transition:stroke .5s ease,fill .5s ease}
#genViz .node-d{fill:#3f8f74;transition:fill .5s ease}
#genViz[data-lvl="1"] .e1 path,#genViz[data-lvl="2"] .e2 path,#genViz[data-lvl="3"] .e3 path{stroke:#3b9dff}
#genViz[data-lvl="1"] .g1 .node-o,#genViz[data-lvl="2"] .g2 .node-o,#genViz[data-lvl="3"] .g3 .node-o{stroke:#3b9dff;fill:#11362b}
#genViz[data-lvl="1"] .g1 .node-d,#genViz[data-lvl="2"] .g2 .node-d,#genViz[data-lvl="3"] .g3 .node-d{fill:#3b9dff}
#genViz .edge path{stroke:var(--line-strong);transition:stroke .5s ease}
#genViz .node-o{fill:var(--panel-solid);stroke:var(--line-strong);stroke-width:1.3;transition:stroke .5s ease,fill .5s ease}
#genViz .node-d{fill:var(--muted);transition:fill .5s ease}
#genViz[data-lvl="1"] .e1 path,#genViz[data-lvl="2"] .e2 path,#genViz[data-lvl="3"] .e3 path{stroke:var(--mint)}
#genViz[data-lvl="1"] .g1 .node-o,#genViz[data-lvl="2"] .g2 .node-o,#genViz[data-lvl="3"] .g3 .node-o{stroke:var(--mint);fill:var(--mint-soft-2)}
#genViz[data-lvl="1"] .g1 .node-d,#genViz[data-lvl="2"] .g2 .node-d,#genViz[data-lvl="3"] .g3 .node-d{fill:var(--mint)}
.chips button{cursor:pointer;background:transparent;font:inherit}
.chips button.chip-t{border:1px solid var(--line-strong);color:var(--muted)}
.chips button.chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)}
/* pricing tiles: mint discipline */
.tiles{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));align-items:stretch}
.tile{position:relative;background:linear-gradient(170deg,rgba(22,38,32,.55),rgba(10,18,15,.65));border:1px solid var(--line);
.tile{position:relative;background:var(--panel-grad);border:1px solid var(--line);
border-radius:var(--radius);padding:26px 18px;text-align:center;display:flex;flex-direction:column;gap:6px;
transition:transform .2s ease,border-color .2s ease}
.tile:hover{transform:translateY(-5px);border-color:var(--line-strong)}
@@ -159,7 +159,7 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.tile .cr{color:var(--mint);font-weight:700;font-size:14.5px}
.tile .bonus{font-size:12px;color:var(--mint-hi)}
.tile .pol{font-family:var(--mono);font-size:12px;color:var(--muted);flex:1}
.tile.hot{border:1px solid rgba(59,157,255,.65);box-shadow:0 0 44px rgba(59,157,255,.14)}
.tile.hot{border:1px solid var(--mint-line-2);box-shadow:0 0 44px rgba(59,157,255,.14)}
.tile.hot::before{content:"MOST POPULAR";position:absolute;top:-11px;left:50%;transform:translateX(-50%);
background:var(--mint);color:var(--mint-ink);font-family:var(--disp);font-size:10px;font-weight:800;
letter-spacing:.12em;border-radius:999px;padding:4px 14px}
@@ -167,14 +167,14 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.split{display:flex;gap:8px;margin:18px 0}
.split div{border-radius:12px;padding:16px 6px;text-align:center;font-size:13px;font-weight:700;font-family:var(--disp);
border:1px solid var(--line-strong);color:var(--mint)}
.split .s50{flex:5;background:rgba(59,157,255,.16);box-shadow:0 0 30px rgba(59,157,255,.12)}
.split .s20{flex:2;background:rgba(59,157,255,.09)}
.split .s10{flex:1;background:rgba(59,157,255,.05)}
.split .sa{flex:2;background:rgba(139,166,156,.08);color:var(--muted)}
.split .s50{flex:5;background:var(--mint-soft-2);box-shadow:0 0 30px rgba(59,157,255,.12)}
.split .s20{flex:2;background:var(--mint-soft)}
.split .s10{flex:1;background:var(--mint-faint)}
.split .sa{flex:2;background:var(--muted-soft);color:var(--muted)}
section[id]{scroll-margin-top:84px} /* anchored menu targets clear the sticky nav */
/* ticker */
.ticker{overflow:hidden;contain:layout paint;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
background:rgba(59,157,255,.04);white-space:nowrap;padding:10px 0;
background:var(--mint-faint);white-space:nowrap;padding:10px 0;
-webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)}
.ticker .inner{display:inline-block;font-family:var(--mono);font-size:12.5px;padding-left:100%;animation:tick 120s linear infinite}
@@ -202,32 +202,32 @@ tr:last-child td{border-bottom:0}
.feed .t-TierPaid{color:var(--mint)}
.feed .t-AdminPaid{color:var(--muted)}
.feed .tx a{color:var(--muted);font-size:12px}
.badge{display:inline-block;background:var(--mint-soft);color:var(--mint);border:1px solid rgba(59,157,255,.35);
.badge{display:inline-block;background:var(--mint-soft);color:var(--mint);border:1px solid var(--mint-line);
border-radius:999px;padding:3px 13px;font-size:12px;font-weight:700}
.spend-banner{background:linear-gradient(160deg,rgba(242,201,76,.14),rgba(242,201,76,.04));border-color:rgba(242,201,76,.55);text-align:center;padding:22px 20px}
.spend-banner .lbl{font-family:var(--disp);font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:#f2c94c}
.spend-banner .big{font-family:var(--disp);font-size:clamp(40px,6vw,64px);font-weight:800;color:#f2c94c;line-height:1.05;margin:6px 0 4px;font-variant-numeric:tabular-nums}
.spend-banner{background:linear-gradient(160deg,var(--gold-soft),var(--gold-faint));border-color:var(--gold-line);text-align:center;padding:22px 20px}
.spend-banner .lbl{font-family:var(--disp);font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:var(--gold-2)}
.spend-banner .big{font-family:var(--disp);font-size:clamp(40px,6vw,64px);font-weight:800;color:var(--gold-2);line-height:1.05;margin:6px 0 4px;font-variant-numeric:tabular-nums}
.spend-banner .big .unit{font-size:20px;font-weight:700;color:var(--ink)}
.spend-banner .sub{color:var(--ink);font-size:15px}
.spend-banner .rates{display:flex;gap:8px 18px;flex-wrap:wrap;justify-content:center;margin-top:12px;font-size:12.5px;color:var(--muted)}
.spend-banner .rates b{color:var(--ink)}
.boot-spin{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:60vh}
.boot-spin .ring{width:46px;height:46px;border-radius:50%;border:4px solid rgba(59,157,255,.18);border-top-color:var(--mint);animation:bootspin .9s linear infinite}
.boot-spin .ring{width:46px;height:46px;border-radius:50%;border:4px solid var(--mint-soft-2);border-top-color:var(--mint);animation:bootspin .9s linear infinite}
@keyframes bootspin{to{transform:rotate(360deg)}}
.bo-top{flex-wrap:wrap}
.ad-strip{flex:1 1 100%;font-size:13.5px;padding:8px 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ad-strip a{color:var(--ink)}
.ad-strip b{color:var(--mint)}
.ad-foot{text-align:center}
.pv{border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:0 0 16px;background:rgba(4,8,7,.35)}
.pv{border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:0 0 16px;background:var(--ground-soft)}
.pv-head b{display:block;font-size:18px;margin:4px 0 2px}
.done-big{display:flex;flex-direction:column;align-items:center;gap:6px;padding:26px 16px;text-align:center}
.done-big .tick{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font-size:48px;font-weight:800;color:var(--mint-ink);background:var(--mint);box-shadow:0 0 0 10px rgba(59,157,255,.15),0 10px 30px rgba(59,157,255,.35)}
.done-big b{font-family:var(--disp);font-size:22px;margin-top:8px}
.badge.amber{background:rgba(139,166,156,.1);border-color:rgba(139,166,156,.4);color:var(--muted)}
.badge.amber{background:var(--muted-soft);border-color:var(--line-strong);color:var(--muted)}
/* faq */
details{border:1px solid var(--line);border-radius:14px;margin:0 0 10px;background:var(--panel)}
details[open]{border-color:rgba(59,157,255,.45)}
details[open]{border-color:var(--mint-line)}
summary{cursor:pointer;padding:16px 20px;font-weight:700;font-family:var(--disp);font-size:15px;list-style:none}
summary::before{content:"+";color:var(--mint);font-weight:800;margin-right:12px}
details[open] summary::before{content:"−"}
@@ -235,16 +235,16 @@ details p{margin:0;padding:0 20px 18px 42px;color:var(--muted);font-size:14.5px}
/* closing cta card */
.closer{position:relative;display:grid;gap:26px;align-items:center;grid-template-columns:1fr;
padding:44px 36px;border-radius:24px;overflow:hidden;margin:80px 0 0;
background:linear-gradient(160deg,#0d1d17,#060c0a);border:1px solid var(--line-strong)}
background:var(--panel-grad-deep);border:1px solid var(--line-strong)}
@media(min-width:880px){.closer{grid-template-columns:1.2fr .8fr}}
.closer::before{content:"";position:absolute;width:460px;height:460px;right:-140px;top:-260px;border-radius:50%;
background:radial-gradient(circle,rgba(59,157,255,.2),transparent 65%);pointer-events:none}
background:radial-gradient(circle,var(--mint-soft-2),transparent 65%);pointer-events:none}
.closer h2{margin:0 0 12px}
/* footer + ghost wordmark */
footer{border-top:1px solid var(--line);margin-top:90px;padding:34px 0 0;color:var(--muted);font-size:13.5px;overflow:hidden}
.ghost{font-family:var(--disp);font-weight:800;font-size:clamp(64px,13vw,170px);line-height:.9;text-align:center;
margin:34px 0 -20px;letter-spacing:-.02em;user-select:none;
background:linear-gradient(180deg,rgba(59,157,255,.14),transparent 78%);
background:linear-gradient(180deg,var(--mint-soft-2),transparent 78%);
-webkit-background-clip:text;background-clip:text;color:transparent;white-space:nowrap}
/* misc */
#status{position:fixed;left:50%;transform:translateX(-50%);bottom:22px;background:var(--panel-solid);
@@ -252,7 +252,7 @@ footer{border-top:1px solid var(--line);margin-top:90px;padding:34px 0 0;color:v
box-shadow:0 12px 40px rgba(0,0,0,.55)}
#status.ok{border-color:var(--mint)}
#status.bad{border-color:var(--bad)}
input,select,textarea{background:rgba(4,8,7,.65);border:1px solid var(--line-strong);color:var(--ink);border-radius:11px;
input,select,textarea{background:var(--field-bg);border:1px solid var(--line-strong);color:var(--ink);border-radius:11px;
padding:11px 14px;font-size:14.5px;font-family:inherit}
input[type=range]{padding:0;border:0;background:transparent;accent-color:var(--mint);height:28px;vertical-align:middle}
input:focus,select:focus,textarea:focus{border-color:var(--mint)}
@@ -263,15 +263,15 @@ textarea{resize:vertical;font:inherit}
.bo-body{background:var(--ground)}
.bo{display:grid;grid-template-columns:236px 1fr;min-height:100vh}
.bo-side{position:sticky;top:0;height:100vh;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;display:flex;flex-direction:column;gap:22px;
padding:22px 16px;background:rgba(10,18,15,.92);border-right:1px solid var(--line)}
padding:22px 16px;background:var(--side-bg);border-right:1px solid var(--line)}
.bo-side .logo{font-size:19px;padding:0 8px}
.bo-menu{display:flex;flex-direction:column;gap:4px}
.bo-menu button{display:flex;align-items:center;gap:11px;background:transparent;border:0;color:var(--muted);
font:600 14px var(--disp);padding:11px 12px;border-radius:11px;cursor:pointer;text-align:left;
border-left:3px solid transparent}
.bo-menu button svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.bo-menu button:hover{color:var(--ink);background:rgba(59,157,255,.05)}
.bo-menu button.on{color:var(--mint);background:rgba(59,157,255,.09);border-left-color:var(--mint)}
.bo-menu button:hover{color:var(--ink);background:var(--mint-faint)}
.bo-menu button.on{color:var(--mint);background:var(--mint-soft);border-left-color:var(--mint)}
.bo-links{display:flex;flex-direction:column;gap:2px;padding:14px 12px;border-top:1px solid var(--line)}
.bo-cap{font-family:var(--mono);font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
.bo-links a{color:var(--muted);font-size:13.5px;padding:5px 0}
@@ -283,7 +283,7 @@ textarea{resize:vertical;font:inherit}
.bo-pagefoot a{color:var(--muted)}
.bo-pagefoot a:hover{color:var(--ink);text-decoration:none}
.bo-top{display:flex;align-items:center;gap:16px;padding:16px 26px;border-bottom:1px solid var(--line);
background:rgba(6,10,8,.75);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);position:sticky;top:0;z-index:5}
background:var(--nav-bg);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);position:sticky;top:0;z-index:5}
.bo-top h2{font-size:20px}
#boBurger{display:none;background:transparent;border:1px solid var(--line-strong);color:var(--ink);
border-radius:9px;font-size:17px;padding:5px 11px;cursor:pointer}
@@ -320,11 +320,11 @@ textarea{resize:vertical;font:inherit}
.feat-day .fd-occ{font-family:var(--mono);font-size:11px;color:var(--muted)}
.feat-day.open2 .fd-occ{color:var(--mint)}
/* ── featured rotation strip ── */
.feat-top{max-width:760px;margin:16px auto;border:1px solid rgba(255,177,56,.5)}
.feat-top{max-width:760px;margin:16px auto;border:1px solid var(--amber-line)}
.feat-strip{display:flex;justify-content:center;margin-top:10px}
.feat-strip a{max-width:728px;width:100%;display:flex;justify-content:space-between;gap:10px;padding:11px 14px;border-radius:10px;
background:var(--panel);border:1px solid #ffb238;color:var(--ink);text-decoration:none;font-weight:600}
.feat-strip a:hover{border-color:#ffd15c;box-shadow:0 0 0 1px rgba(255,177,56,.4)}
background:var(--panel);border:1px solid var(--amber);color:var(--ink);text-decoration:none;font-weight:600}
.feat-strip a:hover{border-color:var(--gold);box-shadow:0 0 0 1px var(--amber-line)}
.feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap}
.feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap}
/* ── achievement badges ── */
@@ -333,22 +333,22 @@ textarea{resize:vertical;font:inherit}
.badge-a .badge-img{width:150px;height:150px;border-radius:14px;object-fit:cover;border:1px solid var(--line-strong)}
.badge-a.locked .badge-img{filter:grayscale(.85) brightness(.5);opacity:.7}
.badge-a .medal{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;position:relative;
background:radial-gradient(circle at 50% 35%,rgba(59,157,255,.28),rgba(9,26,19,.9));
background:radial-gradient(circle at 50% 35%,var(--mint-soft-2),var(--panel-solid));
border:2px solid var(--mint);box-shadow:0 0 18px rgba(59,157,255,.3)}
.badge-a.locked .medal{background:rgba(139,166,156,.08);border-color:var(--line-strong);box-shadow:none;filter:grayscale(1);opacity:.5}
.badge-a.locked .medal{background:var(--muted-soft);border-color:var(--line-strong);box-shadow:none;filter:grayscale(1);opacity:.5}
.badge-a .medal svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.badge-a.locked .medal svg{stroke:var(--muted)}
.badge-a .bl{font-size:12px;font-weight:700;line-height:1.2}
.badge-a .bs{font-size:10.5px;color:var(--muted)}
.badge-a .share{font-size:11px;color:var(--mint);cursor:pointer;background:none;border:0;padding:0;text-decoration:underline}
/* ── "Your next move": milestone stepper card ── */
.next-card{position:relative;overflow:hidden;border-color:rgba(59,157,255,.28)}
.next-card{position:relative;overflow:hidden;border-color:var(--mint-line)}
.next-card::before{content:"";position:absolute;inset:0;pointer-events:none;background:
radial-gradient(420px 150px at 10% 0%,rgba(59,157,255,.12),transparent 70%),
radial-gradient(360px 130px at 90% 100%,rgba(157,125,255,.09),transparent 70%)}
radial-gradient(420px 150px at 10% 0%,var(--mint-soft),transparent 70%),
radial-gradient(360px 130px at 90% 100%,var(--violet-soft),transparent 70%)}
.nc-head{display:flex;gap:14px;align-items:flex-start;position:relative}
.nc-head .pl{flex:0 0 auto;width:44px;height:44px;border-radius:12px;display:grid;place-items:center;
background:rgba(59,157,255,.12);border:1px solid rgba(59,157,255,.35)}
background:var(--mint-soft);border:1px solid var(--mint-line)}
.nc-head .pl svg{width:20px;height:20px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nc-steps{display:flex;margin-top:20px;position:relative;flex-wrap:wrap;row-gap:14px}
.nc-step{flex:1;min-width:88px;display:flex;flex-direction:column;align-items:center;gap:7px;
@@ -369,31 +369,31 @@ textarea{resize:vertical;font:inherit}
.statx{display:flex;gap:14px;align-items:flex-start;background:var(--panel);border:1px solid var(--line);
border-radius:var(--radius);padding:18px;position:relative;overflow:hidden}
.statx .pl{flex:0 0 auto;width:46px;height:46px;border-radius:13px;display:grid;place-items:center;
background:rgba(59,157,255,.1);border:1px solid rgba(59,157,255,.3)}
background:var(--mint-soft);border:1px solid var(--mint-line)}
.statx .pl svg{width:22px;height:22px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.statx.c-cyan .pl{background:rgba(84,204,255,.1);border-color:rgba(84,204,255,.3)}
.statx.c-cyan .pl{background:var(--cyan-soft);border-color:var(--cyan-line)}
.statx.c-cyan .pl svg{stroke:var(--cyan)}
.statx.c-violet .pl{background:rgba(157,125,255,.12);border-color:rgba(157,125,255,.32)}
.statx.c-violet .pl{background:var(--violet-soft);border-color:var(--violet-line)}
.statx.c-violet .pl svg{stroke:var(--violet)}
.statx.c-amber .pl{background:rgba(255,178,56,.1);border-color:rgba(255,178,56,.3)}
.statx.c-amber .pl{background:var(--amber-soft);border-color:var(--amber-line)}
.statx.c-amber .pl svg{stroke:var(--amber)}
.statx .nv{font-family:var(--disp);font-size:26px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1}
.statx .lb{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-top:2px}
.chip{display:inline-block;margin-top:7px;font-size:11.5px;font-weight:700;border-radius:999px;padding:2px 10px;
background:rgba(59,157,255,.1);color:var(--mint)}
.chip.flat{background:rgba(139,166,156,.12);color:var(--muted)}
.chip.warm{background:rgba(255,178,56,.12);color:var(--amber)}
background:var(--mint-soft);color:var(--mint)}
.chip.flat{background:var(--muted-soft);color:var(--muted)}
.chip.warm{background:var(--amber-soft);color:var(--amber)}
.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.card-head .sub{font-size:12px;color:var(--muted)}
/* bar chart (divs, real data) */
.barchart{display:flex;align-items:flex-end;gap:6px;height:120px;margin-top:14px}
.barchart .bar{flex:1;min-width:6px;background:linear-gradient(180deg,var(--mint),rgba(59,157,255,.25));
.barchart .bar{flex:1;min-width:6px;background:linear-gradient(180deg,var(--mint),var(--mint-soft-2));
border-radius:5px 5px 2px 2px;position:relative;transition:height .5s ease}
.barchart .bar.alt{background:linear-gradient(180deg,var(--violet),rgba(157,125,255,.25))}
.barchart .bar.alt{background:linear-gradient(180deg,var(--violet),var(--violet-soft))}
.barchart .bar:hover::after{content:attr(data-v);position:absolute;bottom:calc(100% + 4px);left:50%;
transform:translateX(-50%);background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:7px;
padding:2px 8px;font-family:var(--mono);font-size:11px;white-space:nowrap;z-index:3}
.barchart .bar.empty{background:rgba(139,166,156,.15);height:4px!important}
.barchart .bar.empty{background:var(--muted-soft);height:4px!important}
.chart-x{display:flex;gap:6px;margin-top:6px}
.chart-x span{flex:1;text-align:center;font-family:var(--mono);font-size:10px;color:var(--muted);overflow:hidden;white-space:nowrap}
/* donut + ring (SVG) */
@@ -434,7 +434,7 @@ textarea{resize:vertical;font:inherit}
.bio-socials a svg{flex:0 0 auto}
.bio-socials a:hover{border-color:var(--mint)}
.bio-qr{flex:0 0 auto;background:var(--panel);border:1px solid var(--line-strong);border-radius:14px;padding:10px}
.bio-qr img{display:block;border-radius:8px;background:#eef7f3}
.bio-qr img{display:block;border-radius:8px;background:#fff} /* a QR code stays on white in both themes so it scans */
/* ── wall page ── */
.wall-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:16px;text-align:center}
.wall-card img{max-width:100%;border-radius:10px;border:1px solid var(--line-strong)}
@@ -461,9 +461,9 @@ textarea{resize:vertical;font:inherit}
.lin-row .dt{font-size:12px;color:var(--muted);text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.lin-row .chat-msg-btn{justify-self:end}
.lin-row .lin-act-btn{justify-self:end;white-space:nowrap}
.lin-act{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 10px 10px;margin:-1px 0 6px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.025);border-radius:0 0 10px 10px}
.lin-chip{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap} .lin-chip b{font-weight:600;color:var(--ink);margin-right:5px} .lin-chip.on{border-color:rgba(59,157,255,.45);color:var(--ink)} .lin-chip.warn{border-color:rgba(255,209,92,.5)}
.lin-verdict{margin-left:auto;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#ffd15c} .lin-verdict.on{color:var(--mint)}
.lin-act{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 10px 10px;margin:-1px 0 6px;border-bottom:1px solid var(--line);background:var(--ink-faint);border-radius:0 0 10px 10px}
.lin-chip{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap} .lin-chip b{font-weight:600;color:var(--ink);margin-right:5px} .lin-chip.on{border-color:var(--mint-line);color:var(--ink)} .lin-chip.warn{border-color:var(--gold-line)}
.lin-verdict{margin-left:auto;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gold)} .lin-verdict.on{color:var(--mint)}
@media (max-width:560px){.lin-chip{white-space:normal}.lin-act{padding:8px 4px 10px}}
@media (max-width:560px){.lin-row{grid-template-columns:1fr auto;gap:2px 10px}
.lin-row .em{grid-column:1/2}.lin-row .dt{grid-column:1/2;text-align:left}.lin-row .chat-msg-btn{grid-row:1/3;grid-column:2}
@@ -473,7 +473,7 @@ textarea{resize:vertical;font:inherit}
.ed-bar button{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;
padding:5px 11px;font-size:12.5px;cursor:pointer}
.ed-bar button:hover,.ed-bar button:focus-visible{border-color:var(--mint);outline:none}
.ed-body{background:rgba(4,8,7,.65);border:1px solid var(--line-strong);border-radius:11px;
.ed-body{background:var(--field-bg);border:1px solid var(--line-strong);border-radius:11px;
min-height:180px;padding:12px 14px;outline:none;overflow-wrap:anywhere}
.ed-body:focus{border-color:var(--mint)}
.ed-body:empty::before{content:attr(data-ph);color:var(--muted)}
@@ -493,11 +493,11 @@ textarea.ed-body{width:100%;min-height:180px;resize:vertical}
.subtab.on{color:var(--mint);border-bottom-color:var(--mint)}
.subtab .pill{position:static}
/* ── solo-ads inbox ── */
.bo-menu .pill{margin-left:auto;background:var(--amber);color:#1a1206;font-size:11px;font-weight:800;
.bo-menu .pill{margin-left:auto;background:var(--amber);color:var(--amber-ink);font-size:11px;font-weight:800;
border-radius:999px;padding:1px 8px;line-height:1.5}
.ib-row{display:flex;gap:10px;align-items:baseline;padding:11px 6px;border-bottom:1px solid var(--line);
cursor:pointer;flex-wrap:wrap}
.ib-row:hover{background:rgba(59,157,255,.05)}
.ib-row:hover{background:var(--mint-faint)}
.ib-row .sub{font-weight:700;flex:1;min-width:160px;overflow-wrap:anywhere}
.ib-row.unread .sub{color:var(--mint)}
.ib-row .from,.ib-row .when{font-size:12px;color:var(--muted);white-space:nowrap}
@@ -518,9 +518,9 @@ textarea.ed-body{width:100%;min-height:180px;resize:vertical}
#pane-earn .card h3::before,#pane-earnings .card h3::before{background:var(--violet)}
#pane-promo .card h3::before{background:var(--cyan)}
#pane-wallet .card h3::before,#pane-profile .card h3::before{background:var(--mint)}
.bo .card{background:linear-gradient(165deg,rgba(24,36,31,.6),rgba(13,19,17,.66))}
#pane-line .qualbar,#nextCard{border-left:3px solid rgba(59,157,255,.4)}
.promo-block{background:rgba(4,8,7,.55);border:1px solid var(--line);border-radius:12px;
.bo .card{background:var(--panel-grad)}
#pane-line .qualbar,#nextCard{border-left:3px solid var(--mint-line)}
.promo-block{background:var(--ground-soft);border:1px solid var(--line);border-radius:12px;
padding:14px 16px;margin:0 0 12px;font-size:13.5px;line-height:1.6;white-space:pre-wrap}
.promo-block .btn{margin-top:10px}
/* back-office polish: pane transitions, quick actions */
@@ -529,19 +529,19 @@ textarea.ed-body{width:100%;min-height:180px;resize:vertical}
@keyframes panein{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
}
.qa{display:flex;flex-direction:column;gap:8px}
.qa button{display:flex;align-items:center;gap:10px;background:rgba(59,157,255,.05);border:1px solid var(--line);
.qa button{display:flex;align-items:center;gap:10px;background:var(--mint-faint);border:1px solid var(--line);
color:var(--ink);font:600 14px var(--disp);padding:11px 14px;border-radius:11px;cursor:pointer;text-align:left;
transition:border-color .15s ease,background .15s ease}
.qa button:hover{border-color:var(--mint);background:rgba(59,157,255,.1)}
.qa button:hover{border-color:var(--mint);background:var(--mint-soft)}
/* member sub-navigation */
.subnav{display:flex;gap:6px;flex-wrap:wrap;background:rgba(16,28,24,.7);border:1px solid var(--line);
.subnav{display:flex;gap:6px;flex-wrap:wrap;background:var(--pill-bg);border:1px solid var(--line);
border-radius:999px;padding:6px 8px;width:fit-content;margin:0 0 22px}
.subnav button{background:transparent;border:0;color:var(--muted);font:600 13.5px var(--disp);
padding:8px 16px;border-radius:999px;cursor:pointer}
.subnav button:hover{color:var(--ink)}
.subnav button.on{color:var(--mint-ink);background:var(--mint)}
/* member dashboard: qualification progress + roster */
.qualbar{position:relative;height:12px;border-radius:999px;background:rgba(4,8,7,.7);border:1px solid var(--line-strong);
.qualbar{position:relative;height:12px;border-radius:999px;background:var(--ground-soft);border:1px solid var(--line-strong);
margin:26px 0 30px;max-width:520px}
.qualbar #qualFill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--mint),var(--mint-hi));
box-shadow:0 0 18px rgba(59,157,255,.4);width:0;transition:width .6s ease}
@@ -567,8 +567,8 @@ img{max-width:100%}
font-size:22px;cursor:pointer;line-height:1}
.ch-msgs{padding:14px;overflow-y:auto;max-height:340px;display:flex;flex-direction:column;gap:10px}
.ch-m{border-radius:12px;padding:9px 13px;font-size:13.5px;line-height:1.5;max-width:86%}
.ch-m.bot{background:rgba(59,157,255,.08);border:1px solid rgba(59,157,255,.2);align-self:flex-start}
.ch-m.me{background:rgba(130,148,196,.12);border:1px solid var(--line);align-self:flex-end}
.ch-m.bot{background:var(--mint-faint);border:1px solid var(--mint-line);align-self:flex-start}
.ch-m.me{background:var(--muted-soft);border:1px solid var(--line);align-self:flex-end}
.ch-m a{word-break:break-all}
.ch-input{display:flex;gap:8px;padding:11px;border-top:1px solid var(--line)}
.ch-input input{flex:1;min-width:0}
@@ -576,7 +576,7 @@ img{max-width:100%}
font-weight:700;cursor:pointer;font-family:var(--disp)}
@media(prefers-reduced-motion:no-preference){
.feed .row:first-child{animation:landed .9s ease}
@keyframes landed{from{background:rgba(59,157,255,.3)}to{background:var(--mint-soft)}}
@keyframes landed{from{background:var(--mint-soft-2)}to{background:var(--mint-soft)}}
}
/* ── Sponsor chat: FAB, slide-in drawer, threads, bubbles, presence ── */
@@ -630,12 +630,12 @@ img{max-width:100%}
.lt-nodes{display:flex;gap:8px;flex-wrap:wrap}
.lt-node{background:var(--panel);border:1px solid var(--line-strong);border-radius:10px;padding:6px 12px;font-size:13px;font-weight:600;white-space:nowrap}
.lt-node.deep{color:var(--muted)}
.lt-node.qualified{border-color:#ffb238;color:#ffd15c;box-shadow:0 0 0 1px rgba(255,177,56,.35)}
.lt-node.qualified{border-color:var(--amber);color:var(--gold);box-shadow:0 0 0 1px var(--amber-line)}
.lt-node.open{border-style:dashed;color:var(--muted);background:transparent}
.lt-node .lt-n{display:inline-block;font-style:normal;font-size:10px;line-height:16px;min-width:16px;text-align:center;border-radius:8px;background:rgba(255,177,56,.18);color:#ffd15c;margin-left:6px;padding:0 4px;font-variant-numeric:tabular-nums}
.lt-node .lt-n{display:inline-block;font-style:normal;font-size:10px;line-height:16px;min-width:16px;text-align:center;border-radius:8px;background:var(--amber-soft);color:var(--gold);margin-left:6px;padding:0 4px;font-variant-numeric:tabular-nums}
.sh-report{display:block;text-align:center;margin-top:10px;color:rgba(255,255,255,.45);font-size:12px}
.sh-report:hover{color:rgba(255,255,255,.8)}
.sh-report{display:block;text-align:center;margin-top:10px;color:var(--muted);font-size:12px}
.sh-report:hover{color:var(--ink)}
/* ── promo tools (2026-09-09) ── */
.promo-strip{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;padding:16px 20px}
@@ -666,7 +666,7 @@ img{max-width:100%}
.promo-bv{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px;padding:14px 16px;border:1px dashed var(--line-strong);border-radius:12px}
.promo-bv b{font-family:var(--disp)}
.obj-wrap{display:flex;flex-direction:column;gap:8px}
.obj{border:1px solid var(--line);border-radius:12px;background:rgba(4,8,7,.4)}
.obj{border:1px solid var(--line);border-radius:12px;background:var(--ground-soft)}
.obj summary{cursor:pointer;padding:12px 16px;font-family:var(--disp);font-weight:700;font-size:15px;list-style:none;display:flex;justify-content:space-between;gap:10px}
.obj summary::after{content:"+";color:var(--mint);font-weight:800}
.obj[open] summary::after{content:"–"}
@@ -688,12 +688,12 @@ img{max-width:100%}
.wo-slot img{max-width:100%;border-radius:8px}
/* getting-started stepper on the Overview (Jim could not find the wallet step, 2026-09-14) */
.gs{border-color:rgba(59,157,255,.45)}
.gs{border-color:var(--mint-line)}
.gs-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:4px 0 12px}
.gs-step{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px 12px;color:var(--muted);font-size:14px}
.gs-step .n{flex:0 0 26px;width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:700;border:1px solid var(--line);font-size:13px}
.gs-step.done{color:var(--ink)} .gs-step.done .n{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)}
.gs-step.now{color:var(--ink);border-color:var(--mint);background:rgba(59,157,255,.07)} .gs-step.now .n{border-color:var(--mint);color:var(--mint)}
.gs-step.now{color:var(--ink);border-color:var(--mint);background:var(--mint-faint)} .gs-step.now .n{border-color:var(--mint);color:var(--mint)}
.gs-now{display:flex;gap:14px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px}
.gs-now p{margin:0;flex:1;min-width:240px;max-width:60ch} .gs-now p b{display:block;font-family:var(--disp);font-size:16px;margin-bottom:2px}
@keyframes gsPulse{0%{box-shadow:0 0 0 0 rgba(59,157,255,.7)}70%{box-shadow:0 0 0 14px rgba(59,157,255,0)}100%{box-shadow:0 0 0 0 rgba(59,157,255,0)}}
@@ -702,16 +702,16 @@ img{max-width:100%}
/* promo toolkit tiers */
.tk-tiers{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.tk-tier{border:1px solid var(--line);border-radius:12px;padding:12px 14px;font-size:13.5px;color:var(--muted)}
.tk-tier.reached{border-color:rgba(59,157,255,.5);color:var(--ink)} .tk-tier.current{background:rgba(59,157,255,.07)}
.tk-tier.reached{border-color:var(--mint-line-2);color:var(--ink)} .tk-tier.current{background:var(--mint-faint)}
.tk-tier b{display:block;font-family:var(--disp);font-size:15px;color:var(--ink)} .tk-tier .need{font-size:12px;margin:2px 0 8px;color:var(--muted)}
.tk-tier ul{margin:0;padding-left:16px} .tk-tier li{margin:3px 0} .tk-tier li.soon{opacity:.65} .tk-tier li.soon::after{content:' (coming)';font-size:11px;color:var(--muted)}
.tk-tier .lock{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#ffd15c}
.tk-tier .lock{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gold)}
.tk-hist{border-top:1px solid var(--line);padding:8px 0;font-size:13px} .tk-hist .muted{font-size:12px}
.tk-sec{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)} .tk-grid{display:flex;gap:8px;flex-wrap:wrap}
.tk-vids{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px} .tk-vid{border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:13px} .tk-vid b{display:block;font-weight:600;margin-bottom:4px} .tk-vid .st{font-size:12px;color:var(--muted)}
.tk-bar{height:8px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden;margin:6px 0 4px} .tk-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#1fb894,#3b9dff);transition:width .6s ease;min-width:4px}
.tk-bar{height:8px;border-radius:99px;background:var(--ink-faint);overflow:hidden;margin:6px 0 4px} .tk-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--cyan),var(--mint));transition:width .6s ease;min-width:4px}
.tk-table{width:100%;border-collapse:collapse;font-size:13px} .tk-table th,.tk-table td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)} .tk-table th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)} .tk-table td.n{font-variant-numeric:tabular-nums;text-align:right} .tk-table th.n{text-align:right} .tk-table tr.best td{color:var(--mint)}
.tk-team{border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:6px 0;font-size:13px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between} .tk-team .who b{font-weight:600} .tk-team .who span{color:var(--muted);font-size:12px} .tk-team.stalled{border-color:rgba(255,209,92,.45)}
.tk-team{border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:6px 0;font-size:13px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between} .tk-team .who b{font-weight:600} .tk-team .who span{color:var(--muted);font-size:12px} .tk-team.stalled{border-color:var(--gold-line)}
.tk-nudge{width:100%;margin:8px 0 0;padding:8px 12px;border:1px dashed var(--line);border-radius:10px;font-size:13px}
/* click sources stack one per line so the Clicks column stays narrow (Marty, 2026-09-15) */
.clk-src span{display:block;white-space:nowrap} .camp-table td{white-space:normal} .camp-table td:first-child{max-width:260px}
@@ -733,13 +733,13 @@ img{max-width:100%}
/* Pipeline board (Marty, 2026-09-15): columns scroll sideways inside their own box, never the page */
.pipe-board{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity}
.pipe-col{flex:0 0 220px;scroll-snap-align:start;background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:12px;padding:10px;min-height:120px}
.pipe-col{flex:0 0 220px;scroll-snap-align:start;background:var(--ground-soft);border:1px solid var(--line);border-radius:12px;padding:10px;min-height:120px}
.pipe-col h4{margin:0 0 2px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--mint);display:flex;justify-content:space-between;gap:8px}
.pipe-col h4 span{color:var(--muted);font-variant-numeric:tabular-nums}
.pipe-col .hint{font-size:11.5px;color:var(--muted);margin:0 0 8px;line-height:1.35}
.pipe-card{background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin:0 0 8px;cursor:pointer;transition:border-color .15s}
.pipe-card{background:var(--ink-faint);border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin:0 0 8px;cursor:pointer;transition:border-color .15s}
.pipe-card:hover,.pipe-card:focus-visible{border-color:var(--mint);outline:none}
.pipe-card.on{border-color:var(--gold,#e6c15a)}
.pipe-card.on{border-color:var(--gold)}
.pipe-card .nm{font-weight:700;font-size:14px;display:flex;justify-content:space-between;gap:6px;align-items:baseline}
.pipe-card .nm small{font-weight:400;font-size:11px;color:var(--muted);white-space:nowrap}
.pipe-card .sub{font-size:12px;color:var(--muted);margin-top:3px;line-height:1.35}
@@ -761,27 +761,60 @@ img{max-width:100%}
--cyan:#6fd3ff; --violet:#a48cff; --amber:#ffcf5a; --bad:#ff8f8f;
--chrome:linear-gradient(180deg,#f4f9ff 0%,#bcd6f7 38%,#7fa9dc 52%,#dbe9fb 68%,#9cc0ec 100%);
--disp:"Rajdhani","Segoe UI",system-ui,sans-serif;
/* 2026-11-01 theme tokens: every surface, text, border and soft fill that used to be a literal (tools.css maps
them onto Control Room tokens inside /tools and /admin). Light values live in :root[data-theme="light"] below. */
--mint-deep:#1f7be0; --mint-pale:#bcd6f7;
--mint-faint:rgba(59,157,255,.06); --mint-soft-2:rgba(59,157,255,.16); --mint-line:rgba(59,157,255,.38); --mint-line-2:rgba(59,157,255,.6);
--gold:#ffd15c; --gold-2:#f2c94c; --gold-soft:rgba(242,201,76,.14); --gold-faint:rgba(242,201,76,.04); --gold-line:rgba(242,201,76,.5);
--amber-soft:rgba(255,207,90,.12); --amber-line:rgba(255,207,90,.4); --amber-ink:#1a1206;
--cyan-soft:rgba(111,211,255,.1); --cyan-line:rgba(111,211,255,.3); --violet-soft:rgba(164,140,255,.12); --violet-line:rgba(164,140,255,.32);
--muted-soft:rgba(143,166,200,.12); --ink-faint:rgba(255,255,255,.04);
--ground-soft:rgba(2,10,36,.5); --field-bg:rgba(2,10,36,.65); --nav-bg:rgba(2,10,36,.78); --side-bg:rgba(4,16,48,.92); --pill-bg:rgba(10,26,60,.7);
--panel-grad:linear-gradient(165deg,rgba(14,34,74,.6),rgba(6,18,46,.66)); --panel-grad-deep:linear-gradient(170deg,#0a1c44,#040d2a);
--glow:#0a2a6b; --sh-lg:0 0 0 1px rgba(59,157,255,.06),0 18px 50px rgba(1,6,24,.55);
color-scheme:dark;
}
body{background:radial-gradient(1200px 600px at 50% -10%,#0a2a6b 0%,rgba(10,42,107,0) 60%),var(--ground);font-family:"Manrope","Segoe UI",system-ui,sans-serif}
body{background:radial-gradient(1200px 600px at 50% -10%,var(--glow) 0%,transparent 60%),var(--ground);font-family:"Manrope","Segoe UI",system-ui,sans-serif}
body::before{opacity:1;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%233b9dff' stroke-opacity='.10' stroke-width='1.2'%3E%3Cpath d='M0 60h120l30 30h90v60l40 40h140'/%3E%3Cpath d='M60 420V300l40-40h80V180l40-40h200'/%3E%3Cpath d='M420 340H300l-30-30h-90V220'/%3E%3Cpath d='M0 200h60l20 20v80'/%3E%3C/g%3E%3Cg fill='%233b9dff' fill-opacity='.22'%3E%3Ccircle cx='120' cy='60' r='2.4'/%3E%3Ccircle cx='240' cy='150' r='2.4'/%3E%3Ccircle cx='420' cy='190' r='2.4'/%3E%3Ccircle cx='60' cy='300' r='2.4'/%3E%3Ccircle cx='300' cy='340' r='2.4'/%3E%3Ccircle cx='180' cy='180' r='2.4'/%3E%3Ccircle cx='80' cy='300' r='2.4'/%3E%3C/g%3E%3C/svg%3E")}
h1,h2,h3{font-family:var(--disp);letter-spacing:.005em;font-weight:700}
.hero h1{font-size:clamp(40px,6vw,70px);text-transform:uppercase;letter-spacing:.02em;line-height:1.02}
.hero h1 em{background:var(--chrome);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none}
.btn{background:linear-gradient(180deg,#8cc8ff 0%,#3b9dff 55%,#1f7be0 100%);color:#03122e;border:1px solid rgba(220,236,255,.55);box-shadow:0 6px 28px rgba(59,157,255,.35),inset 0 1px 0 rgba(255,255,255,.55);text-transform:uppercase;letter-spacing:.06em;font-size:14px}
.btn:hover{background:linear-gradient(180deg,#a6d6ff 0%,#4ea9ff 55%,#2a86ea 100%);box-shadow:0 10px 40px rgba(59,157,255,.5),inset 0 1px 0 rgba(255,255,255,.6)}
.btn.sec{background:rgba(59,157,255,.06);color:#bcd6f7;border:1px solid rgba(140,200,255,.45);box-shadow:none;text-transform:none;letter-spacing:0}
.btn.sec:hover{background:rgba(59,157,255,.14)}
.card,.promo-block,.stat{border-color:var(--line);box-shadow:0 0 0 1px rgba(59,157,255,.06),0 18px 50px rgba(1,6,24,.55)}
.btn{background:linear-gradient(180deg,var(--mint-hi) 0%,var(--mint) 55%,var(--mint-deep) 100%);color:var(--mint-ink);border:1px solid var(--mint-line-2);box-shadow:0 6px 28px rgba(59,157,255,.35),inset 0 1px 0 rgba(255,255,255,.55);text-transform:uppercase;letter-spacing:.06em;font-size:14px}
.btn:hover{background:linear-gradient(180deg,var(--mint-hi) 0%,var(--mint) 40%,var(--mint-deep) 100%);filter:brightness(1.07);box-shadow:0 10px 40px rgba(59,157,255,.5),inset 0 1px 0 rgba(255,255,255,.6)}
.btn.sec{background:var(--mint-faint);color:var(--mint-pale);border:1px solid var(--mint-line);box-shadow:none;text-transform:none;letter-spacing:0}
.btn.sec:hover{background:var(--mint-soft-2);filter:none}
.card,.promo-block,.stat{border-color:var(--line);box-shadow:var(--sh-lg)}
.card h3,.card-head h3{font-family:var(--disp);font-size:20px;letter-spacing:.02em;text-transform:uppercase}
.stat .n{background:var(--chrome);-webkit-background-clip:text;background-clip:text;color:transparent;font-family:var(--disp);font-size:34px}
nav{background:rgba(2,10,36,.78);border-bottom:1px solid rgba(88,150,255,.2)}
nav .links a.active{color:#eaf2ff;background:rgba(59,157,255,.16);box-shadow:inset 0 0 0 1px rgba(140,200,255,.35)}
.wordmark{font-family:var(--disp);font-weight:700;font-size:24px;letter-spacing:.06em;text-transform:uppercase;color:#eaf2ff;display:inline-flex;align-items:center;gap:8px;line-height:1}
nav{background:var(--nav-bg);border-bottom:1px solid var(--line)}
nav .links a.active{color:var(--ink);background:var(--mint-soft-2);box-shadow:inset 0 0 0 1px var(--mint-line)}
.wordmark{font-family:var(--disp);font-weight:700;font-size:24px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink);display:inline-flex;align-items:center;gap:8px;line-height:1}
.wordmark b{background:var(--chrome);-webkit-background-clip:text;background-clip:text;color:transparent;font-weight:700}
.wordmark svg{width:26px;height:26px;flex:none}
.rehearsal{background:rgba(255,207,90,.08);border-bottom:1px solid rgba(255,207,90,.25);color:#cbb677}
.rehearsal b{color:#ffcf5a}
.rehearsal{background:var(--amber-soft);border-bottom:1px solid var(--amber-line);color:var(--amber)}
.rehearsal b{color:var(--amber)}
.bo-side,.bo-menu button.on{border-color:var(--line)}
.bo-menu button.on{background:rgba(59,157,255,.14);color:#eaf2ff}
.chip-t.on{background:linear-gradient(180deg,#8cc8ff,#3b9dff);color:#03122e;border-color:transparent}
.pill{background:linear-gradient(180deg,#8cc8ff,#3b9dff);color:#03122e}
.bo-menu button.on{background:var(--mint-soft-2);color:var(--ink)}
.chip-t.on{background:linear-gradient(180deg,var(--mint-hi),var(--mint));color:var(--mint-ink);border-color:transparent}
.pill{background:linear-gradient(180deg,var(--mint-hi),var(--mint));color:var(--mint-ink)}
/* ── Light theme for the sapphire pages (2026-11-01): light ground, white panels, dark ink, the same blue family
darkened so it reads as text on white; the chrome headline gradient turns blue steel so it still shows. ── */
:root[data-theme="light"]{
--ground:#E9EEF5; --ground2:#F3F6FB; --panel:#FFFFFF; --panel-solid:#FFFFFF;
--line:#CDD7E5; --line-strong:#AEBED4; --ink:#0F1B2E; --muted:#596984;
--mint:#175FD8; --mint-hi:#0B4BB3; --mint-deep:#0A3F96; --mint-ink:#FFFFFF; --mint-pale:#0B4BB3;
--mint-faint:#EEF4FE; --mint-soft:#E1ECFC; --mint-soft-2:#CFE0FB; --mint-line:#A9C6F2; --mint-line-2:#5F93E6;
--cyan:#0A6F8C; --violet:#5B3FD6; --amber:#8F5400; --bad:#B91C1C;
--gold:#7A5200; --gold-2:#8A6400; --gold-soft:#FFF4D1; --gold-faint:#FFFBEB; --gold-line:#E6C25E;
--amber-soft:#FFF1D6; --amber-line:#E8C27A; --amber-ink:#FFFFFF;
--cyan-soft:#DDF1F8; --cyan-line:#9FD3E6; --violet-soft:#EEE9FF; --violet-line:#C4B5FF;
--muted-soft:rgba(94,110,136,.12); --ink-faint:rgba(15,27,46,.05);
--ground-soft:#F3F6FB; --field-bg:#FFFFFF; --nav-bg:rgba(243,246,251,.88); --side-bg:rgba(243,246,251,.97); --pill-bg:rgba(255,255,255,.85);
--panel-grad:linear-gradient(180deg,#FFFFFF,#F6F8FC); --panel-grad-deep:linear-gradient(180deg,#F3F6FB,#E3EAF4);
--glow:#E3EDFB; --sh-lg:0 0 0 1px rgba(15,27,46,.03),0 14px 34px -20px rgba(15,27,46,.35);
--chrome:linear-gradient(180deg,#0B4BB3 0%,#1F6FEB 40%,#5A97F0 52%,#1F6FEB 66%,#0B4BB3 100%);
color-scheme:light;
}
:root[data-theme="light"] body::before{opacity:.6}
:root[data-theme="light"] .ghost{background:linear-gradient(180deg,rgba(23,95,216,.22),transparent 78%);-webkit-background-clip:text;background-clip:text}
:root[data-theme="light"] .mockup,:root[data-theme="light"] .modal-card,:root[data-theme="light"] #status,:root[data-theme="light"] #iapChatPanel,:root[data-theme="light"] .chat-drawer{box-shadow:0 18px 50px -20px rgba(15,27,46,.35)}
+12 -5
View File
@@ -5,11 +5,15 @@
(function () {
const $ = id => document.getElementById(id); const esc = CR.esc, fmt = CR.fmt, api = CR.api, toast = CR.toast, dialog = CR.dialog;
let S = [], CAT = [], ROT = [], SEL = null, DET = null, FILTER = '', KEYS = [], EVENTS = ['join', 'lead', 'wallet', 'purchase', 'external'], LIMITS = {}, URL_ROT = null, PE = [];
CR.mount({ active: 'sources', title: 'Traffic sources', sub: 'loading', actions: '<button class="btn pri" type="button" id="newBtn">+ New source</button>' });
CR.mount({ active: 'sources', title: 'Traffic sources', sub: 'loading', actions: '<a class="btn sm" href="/traffic-guide" title="Which traffic works for which kind of offer">Traffic guide</a> <button class="btn pri" type="button" id="newBtn">+ New source</button>' });
// traffic guide (2026-10-28): formats each network sells, adult-heavy / strict-policy flags, what it suits best
const TG = window.TRAFFIC_GUIDE || null;
const gTags = key => { const n = TG && TG.NETWORKS[key]; if (!n) return ''; return n.f.map(f => '<span class="tag plain">' + esc(TG.fmtName(f)) + '</span>').join('') + (n.adult === 'adult' ? '<span class="tag warn">adult sites</span>' : n.adult === 'mixed' ? '<span class="tag dim" title="Big adult inventory; target its mainstream sites">adult-heavy</span>' : '') + (n.strict ? '<span class="tag warn" title="Strict ad policy: crypto, income claims and MLM are restricted or need approval">strict policy</span>' : ''); };
const gText = key => { const n = TG && TG.NETWORKS[key]; return n ? n.f.map(f => (TG.FORMATS[f] || {}).name || f).join(' ') : ''; };
const ago = ts => { if (!ts) return 'never'; const s = Math.max(0, Math.round((Date.now() - ts) / 1000)); return s < 60 ? 'just now' : s < 3600 ? Math.round(s / 60) + ' min ago' : s < 86400 ? Math.round(s / 3600) + ' h ago' : Math.round(s / 86400) + ' d ago'; };
const netOf = s => CAT.find(c => c.key === s.template) || null;
const netName = s => { const n = netOf(s); return n ? n.name : (s.template === 'custom' ? 'Custom' : s.template); };
const EV_LABEL = { join: 'Join', lead: 'Lead', wallet: 'Wallet', purchase: 'Purchase', external: 'Partner-reported' };
const EV_LABEL = { join: 'Join', lead: 'Lead', wallet: 'Wallet', purchase: 'Purchase', external: 'Partner-reported', goal: 'Any goal (pixel)' };
async function load(keep) {
let r; try { r = await CR.get('/api/my/sources'); } catch (e) { CR.sub('could not load'); return; }
@@ -43,6 +47,9 @@
$('dOn').innerHTML = s.enabled ? '<span class="ok"><span class="dot"></span>ON</span>' : '<span class="warn"><span class="dot"></span>OFF' + (s.fails >= 10 ? ' (postback failed 10 times)' : '') + '</span>';
$('togBtn').textContent = s.enabled ? 'Disable' : 'Enable';
$('tiles').innerHTML = [CR.tile({ k: 'Clicks, 30 d', v: fmt(s.hits30 || 0), hi: true }), CR.tile({ k: 'Unique, 30 d', v: fmt(s.unique30 || 0) }), CR.tile({ k: 'Conversions, 30 d', v: fmt(s.conv30 || 0) }), CR.tile({ k: 'Postbacks sent', v: fmt(s.sent || 0), note: s.lastAt ? 'last ' + ago(s.lastAt) + ' · ' + s.lastStatus : 'none yet' }), CR.tile({ k: 'Links using it', v: fmt(s.links || 0) })].join('');
const gb = TG && TG.NETWORKS[s.template], bf = gb ? TG.bestFor(s.template) : [];
$('dGuide').hidden = !gb;
if (gb) $('dGuide').innerHTML = (gb.f.length ? '<span>Sells</span>' + gTags(s.template) : gTags(s.template)) + (bf.length ? '<span>· Best for: <b>' + esc(bf.join(', ')) + '</b></span>' : (gb.note ? '<span>' + esc(gb.note) + '</span>' : '')) + '<span class="grow"></span><a href="/traffic-guide">Which traffic for which offer &rarr;</a>';
renderUrl(s); renderPb(s, null); renderSettings(s);
if (!quiet) window.scrollTo({ top: 0 });
try { DET = await CR.get('/api/my/sources/' + id); } catch (e) { DET = null; }
@@ -102,14 +109,14 @@
async function newSource() {
if (!CAT.length) { try { CAT = (await CR.get('/api/sources/catalog')).catalog || []; } catch (e) {} }
let chosen = null;
const row = c => '<div class="cat" data-key="' + esc(c.key) + '" role="button" tabindex="0"><div><b>' + esc(c.name) + '</b><span class="site">' + esc(c.site || '') + (c.costModel ? ' · ' + esc(c.costModel) : '') + '</span></div><div class="tags">' + (c.hasClickId ? '' : '<span class="tag warn" title="This network has no click id macro and no postback. The source still tags your campaign URL and shows in Reports.">no click id</span>') + (c.hasPostback ? '<span class="tag ok">postback</span>' : (c.hasClickId ? '<span class="tag dim">no postback</span>' : '')) + (c.verified ? '' : '<span class="tag dim" title="Macros copied from public docs, not yet checked against a live account">unverified</span>') + '</div></div>';
const p1 = dialog({ title: 'New source', text: 'Pick the network you buy traffic on. Its macros and postback come prefilled; you can change anything later under Settings.',
const row = c => '<div class="cat" data-key="' + esc(c.key) + '" role="button" tabindex="0"><div><b>' + esc(c.name) + '</b><span class="site">' + esc(c.site || '') + (c.costModel ? ' · ' + esc(c.costModel) : '') + '</span>' + (gTags(c.key) ? '<div class="fm">' + gTags(c.key) + '</div>' : '') + '</div><div class="tags">' + (c.hasClickId ? '' : '<span class="tag warn" title="This network has no click id macro and no postback. The source still tags your campaign URL and shows in Reports.">no click id</span>') + (c.hasPostback ? '<span class="tag ok">postback</span>' : (c.hasClickId ? '<span class="tag dim">no postback</span>' : '')) + (c.verified ? '' : '<span class="tag dim" title="Macros copied from public docs, not yet checked against a live account">unverified</span>') + '</div></div>';
const p1 = dialog({ title: 'New source', text: 'Pick the network you buy traffic on. Its macros and postback come prefilled; you can change anything later under Settings. Search by name or by format (pop, push, native...). Not sure which fits your offer? See the Traffic guide.',
html: '<input class="field catf" id="catFilter" type="search" placeholder="Search ' + CAT.length + ' networks by name or site" aria-label="Search networks"><div class="catlist" id="catList">' + CAT.map(row).join('') + '</div>', ok: 'Custom (define your own)', no: 'Cancel' });
const host = $('crModalHost');
const wire = () => host.querySelectorAll('.cat').forEach(el => { const go = () => { chosen = el.dataset.key; host.querySelector('#dlgOk').click(); }; el.addEventListener('click', go); el.addEventListener('keydown', e => { if (e.key === 'Enter') { e.preventDefault(); go(); } }); });
wire();
const flt = host.querySelector('#catFilter'); flt.focus();
flt.addEventListener('input', () => { const q = flt.value.trim().toLowerCase(); const list = CAT.filter(c => !q || c.name.toLowerCase().includes(q) || (c.site || '').toLowerCase().includes(q) || c.key.includes(q)); host.querySelector('#catList').innerHTML = list.length ? list.map(row).join('') : '<div class="cat"><span class="muted">No network by that name. Use Custom and paste its macros yourself.</span></div>'; wire(); });
flt.addEventListener('input', () => { const q = flt.value.trim().toLowerCase(); const list = CAT.filter(c => !q || c.name.toLowerCase().includes(q) || (c.site || '').toLowerCase().includes(q) || c.key.includes(q) || gText(c.key).toLowerCase().includes(q)); host.querySelector('#catList').innerHTML = list.length ? list.map(row).join('') : '<div class="cat"><span class="muted">No network by that name. Use Custom and paste its macros yourself.</span></div>'; wire(); });
flt.addEventListener('keydown', e => { if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); const first = host.querySelector('.cat[data-key]'); if (first) first.click(); } });
const ok = await p1; if (!ok) return;
const tpl = chosen ? CAT.find(c => c.key === chosen) : null;
+40 -24
View File
@@ -1,7 +1,12 @@
/* /tools: the legacy member panes inside the Control Room. site.css sits in the "legacy" layer under cr.css, so the
shared classes (.btn .chip .chips .muted .mono .tile) already take the Control Room look; this file restyles the
pane internals that only site.css knows about, to the INSTRUMENT light scheme. */
:root{--mint:var(--accent-hi);--mint-ink:#fff;--mint-hi:var(--accent);--mint-soft:var(--accent-soft);--cyan:var(--ok);--violet:#6D4AFF;--amber:var(--warn);--gold:var(--sig);--disp:var(--display);--radius:8px;--ground:var(--bg);--ground2:var(--panel-2);--panel-solid:var(--panel);--ink:#0F1B2E}
/* every site.css token maps onto a Control Room token here, so both themes flow through (2026-11-01) */
:root{--mint:var(--accent-hi);--mint-ink:var(--accent-ink);--mint-hi:var(--accent);--mint-deep:var(--accent-hi);--mint-pale:var(--accent-hi);--mint-soft:var(--accent-soft);--mint-faint:var(--accent-soft);--mint-soft-2:var(--accent-soft);--mint-line:var(--accent-dim);--mint-line-2:var(--accent);
--cyan:var(--ok);--cyan-soft:var(--ok-soft);--cyan-line:var(--ok-line);--amber:var(--warn);--amber-soft:var(--warn-soft);--amber-line:var(--warn-line);--amber-ink:var(--accent-ink);
--gold:var(--sig);--gold-2:var(--sig-2);--gold-soft:var(--sig-soft);--gold-faint:var(--sig-soft);--gold-line:var(--sig-line);--muted-soft:var(--panel-2);--ink-faint:var(--row-hover);
--ground:var(--bg);--ground2:var(--panel-2);--ground-soft:var(--panel-2);--panel-solid:var(--panel);--nav-bg:var(--panel);--side-bg:var(--panel);--pill-bg:var(--panel-2);--panel-grad-deep:var(--panel-grad);--glow:transparent;
--disp:var(--display);--radius:8px}
#page{color:var(--ink)}
#memberArea.bo{display:block;min-height:0}
.bo-main{display:block}
@@ -12,7 +17,7 @@
.tabs.bo-menu button.on{background:var(--panel);border-color:var(--accent);color:var(--accent-hi);box-shadow:0 1px 2px rgba(15,27,46,.08)}
.tabs.bo-menu button svg{display:none}
.tools-right{margin-left:auto;display:flex;gap:8px;align-items:center}
.chat-badge{display:inline-grid;place-items:center;min-width:16px;height:16px;border-radius:8px;background:var(--sig);color:#fff;font:700 10px var(--mono);padding:0 4px}
.chat-badge{display:inline-grid;place-items:center;min-width:16px;height:16px;border-radius:8px;background:var(--sig);color:var(--sig-ink);font:700 10px var(--mono);padding:0 4px}
.ad-strip{padding:8px 24px 0}
.card{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:14px 16px;margin:0 0 14px;box-shadow:var(--sh);color:var(--ink)}
.card h3,.card-head h3{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;margin:0 0 8px;color:var(--ink)}
@@ -20,20 +25,20 @@
.card-head .sub{font-family:var(--mono);font-size:10.5px;color:var(--muted);letter-spacing:.04em}
.card p{color:var(--ink-2)} .card .muted{color:var(--muted)}
.small{font-size:12.5px} .eyebrow{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
#page input:not([type=checkbox]):not([type=radio]):not([type=file]),#page select,#page textarea{background:#fff;border:1px solid var(--line-strong);border-radius:6px;padding:7px 10px;color:var(--ink);font:inherit;box-shadow:0 1px 2px rgba(15,27,46,.06) inset}
#page input:focus,#page select:focus,#page textarea:focus{border-color:var(--sig);outline:none;box-shadow:0 0 0 3px rgba(255,106,26,.18)}
#page input::placeholder,#page textarea::placeholder{color:#8E9BB1}
#page input:not([type=checkbox]):not([type=radio]):not([type=file]),#page select,#page textarea{background:var(--field-bg);border:1px solid var(--line-strong);border-radius:6px;padding:7px 10px;color:var(--ink);font:inherit;box-shadow:0 1px 2px rgba(15,27,46,.06) inset}
#page input:focus,#page select:focus,#page textarea:focus{border-color:var(--sig);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--sig) 18%,transparent)}
#page input::placeholder,#page textarea::placeholder{color:var(--muted)}
.btn.sec{background:transparent;color:var(--ink);box-shadow:none}
.btn.small{padding:4px 9px;font-size:11px}
.btn.disabled,.btn[disabled]{opacity:.5}
.chip-t,.chips button.chip-t{border:1px solid var(--line-strong);border-radius:999px;padding:4px 12px;font:700 11.5px var(--body);color:var(--ink-2);background:#fff;cursor:pointer}
.chip-t,.chips button.chip-t{border:1px solid var(--line-strong);border-radius:999px;padding:4px 12px;font:700 11.5px var(--body);color:var(--ink-2);background:var(--panel);cursor:pointer}
.chip-t.on,.chips button.chip-t.on{border-color:var(--accent);color:var(--accent-hi);background:var(--accent-soft)}
.chip,.chip.flat{font-size:10.5px;padding:2px 8px}
.pill{display:inline-block;font:700 10px var(--mono);letter-spacing:.06em;text-transform:uppercase;border:1px solid var(--line-strong);border-radius:4px;padding:1px 7px;color:var(--ink-2);background:var(--panel-2)}
.statx{background:linear-gradient(180deg,#FFFFFF,#F6F8FC);border:1px solid var(--line);border-radius:8px;padding:12px 14px;box-shadow:var(--sh)}
.statx{background:var(--panel-grad);border:1px solid var(--line);border-radius:8px;padding:12px 14px;box-shadow:var(--sh)}
.statx .pl{background:var(--accent-soft);border:1px solid var(--line)} .statx .pl svg{stroke:var(--accent-hi)}
.statx.c-cyan .pl{background:var(--ok-soft)} .statx.c-cyan .pl svg{stroke:var(--ok)}
.statx.c-violet .pl{background:#EEE9FF} .statx.c-violet .pl svg{stroke:#6D4AFF}
.statx.c-violet .pl{background:var(--violet-soft)} .statx.c-violet .pl svg{stroke:var(--violet)}
.statx.c-amber .pl{background:var(--warn-soft)} .statx.c-amber .pl svg{stroke:var(--warn)}
.statx .nv{font-family:var(--display);font-size:28px;color:var(--ink)} .statx .lb{font-size:10.5px;letter-spacing:.1em}
.promo-block,.pv,.obj,.gs,.next-card,.wo-slot,.lin-row,.tk-sec,.pipe-col,.pipe-card,.angle-row,.pb-acc{background:var(--panel-2);border:1px solid var(--line);border-radius:8px}
@@ -45,17 +50,17 @@
.pb-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px} .pb-size{font-family:var(--mono);font-size:11px;color:var(--muted);flex:1}
.obj>summary{padding:10px 14px;font-weight:700;cursor:pointer;color:var(--ink)} .obj-body{padding:0 14px 14px} .obj-truth p{color:var(--ink-2)}
.next-card{border-color:var(--accent-soft)} .next-card::before{display:none}
.callout{background:var(--sig-soft);border:1px solid #F7C7A9;border-radius:8px;padding:10px 12px;color:var(--ink)}
.callout{background:var(--sig-soft);border:1px solid var(--sig-line);border-radius:8px;padding:10px 12px;color:var(--ink)}
table{font-size:13px;color:var(--ink)} th{font-family:var(--mono);font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);text-align:left;padding:8px 10px;border-bottom:1px solid var(--line)} td{padding:8px 10px;border-bottom:1px solid var(--line)}
.feed .row{color:var(--ink)} .feed .row:first-child{background:var(--accent-soft)} .feed .t-TierPaid,.feed .t-Purchase,.feed .t-AwardPaid{color:var(--accent-hi)}
.badge{background:var(--accent-soft);color:var(--accent-hi);border-color:var(--accent-soft)}
.qa button{display:block;width:100%;text-align:left;background:#fff;border:1px solid var(--line-strong);border-radius:var(--r);padding:8px 12px;margin:0 0 6px;font:700 12px var(--body);color:var(--ink);cursor:pointer} .qa button:hover{border-color:var(--accent)}
.line-tree,.lt-node{color:var(--ink)} .lt-node{background:#fff;border:1px solid var(--line-strong);border-radius:6px;padding:4px 10px} .lt-node.qualified{border-color:var(--sig);color:var(--sig-2)}
.qa button{display:block;width:100%;text-align:left;background:var(--panel);border:1px solid var(--line-strong);border-radius:var(--r);padding:8px 12px;margin:0 0 6px;font:700 12px var(--body);color:var(--ink);cursor:pointer} .qa button:hover{border-color:var(--accent)}
.line-tree,.lt-node{color:var(--ink)} .lt-node{background:var(--panel);border:1px solid var(--line-strong);border-radius:6px;padding:4px 10px} .lt-node.qualified{border-color:var(--sig);color:var(--sig-2)}
.boot-spin .ring{border-color:var(--accent-soft);border-top-color:var(--accent)}
.bo-pagefoot{margin:8px 0 0;padding:14px 24px;border-top:1px solid var(--line);display:flex;gap:18px;flex-wrap:wrap;align-items:center;font-size:12px} .bo-pagefoot a{color:var(--muted)} .bo-pagefoot a:hover{color:var(--ink)}
#status{position:fixed;left:50%;transform:translateX(-50%);bottom:20px;background:var(--chrome);color:var(--chrome-ink);border:1px solid var(--chrome-line);border-left:3px solid var(--ok);padding:9px 14px;border-radius:6px;font-size:12px;font-weight:600;z-index:60;max-width:min(560px,92vw)}
#status.bad{border-left-color:var(--sig)}
.ed-body{background:#fff;border:1px solid var(--line-strong);border-radius:6px;min-height:110px;padding:10px;color:var(--ink)} .ed-bar button{background:#fff;border:1px solid var(--line-strong);border-radius:5px;color:var(--ink);padding:3px 8px;cursor:pointer}
.ed-body{background:var(--field-bg);border:1px solid var(--line-strong);border-radius:6px;min-height:110px;padding:10px;color:var(--ink)} .ed-bar button{background:var(--panel);border:1px solid var(--line-strong);border-radius:5px;color:var(--ink);padding:3px 8px;cursor:pointer}
.chat-drawer{background:var(--panel);color:var(--ink);border-left:1px solid var(--line);box-shadow:-20px 0 40px -30px rgba(15,27,46,.5)} .chat-head{border-bottom:1px solid var(--line)} .chat-msgs,.chat-threads{color:var(--ink)}
.grid.c2{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.tr-group{color:var(--muted)!important}
@@ -72,17 +77,28 @@ table{font-size:13px;color:var(--ink)} th{font-family:var(--mono);font-size:10.5
.pipe-board [data-stage="bought"],.pipe-due [data-stage="bought"]{--st:#16a34a}
.pipe-board [data-stage="building"],.pipe-due [data-stage="building"]{--st:#b7791f}
.pipe-board [data-stage="later"],.pipe-due [data-stage="later"]{--st:#64748b}
.pipe-board .pipe-col{background:color-mix(in srgb,var(--st) 7%,#f8fafc);border:1px solid color-mix(in srgb,var(--st) 28%,#e2e8f0);border-top:4px solid var(--st);border-radius:10px}
.pipe-board .pipe-col h4{color:var(--st);font-weight:800}
.pipe-board .pipe-col h4 span{background:var(--st);color:#fff;border-radius:999px;padding:0 8px;font-size:12px;line-height:20px;min-width:22px;text-align:center}
.pipe-board .pipe-col .hint{color:#475569}
.pipe-board .pipe-card,.pipe-due .pipe-card{background:#fff;border:1px solid color-mix(in srgb,var(--st) 22%,#e2e8f0);border-left:4px solid var(--st);border-radius:8px;box-shadow:0 1px 2px rgba(15,23,42,.06)}
.pipe-board .pipe-col{background:color-mix(in srgb,var(--st) 7%,var(--panel-2));border:1px solid color-mix(in srgb,var(--st) 28%,var(--line));border-top:4px solid var(--st);border-radius:10px}
.pipe-board .pipe-col h4{color:color-mix(in srgb,var(--st) 72%,var(--ink));font-weight:800}
.pipe-board .pipe-col h4 span{background:var(--st);color:var(--on-ink);border-radius:999px;padding:0 8px;font-size:12px;line-height:20px;min-width:22px;text-align:center}
.pipe-board .pipe-col .hint{color:var(--ink-2)}
.pipe-board .pipe-card,.pipe-due .pipe-card{background:var(--panel);border:1px solid color-mix(in srgb,var(--st) 22%,var(--line));border-left:4px solid var(--st);border-radius:8px;box-shadow:0 1px 2px rgba(15,23,42,.06)}
.pipe-board .pipe-card:hover,.pipe-board .pipe-card:focus-visible,.pipe-due .pipe-card:hover{border-color:var(--st);box-shadow:0 2px 8px color-mix(in srgb,var(--st) 25%,transparent)}
.pipe-board .pipe-card.on{box-shadow:0 0 0 2px var(--st)}
.pipe-card .nm{color:#0f172a}
.pipe-card .nm small{color:#64748b}
.pipe-card .sub{color:#334155}
.pipe-card .note{color:#1e293b}
.pipe-card.stalled{background:#fffbeb}
.pipe-card .chip.warm{background:#fef3c7;border-color:#f59e0b;color:#92400e;font-weight:700}
.pipe-card .chip.flat{background:#f1f5f9;border-color:#cbd5e1;color:#334155}
.pipe-card .nm{color:var(--ink)}
.pipe-card .nm small{color:var(--muted)}
.pipe-card .sub{color:var(--ink-2)}
.pipe-card .note{color:var(--ink)}
.pipe-card.stalled{background:var(--note-bg)}
.pipe-card .chip.warm{background:var(--note-soft);border-color:var(--note-line);color:var(--note-ink);font-weight:700}
.pipe-card .chip.flat{background:var(--panel-2);border-color:var(--line-strong);color:var(--ink-2)}
/* dark theme: pipeline stage colours lifted for dark panels (titles, stripes, count pills) */
:root[data-theme="dark"] :where(.pipe-board .pipe-col,.pipe-due .pipe-card,.pipe-board .pipe-card){--st:#8E9FB8}
:root[data-theme="dark"] .pipe-board [data-stage="talking"],:root[data-theme="dark"] .pipe-due [data-stage="talking"]{--st:#B59CFF}
:root[data-theme="dark"] .pipe-board [data-stage="joined"],:root[data-theme="dark"] .pipe-due [data-stage="joined"]{--st:#7AAAFF}
:root[data-theme="dark"] .pipe-board [data-stage="wallet"],:root[data-theme="dark"] .pipe-due [data-stage="wallet"]{--st:#4FC3E6}
:root[data-theme="dark"] .pipe-board [data-stage="payouts"],:root[data-theme="dark"] .pipe-due [data-stage="payouts"]{--st:#FF9A5C}
:root[data-theme="dark"] .pipe-board [data-stage="bought"],:root[data-theme="dark"] .pipe-due [data-stage="bought"]{--st:#4CCB7A}
:root[data-theme="dark"] .pipe-board [data-stage="building"],:root[data-theme="dark"] .pipe-due [data-stage="building"]{--st:#D9A441}
:root[data-theme="dark"] .pipe-board [data-stage="later"],:root[data-theme="dark"] .pipe-due [data-stage="later"]{--st:#8E9FB8}
/* Appearance card on the Profile pane */
.theme-card .seg{margin-top:4px} .theme-card .seg button.on{background:var(--accent);color:var(--accent-ink)}
+149
View File
@@ -0,0 +1,149 @@
// LinkSpin traffic guide data (2026-10-28, Marty: members ask "what traffic for what kind of offer?").
// Shared by the Traffic guide page (/traffic-guide) and the Sources screen (format tags, "good for" line).
// Network formats are what each network is known to sell; members should still confirm in their own ad panel.
window.TRAFFIC_GUIDE = (function () {
const FORMATS = {
pop: {
name: 'Popunder', short: 'Pop',
what: 'Your page opens in a new window or tab behind (or over) the site the visitor was reading.',
buy: 'Usually CPM or CPV (per thousand views). The cheapest clicks you can buy, and the most of them.',
wins: 'One-step offers that need no trust: free sign-ups, email capture, giveaways, games, app installs.',
fails: 'Anything that needs explaining or trust first: long sales letters, high-ticket offers, a cold opportunity pitch.',
page: 'Fast, mobile, one headline and one big button. If it takes more than a few seconds to load, the visitor is gone.',
},
push: {
name: 'Push notifications', short: 'Push',
what: 'A short notification with an icon and a headline, sent to people who allowed notifications from some site.',
buy: 'CPC (per click). You only pay when someone taps.',
wins: 'Curiosity and news-style hooks: lead capture, giveaways, games, "how I..." stories, free tools.',
fails: 'Sending the click straight to a checkout or a signup that asks for a lot. Push readers want a quick payoff.',
page: 'Use a short pre-lander that continues the headline, then the sign-up. Refresh the headline and icon often; push audiences tire fast.',
},
inpage: {
name: 'In-page push', short: 'In-page',
what: 'An ad that looks like a push notification but shows inside the web page (works on iPhones too).',
buy: 'CPC or CPM.',
wins: 'The same offers as push and pop: free sign-ups, giveaways, games, quick lead forms.',
fails: 'Offers that need a long read before anyone acts.',
page: 'Same as push: a headline that promises one thing, and a page that delivers it right away.',
},
native: {
name: 'Native ads', short: 'Native',
what: 'A thumbnail and headline inside "recommended stories" boxes on news and content sites.',
buy: 'CPC. Clicks cost more than pop or push, but readers are in reading mode.',
wins: 'Story-style pre-sells: courses and info products, software, an opportunity explained through your own story.',
fails: 'Hard sells and hype. Mainstream native networks reject income claims and are strict about crypto.',
page: 'An article or "my story" page that warms the reader up, then sends them to the sign-up. Never a bare sign-up form.',
},
search: {
name: 'Search ads', short: 'Search',
what: 'Text ads next to search results, shown to people typing a keyword you bid on.',
buy: 'CPC on keywords. Can be pricey on popular words, cheap on specific ones.',
wins: 'Things people already look for: advertising tools, buying website traffic, software, how-to courses.',
fails: 'Offers nobody searches for. Google and Microsoft also restrict crypto, income opportunities and MLM.',
page: 'Match the keyword in your headline. A searcher wants the answer to what they typed, not a detour.',
},
social: {
name: 'Social ads', short: 'Social',
what: 'Ads in social feeds and stories, aimed by interests, age and location.',
buy: 'CPM or CPC, set by auction.',
wins: 'Video and story content, free lead magnets, community and webinar invites, software and courses.',
fails: 'Direct crypto or "make money" pitches: Facebook restricts them, and accounts get banned for it.',
page: 'Lead with something free and useful (a guide, a video, a webinar), then follow up by email.',
},
display: {
name: 'Banners', short: 'Banner',
what: 'Image ads in fixed spots on websites (728x90, 300x250 and so on).',
buy: 'CPM or CPC.',
wins: 'Retargeting people who already know you, brand reminders, simple free offers.',
fails: 'Cold, complex offers. Banner click rates are low, so the offer has to be obvious at a glance.',
page: 'Bold, simple creative with one message. Test several sizes; some spots convert far better than others.',
},
redirect: {
name: 'Domain redirect', short: 'Redirect',
what: 'Visitors who typed a parked or expired domain are sent straight to your page (also called zero-click).',
buy: 'CPV (per visit).',
wins: 'Lead capture, giveaways, simple sign-ups in the right niche.',
fails: 'Offers that need a pre-sell. The visitor did not choose your ad.',
page: 'Fast and simple, like pop traffic.',
},
};
// offer types LinkSpin members promote; rating per format: best / good / weak / avoid, with a one-line why
const OFFERS = [
{ key: 'join', name: 'Free sign-up or email capture', ex: 'a free join page, a squeeze page, a lead magnet',
fit: { pop: ['best', 'Cheap volume for a one-field page'], inpage: ['best', 'Works on every phone, fast decision'], push: ['good', 'Use a short pre-lander first'], native: ['good', 'Pre-sell with a story, then the form'], redirect: ['good', 'Simple page, quick decision'], social: ['good', 'Offer something free and useful'], display: ['weak', 'Low click rates for cold sign-ups'], search: ['weak', 'Few people search for a page they have never heard of'] },
tip: 'Ask for the email only. Every extra field costs sign-ups. Follow up by email; most people join on a later message.' },
{ key: 'opp', name: 'Crypto or team-build opportunity', ex: 'an on-chain team build, a crypto earning program',
fit: { native: ['good', 'Explain it through your story, check each network\'s crypto rules first'], push: ['good', 'Curiosity hook to a pre-sell or squeeze page, never straight to a buy'], inpage: ['good', 'Same as push'], pop: ['weak', 'Cold and skimming; only to a free squeeze page'], display: ['weak', 'Too much to explain in a banner'], redirect: ['weak', 'No pre-sell'], search: ['avoid', 'Google and Microsoft restrict crypto and income offers'], social: ['avoid', 'Facebook restricts crypto and money-making ads; accounts get banned'] },
tip: 'Capture the email first and explain by email or video. No income promises in ads or pages; networks reject them and they draw complaints.' },
{ key: 'ads', name: 'Advertising tools and ad credits', ex: 'InstantAdPay, LinkSpin, traffic tools',
fit: { search: ['best', 'People search for "buy website traffic" and "advertise my site"'], push: ['good', '"Free ad credits" is a strong hook'], pop: ['good', 'Send to a free join that gives credits'], inpage: ['good', 'Same as push'], native: ['good', 'A how-I-get-traffic story'], social: ['good', 'Target small business owners and marketers'], display: ['weak', 'Fine for retargeting'], redirect: ['weak', 'Rarely the right audience'] },
tip: 'Sell the free starting credits, not the plan. "Get your first ads seen free" beats "join my business".' },
{ key: 'games', name: 'Games and play-to-earn', ex: 'browser games, game rewards',
fit: { pop: ['best', 'Gamers click fast; send to the game itself'], inpage: ['best', 'Mobile-heavy, quick tap to play'], push: ['good', 'Short, playful headlines'], social: ['good', 'Short gameplay video'], native: ['weak', 'Readers are not in play mode'], display: ['weak', 'Only with an eye-catching game image'], redirect: ['weak', 'Hit and miss'], search: ['weak', 'Only for the game\'s own name'] },
tip: 'Land them in the game, not on a sign-up wall. Let them play first and ask for an account when they win something.' },
{ key: 'software', name: 'Software, apps and AI tools', ex: 'an AI writer, a page builder, an app',
fit: { search: ['best', 'High intent: people search for the job the tool does'], native: ['good', 'Review-style or how-to articles'], social: ['good', 'Show the tool working in a short video'], push: ['good', 'A free trial or free tool hook'], inpage: ['good', 'Same as push'], display: ['weak', 'Retargeting only'], pop: ['weak', 'Low attention for a tool that needs a demo'], redirect: ['weak', 'Rarely the right audience'] },
tip: 'Lead with the free trial or free version and one clear result ("write a week of posts in 5 minutes").' },
{ key: 'info', name: 'Courses and info products', ex: 'a course, an ebook, a coaching program',
fit: { native: ['best', 'Story pre-sell to a free lesson'], social: ['good', 'Free lesson or webinar invite'], search: ['good', 'How-to keywords'], push: ['good', 'Only through a pre-lander'], inpage: ['good', 'Only through a pre-lander'], pop: ['weak', 'Too cold for a paid course'], display: ['weak', 'Retargeting only'], redirect: ['weak', 'No pre-sell'] },
tip: 'Give a free first lesson for an email, then sell by email. Cold traffic rarely buys a course on the first visit.' },
{ key: 'sweeps', name: 'Giveaways and freebies', ex: 'a contest, a free gift, a spin-to-win',
fit: { pop: ['best', 'The classic pop offer'], push: ['best', '"You could win" headlines work'], inpage: ['best', 'Same as push'], redirect: ['good', 'Quick entry form'], display: ['good', 'A clear prize image'], native: ['weak', 'Pricey clicks for a freebie'], social: ['weak', 'Strict contest rules on social'], search: ['avoid', 'Almost nobody searches for it'] },
tip: 'Show the prize and the deadline. Keep the entry to one field and say clearly what happens next.' },
];
// formats each catalog network sells (by catalog key). adult: 'mixed' = big adult inventory with mainstream
// options (pick mainstream / non-adult in the targeting), 'adult' = mostly adult sites.
// strict: mainstream ad policies (crypto, income claims, MLM are restricted or need approval).
const NETWORKS = {
'7search-ppc': { f: ['search', 'display'], note: 'Small search network, cheaper and less strict than Google' },
activerevenue: { f: ['pop', 'push', 'inpage', 'native'] },
adskeeper: { f: ['native'], note: 'Native network from the MGID family' },
adsterra: { f: ['pop', 'inpage', 'display', 'native'], note: 'Social Bar is its in-page push format' },
bidvertiser: { f: ['pop', 'push', 'native', 'display'] },
clickadu: { f: ['pop', 'inpage', 'push', 'display'] },
exoclick: { f: ['pop', 'display', 'native', 'push', 'inpage'], adult: 'mixed' },
ezmob: { f: ['pop', 'push', 'native', 'display'] },
facebook: { f: ['social'], strict: true },
froggyads: { f: ['pop', 'push', 'inpage', 'display'] },
'google-adwords': { f: ['search', 'display'], strict: true, note: 'Also YouTube video ads' },
hilltopads: { f: ['pop', 'inpage', 'display'] },
mgid: { f: ['native'], strict: true },
'microsoft-advertising': { f: ['search'], strict: true, note: 'Bing, Yahoo and partner search' },
mondiad: { f: ['push', 'inpage', 'native'] },
mybid: { f: ['pop', 'push', 'native', 'display'] },
plugrush: { f: ['pop', 'display', 'native'], adult: 'mixed' },
popads: { f: ['pop'] },
popcash: { f: ['pop'] },
propellerads: { f: ['pop', 'push', 'inpage'] },
pushground: { f: ['push', 'inpage'] },
reacheffect: { f: ['push', 'pop'] },
revcontent: { f: ['native'], strict: true },
taboola: { f: ['native'], strict: true },
tonic: { f: [], note: 'Mostly a search-monetization partner; confirm what traffic they sell before you spend' },
trafficjunky: { f: ['display', 'native'], adult: 'adult', note: 'Adult sites; also video pre-roll' },
trafficshop: { f: ['pop', 'display'], adult: 'mixed' },
trafficstars: { f: ['pop', 'display', 'native', 'push', 'inpage'], adult: 'mixed' },
ungads: { f: [], note: 'Check the ad formats in your account' },
zeropark: { f: ['pop', 'push', 'redirect', 'search'] },
};
const RULES = [
['Test small, then scale', 'Start each network with a small daily budget and one offer. Keep what converts, cut what does not, then raise the budget on the winners.'],
['Track every click', 'Set the network up under Sources so its click id and postback are on the link. Then Reports shows which network, zone and creative actually converts.'],
['Change one thing at a time', 'New headline or new page or new network, not all three at once, or you will not know what made the difference.'],
['Block the zones that waste money', 'Pop, push and native networks sell from thousands of sites. After a day or two, block the sites and zones with clicks and no sign-ups.'],
['No income promises', 'Ads and pages that promise earnings get rejected and draw complaints. Show what the program is and let people decide.'],
['Mainstream vs adult inventory', 'Networks marked adult-heavy sell a lot of adult traffic. Target their mainstream (non-adult) sites unless your offer fits that audience.'],
];
const fmtName = k => (FORMATS[k] || {}).short || k;
// the formats a source sells, and the offers those formats suit best (for the Sources screen line)
function bestFor(key) {
const n = NETWORKS[key]; if (!n || !n.f.length) return [];
return OFFERS.filter(o => n.f.some(f => o.fit[f] && o.fit[f][0] === 'best') && !(n.strict && o.key === 'opp') && !(n.adult === 'adult' && !['games', 'sweeps'].includes(o.key))).map(o => o.name);
}
return { FORMATS, OFFERS, NETWORKS, RULES, fmtName, bestFor };
})();
+53
View File
@@ -0,0 +1,53 @@
// LinkSpin Traffic guide page (2026-10-28): offer picker, the ad formats, the networks, ground rules.
(function () {
const G = window.TRAFFIC_GUIDE, $ = id => document.getElementById(id), esc = CR.esc;
CR.mount({ active: 'sources', crumb: 'Control room · Sources', title: 'Traffic guide', sub: 'which traffic for which offer', actions: '<a class="btn sm" href="/sources">&larr; Sources</a>' });
let CAT = [], OFF = null, NF = '';
const nameOf = k => { const c = CAT.find(x => x.key === k); return c ? c.name : k; };
const ORDER = ['best', 'good', 'weak', 'avoid'];
function tags(k) {
const n = G.NETWORKS[k] || { f: [] };
return n.f.map(f => '<span class="tag plain">' + esc(G.fmtName(f)) + '</span>').join('')
+ (n.adult === 'adult' ? '<span class="tag warn">adult sites</span>' : n.adult === 'mixed' ? '<span class="tag dim" title="Big adult inventory; target its mainstream sites">adult-heavy</span>' : '')
+ (n.strict ? '<span class="tag warn" title="Strict ad policy: crypto, income claims and MLM are restricted or need approval">strict policy</span>' : '');
}
function renderOffers() {
$('offers').innerHTML = G.OFFERS.map(o => '<button type="button" class="chip' + (OFF === o.key ? ' on' : '') + '" data-k="' + o.key + '">' + esc(o.name) + '</button>').join('');
$('offers').querySelectorAll('.chip').forEach(b => b.addEventListener('click', () => { OFF = OFF === b.dataset.k ? null : b.dataset.k; try { history.replaceState(null, '', OFF ? '#' + OFF : location.pathname); } catch (e) {} renderOffers(); renderResult(); }));
}
function renderResult() {
const o = G.OFFERS.find(x => x.key === OFF);
if (!o) { $('result').innerHTML = '<div class="muted">Pick one above.</div>'; return; }
const rows = Object.keys(o.fit).sort((a, b) => ORDER.indexOf(o.fit[a][0]) - ORDER.indexOf(o.fit[b][0]));
const good = rows.filter(f => o.fit[f][0] === 'best' || o.fit[f][0] === 'good');
// networks that sell at least one best/good format; strict-policy networks are left out for the opportunity offer
// adult-only sites suit few offers
const nets = Object.keys(G.NETWORKS).filter(k => { const n = G.NETWORKS[k]; if (n.strict && o.key === 'opp') return false; if (n.adult === 'adult' && !['games', 'sweeps'].includes(o.key)) return false; return n.f.some(f => good.includes(f)); })
.map(k => ({ k, score: G.NETWORKS[k].f.reduce((s, f) => s + (o.fit[f] ? (o.fit[f][0] === 'best' ? 3 : o.fit[f][0] === 'good' ? 1 : 0) : 0), 0) }))
.sort((a, b) => b.score - a.score || nameOf(a.k).localeCompare(nameOf(b.k)));
$('result').innerHTML = '<div class="res"><div class="fit">'
+ rows.map(f => '<div class="r"><span class="fn">' + esc(G.FORMATS[f].name) + '</span><span class="rate ' + o.fit[f][0] + '">' + o.fit[f][0] + '</span><span class="why">' + esc(o.fit[f][1]) + '</span></div>').join('')
+ '</div><div style="display:grid;gap:12px;align-content:start"><div class="tipbox"><b>Tip.</b> ' + esc(o.tip) + '</div>'
+ '<div><div class="sec" style="margin-bottom:6px">Networks that sell those formats</div><div class="nets">' + nets.map(x => '<a href="#net-' + esc(x.k) + '">' + esc(nameOf(x.k)) + '</a>').join('') + '</div></div>'
+ (o.key === 'opp' ? '<div class="muted" style="font-size:12px">Google, Microsoft, Facebook, Taboola, Revcontent and MGID are left out: their policies restrict crypto and income offers.</div>' : '')
+ '</div></div>';
}
function renderFormats() {
$('fmts').innerHTML = Object.keys(G.FORMATS).map(k => { const f = G.FORMATS[k];
return '<div class="fmt" id="fmt-' + k + '"><h3>' + esc(f.name) + '</h3><p>' + esc(f.what) + '</p><p><b>How you pay:</b> ' + esc(f.buy) + '</p><p><b>Converts:</b> ' + esc(f.wins) + '</p><p><b>Struggles:</b> ' + esc(f.fails) + '</p><p><b>Landing page:</b> ' + esc(f.page) + '</p></div>'; }).join('');
}
function renderNets() {
const fs = Object.keys(G.FORMATS);
$('nfilter').innerHTML = '<button type="button" class="chip' + (NF ? '' : ' on') + '" data-f="">All</button>' + fs.map(f => '<button type="button" class="chip' + (NF === f ? ' on' : '') + '" data-f="' + f + '">' + esc(G.FORMATS[f].name) + '</button>').join('');
$('nfilter').querySelectorAll('.chip').forEach(b => b.addEventListener('click', () => { NF = b.dataset.f; renderNets(); }));
const keys = Array.from(new Set(CAT.map(c => c.key).concat(Object.keys(G.NETWORKS)))).filter(k => !NF || ((G.NETWORKS[k] || {}).f || []).includes(NF)).sort((a, b) => nameOf(a).localeCompare(nameOf(b)));
$('nrows').innerHTML = keys.length ? keys.map(k => { const n = G.NETWORKS[k] || { f: [] }, c = CAT.find(x => x.key === k) || {}, bf = G.bestFor(k);
return '<div class="rw" id="net-' + esc(k) + '"><div class="nm"><b>' + esc(nameOf(k)) + '</b><span>' + esc(c.site || '') + '</span></div><div class="tg2">' + (tags(k) || '<span class="muted" style="font-size:12px">check in your account</span>') + '</div>'
+ '<div class="note">' + (bf.length ? 'Best for: ' + esc(bf.join(', ')) + '. ' : '') + esc(n.note || '') + '</div></div>'; }).join('')
: '<div class="rw"><span class="muted">No network sells that format.</span></div>';
}
$('rules').innerHTML = G.RULES.map(r => '<div><b>' + esc(r[0]) + '</b><span>' + esc(r[1]) + '</span></div>').join('');
OFF = (location.hash.slice(1) && G.OFFERS.some(o => o.key === location.hash.slice(1))) ? location.hash.slice(1) : null;
renderOffers(); renderResult(); renderFormats(); renderNets();
CR.get('/api/sources/catalog').then(r => { CAT = r.catalog || []; renderResult(); renderNets(); }).catch(() => {});
})();
+8 -5
View File
@@ -17,9 +17,11 @@
title.innerHTML = safeName;
if (hostEl) hostEl.innerHTML = safeName;
IAP.$('bioHead').hidden = false;
if (w.avatarUrl) { const av = IAP.$('bioAvatar'); av.src = w.avatarUrl; av.hidden = false; }
// profile fields (avatar, bio, socials, intro video) are rendered only when the server says the member has bought (w.bought);
// a free member's wall shows the name, the line's ads and the join call, nothing from the profile (2026-10-30)
if (w.bought && w.avatarUrl) { const av = IAP.$('bioAvatar'); av.src = w.avatarUrl; av.hidden = false; }
if (w.badge) { const bb = IAP.$('bioBadge'); if (bb) { bb.src = w.badge.img; bb.title = w.badge.label + ' badge'; bb.hidden = false; } }
IAP.$('bioText').textContent = w.bio || 'Building a team on LinkSpin — join through this page and you\'re in my line.';
IAP.$('bioText').textContent = (w.bought && w.bio) || 'Building a team on LinkSpin. Join through this page and you are in my line.';
if (w.qrUrl) IAP.$('bioQr').src = w.qrUrl;
// social links
const SOC = { facebook: 'Facebook', twitter: 'X', youtube: 'YouTube', instagram: 'Instagram', tiktok: 'TikTok', telegram: 'Telegram', linkedin: 'LinkedIn', website: 'Website' };
@@ -36,14 +38,15 @@
website: svg('<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c3 3.5 3 14.5 0 18M12 3c-3 3.5-3 14.5 0 18"/>')
};
const sc = IAP.$('bioSocials');
if (sc && w.socials && typeof w.socials === 'object') {
if (sc && w.bought && w.socials && typeof w.socials === 'object') {
// paid placement: Google wants these marked sponsored (plus ugc), never a plain dofollow (2026-10-30)
const links = Object.keys(SOC).filter(k => w.socials[k]).map(k =>
'<a href="' + String(w.socials[k]).replace(/"/g, '%22') + '" target="_blank" rel="noopener nofollow me">' + (ICON[k] || '') + '<span>' + SOC[k] + '</span></a>');
'<a href="' + String(w.socials[k]).replace(/"/g, '%22') + '" target="_blank" rel="sponsored ugc noopener">' + (ICON[k] || '') + '<span>' + SOC[k] + '</span></a>');
sc.innerHTML = links.join('');
}
// intro video under the bio: YouTube / Vimeo embed, or a direct file
const bv = IAP.$('bioVideo');
const vurl = w.socials && typeof w.socials === 'object' ? String(w.socials.video || '') : '';
const vurl = w.bought && w.socials && typeof w.socials === 'object' ? String(w.socials.video || '') : '';
if (bv && vurl) {
let yt = /(?:youtube\.com\/(?:watch\?(?:.*&)?v=|shorts\/|embed\/)|youtu\.be\/)([A-Za-z0-9_-]{6,})/.exec(vurl);
let vm = /vimeo\.com\/(?:video\/)?(\d+)/.exec(vurl);
-13
View File
@@ -7,17 +7,4 @@
document.getElementById('gate').style.display = signedIn ? 'none' : 'block';
document.getElementById('body').style.display = signedIn ? 'block' : 'none';
if (!signedIn) return;
// MoonPay: same signed link the Buy pane uses, prefilled with this member's wallet when one is linked
const mb = document.getElementById('wlMoonpay'), note = document.getElementById('wlMoonpayNote');
if (note && !me.address) note.textContent = 'Link your wallet first (Wallet tab) and MoonPay opens with your address already filled in. Without it you paste the address yourself.';
if (mb) mb.addEventListener('click', async () => {
let pol = 30;
try { const { products } = await (await fetch('/api/catalog')).json(); const p25 = (products || []).find(p => p.priceCents === 2500); if (p25 && p25.costWei) pol = Math.max(30, Math.ceil(Number(p25.costWei) / 1e18) + 3); } catch (e) {}
try {
const r = await (await fetch('/api/moonpay-url?pol=' + pol + (me.address ? '&address=' + encodeURIComponent(me.address) : ''))).json();
if (!r.url) throw new Error('no url');
window.open(r.url, '_blank', 'noopener');
IAP.status(r.signed ? 'MoonPay opened with your wallet address pre-filled. Choose the amount, pay, and the POL lands in your wallet.' : 'MoonPay opened. Choose POL on the Polygon network and paste your own wallet address as the destination.', 'ok');
} catch (e) { IAP.status('Could not open MoonPay. Try again in a minute.', 'bad'); }
});
})();
Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

+4 -3
View File
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>The contract | LinkSpin</title>
@@ -16,9 +16,10 @@
<meta name="twitter:image" content="{{SITE_URL}}/banners/linkspin-og-1200x630.png">
<meta name="theme-color" content="#0B1424">
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
<style>
.rule{display:grid;grid-template-columns:150px minmax(0,1fr);gap:14px;padding:10px 0;border-bottom:1px solid var(--line);font-size:14px;color:var(--ink-2)}
.rule:last-child{border-bottom:0}
@@ -49,7 +50,7 @@
<h1 class="disp" style="margin:0;font-size:44px;line-height:1.04">The contract, in plain words</h1>
<p style="font-size:16px">Every dollar on this platform moves through one smart contract on Polygon. It takes a package payment and splits it to real wallets in the same transaction. It has no balance to drain, no pause button, and no owner power over money. This page says what it does, with the source beside it. Verify every claim yourself. That is the point.</p>
<div class="ctas">
<span class="mono" id="cAddr" style="font-size:12px;padding:10px 12px;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;color:#8CC8FF;overflow-wrap:anywhere">…</span>
<span class="mono" id="cAddr" style="font-size:12px;padding:10px 12px;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;color:var(--chrome-hi);overflow-wrap:anywhere">…</span>
<span class="tag" id="cChain">…</span>
</div>
<div class="ctas">
+285
View File
@@ -0,0 +1,285 @@
<!doctype html>
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Conversion tracking: see which ad, link and page bring sign-ups | LinkSpin</title>
<meta name="description" content="How to set up the LinkSpin conversion pixel: create a goal under Conversions, put the landing tag on the page your ad or spin link points to and the goal pixel on your thank-you page, then read conversions and cost per goal by campaign, spin link, page and traffic source. Copy-paste examples for HTML, WordPress, page builders, Aweber and GetResponse.">
<link rel="canonical" href="{{SITE_URL}}/conversion-tracking">
<meta property="og:type" content="website"><meta property="og:site_name" content="LinkSpin">
<meta property="og:url" content="{{SITE_URL}}/conversion-tracking">
<meta property="og:title" content="Conversion tracking: see which ad, link and page bring sign-ups">
<meta property="og:description" content="Clicks tell you who looked. The LinkSpin conversion pixel tells you which ad, spin link, page and traffic source brought a subscriber or a sale. Free for every member. Set it up in four steps.">
<meta name="twitter:card" content="summary">
<meta name="theme-color" content="#0B1424">
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
<style>
.rg{max-width:980px}
.rg p{margin:0}
.pb{padding:14px 16px}
.rg-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:12px}
.rg-two .tile{display:grid;gap:4px;padding:12px 14px;font-size:14.5px;align-content:start;min-width:0}
.rg-two .tile span{color:var(--ink-2)}
/* the flow: across on a wide screen, down on a phone */
.cg-flow{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:26px}
.cg-flow li{position:relative;border:1px solid var(--line-strong);border-radius:8px;padding:10px 12px;font-size:13.5px;line-height:1.45;background:var(--panel);color:var(--ink-2);min-width:0}
.cg-flow li b{display:block;font-weight:800;color:var(--ink);margin-bottom:3px}
.cg-flow li .k{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;font:700 12px var(--mono);margin-bottom:6px;background:var(--chrome);color:var(--chrome-ink)}
.cg-flow li code{font:500 12px var(--mono);color:var(--accent-hi);overflow-wrap:anywhere}
.cg-flow li.f-ad{border-color:var(--accent);background:var(--accent-soft)}
.cg-flow li.f-tag{border-color:var(--ok);background:var(--ok-soft)}
.cg-flow li.f-px{border-color:var(--sig);background:var(--sig-soft)}
.cg-flow li.f-win{border-color:var(--ok);background:var(--ok-soft)}
.cg-flow li:not(:last-child)::after{content:"";position:absolute;right:-20px;top:50%;margin-top:-7px;border:7px solid transparent;border-left:9px solid var(--line-strong);border-right:0}
@media (max-width:820px){
.cg-flow{grid-template-columns:1fr;gap:24px}
.cg-flow li:not(:last-child)::after{right:auto;left:22px;top:auto;bottom:-19px;margin-top:0;border:7px solid transparent;border-top:9px solid var(--line-strong);border-bottom:0}
}
/* member route */
.rg-route{list-style:none;counter-reset:s;margin:0;padding:0;display:grid;gap:12px}
.rg-route > li{counter-increment:s;display:grid;grid-template-columns:40px minmax(0,1fr);gap:14px;align-items:start;padding:12px 0;border-bottom:1px solid var(--line)}
.rg-route > li:last-child{border-bottom:0}
.rg-route > li::before{content:counter(s);font:700 20px var(--display);width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(180deg,#FF7A32,var(--sig));color:var(--sig-ink)}
.rg-route > li > div{min-width:0;display:grid;gap:8px}
.rg-route h3{font:700 17px var(--display);letter-spacing:.04em;text-transform:uppercase;margin:0;color:var(--ink)}
.rg-route p{font-size:14px;color:var(--ink-2)}
.rg-where{display:flex;flex-wrap:wrap;gap:6px}
.rg-chip{font:700 11.5px var(--body);padding:3px 10px;border-radius:999px;background:var(--accent-soft);color:var(--accent-hi);border:1px solid var(--accent-dim)}
.rg-chip.iap{background:var(--ok-soft);color:var(--ok);border-color:var(--ok-line)}
/* code */
.cg-code{border:1px solid var(--chrome-line);border-radius:8px;background:var(--inset);padding:10px 12px;min-width:0}
.cg-code pre{margin:0;font:500 12.5px/1.6 var(--mono);color:var(--chrome-ink);white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
.cg-lbl{display:flex;justify-content:space-between;align-items:center;gap:8px;font:700 10.5px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--chrome-sub);margin:0 0 6px}
.cg-copy{font:700 12px var(--body);background:transparent;color:var(--chrome-ink);border:1px solid var(--chrome-sub);border-radius:6px;padding:2px 10px;cursor:pointer}
.cg-copy:hover{background:var(--chrome-2)}
.cg-ph{color:var(--chrome-warm);font-weight:700}
.rg code.i{font:500 13px var(--mono);color:var(--accent-hi);background:var(--accent-soft);padding:1px 5px;border-radius:4px;overflow-wrap:anywhere}
.cg-ex{display:grid;gap:8px}
.cg-ex p,.cg-ex li{font-size:14px;color:var(--ink-2)}
.cg-ex ol,.cg-ex ul{margin:0;padding-left:20px;display:grid;gap:5px}
.cg-warn{border-left:4px solid var(--sig);background:var(--sig-soft);padding:10px 14px;border-radius:0 8px 8px 0;font-size:14px;color:var(--ink-2)}
/* numbers */
.rg-tbl table{width:100%;border-collapse:collapse;font-size:14px;table-layout:fixed}
.rg-tbl th,.rg-tbl td{padding:9px 14px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}
.rg-tbl th{font:700 10.5px var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.rg-tbl td:first-child{width:32%;font-weight:700}
.rg-tbl tr:last-child td{border-bottom:0}
.cg-check{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.cg-check li{position:relative;padding:10px 12px 10px 40px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2);font-size:14px;color:var(--ink-2)}
.cg-check li::before{content:"";position:absolute;left:12px;top:12px;width:16px;height:16px;border-radius:4px;border:2px solid var(--accent)}
.cg-check li b{color:var(--ink)}
.rg-faq{display:grid;gap:14px;margin:0}
.rg-faq dt{font-weight:800;color:var(--ink)}
.rg-faq dd{margin:4px 0 0;color:var(--ink-2);font-size:14px}
@media (max-width:640px){.rg h1{font-size:34px!important}.rg-route > li{grid-template-columns:34px minmax(0,1fr);gap:10px}.rg-route > li::before{width:34px;height:34px;font-size:17px}.rg-tbl th,.rg-tbl td{padding:8px 10px}}
</style>
</head>
<body>
<header class="top">
<div class="wrap">
<a class="brand" href="/" aria-label="LinkSpin home"><span class="mark"></span><span class="word">Link<b>Spin</b></span></a>
<span class="eyebrow" style="color:var(--chrome-sub);padding-left:14px;border-left:1px solid var(--chrome-line)">Conversion tracking</span>
<span class="grow"></span>
<a href="/conversions" class="btn ghost">Open Conversions</a>
<a href="/join" class="btn pri">Start free</a>
</div>
</header>
<main class="sec" style="padding-top:44px">
<div class="wrap rg" style="display:grid;gap:22px">
<div class="text" style="display:grid;gap:12px">
<span class="eyebrow">LinkSpin + InstantAdPay · free for every member</span>
<h1 class="disp" style="margin:0;font-size:44px;line-height:1.04">Conversion tracking: see which ad, link and page bring sign-ups</h1>
<p style="font-size:16px;color:var(--ink-2)">Clicks tell you who looked. The conversion pixel tells you which ad, which spin link, which page and which traffic source brought a subscriber or a sale, and what each one cost you in credits. You paste two small tags on your own site, one time. After that, Conversions in your Control Room counts every goal against the click that sent it.</p>
<div class="ctas"><a class="btn pri" href="/conversions">Open Conversions</a><a class="btn blue" href="/join">Not a member yet? Start free</a></div>
</div>
<video src="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/conversion-tracking-ls.mp4?v=20261026" poster="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/conversion-tracking-ls.jpg?v=20261026" controls playsinline preload="metadata" width="1200" height="675" style="display:block;width:100%;height:auto;max-width:860px;background:#000;border-radius:16px;border:1px solid var(--line);margin:0 auto" aria-label="Video: Marty walks through setting up conversion tracking, about 3 minutes"></video>
<div class="panel">
<div class="ph"><h2>Why track conversions</h2><span class="meta">why it matters</span></div>
<div class="pb" style="display:grid;gap:12px">
<div class="rg-two">
<div class="tile"><b>Clicks are not sign-ups</b><span>One banner can get lots of clicks from people who never sign up. Another gets fewer clicks and brings you subscribers. Without tracking, both look the same, or the wrong one looks better.</span></div>
<div class="tile"><b>Find the winner</b><span>Every goal is counted against the click that sent the visitor, so you see which ad campaign, spin link, destination page and traffic source produced it.</span></div>
<div class="tile"><b>A cost per goal, in credits</b><span>Each ad campaign shows its goals, its rate and what each goal cost: the credits the campaign has spent, divided by its goals. Lower is better.</span></div>
<div class="tile"><b>Put next month's fuel behind it</b><span>This is the "your numbers get useful" part of <a href="/refuel">Fuel Your Offers</a>. Run your traffic all month, let the goals come in, then put next month's refuel behind the ad, link and page that convert, instead of guessing. Your goals also feed the goals dial in the Engine Room.</span></div>
</div>
</div>
</div>
<div class="panel">
<div class="ph"><h2>How a conversion gets counted</h2><span class="meta">the flow</span></div>
<div class="pb" style="display:grid;gap:12px">
<ol class="cg-flow" aria-label="How a conversion gets counted, step by step">
<li class="f-ad"><span class="k">1</span><b>Someone clicks</b>Your ad or your spin link. The click gets a random id, added to your page's address as <code>?lsclk=…</code></li>
<li class="f-tag"><span class="k">2</span><b>They land on your page</b>The landing tag keeps that id on your own site for 30 days.</li>
<li><span class="k">3</span><b>They sign up or buy</b>Through your form or your checkout. Nothing changes for them.</li>
<li class="f-px"><span class="k">4</span><b>Your thank-you page loads</b>The goal pixel there reads the kept id and sends it to LinkSpin.</li>
<li class="f-win"><span class="k">5</span><b>Counted in Conversions</b>Against the ad, spin link, page and source that sent them, with cost per goal.</li>
</ol>
<p class="muted" style="font-size:13px">The id is random. It identifies the click, not the person. Nothing personal is read from your page or sent anywhere. An ad click and the spin-link click it led to count as one click.</p>
</div>
</div>
<div class="panel">
<div class="ph"><h2>Set it up in four steps</h2><span class="meta">one time</span></div>
<div class="pb">
<ol class="rg-route">
<li><div>
<h3>Create a goal</h3>
<p>Open <b>Conversions</b> in your Control Room and press <b>Add a goal</b>. Name it with one word for what you count: <b>subscriber</b>, <b>sale</b>, <b>signup</b> (letters, numbers, - or _, up to 32). The default value is optional, in US dollars, used when the pixel carries none. Up to 20 goals per account.</p>
<p>Each goal gets its own pixel id: <b>px</b> plus 10 letters and numbers. It is public and safe to paste: it can only count clicks that are yours. Once you have a goal, your spin links and Banner Spins add the click id to your destinations automatically.</p>
<div class="rg-where"><span class="rg-chip">LinkSpin: Control Room, Conversions</span><span class="rg-chip iap">InstantAdPay: Campaigns, Conversion tracking</span></div>
</div></li>
<li><div>
<h3>Landing tag on the page your traffic lands on</h3>
<p>Under <b>Snippets for</b>, pick your goal and copy <b>1. Landing tag</b>. Paste it once on your landing page (the address your ad or spin link sends people to), just before <code class="i">&lt;/body&gt;</code>. It keeps the click id on your site for 30 days, fills hidden form fields named <code class="i">lsclk</code>, and adds the id to links that stay on your site.</p>
<div class="cg-code"><div class="cg-lbl"><span>1. Landing tag</span><button class="cg-copy" type="button" data-copy>Copy</button></div><pre>&lt;script async src="https://linkspin.app/t.js?px=<span class="cg-ph">YOUR_PIXEL_ID</span>"&gt;&lt;/script&gt;</pre></div>
<p>It is fine on every page of your site (in a site-wide footer). It never slows or breaks the page, even if LinkSpin cannot be reached, and it works inside traffic-exchange frames.</p>
</div></li>
<li><div>
<h3>Goal pixel on your thank-you page</h3>
<p>Copy the goal pixel and paste it on the page people see only after they sign up or buy. Use the script version (<b>2b</b>) wherever your page allows scripts: it reads the id the landing tag kept, the surest match. Use the image version (<b>2</b>) where scripts are not allowed.</p>
<div class="cg-code"><div class="cg-lbl"><span>2b. Goal pixel, script (surest)</span><button class="cg-copy" type="button" data-copy>Copy</button></div><pre>&lt;script async src="https://linkspin.app/cv.js?px=<span class="cg-ph">YOUR_PIXEL_ID</span>&amp;goal=<span class="cg-ph">subscriber</span>"&gt;&lt;/script&gt;</pre></div>
<div class="cg-code"><div class="cg-lbl"><span>2. Goal pixel, image</span><button class="cg-copy" type="button" data-copy>Copy</button></div><pre>&lt;img src="https://linkspin.app/cv.gif?px=<span class="cg-ph">YOUR_PIXEL_ID</span>&amp;goal=<span class="cg-ph">subscriber</span>" width="1" height="1" alt="" style="display:none"&gt;</pre></div>
<p>Recording what a sale was worth? Add <code class="i">&amp;value=19.95</code> to the pixel address. Without it, the goal's default value is used.</p>
<div class="cg-warn"><b>Only on the thank-you page.</b> Never put the goal pixel on your landing page. Everyone who lands would count as a goal.</div>
</div></li>
<li><div>
<h3>Send a test conversion</h3>
<p>Press <b>Send a test conversion</b> next to the snippets. It loads your real pixel, is recorded apart and never counted, and the goal row shows when the last test arrived. That proves your pixel id works.</p>
<p>To check the pixel on your real thank-you page, add <code class="i">&amp;test=1</code> to the end of the pixel address, open your thank-you page once, then reload Conversions: the last test time updates. Take <code class="i">&amp;test=1</code> back out afterwards. Last, open your own spin link, Banner Spin click link or ad and look at the address bar on your landing page: you should see <code class="i">lsclk=</code> in it. That click is yours, so anything you finish after it is kept as a test, never counted.</p>
</div></li>
</ol>
</div>
</div>
<div class="panel">
<div class="ph"><h2>Where the code goes, by platform</h2><span class="meta">copy and paste</span></div>
<div class="pb" style="display:grid;gap:18px">
<p class="muted" style="font-size:13.5px">In every example, replace <span class="mono" style="color:var(--sig-2);font-weight:700">YOUR_PIXEL_ID</span> with your goal's pixel id and <span class="mono" style="color:var(--sig-2);font-weight:700">subscriber</span> with your goal's name. The snippets on your Conversions screen come with both filled in.</p>
<div class="cg-ex">
<h3 style="margin:0">A plain HTML page</h3>
<p>Landing page: the landing tag right before the closing body tag.</p>
<div class="cg-code"><div class="cg-lbl"><span>landing.html</span><button class="cg-copy" type="button" data-copy>Copy</button></div><pre> ...your page...
&lt;script async src="https://linkspin.app/t.js?px=<span class="cg-ph">YOUR_PIXEL_ID</span>"&gt;&lt;/script&gt;
&lt;/body&gt;</pre></div>
<p>Thank-you page: the goal pixel.</p>
<div class="cg-code"><div class="cg-lbl"><span>thank-you.html</span><button class="cg-copy" type="button" data-copy>Copy</button></div><pre> ...your thank-you message...
&lt;script async src="https://linkspin.app/cv.js?px=<span class="cg-ph">YOUR_PIXEL_ID</span>&amp;goal=<span class="cg-ph">subscriber</span>"&gt;&lt;/script&gt;
&lt;/body&gt;</pre></div>
<p>Your own form on the landing page? Add a hidden field and the landing tag fills it with the click id, so your own system can keep it with the lead:</p>
<div class="cg-code"><div class="cg-lbl"><span>hidden field</span><button class="cg-copy" type="button" data-copy>Copy</button></div><pre>&lt;input type="hidden" name="lsclk" value=""&gt;</pre></div>
</div>
<div class="cg-ex">
<h3 style="margin:0">WordPress</h3>
<ol>
<li><b>Landing tag, site-wide:</b> with a header and footer plugin (WPCode, for example), paste the landing tag into the <b>footer</b> box and save. It now runs on every page, landing page included.</li>
<li><b>Goal pixel, thank-you page only:</b> edit your thank-you page, add a <b>Custom HTML</b> block, paste the goal pixel into it and update the page. Do not put the goal pixel in the site-wide footer.</li>
<li>If your WordPress plan or theme strips scripts out of blocks (some hosted plans do), use the image version of the goal pixel in the Custom HTML block.</li>
</ol>
</div>
<div class="cg-ex">
<h3 style="margin:0">Funnel and page builders</h3>
<p>Most builders that allow custom code give you one of two places, and either works:</p>
<ul>
<li>A <b>tracking code</b> or <b>footer code</b> box in the page or funnel settings. Landing tag in the landing page's box, goal pixel in the thank-you page's box.</li>
<li>A <b>custom HTML</b> or <b>code</b> element you drop onto the page. One on each page with the matching line.</li>
</ul>
<p>If a page only accepts images and no scripts, use the image version of the goal pixel there. Keep the landing page and the thank-you page on the same domain.</p>
</div>
<div class="cg-ex">
<h3 style="margin:0">Autoresponders: Aweber, GetResponse and others</h3>
<p>If your list provider shows its own thank-you page after someone subscribes, you cannot paste the pixel there. Point the provider at a thank-you page on <b>your</b> site instead, and put the goal pixel on that page.</p>
<ul>
<li><b>Aweber:</b> open your sign-up form's settings, set <b>Thank You Page</b> to a custom page, and paste your own page's address.</li>
<li><b>GetResponse:</b> in the form or landing page settings, set the <b>thank-you page</b> to a custom URL, and paste your own page's address.</li>
<li><b>Any other provider:</b> look for "thank-you page", "success page" or "redirect after sign-up" and give it your own page's address.</li>
</ul>
<p>Your own thank-you page needs only your message and the goal pixel. Keep the form on your landing page (where the landing tag runs) and use the same domain for both pages.</p>
</div>
<div class="cg-ex">
<h3 style="margin:0">What if I can't put code on the thank-you page?</h3>
<p>Best fix: send people to a thank-you page you control, as above. If that is not possible:</p>
<ul>
<li><b>The pixel can go on the thank-you page, but it is on another domain, or only images are allowed.</b> Use the image version. It cannot read the id your landing tag kept, so it counts through LinkSpin's cookie or the 24-hour match (the same network and browser within a day of the click). Both work, just less surely, and Conversions labels them so you can tell. Keep the landing tag on your landing page: it is what sets up both of these for spin-link clicks.</li>
<li><b>No code of any kind after the sign-up.</b> Then nothing can tell LinkSpin the sign-up happened. You can still keep the click id with each lead through the hidden <code class="i">lsclk</code> field, if your provider stores custom fields.</li>
<li><b>Your page signs people up without leaving the page</b> (a pop-up form). With the landing tag on that page, your page's own code can count the goal with one line after a successful sign-up: <code class="i">if (window.LinkSpin) LinkSpin.goal('YOUR_PIXEL_ID', 'subscriber');</code></li>
<li><b>A tracker or traffic network wants the conversion too.</b> Set a postback to the event <code class="i">goal</code> on <a href="/links">Links</a> or on a <a href="/sources">traffic source</a>. It fires for every counted goal, with <code class="i">{event}</code> set to the goal's name.</li>
</ul>
</div>
</div>
</div>
<div class="panel rg-tbl">
<div class="ph"><h2>How to read Conversions</h2><span class="meta">your numbers</span></div>
<table>
<thead><tr><th>You see</th><th>What it means</th></tr></thead>
<tbody>
<tr><td>Counted</td><td>Goals counted in the range you picked (7, 30 or 90 days), tests and your own clicks (ads, spin links, Banner Spins) left out.</td></tr>
<tr><td>Cost / goal</td><td>The credits the ad campaign has spent so far, divided by its goals of this goal type, in that site's ad credits. Clicks and goals follow the range; spend is the campaign's total, so on an older campaign the figure reads high.</td></tr>
<tr><td>Rate</td><td>Goals divided by the campaign's tracked clicks in the range.</td></tr>
<tr><td>Address</td><td>Surest. The thank-you page's own address still carried the click id.</td></tr>
<tr><td>Kept</td><td>Exact. The landing tag kept the click id on your site and the goal pixel read it back.</td></tr>
<tr><td>Cookie</td><td>Exact, through LinkSpin's own cookie. Some browsers block it.</td></tr>
<tr><td>24 h match</td><td>The same network and browser within a day of the click. A good guess, not proof.</td></tr>
<tr><td>Test / last test</td><td>When your last test conversion arrived. Tests are recorded apart and never counted.</td></tr>
</tbody>
</table>
<div class="pb" style="border-top:1px solid var(--line)"><p class="muted" style="font-size:13px">Each goal gets its own report: by ad campaign (LinkSpin and InstantAdPay), by spin link, by Banner Spin, by destination page and by traffic source (a source you named under Sources, or else the referring site or ad placement). Press CSV for every conversion with its time in Central time, goal, value, match method, campaign, spin link, page, source, country and device. The counting rules: each goal counts once per click, only within 30 days of a real click, and only for clicks on your own ads, links and Banner Spins. Your own clicks on any of them (made while signed in, or from a browser you sign in from) are kept as tests: the note at the top of "How sure is each count" says how many.</p></div>
</div>
<div class="panel">
<div class="ph"><h2>Troubleshooting checklist</h2><span class="meta">not counting?</span></div>
<div class="pb">
<ul class="cg-check">
<li><b>Is the pixel id right?</b> It is <code class="i">px</code> plus 10 letters and numbers, copied from Snippets. A removed goal's pixel stops counting.</li>
<li><b>Did the test arrive?</b> Press Send a test conversion. If the last test time updates, the goal is live. If the <code class="i">&amp;test=1</code> check on your real page does not update it, the pixel is not on that page or the page strips it.</li>
<li><b>Does the click id reach your page?</b> Open your own spin link, Banner Spin or ad: your landing page's address should show <code class="i">lsclk=</code>. If it does not, something between the click and your page (another redirect or a link shortener) is dropping it. Point the link straight at the page with the landing tag.</li>
<li><b>Banner Spin straight to a page?</b> That works too. Once you have a goal, a Banner Spin banner that points straight at a page adds its own click id (<code class="i">lsclk=</code>) to the page address, and its goals show under By Banner Spin. A banner that points at one of your spin links is counted under that spin link.</li>
<li><b>Is the landing tag on the page the click lands on?</b> Exactly that address, not another page of your site.</li>
<li><b>Same domain for both pages?</b> The landing tag keeps the id on one domain. If the landing page is on <code class="i">www.yoursite.com</code> and the thank-you page on <code class="i">yoursite.com</code> (or another site), the script pixel cannot read it and only the cookie or 24-hour match is left.</li>
<li><b>Goal pixel only on the thank-you page?</b> Not in a site-wide footer, not on the landing page.</li>
<li><b>Scripts stripped?</b> Some builders and hosted blogs remove scripts. Use the image version of the goal pixel there.</li>
<li><b>Testing with your own clicks?</b> Your own clicks on your own ads, spin links and Banner Spins are kept as tests and never show in the counts, whether you are signed in or not on that browser (LinkSpin knows the browsers you sign in from). Use Send a test conversion and the <code class="i">&amp;test=1</code> check above to test.</li>
<li><b>Older than 30 days, or the same click twice?</b> A sign-up more than 30 days after the click does not count, and each click counts once per goal.</li>
</ul>
</div>
</div>
<div class="panel">
<div class="ph"><h2>Questions members ask</h2><span class="meta">quick answers</span></div>
<div class="pb">
<dl class="rg-faq">
<div><dt>Does it cost anything?</dt><dd>No. The conversion pixel is free for every member and uses no credits.</dd></div>
<div><dt>Will the tags slow down or break my page?</dt><dd>No. Both load in the background, never stop your page from showing and do nothing visible. If LinkSpin cannot be reached, your page works exactly as before.</dd></div>
<div><dt>Do I need a separate goal for each link or ad?</dt><dd>No. One goal covers every ad and spin link you own. Each conversion is counted against whichever click sent that visitor.</dd></div>
<div><dt>I advertise on InstantAdPay too. Do I set it up twice?</dt><dd>No. Your InstantAdPay goals are these same goals, held on your LinkSpin account under the same email. One landing tag and one goal pixel count clicks from both sites.</dd></div>
<div><dt>Is any personal data sent?</dt><dd>No. The click id is random. No name or email from your page is read or sent.</dd></div>
</dl>
</div>
</div>
<p class="muted" style="font-size:12.5px">One credit is one cent of ad delivery. Credits are not money and cannot be withdrawn. Conversion tracking shows what your own ads and pages produce; it does not promise any number of sign-ups or sales. No income is guaranteed; any commissions depend on real purchases in your line and on your own effort. Cryptocurrency involves risk of loss. (<a href="https://instantadpay.com/conversion-tracking">The InstantAdPay side</a>.)</p>
</div>
</main>
<footer class="foot">
<div class="wrap">
<span class="word">Link<b>Spin</b></span>
<a href="/">Home</a>
<a href="/refuel">Fuel Your Offers</a>
<a href="/support">Support</a>
<a href="/terms">Terms</a>
<a href="/privacy">Privacy</a>
<a href="/disclaimer">Disclaimer</a>
<span class="grow"></span>
<span class="mono" style="font-size:11px">Advertising services with a performance referral program. Not an investment. Crypto transactions are irreversible.</span>
</div>
</footer>
<script src="/assets/conversion-guide.js?v=20261024ct"></script>
</body>
</html>
+75
View File
@@ -0,0 +1,75 @@
<!doctype html>
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Conversions · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.panel{align-content:start}
.range{display:flex;border:1px solid var(--line-strong);border-radius:var(--r);overflow:hidden;background:var(--panel-2)} .range button{background:transparent;border:0;color:var(--muted);font-family:var(--mono);font-size:12px;padding:5px 10px;cursor:pointer} .range button.on{background:var(--ink);color:var(--on-ink)}
.goals .hd,.goals .rw{grid-template-columns:minmax(0,1fr) 120px 70px 90px 150px;gap:8px;align-items:center}
.camps .hd,.camps .rw{grid-template-columns:minmax(0,1fr) 92px 60px 56px 60px 90px;gap:8px}
.lst .hd,.lst .rw{grid-template-columns:minmax(0,1fr) 60px;gap:8px}
.meth{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.meth .m{background:var(--panel-2);border:1px solid var(--line);border-radius:6px;padding:8px 10px;display:grid;gap:2px}
.meth .m .k{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)} .meth .m .v{font-family:var(--display);font-weight:700;font-size:20px}
.snip{display:grid;gap:6px;margin-top:10px} .snip .code{display:block;font-size:12px;line-height:1.6;padding:10px 12px;overflow-wrap:anywhere;white-space:pre-wrap}
.steps{margin:6px 0 0;padding-left:20px;display:grid;gap:6px}
.gsel{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.pill{font-family:var(--mono);font-size:11px;padding:1px 7px;border-radius:3px;background:var(--panel-2);border:1px solid var(--line)}
@media (max-width:900px){.two{grid-template-columns:1fr}.body{padding:12px 16px}.goals .hd{display:none}.goals .rw{grid-template-columns:minmax(0,1fr) auto;row-gap:4px}.camps .hd,.camps .rw{grid-template-columns:minmax(0,1fr) 60px 44px 44px 64px;font-size:12px}.camps .hd span:nth-child(2),.camps .rw span:nth-child(2){display:none}.meth{grid-template-columns:repeat(2,minmax(0,1fr))}}
</style>
</head>
<body>
<div id="page">
<div class="body">
<div class="panel">
<div class="ph" style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px"><h2>Your goals</h2><button class="btn pri" type="button" id="addGoal">Add a goal</button></div>
<div class="muted" style="margin:4px 0 10px">A goal is something you want counted: a subscriber, a sale, a sign-up. Each goal has its own pixel id. The id is public and safe to paste: it can only count clicks that are yours.</div>
<div class="tbl goals"><div class="hd"><span>Goal</span><span>Pixel id</span><span class="r">Value</span><span class="r">Counted</span><span></span></div><div id="goalRows"></div></div>
</div>
<div class="two">
<div class="panel">
<h2>Set it up in 3 steps</h2>
<div style="margin:2px 0 6px"><a href="/conversion-tracking" target="_blank" rel="noopener">How to set it up: the step-by-step guide with copy-paste examples (WordPress, page builders, Aweber, GetResponse)</a></div>
<ol class="steps">
<li><b>Landing page:</b> paste the landing tag once, before &lt;/body&gt;. It keeps the click id on your own site for 30 days.</li>
<li><b>Thank-you page:</b> paste the goal pixel for the goal (the image works anywhere; the script version is surer).</li>
<li><b>Test it:</b> press <b>Send a test conversion</b> below. To check your real thank-you page, add <span class="mono">&amp;test=1</span> to its pixel, open the page once, and the last test time updates (take it back out afterwards). Your own clicks on your ads, spin links and Banner Spins are kept as tests and never counted, so finishing your own form proves nothing in the counts.</li>
</ol>
<div class="gsel" style="margin-top:12px"><span class="muted">Snippets for</span><select class="field" id="goalPick" style="width:auto;min-width:160px"></select><button class="btn" type="button" id="testBtn">Send a test conversion</button><span class="muted" id="testNote"></span></div>
<div class="snip"><span class="sec">1. Landing tag</span><code class="code mono" id="snTag"></code><div><button class="btn sm" type="button" data-copy="snTag">Copy</button></div></div>
<div class="snip"><span class="sec">2. Goal pixel (image)</span><code class="code mono" id="snImg"></code><div><button class="btn sm" type="button" data-copy="snImg">Copy</button></div></div>
<div class="snip"><span class="sec">2b. Goal pixel (script, reads what the landing tag kept)</span><code class="code mono" id="snJs"></code><div><button class="btn sm" type="button" data-copy="snJs">Copy</button></div></div>
<div class="muted" style="margin-top:8px">Add <span class="mono">&amp;value=19.95</span> to the pixel to record what the sale was worth. Without it, the goal's default value is used.</div>
</div>
<div class="panel">
<h2>Autoresponders and hosted thank-you pages</h2>
<div class="ink2" style="display:grid;gap:8px">
<p style="margin:0">If your list provider shows its own thank-you page, you cannot paste the pixel there. Point the provider at a page on <b>your</b> site instead, and put the pixel on that page.</p>
<p style="margin:0"><b>Aweber:</b> open your sign-up form, go to its settings, set <b>Thank You Page</b> to a custom page and paste your page's address.</p>
<p style="margin:0"><b>GetResponse:</b> in the form or landing page settings, set the <b>thank-you page</b> to a custom URL and paste your page's address.</p>
<p style="margin:0">If you cannot change it, the pixel can still count through LinkSpin's cookie or the 24-hour match, just less surely.</p>
<p style="margin:0"><b>Forms on your own page:</b> add a hidden field named <span class="mono">lsclk</span> and the landing tag fills it with the click id, so your own system can pass it on.</p>
<p style="margin:0"><b>Postbacks:</b> a postback set to the event <span class="mono">goal</span> (on <a href="/links">Links</a> or a <a href="/sources">traffic source</a>) fires for every goal, with <span class="mono">{event}</span> = the goal's name.</p>
</div>
</div>
</div>
<div class="panel">
<div class="ph" style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px"><h2>How sure is each count</h2><span class="muted" id="totalNote"></span></div>
<div class="meth" id="methRows"></div>
<div class="muted" style="margin-top:8px"><b>Address</b>: the click id was on the thank-you page's address. <b>Kept</b>: the landing tag kept it on your site. Both are exact. <b>Cookie</b>: LinkSpin's own cookie, exact but some browsers block it. <b>24 h match</b>: same network and browser within a day of the click, a good guess, not proof. Each goal counts once per click, only within 30 days of the click, and only for clicks on your own ads and links.</div>
</div>
<div id="goalReports"></div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/conversions.js?v=20261026a"></script>
</body>
</html>
+11 -9
View File
@@ -1,19 +1,20 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Credits · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px;align-items:start}
.pkgs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.pk{border:1px solid var(--line);border-radius:8px;padding:12px 12px 10px;background:#FFF;display:flex;flex-direction:column;gap:4px;cursor:pointer;text-align:left;font:inherit;color:inherit;min-height:44px;box-shadow:var(--sh)}
.pk{border:1px solid var(--line);border-radius:8px;padding:12px 12px 10px;background:var(--panel);display:flex;flex-direction:column;gap:4px;cursor:pointer;text-align:left;font:inherit;color:inherit;min-height:44px;box-shadow:var(--sh)}
.pk:hover{border-color:var(--accent)}
.pk.on{border-color:var(--sig);box-shadow:0 0 0 3px rgba(255,106,26,.18);background:linear-gradient(180deg,#FFFFFF,var(--hi-row))}
.pk.on{border-color:var(--sig);box-shadow:0 0 0 3px color-mix(in srgb,var(--sig) 18%,transparent);background:linear-gradient(180deg,var(--panel),var(--hi-row))}
.pk .k{font:700 10px var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.pk.on .k{color:var(--sig-2)}
.pk .price{font-family:var(--display);font-weight:700;font-size:28px;line-height:1;letter-spacing:.02em}
@@ -34,7 +35,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>
@@ -45,7 +46,6 @@
<div class="acts" id="fromWrap" hidden><label class="lbl" style="min-width:min(100%,320px)">Buy from<select class="field" id="buyFrom"></select></label><span class="muted" style="font-size:12px" id="fromHint"></span></div>
<div class="acts" id="buyActs">
<button class="btn pri" type="button" id="buyBtn" disabled>Connect a wallet to buy</button>
<button class="btn" type="button" id="cardBtn">Buy POL with a card</button>
<span class="muted" style="font-size:12px">SafePal recommended. MetaMask, Phantom and WalletConnect wallets also work.</span>
</div>
<div id="holdBox" class="warn" style="font-size:13px" hidden></div>
@@ -60,6 +60,7 @@
</div>
</div>
<div style="display:grid;gap:16px;align-content:start">
<div class="panel" id="rfPanel" hidden style="padding:0" aria-live="polite"><div class="ph"><h3>Monthly Refuel</h3><span class="meta" id="rfMeta"></span></div><div style="padding:12px 16px 14px;font-size:13px" class="ink2" id="rfBody"></div></div>
<div class="panel" style="padding:0">
<div class="ph"><h3 id="goesTitle">Where it goes</h3><span class="meta">same transaction</span></div>
<div style="padding:10px 16px 14px" id="goesRows"></div>
@@ -80,9 +81,10 @@
</div>
</div>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/wallet.js?v=20261021a"></script>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/credits-screen.js?v=20261019pos"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/credits-screen.js?v=20261101t"></script>
<script src="/assets/fuel.js?v=20261025ff"></script>
</body>
</html>
+34
View File
@@ -0,0 +1,34 @@
/* LinkSpin goal pixel, script version (conversion pixel, 2026-10-23). Paste on your thank-you page:
* <script async src="https://linkspin.app/cv.js?px=YOUR_PIXEL_ID&goal=subscriber"></script> (optional &value=19.95)
* It sends the click id from this page's address, or the one the landing tag (t.js) kept on your site, to LinkSpin.
* The image version (cv.gif) works without scripts; this one is surer because it can read what the landing tag kept.
* It never throws and never blocks your page.
*/
(function () {
try {
var RX = /^[a-z0-9]{6,24}$/i, W = window;
function stored() {
var v = '';
try { var j = JSON.parse(W.localStorage.getItem('ls_clk') || 'null'); if (j && RX.test(j.id || '') && Date.now() - (j.ts || 0) < 30 * 864e5) v = j.id; } catch (e) {}
if (!v) { try { var m = /(?:^|;\s*)ls_clk=([a-z0-9]{6,24})/i.exec(document.cookie || ''); if (m) v = m[1]; } catch (e) {} }
return v;
}
var q = new URLSearchParams(location.search);
var inUrl = q.get('lsclk') || q.get('lsid') || q.get('clickid') || '';
var c = '', m = '';
if (RX.test(inUrl)) { c = inUrl; m = 'url'; } else { c = stored(); m = c ? 'stored' : ''; }
var list = document.getElementsByTagName('script');
for (var i = 0; i < list.length; i++) {
var s = list[i];
try {
if (!/\/cv\.js(\?|$)/.test(s.src || '') || s.getAttribute('data-ls-done')) continue;
s.setAttribute('data-ls-done', '1');
var u = new URL(s.src, location.href), px = u.searchParams.get('px') || '';
if (!/^px[a-f0-9]{10}$/.test(px)) continue;
var goal = u.searchParams.get('goal') || '', value = u.searchParams.get('value');
var out = u.origin + '/cv.gif?px=' + px + (goal ? '&goal=' + encodeURIComponent(goal) : '') + (value != null && value !== '' ? '&value=' + encodeURIComponent(value) : '') + (c ? '&c=' + encodeURIComponent(c) + '&m=' + m : '') + (u.searchParams.get('test') === '1' ? '&test=1' : '') + '&r=' + Math.random().toString(36).slice(2, 8);
var im = new Image(1, 1); im.src = out;
} catch (e) {}
}
} catch (e) { /* never break the member's page */ }
})();
+3 -2
View File
@@ -1,14 +1,15 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Risk and Earnings Disclaimer | LinkSpin</title>
<meta name="description" content="LinkSpin risk and earnings disclaimer.">
<link rel="canonical" href="{{SITE_URL}}/disclaimer">
<meta name="theme-color" content="#0B1424">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
</head>
<body>
<header class="top">
+5 -4
View File
@@ -1,14 +1,15 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>How earning works | LinkSpin</title>
<meta name="description" content="How members earn ad credits on LinkSpin: the daily set, the claim streak, verified visits, videos, inbox ads, the login bonus, and what to do with the credits.">
<meta name="robots" content="noindex">
<meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
<style>
.eg{max-width:820px}
.eg h2{font-size:23px;margin:40px 0 10px;padding-top:18px;border-top:1px solid var(--line)}
@@ -17,7 +18,7 @@
table{border-collapse:collapse;width:100%;max-width:560px;margin:10px 0 16px;font-variant-numeric:tabular-nums;font-size:15px}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line)} th{color:var(--muted);font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:500}
td:last-child,th:last-child{text-align:right}
.rule{border-left:4px solid var(--mint);background:rgba(59,157,255,.07);padding:14px 18px;border-radius:0 12px 12px 0;margin:0 0 20px}
.rule{border-left:4px solid var(--mint);background:var(--mint-faint);padding:14px 18px;border-radius:0 12px 12px 0;margin:0 0 20px}
.rule b{font-family:var(--disp);display:block;margin-bottom:4px}
</style>
</head>
@@ -68,6 +69,6 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
</body>
</html>
+4 -3
View File
@@ -1,12 +1,13 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Help · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px;max-width:980px}
.hl .hd,.hl .rw{grid-template-columns:minmax(0,1fr) 150px 130px}.hl .rw{cursor:pointer}
@@ -29,7 +30,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=20261023a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/help-screen.js?v=20261016a"></script>
</body>
</html>
+3 -2
View File
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>LinkSpin: one link, every page you promote</title>
@@ -18,9 +18,10 @@
<meta name="twitter:image" content="{{SITE_URL}}/banners/linkspin-og-1200x630.png">
<meta name="theme-color" content="#0B1424">
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
</head>
<body>
+6 -5
View File
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Join LinkSpin</title>
@@ -7,12 +7,13 @@
<meta name="robots" content="noindex, follow">
<meta name="theme-color" content="#0B1424">
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
<style>
.spon{display:inline-flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:999px;background:#FFF;align-self:flex-start;max-width:100%}
.spon .av{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent-dim));display:grid;place-items:center;color:#fff;font:700 11px var(--mono);overflow:hidden;flex:none}
.spon{display:inline-flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:999px;background:var(--panel);align-self:flex-start;max-width:100%}
.spon .av{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent-dim));display:grid;place-items:center;color:var(--accent-ink);font:700 11px var(--mono);overflow:hidden;flex:none}
.spon .av img{width:100%;height:100%;object-fit:cover}
.steps{display:flex;flex-direction:column;gap:12px;margin-top:6px}
.step{display:flex;gap:12px;align-items:flex-start}
@@ -105,7 +106,7 @@ body.squeeze .card{position:sticky;top:16px}
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/join.js?v=20261009b"></script>
</body>
</html>
+12 -11
View File
@@ -1,41 +1,42 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Founding week checklist | LinkSpin</title>
<meta name="description" content="The eight things a leader gets done before launch, and why the order matters. Member training.">
<meta name="robots" content="noindex">
<meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
<style>
.lw-rule{border-left:4px solid #f2c94c;background:rgba(242,201,76,.08);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 24px}
.lw-rule{border-left:4px solid var(--gold-2);background:var(--gold-soft);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 24px}
.lw-rule b{font-family:var(--disp);font-size:17px;display:block;margin-bottom:6px}
.lw-top{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.lw-count{font-family:var(--disp);font-weight:800;font-size:15px}
.lw-count b{color:var(--mint);font-size:22px}
.lw-bar{height:10px;border-radius:99px;background:rgba(255,255,255,.06);overflow:hidden;margin:8px 0 0;width:100%}
.lw-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--mint),#9ff2dc);width:0;transition:width .4s}
.lw-bar{height:10px;border-radius:99px;background:var(--ink-faint);overflow:hidden;margin:8px 0 0;width:100%}
.lw-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--mint),var(--cyan));width:0;transition:width .4s}
.lw-when{font-family:var(--mono);font-size:12px;color:var(--muted)}
.lw-when b{color:var(--ink);font-family:var(--disp);font-size:18px;display:block}
.chk{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.chk li{display:grid;grid-template-columns:34px 1fr auto;gap:14px;align-items:start;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 16px}
.chk li.done{border-color:rgba(59,157,255,.45)}
.chk li.done{border-color:var(--mint-line)}
.chk .box{width:30px;height:30px;border-radius:9px;border:2px solid var(--line-strong);display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--mint);font-size:18px}
.chk li.done .box{background:rgba(59,157,255,.14);border-color:var(--mint)}
.chk li.done .box{background:var(--mint-soft-2);border-color:var(--mint)}
.chk h3{margin:0 0 3px;font-size:16px}
.chk p{margin:0;color:var(--muted);font-size:14px}
.chk .why{margin-top:6px;font-size:13px;color:var(--ink)}
.chk .act{white-space:nowrap}
.chk .act .btn{margin-top:0}
.days{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.days>div{background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px}
.days>div{background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px}
.days .k{font-family:var(--disp);font-weight:800;color:var(--mint);margin-bottom:6px}
.days ul{margin:0;padding-left:18px}
blockquote{margin:0 0 10px;background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 16px;color:var(--muted)}
blockquote{margin:0 0 10px;background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 16px;color:var(--muted)}
blockquote span{display:block;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint);margin-bottom:6px}
.swipe{margin:0 0 12px;background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 16px}
.swipe{margin:0 0 12px;background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 16px}
.swipe .cap{font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint);margin-bottom:6px;display:flex;justify-content:space-between;gap:10px;align-items:center}
.swipe .subj{font-weight:700;margin:0 0 8px}
.swipe pre{white-space:pre-wrap;font:inherit;color:var(--muted);margin:0;line-height:1.5}
@@ -104,7 +105,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/launch.js?v=20260915b"></script>
</body>
</html>
+4 -3
View File
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Live ledger | LinkSpin</title>
@@ -16,9 +16,10 @@
<meta name="twitter:image" content="{{SITE_URL}}/banners/linkspin-og-1200x630.png">
<meta name="theme-color" content="#0B1424">
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
</head>
<body>
<header class="top">
@@ -64,7 +65,7 @@
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/ledger.js?v=20261007a"></script>
</body>
</html>
+13 -12
View File
@@ -1,22 +1,23 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Links · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.ws{display:grid;grid-template-columns:320px minmax(0,1fr);min-height:calc(100vh - 94px)}
.dbody .tiles{grid-template-columns:repeat(auto-fit,minmax(128px,1fr))}
.list{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;background:rgba(255,255,255,.55)}
.list{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;background:var(--panel-glass)}
.list .hd{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line)}
.list .hd h2{font-family:var(--display);font-size:20px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin:0}
.list .flt{padding:8px 16px;border-bottom:1px solid var(--line)}
.list .items{overflow:auto}
.item{display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:8px;padding:11px 16px;border-bottom:1px solid var(--line);border-left:3px solid transparent;cursor:pointer}
.item:hover{background:rgba(31,111,235,.05)} .item.on{background:var(--panel);border-left-color:var(--sig)}
.item:hover{background:var(--row-hover)} .item.on{background:var(--panel);border-left-color:var(--sig)}
.item .nm{font-weight:700;display:flex;gap:8px;align-items:center;flex-wrap:wrap} .item .cd{font-family:var(--mono);font-size:11px;color:var(--muted)}
.item .rt{display:grid;justify-items:end;gap:3px} .item .rt .n{font-family:var(--mono)}
.detail{display:flex;flex-direction:column;min-width:0}
@@ -39,9 +40,9 @@
}
.dest .dl{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.hdot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--line-strong);flex:none;vertical-align:middle}
.hdot.ok{background:var(--ok);box-shadow:0 0 0 2px rgba(14,138,92,.2)} .hdot.warn{background:#D98B0C;box-shadow:0 0 0 2px rgba(217,139,12,.2)} .hdot.bad{background:var(--bad);box-shadow:0 0 0 2px rgba(185,28,28,.2)}
.hchip{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:10px;font-weight:700;color:var(--ink-2);border:1px solid var(--line-strong);border-radius:999px;padding:2px 8px;white-space:nowrap;background:#fff;cursor:pointer;letter-spacing:.02em}
.hchip.set{color:var(--sig-2);border-color:rgba(255,106,26,.5);background:var(--sig-soft)}
.hdot.ok{background:var(--ok);box-shadow:0 0 0 2px color-mix(in srgb,var(--ok) 20%,transparent)} .hdot.warn{background:var(--note-line);box-shadow:0 0 0 2px color-mix(in srgb,var(--note-line) 20%,transparent)} .hdot.bad{background:var(--bad);box-shadow:0 0 0 2px color-mix(in srgb,var(--bad) 20%,transparent)}
.hchip{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:10px;font-weight:700;color:var(--ink-2);border:1px solid var(--line-strong);border-radius:999px;padding:2px 8px;white-space:nowrap;background:var(--panel);cursor:pointer;letter-spacing:.02em}
.hchip.set{color:var(--sig-2);border-color:var(--sig-line);background:var(--sig-soft)}
.he{display:grid;gap:10px}
.he-presets{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.he-tz{display:flex;gap:8px;align-items:center;flex-wrap:wrap} .he-tz select{width:auto;min-width:180px} .he-tz input{width:200px}
@@ -54,7 +55,7 @@
.he-grid .c.on{background:var(--sig);border-color:var(--sig-2)}
.he-sum{font-weight:700} .he-sum small{font-weight:500;color:var(--muted)}
.he .acts{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.note{border:1px solid rgba(194,65,12,.4);background:var(--warn-soft);color:var(--warn);border-radius:8px;padding:8px 12px;font-size:12px}
.note{border:1px solid var(--warn-line);background:var(--warn-soft);color:var(--warn);border-radius:8px;padding:8px 12px;font-size:12px}
.wrow{display:flex;align-items:center;gap:8px} .wrow input{width:56px}
.empty{padding:40px 24px;color:var(--muted);text-align:center;display:grid;gap:10px;justify-items:center}
.two{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px}
@@ -71,9 +72,9 @@
.vsw .nw{font-family:var(--mono);font-size:9px;letter-spacing:.06em;color:var(--sig-2);margin-left:4px}
.bsr .hd,.bsr .rw{grid-template-columns:minmax(0,2.4fr) 140px 80px 80px 96px 130px}
.bsr .rw.edit{grid-template-columns:1fr;background:var(--panel-2)}
.bthumb{display:block;max-width:100%;max-height:96px;width:auto;height:auto;border:1px solid var(--line);border-radius:4px;background:repeating-conic-gradient(#eef1f5 0 25%,#fff 0 50%) 50%/12px 12px}
.bthumb{display:block;max-width:100%;max-height:96px;width:auto;height:auto;border:1px solid var(--line);border-radius:4px;background:repeating-conic-gradient(var(--panel-2) 0 25%,var(--panel) 0 50%) 50%/12px 12px}
.bprev{display:grid;gap:6px;justify-items:start;overflow:auto;max-width:100%}
.bprev img{display:block;max-width:100%;height:auto;border:1px dashed var(--line-strong);background:repeating-conic-gradient(#eef1f5 0 25%,#fff 0 50%) 50%/12px 12px}
.bprev img{display:block;max-width:100%;height:auto;border:1px dashed var(--line-strong);background:repeating-conic-gradient(var(--panel-2) 0 25%,var(--panel) 0 50%) 50%/12px 12px}
.bframe{border:1px dashed var(--line-strong);display:grid;place-items:center;color:var(--muted);font-family:var(--mono);font-size:11px;max-width:100%;background:var(--panel-2)}
.addg{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
.addg .full{grid-column:1/-1}
@@ -85,7 +86,7 @@
.modes{display:grid;gap:8px} .modes label{display:flex;gap:8px;align-items:flex-start;cursor:pointer} .modes input{margin-top:3px}
.bsr .ml{display:none}
.st3 .hd,.st3 .rw{grid-template-columns:minmax(0,2fr) 80px 70px 70px 64px 74px 56px}
.st3 .ml{display:none} .bhl{font-size:11.5px} .bswin{background:var(--ok);color:#fff;border-radius:3px;padding:1px 6px;font-size:10px;font-weight:700;letter-spacing:.06em;margin-left:6px;vertical-align:middle}
.st3 .ml{display:none} .bhl{font-size:11.5px} .bswin{background:var(--ok);color:var(--ok-ink);border-radius:3px;padding:1px 6px;font-size:10px;font-weight:700;letter-spacing:.06em;margin-left:6px;vertical-align:middle}
.bscache{display:block;margin-top:3px;font-size:11px;color:var(--warn)} .bsbreak{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:900px){.bsr .ml,.st3 .ml{display:inline;color:var(--muted);font-size:11px}.bsr .rw .r,.st3 .rw .r{text-align:left}.bsr .hd,.st3 .hd{display:none}.bsr .rw{grid-template-columns:1fr 1fr}.st3 .rw{grid-template-columns:1fr 1fr 1fr}.st3 .rw>:first-child{grid-column:1/-1}.addg{grid-template-columns:1fr}.bsbreak{grid-template-columns:1fr}}
@media (max-width:760px){.bsr .rw{grid-template-columns:1fr}.tgt{grid-template-columns:1fr}.vsw{padding:8px 10px 0}.vsw button{padding:6px 10px;font-size:14px}}
@@ -252,7 +253,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/links.js?v=20261021t"></script>
<script src="/assets/banner-spin.js?v=20261020bs3"></script>
</body>
+18 -10
View File
@@ -1,14 +1,15 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>More · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<style>@import url("/assets/site.css?v=ls20260916a") layer(legacy);</style>
<link rel="stylesheet" href="/assets/tools.css?v=20261018pc2">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>@import url("/assets/site.css?v=ls20261101t") layer(legacy);</style>
<link rel="stylesheet" href="/assets/tools.css?v=20261101t">
</head>
<body>
@@ -108,6 +109,7 @@
<p><input id="obUsername" placeholder="Username (3-20 letters, numbers, _)" autocomplete="off" style="width:100%"></p>
<p class="muted small" style="margin:12px 0 4px">Optional — a short bio for your public page (you can skip this).</p>
<p><textarea id="obBio" rows="2" maxlength="600" placeholder="A short bio (optional)" style="width:100%"></textarea></p>
<p class="muted small" style="margin:-6px 0 8px">No links in the bio, and nothing from the prohibited list in the <a href="/terms#prohibited" target="_blank" rel="noopener">Terms</a>.</p>
<p id="obErr" class="small" style="color:var(--bad)" hidden></p>
<p style="margin-top:14px;display:flex;gap:10px;justify-content:flex-end">
<button class="btn sec small" id="obSkip" type="button" hidden>Skip for now</button>
@@ -589,7 +591,7 @@
campaigns just like purchased ones.</p>
<p><span class="badge" id="earnProgress">…</span>
<span class="badge" id="earnBalance">…</span></p>
<div class="card" style="background:rgba(4,8,7,.5)" id="earnStage">
<div class="card" style="background:var(--ground-soft)" id="earnStage">
<div id="earnAdBox" class="small muted" style="min-height:80px;display:grid;place-items:center">
Press the button to open the first ad in a new tab.</div>
<p style="margin-top:14px">
@@ -608,7 +610,7 @@
can't be skipped — the timer runs on our server. You never see your own videos.
Prefer a feed? <a href="/shorts">Open Shorts</a> for a full-screen, swipe-to-next experience.</p>
<p><span class="badge" id="vidProgress">…</span></p>
<div class="card" style="background:rgba(4,8,7,.5)" id="vidStage">
<div class="card" style="background:var(--ground-soft)" id="vidStage">
<div id="vidBox" class="small muted" style="min-height:120px;display:grid;place-items:center">
Press the button to load the first video.</div>
<div id="vidWrap" hidden style="max-width:560px;margin:0 auto">
@@ -630,7 +632,7 @@
<p class="muted small">Visit a member's site in a new tab, stay the required few seconds,
pass a quick check, and earn. Each site counts once for you — real, unique human visits.</p>
<p><span class="badge" id="vsProgress">…</span></p>
<div class="card" style="background:rgba(4,8,7,.5)">
<div class="card" style="background:var(--ground-soft)">
<div id="vsBox" class="small muted" style="min-height:70px;display:grid;place-items:center">Press the button to load a site to visit.</div>
<div id="vsCheck" hidden style="margin-top:10px"><span class="prompt" id="vsPrompt"></span> <span id="vsOpts"></span></div>
<p style="margin-top:12px">
@@ -848,6 +850,7 @@
<button class="btn small sec" id="pfAvatarBtn" type="button">Upload avatar</button>
<span class="small muted" id="pfAvatarInfo"></span></p>
<p><textarea id="pfBio" rows="3" maxlength="600" placeholder="A short bio for your profile page…" style="width:100%"></textarea></p>
<p class="small muted" style="margin:-6px 0 10px">No links in the bio, and nothing from the prohibited list in the <a href="/terms#prohibited" target="_blank" rel="noopener">Terms</a>.</p>
<p class="small muted" style="margin-bottom:4px">Social links (https URLs — shown on your public page):</p>
<div class="grid c2" style="gap:8px">
<input id="soc-facebook" placeholder="Facebook URL" style="width:100%">
@@ -864,6 +867,11 @@
<p style="margin-top:12px"><button class="btn" id="pfDetailsSave">Save profile</button>
<a class="btn small sec" id="pfViewBio" target="_blank" rel="noopener" hidden>View my page</a></p>
</div>
<div class="card theme-card">
<h3>Appearance</h3>
<p class="muted small">Light or dark, or Auto to follow your device setting. Saved with your account, so it follows you to any browser you sign in on.</p>
<span class="seg theme-seg" role="group" aria-label="Theme"><button type="button" data-theme="light" title="Light theme">Light</button><button type="button" data-theme="dark" title="Dark theme">Dark</button><button type="button" data-theme="auto" title="Follow the device">Auto</button></span>
</div>
<div class="card">
<h3>Your line banner</h3>
<p class="muted small">Set a destination link (and a banner image for your wall), and every new
@@ -1007,12 +1015,12 @@
</div>
</div>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/cr-shell.js?v=20261101t"></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>
<script src="/assets/my.js?v=20261023q"></script>
<script src="/assets/my.js?v=20261101t"></script>
<script src="/assets/chat.js?v=20261016a"></script>
</body>
</html>
+6 -5
View File
@@ -1,15 +1,16 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Pages · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.look{display:grid;gap:10px;margin:6px 0 10px}.lk-row{display:flex;gap:10px;align-items:flex-start}.lk-k{flex:none;width:64px;font:700 11px var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding-top:9px}
.lk-opts{display:flex;gap:6px;flex-wrap:wrap}.lk-opts button{font:600 12px var(--body);padding:7px 10px;border-radius:7px;border:1px solid var(--line);background:transparent;color:var(--fg);cursor:pointer}.lk-opts button.on{border-color:var(--accent);background:rgba(59,157,255,.12)}
.lk-opts{display:flex;gap:6px;flex-wrap:wrap}.lk-opts button{font:600 12px var(--body);padding:7px 10px;border-radius:7px;border:1px solid var(--line);background:transparent;color:var(--fg);cursor:pointer}.lk-opts button.on{border-color:var(--accent);background:var(--accent-soft)}
.heroes{display:flex;gap:6px;flex-wrap:wrap}.heroes button{width:72px;height:48px;border-radius:7px;border:2px solid var(--line);padding:0;overflow:hidden;cursor:pointer;background:#000}.heroes button img{width:100%;height:100%;object-fit:cover;display:block;opacity:.8}.heroes button.on{border-color:var(--accent)}.heroes button.on img{opacity:1}
.pal{display:flex;gap:8px;flex-wrap:wrap}.pal button{width:34px;height:26px;border-radius:7px;border:2px solid transparent;cursor:pointer;padding:0;overflow:hidden;display:grid;grid-template-columns:1fr 1fr 1fr}.pal button i{display:block}.pal button.on{border-color:var(--fg)}
@@ -20,7 +21,7 @@
.card{box-shadow:var(--sh)} .card.on{border-color:var(--sig);box-shadow:0 0 0 1px var(--sig),var(--sh)}
.thumb{height:96px;background:var(--panel-2);padding:12px;display:grid;gap:6px;align-content:start} .thumb i{display:block;background:var(--line);height:6px;border-radius:2px} .thumb i.t{background:var(--accent-dim);height:10px;width:70%} .thumb i.b{background:linear-gradient(90deg,var(--accent-hi),var(--accent));height:14px;width:40%;margin-top:auto}
.card .cap{padding:10px 12px;display:grid;gap:3px} .card .cap b{font-size:13px}
.side{border-left:1px solid var(--line);padding:16px;display:grid;gap:12px;align-content:start;background:rgba(255,255,255,.6)}
.side{border-left:1px solid var(--line);padding:16px;display:grid;gap:12px;align-content:start;background:var(--panel-glass)}
.side h2{font-family:var(--display);font-size:18px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin:0}
.types{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px} .types button{background:transparent;border:1px solid var(--line);border-radius:var(--r);color:var(--ink);padding:8px 6px;cursor:pointer;display:grid;gap:2px;text-align:left} .types button.on{border-color:var(--accent)} .types small{color:var(--muted);font-size:11px}
.ed{display:grid;gap:10px} .ed textarea{min-height:90px;resize:vertical}
@@ -72,7 +73,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/pages-screen.js?v=20261021t"></script>
</body>
</html>
+8 -7
View File
@@ -1,14 +1,15 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>For site owners | LinkSpin</title>
<meta name="description" content="Marty's partner kit for site owners who run a downline builder: the platform in three minutes, how the money moves, what your members get, and what you get for listing LinkSpin.">
<meta name="robots" content="noindex">
<meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
<style>
.pk{max-width:820px}
.pk h2{font-size:24px;margin:44px 0 12px;padding-top:20px;border-top:1px solid var(--line)}
@@ -26,11 +27,11 @@
table{border-collapse:collapse;width:100%;margin:10px 0 18px;font-variant-numeric:tabular-nums;font-size:15px}
th,td{text-align:left;padding:9px 10px;border-bottom:1px solid var(--line)} th{color:var(--muted);font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:500}
td:nth-child(2),td:nth-child(3),th:nth-child(2),th:nth-child(3){text-align:right}
.get{border:1px solid #f2c94c;background:rgba(242,201,76,.08);border-radius:14px;padding:18px 22px;margin:16px 0}
.get h3{color:#f2c94c;margin:0 0 8px}
.cta{margin:26px 0 8px;padding:22px;border:1px solid var(--mint);border-radius:14px;background:rgba(59,157,255,.06)}
.get{border:1px solid var(--gold-line);background:var(--gold-soft);border-radius:14px;padding:18px 22px;margin:16px 0}
.get h3{color:var(--gold-2);margin:0 0 8px}
.cta{margin:26px 0 8px;padding:22px;border:1px solid var(--mint);border-radius:14px;background:var(--mint-faint)}
.cta .btn{margin-top:10px}
code{background:rgba(4,8,7,.6);padding:2px 7px;border-radius:6px;font-size:13.5px;word-break:break-all}
code{background:var(--ground-soft);padding:2px 7px;border-radius:6px;font-size:13.5px;word-break:break-all}
@media (max-width:640px){.split{grid-template-columns:1fr 1fr}}
</style>
</head>
@@ -130,7 +131,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford to lose.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/partners.js?v=20261010a"></script>
</body>
</html>
+9 -8
View File
@@ -1,16 +1,17 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Team-building plays | LinkSpin</title>
<meta name="description" content="Three ways to build your LinkSpin line, plus the Qualified Start opening move. Member training.">
<meta name="robots" content="noindex">
<meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
<style>
.pl-rule{border-left:4px solid #f2c94c;background:rgba(242,201,76,.08);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 28px}
.pl-rule{border-left:4px solid var(--gold-2);background:var(--gold-soft);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 28px}
.pl-rule b{font-family:var(--disp);font-size:17px;display:block;margin-bottom:6px}
.pl-split{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:0 0 10px}
.pl-split>div{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:14px 10px;text-align:center}
@@ -24,17 +25,17 @@
.pl-ladder .b{color:var(--mint);font-size:12.5px}
.play header{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:6px}
.play h2{font-size:24px;margin:0}
.play .tag{font-family:var(--mono);font-size:11.5px;color:var(--mint);border:1px solid rgba(59,157,255,.4);border-radius:999px;padding:3px 10px}
.play .tag{font-family:var(--mono);font-size:11.5px;color:var(--mint);border:1px solid var(--mint-line);border-radius:999px;padding:3px 10px}
.play ol{margin:0 0 14px 20px;padding:0;line-height:1.6}
.play ol li{margin:0 0 8px}
.meta{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.meta>div{background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px}
.meta>div{background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px}
.meta .k{font-family:var(--mono);font-size:11px;color:var(--muted);letter-spacing:.08em;text-transform:uppercase;margin-bottom:4px}
.rec{border-color:var(--mint)}
.cal{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.cal>div{background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px}
.cal>div{background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px}
.cal .k{font-family:var(--disp);font-weight:800;color:var(--mint);margin-bottom:6px}
blockquote{margin:0 0 10px;background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 16px;color:var(--muted);font-style:italic}
blockquote{margin:0 0 10px;background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 16px;color:var(--muted);font-style:italic}
blockquote span{display:block;font-style:normal;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint);margin-bottom:4px}
.fit-table th{text-align:left;color:var(--muted);font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:500}
.fit-table td,.fit-table th{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:top}
@@ -192,7 +193,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/plays.js?v=20260910b"></script>
</body>
</html>
+7 -3
View File
@@ -1,14 +1,15 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Privacy Policy | LinkSpin</title>
<meta name="description" content="LinkSpin privacy policy.">
<link rel="canonical" href="{{SITE_URL}}/privacy">
<meta name="theme-color" content="#0B1424">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
</head>
<body>
<header class="top">
@@ -27,6 +28,9 @@
<p>A minimal set: the email you sign up with, a username and any profile details you choose to add (avatar, bio, social links), and, only if you link one, your public wallet address. The links you rotate, the pages you publish, the zones you register, campaign content you create and reports you submit are stored to run the service. We also read on-chain activity that is already public on the blockchain.</p>
<h2 class="disp">Click and impression records</h2>
<p>When someone opens one of your spin links or sees a zone on your site, we record the time, the destination chosen, the country, the device type, the referring site and any click id or tracking parameters in the link, plus a daily-salted hash of the visitor that is not reversible to a person. These records power your reports and are kept for the life of the link.</p>
<h2 class="disp">Conversion tracking</h2>
<p>When someone clicks an ad on LinkSpin or InstantAdPay, or a spin link whose owner tracks goals, we give that click a random click id and add it to the address they land on (as <code>lsclk</code>). We keep the click with its time, campaign, country, device type and where it was clicked, plus a one-way hash of the network address and browser that we use only to match a conversion within 24 hours. We do not store the IP address itself.</p>
<p>Advertisers who use our landing tag (<code>t.js</code>) keep that click id on their own website for 30 days, in the browser's local storage and a cookie named <code>ls_clk</code> on their site. When the visitor later reaches the advertiser's thank-you page, the goal pixel (<code>cv.gif</code> or <code>cv.js</code>) tells us the goal was reached for that click id, so the advertiser can see how many of their clicks became, say, subscribers or sales, and what each cost. We also set a cookie named <code>ls.clk</code> on our own domain when an ad is clicked, so the pixel can still match where the advertiser's site has no tag. Nothing personal is read or stored by the tag or the pixel: no names, emails or form contents. A conversion only ever counts for the advertiser who owns the click.</p>
<h2 class="disp">Leads on your pages</h2>
<p>Email addresses entered on a page you publish belong to you and are shown only to you. We store them so you can download them or forward them to your own autoresponder. Visitors are told on the page who is collecting their email.</p>
<h2 class="disp">What we do not collect</h2>
@@ -34,7 +38,7 @@
<h2 class="disp">How we use it</h2>
<p>To run your account, serve and measure links, pages and ads, attribute referrals, send service and notification emails (payouts, messages, onboarding), and keep the Platform secure. You can set your email and chat notification preferences in your dashboard.</p>
<h2 class="disp">Cookies</h2>
<p>We use a session cookie to keep you signed in, a referral cookie to credit the sponsor whose link you arrived through, a click cookie that ties a sign-up back to the spin link that brought you, and a demo cookie that holds a spin link you made before signing in. That is it. No third-party ad-tracking cookies.</p>
<p>We use a session cookie to keep you signed in, a referral cookie to credit the sponsor whose link you arrived through, a click cookie that ties a sign-up back to the spin link that brought you, a demo cookie that holds a spin link you made before signing in, a visitor cookie (<code>ls.vid</code>) that lets members show or hide their own ads to people who visited their pages, and the conversion click cookie (<code>ls.clk</code>) described above. The last two can be read when our audience or goal pixel loads on a member's own site. We do not use any other company's tracking cookies, and we do not sell or share these records.</p>
<h2 class="disp">Sharing</h2>
<p>Your username and public profile are visible to others by design, and on-chain transactions are public by nature. We share data with infrastructure providers (hosting, email delivery) only as needed to operate the service, with the partner ad network only as impression counts, and when required by law.</p>
<h2 class="disp">Your choices</h2>
+6 -5
View File
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
@@ -12,15 +12,16 @@
<meta property="og:image" content="{{SITE_URL}}/banners/linkspin-og-1200x630.png">
<meta name="theme-color" content="#0B1424">
<link rel="icon" type="image/png" href="/logo-icon.png">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
<style>
.strip .n{font-family:var(--display);font-size:22px;color:var(--chrome-ink);letter-spacing:.04em;line-height:1}
.strip .st{display:flex;align-items:baseline;gap:8px}
.sizes{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.sz{padding:14px;display:flex;flex-direction:column;gap:10px;min-height:130px}
.sz .box{height:62px;display:flex;align-items:center;justify-content:center}
.sz .box i{display:block;background:repeating-linear-gradient(135deg,var(--accent-soft) 0 4px,#fff 4px 8px);border:1.5px solid var(--accent-dim);border-radius:2px}
.sz .box i{display:block;background:repeating-linear-gradient(135deg,var(--accent-soft) 0 4px,var(--panel) 4px 8px);border:1.5px solid var(--accent-dim);border-radius:2px}
.sz .lab{display:flex;justify-content:space-between;align-items:center;gap:6px;flex-wrap:wrap}
.sz .lab b{font:700 14px var(--mono)}
.steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;counter-reset:step}
@@ -34,8 +35,8 @@
.rates td.n{font:700 15px var(--mono);white-space:nowrap}
.yesno{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.yesno ul{margin:0;padding-left:18px;color:var(--ink-2);display:flex;flex-direction:column;gap:8px;font-size:15px}
.tag.v{border-color:rgba(255,106,26,.45);color:var(--sig-2);background:var(--sig-soft)}
.code{display:block;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;color:#8CC8FF;font:500 12px var(--mono);padding:12px 14px;line-height:1.6;overflow-wrap:anywhere}
.tag.v{border-color:var(--sig-line);color:var(--sig-2);background:var(--sig-soft)}
.code{display:block;background:var(--inset);border:1px solid var(--chrome-line);border-radius:6px;color:var(--chrome-hi);font:500 12px var(--mono);padding:12px 14px;line-height:1.6;overflow-wrap:anywhere}
.faq details{border:1px solid var(--line);border-radius:8px;background:var(--panel);padding:0 18px}
.faq summary{cursor:pointer;font-weight:700;padding:14px 0;list-style:none;display:flex;justify-content:space-between;gap:12px}
.faq summary::-webkit-details-marker{display:none}
+285
View File
@@ -0,0 +1,285 @@
<!doctype html>
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Fuel Your Offers: the Monthly Refuel guide | LinkSpin</title>
<meta name="description" content="How the Monthly Refuel streak works on LinkSpin: refuel your ads every month with a $25+ package under Credits (or $20+ on InstantAdPay) and your bonus ad credits climb from +10% to +40%. The flow, the numbers and the member steps.">
<link rel="canonical" href="{{SITE_URL}}/refuel">
<meta property="og:type" content="website"><meta property="og:site_name" content="LinkSpin">
<meta property="og:url" content="{{SITE_URL}}/refuel">
<meta property="og:title" content="Fuel Your Offers: refuel every month, watch your bonus climb">
<meta property="og:description" content="The Monthly Refuel streak on LinkSpin and InstantAdPay: bonus ad credits from +10% up to +40% when you refuel your ads every month. Here is how it works, step by step.">
<meta property="og:image" content="{{SITE_URL}}/banners/fuel-your-offers-1200x675.jpg">
<meta property="og:image:width" content="1200"><meta property="og:image:height" content="675">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Fuel Your Offers: refuel every month, watch your bonus climb">
<meta name="twitter:description" content="Bonus ad credits from +10% up to +40% when you refuel your ads every month on LinkSpin and InstantAdPay.">
<meta name="twitter:image" content="{{SITE_URL}}/banners/fuel-your-offers-1200x675.jpg">
<meta name="theme-color" content="#0B1424">
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
<style>
.rg{max-width:980px}
.rg p{margin:0}
.rg-banner{display:block;width:100%;height:auto;border-radius:8px;border:1px solid var(--line);box-shadow:var(--sh)}
.rg-gauge{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.rg-gauge .tile{padding:12px 14px}
.rg-gauge b{display:block;font:700 26px var(--display);color:var(--sig-2);line-height:1.1;font-variant-numeric:tabular-nums}
.rg-gauge span{font-size:12.5px;color:var(--muted)}
.rg-gauge .tile:last-child{background:var(--sig-soft);border-color:var(--sig)}
.pb{padding:14px 16px}
/* the flow: one spine down the page, decisions open into branch cards that stack on a phone */
.rg-legend{display:flex;flex-wrap:wrap;gap:8px 18px;font-size:12.5px;color:var(--muted);margin:0 0 12px}
.rg-legend i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:6px;vertical-align:-1px;border:1px solid}
.rg-flow{list-style:none;margin:0;padding:0;display:grid}
.rg-flow > li{display:grid;gap:10px;position:relative;padding-bottom:30px}
.rg-flow > li:not(:last-child)::after{content:"";position:absolute;left:22px;bottom:4px;width:2px;height:22px;background:var(--line-strong)}
.rg-flow > li:not(:last-child)::before{content:"";position:absolute;left:17px;bottom:0;border:6px solid transparent;border-top-color:var(--line-strong);border-bottom:0}
.rg-n{border:1px solid var(--line-strong);border-radius:8px;padding:10px 13px;font-size:14px;line-height:1.45;background:var(--panel);color:var(--ink-2);min-width:0}
.rg-n b{display:block;font-weight:800;color:var(--ink);margin-bottom:2px}
.rg-n .k{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;font:700 12px var(--mono);margin-right:6px;vertical-align:1px;background:var(--chrome);color:var(--chrome-ink)}
.rg-n.start{border-color:var(--accent);background:var(--accent-soft)}
.rg-n.ask{border-style:dashed;border-color:var(--ink-2)}
.rg-n.go{border-color:var(--ok);background:var(--ok-soft)}
.rg-n.fuel{border-color:var(--sig);background:var(--sig-soft)}
.rg-n.stop{border-color:var(--line-strong);background:var(--panel-2);color:var(--muted)}
.rg-n .to{display:block;margin-top:4px;font:500 11.5px var(--mono);color:var(--muted)}
.rg-br{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:10px;padding-left:18px;border-left:2px solid var(--line-strong);margin-left:22px}
.rg-b{display:grid;gap:6px;align-content:start;min-width:0}
.rg-e{font:700 11px var(--mono);letter-spacing:.04em;color:var(--accent-hi)}
.rg-b .rg-br{margin-left:4px;padding-left:12px}
/* numbers */
.rg-tbl table{width:100%;border-collapse:collapse;font-size:14px}
.rg-tbl th,.rg-tbl td{padding:9px 14px;text-align:left;border-bottom:1px solid var(--line)}
.rg-tbl th{font:700 10.5px var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.rg-tbl td.n,.rg-tbl th.n{text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums}
.rg-tbl td.both{color:var(--sig-2);font-weight:700}
.rg-tbl tr:last-child td{border-bottom:0}
/* member route */
.rg-route{list-style:none;counter-reset:s;margin:0;padding:0;display:grid;gap:12px}
.rg-route li{counter-increment:s;display:grid;grid-template-columns:40px minmax(0,1fr);gap:14px;align-items:start;padding:12px 0;border-bottom:1px solid var(--line)}
.rg-route li:last-child{border-bottom:0}
.rg-route li::before{content:counter(s);font:700 20px var(--display);width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(180deg,#FF7A32,var(--sig));color:var(--sig-ink)}
.rg-route h3{font:700 17px var(--display);letter-spacing:.04em;text-transform:uppercase;margin:0 0 4px;color:var(--ink)}
.rg-route p{font-size:14px;color:var(--ink-2);margin:0 0 8px}
.rg-where{display:flex;flex-wrap:wrap;gap:6px}
.rg-chip{font:700 11.5px var(--body);padding:3px 10px;border-radius:999px;background:var(--accent-soft);color:var(--accent-hi);border:1px solid var(--accent-dim)}
.rg-chip.iap{background:var(--ok-soft);color:var(--ok);border-color:var(--ok-line)}
.rg-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px}
.rg-two .pb p{font-size:14px;color:var(--ink-2)}
.rg-coach ul{margin:0;padding-left:20px;display:grid;gap:6px;font-size:14px;color:var(--ink-2)}
.rg-faq{display:grid;gap:14px;margin:0}
.rg-faq dt{font-weight:800;color:var(--ink)}
.rg-faq dd{margin:4px 0 0;color:var(--ink-2);font-size:14px}
@media (max-width:640px){.rg-gauge{grid-template-columns:repeat(2,minmax(0,1fr))}.rg h1{font-size:34px!important}.rg-br{margin-left:10px;padding-left:12px}}
</style>
</head>
<body>
<header class="top">
<div class="wrap">
<a class="brand" href="/" aria-label="LinkSpin home"><span class="mark"></span><span class="word">Link<b>Spin</b></span></a>
<span class="eyebrow" style="color:var(--chrome-sub);padding-left:14px;border-left:1px solid var(--chrome-line)">Fuel Your Offers</span>
<span class="grow"></span>
<a href="/credits" class="btn ghost">Buy a package</a>
<a href="/join" class="btn pri">Start free</a>
</div>
</header>
<main class="sec" style="padding-top:44px">
<div class="wrap rg" style="display:grid;gap:22px">
<div class="text" style="display:grid;gap:12px">
<span class="eyebrow">LinkSpin + InstantAdPay · live since October 24, 2026</span>
<h1 class="disp" style="margin:0;font-size:44px;line-height:1.04">Fuel Your Offers: refuel every month, watch your bonus climb</h1>
<p style="font-size:16px;color:var(--ink-2)">Your ads run on fuel. Refuel them every month with a new LinkSpin package under Credits and the Monthly Refuel streak adds bonus ad credits that climb each month, a fresh Refuel Kit loads straight into your Banner Spin, and the Engine Room at the top of Ads tells you the next move. LinkSpin alone keeps your streak going. Refuel InstantAdPay too in the same cycle and the bonus is bigger on both.</p>
<div class="ctas"><a class="btn pri" href="/join">Start free</a><a class="btn blue" href="/credits">Already a member? Buy a package</a></div>
</div>
<video class="rg-banner" src="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/refuel-ls.mp4?v=20261024" poster="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/refuel-ls.jpg?v=20261024" controls playsinline preload="metadata" width="1200" height="675" style="background:#000;width:100%;height:auto;border-radius:16px" aria-label="Video: Marty walks through Fuel Your Offers on LinkSpin, 3 minutes"></video>
<div class="rg-gauge" aria-label="Bonus when you refuel both sites, by streak month">
<div class="tile"><b>+15%</b><span>Month 1, both engines</span></div>
<div class="tile"><b>+20%</b><span>Month 2</span></div>
<div class="tile"><b>+30%</b><span>Month 3</span></div>
<div class="tile"><b>+40%</b><span>Month 4 and on, + 100 Featured credits on InstantAdPay</span></div>
</div>
<div class="panel">
<div class="ph"><h2>Why keep refueling</h2><span class="meta">why it matters</span></div>
<div class="pb" style="display:grid;gap:12px">
<p style="margin:0;font-size:16px;color:var(--ink-2)">Traffic is what makes an offer work, and traffic stops the day your credits run out. A Banner Spin or spin link that runs for a week and then goes quiet gives people one look. Most people don't act on the first look. They act after they've seen your offer a few times, over days and weeks. Refueling every month keeps your offer in front of people the whole month, not just the week you bought.</p>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:12px">
<div class="tile" style="display:grid;gap:4px;padding:12px 14px;font-size:14.5px"><b>Steady beats bursts</b><span>One big push, then nothing, means every new visitor sees you once. A monthly refuel keeps your rotation running every day, so the people who saw you last week see you again this week. That repeat exposure is what turns a click into a sign-up.</span></div>
<div class="tile" style="display:grid;gap:4px;padding:12px 14px;font-size:14.5px"><b>Your numbers get useful</b><span>With traffic running all month, Banner Spin reports and conversion tracking collect enough clicks and goals to crown a winner. Once you track a goal, every Banner Spin click carries a click id, banners that go straight to your page included, so goals on a page with your landing tag are counted per Banner Spin. Next month's fuel goes behind the banner and the page that actually convert.</span></div>
<div class="tile" style="display:grid;gap:4px;padding:12px 14px;font-size:14.5px"><b>Fresh creative every month</b><span>The Refuel Kit loads new banners with your name and QR code straight into your Banner Spin, so the same audience sees something new instead of tuning out.</span></div>
<div class="tile" style="display:grid;gap:4px;padding:12px 14px;font-size:14.5px"><b>Each month buys more</b><span>The bonus climbs the longer you keep the streak, so the same package delivers more in month four than in month one. Refuel InstantAdPay too and it climbs faster.</span></div>
</div>
<p style="margin:0;font-size:15px;color:var(--ink-2)">The bonus isn't the point. It just makes the habit cheaper. The point is that your offer never goes dark.</p>
</div>
</div>
<div class="panel">
<div class="ph"><h2>What happens when you buy a package</h2><span class="meta">the flow</span></div>
<div class="pb">
<div class="rg-legend">
<span><i style="background:var(--ok-soft);border-color:var(--ok)"></i>Streak moves forward</span>
<span><i style="background:var(--sig-soft);border-color:var(--sig)"></i>Bonus boost</span>
<span><i style="background:var(--panel-2);border-color:var(--line-strong)"></i>No refuel bonus</span>
<span><i style="border-style:dashed;border-color:var(--ink-2)"></i>A question</span>
</div>
<ol class="rg-flow" aria-label="Refuel flow, step by step">
<li><div class="rg-n start"><b><span class="k">1</span>You buy a new ad package on either site</b>LinkSpin (under Credits) or InstantAdPay, paid from your own wallet.</div></li>
<li>
<div class="rg-n ask"><b><span class="k">2</span>Does it meet that site's minimum?</b>LinkSpin package: $25 or more. InstantAdPay package: $20 or more. Bought by you or one of your own linked positions.</div>
<div class="rg-br">
<div class="rg-b"><span class="rg-e">No</span><div class="rg-n stop"><b>Normal purchase</b>No refuel bonus.</div></div>
<div class="rg-b"><span class="rg-e">Yes</span><div class="rg-n go"><b>Keep going</b><span class="to">down to the next question</span></div></div>
</div>
</li>
<li>
<div class="rg-n ask"><b><span class="k">3</span>Are you already on a streak?</b></div>
<div class="rg-br">
<div class="rg-b"><span class="rg-e">No: your first refuel, or your streak ended</span><div class="rg-n go"><b>Streak starts at month 1</b>Today becomes your refuel day. Your very first one also earns the Engine Started badge.<span class="to">then step 5</span></div></div>
<div class="rg-b"><span class="rg-e">Yes</span><div class="rg-n go"><b>Keep going</b><span class="to">down to the next question</span></div></div>
</div>
</li>
<li>
<div class="rg-n ask"><b><span class="k">4</span>When is it, against your refuel day?</b></div>
<div class="rg-br">
<div class="rg-b"><span class="rg-e">Inside the window: 5 days before to 5 days after</span><div class="rg-n go"><b>Counted refuel</b>Your streak moves up a month.<span class="to">then step 5</span></div></div>
<div class="rg-b"><span class="rg-e">After the 5-day grace</span>
<div class="rg-n ask"><b>Free miss left in the last 365 days?</b></div>
<div class="rg-br">
<div class="rg-b"><span class="rg-e">Yes</span><div class="rg-n go"><b>Streak kept</b>This package counts as your next month.<span class="to">then step 5</span></div></div>
<div class="rg-b"><span class="rg-e">No</span><div class="rg-n go"><b>Streak starts over at month 1</b>Today becomes your new refuel day.<span class="to">then step 5</span></div></div>
</div>
</div>
<div class="rg-b"><span class="rg-e">More than 5 days before</span>
<div class="rg-n ask"><b>Already refueled on this site this cycle?</b></div>
<div class="rg-br">
<div class="rg-b"><span class="rg-e">No</span><div class="rg-n fuel"><b>Second engine</b>This is the other site's refuel for the same cycle: both-engines rate here, and the first site is topped up to match (step 6). Your refuel day stays put.</div></div>
<div class="rg-b"><span class="rg-e">Yes</span><div class="rg-n fuel"><b>Pit Stop</b>Half your current rate, once per site per cycle. Not a refuel, so your refuel day stays put. A second top-up on the same site is a normal purchase.</div></div>
</div>
</div>
</div>
</li>
<li><div class="rg-n go"><b><span class="k">5</span>Bonus credits land at your month's rate</b>One engine: +10% in month 1, +15% in month 2, +20% in month 3, +25% from month 4. Added on the site where you bought.</div></li>
<li>
<div class="rg-n ask"><b><span class="k">6</span>Later this cycle: refuel the other site too, before your next window opens?</b></div>
<div class="rg-br">
<div class="rg-b"><span class="rg-e">Yes: both engines</span><div class="rg-n fuel"><b>Higher rate on both sites</b>+15%, +20%, +30%, then +40% from month 4. The first site is topped up to match. From month 4 you also get 100 Featured bonus credits on InstantAdPay.</div></div>
<div class="rg-b"><span class="rg-e">No: one engine</span><div class="rg-n go"><b>One-engine rate</b>Your streak still counts. Either site keeps it going.</div></div>
</div>
</li>
<li><div class="rg-n go"><b><span class="k">7</span>This month's Refuel Kit unlocks</b>Badges at 3, 6 and 12 months in a row.</div></li>
<li><div class="rg-n go"><b><span class="k">8</span>Next refuel day = 30 days after this one</b>Reminders 5 days before, on the day, and a last call at the end of your grace. Then it is back to step 1 next month.</div></li>
</ol>
</div>
</div>
<div class="panel rg-tbl">
<div class="ph"><h2>The bonus climbs</h2><span class="meta">percent of the package's credits</span></div>
<table>
<thead><tr><th>Months in a row</th><th class="n">One engine</th><th class="n">Both engines</th></tr></thead>
<tbody>
<tr><td>Month 1</td><td class="n">+10%</td><td class="n both">+15%</td></tr>
<tr><td>Month 2</td><td class="n">+15%</td><td class="n both">+20%</td></tr>
<tr><td>Month 3</td><td class="n">+20%</td><td class="n both">+30%</td></tr>
<tr><td>Month 4 and on</td><td class="n">+25%</td><td class="n both">+40% each</td></tr>
</tbody>
</table>
<div class="pb" style="border-top:1px solid var(--line)"><p class="muted" style="font-size:13px">Bonus ad credits land on the site where you bought: a LinkSpin refuel adds them to your LinkSpin credit balance. One engine means you refueled one site this cycle; both engines means LinkSpin and InstantAdPay in the same cycle. From month 4 with both engines you also get 100 Featured bonus credits on InstantAdPay. A Pit Stop pays half your current rate. On InstantAdPay the refuel bonus also stacks on Five Dollar Friday (+20% on $5+ packages) and Wired Wednesday (+25% on $20+ packages). Bonus credits buy ad delivery only. They are never cash.</p></div>
</div>
<div class="panel">
<div class="ph"><h2>Your route, step by step</h2><span class="meta">member guide</span></div>
<div class="pb">
<ol class="rg-route">
<li><div>
<h3>Start your engine</h3>
<p>Buy a new package of $25 or more under Credits, or $20 or more on InstantAdPay. Today becomes your refuel day, your first bonus lands right away, and you earn the Engine Started badge. Buying from one of your linked positions counts too.</p>
<div class="rg-where"><span class="rg-chip">LinkSpin: Credits</span><span class="rg-chip iap">InstantAdPay: Buy packages</span></div>
</div></li>
<li><div>
<h3>Find your Refuel card</h3>
<p>The Monthly Refuel panel shows your refuel day, your streak month, the bonus your next refuel earns, which sites you refueled this cycle, and whether your Pit Stop is still open.</p>
<div class="rg-where"><span class="rg-chip">LinkSpin: Credits and Ads</span><span class="rg-chip iap">InstantAdPay: Overview</span></div>
</div></li>
<li><div>
<h3>Put this month's Refuel Kit to work</h3>
<p>Your refuel unlocks the month's members-only banners in five sizes (728x90, 468x60, 300x250, 160x600 and 1200x630 for social posts) with your @name and a QR code to your own link. Open the Refuel Kit panel on Ads and press Load into my Banner Spin, or tap Make mine on any size to download it. From a 3-month streak you also get an animated version. Kits you unlock stay yours after the month ends.</p>
<div class="rg-where"><span class="rg-chip">LinkSpin: Ads, Refuel Kit</span><span class="rg-chip iap">InstantAdPay: Promo tools</span></div>
</div></li>
<li><div>
<h3>Check the Engine Room</h3>
<p>Your first refuel opens it at the top of Ads. Three dials: fuel left across both sites, clicks this week against last week, and goals this month from your conversion pixel against a goal you set. Warning lights flag ads running low or out, a refuel day coming, or a login slot opening. Then press the one next-move button.</p>
<div class="rg-where"><span class="rg-chip">LinkSpin: top of Ads</span><span class="rg-chip iap">InstantAdPay: Engine Room tab</span></div>
</div></li>
<li><div>
<h3>Refuel inside your window every month</h3>
<p>The window opens 5 days before your refuel day and stays open 5 days after it (Central time). You get an email and an on-site notice 5 days before, on the day, and a last call. Your next refuel day is 30 days after the day you actually refuel, so it moves with you.</p>
</div></li>
<li><div>
<h3>Light up the second engine</h3>
<p>Refuel on both sites in the same cycle and both get the higher rate. Buy on one site, then the other, in either order, before your next window opens. The first site is topped up automatically to match.</p>
<div class="rg-where"><span class="rg-chip">LinkSpin $25+</span><span class="rg-chip iap">InstantAdPay $20+</span></div>
</div></li>
<li><div>
<h3>Running low early? Take a Pit Stop</h3>
<p>Another package on a site you already refueled this cycle, bought before your window opens, is a Pit Stop: half your current rate, once per site per cycle. It keeps your ads running. Your monthly refuel is still due on your refuel day.</p>
</div></li>
</ol>
</div>
</div>
<div class="rg-two">
<div class="panel"><div class="ph"><h3>If you miss a month</h3></div><div class="pb"><p>You get one free miss in any 365 days. Miss your window once and the streak holds: your next qualifying package counts as the next month. Miss again inside the year and the streak starts over at month 1, with a new refuel day.</p></div></div>
<div class="panel"><div class="ph"><h3>What counts and what doesn't</h3></div><div class="pb"><p>Counts: a new package at or above the minimum, bought by you or one of your own linked positions (on InstantAdPay, Game Pass packages too). Doesn't count: smaller packages, or credits you earned by viewing ads.</p></div></div>
</div>
<div class="tile hi rg-coach" style="padding:18px 22px">
<h2 class="disp" style="margin:0 0 8px;font-size:24px">For leaders: how to coach it</h2>
<ul>
<li>When someone in your line buys their first package, help them pick a refuel day they can keep every month.</li>
<li>Show them the Monthly Refuel panel on Credits and the Engine Room on Ads on day one, so they know where to look.</li>
<li>Teach both engines. One package on each site per cycle earns the higher rate on both.</li>
<li>Load your own Refuel Kit into a live Banner Spin, so they see it working before they try it.</li>
<li>Repeat ad spend keeps every level of your line active, so this is the habit to build.</li>
</ul>
</div>
<div class="panel">
<div class="ph"><h2>Questions members ask</h2><span class="meta">quick answers</span></div>
<div class="pb">
<dl class="rg-faq">
<div><dt>Do I have to use both sites?</dt><dd>No. LinkSpin alone keeps your streak going at the one-engine rate, and so does InstantAdPay alone. Refueling both in the same cycle earns the bigger bonus on both.</dd></div>
<div><dt>Is the bonus cash?</dt><dd>No. Bonus credits are purchased-grade ad credits that run on any format you can buy, login ads included.</dd></div>
<div><dt>I refueled early. Did I lose my place?</dt><dd>Inside the 5-day window it counts as your refuel and your next date moves to 30 days after it. Earlier than that it is a Pit Stop (or your second engine, if it is the other site's first package this cycle), and your refuel day stays put.</dd></div>
<div><dt>When does the Refuel Kit change?</dt><dd>Each month gets its own kit. A counted refuel unlocks that month's kit, and kits you unlocked stay yours.</dd></div>
<div><dt>Is anything billed automatically?</dt><dd>No. You choose every package. Nothing renews on its own.</dd></div>
</dl>
</div>
</div>
<p class="muted" style="font-size:12.5px">One credit is one cent of ad delivery. Credits are not money and cannot be withdrawn. No income is guaranteed; any commissions depend on real purchases in your line and on your own effort. Cryptocurrency involves risk of loss. Fuel Your Offers runs on LinkSpin and InstantAdPay (<a href="https://instantadpay.com/refuel">the InstantAdPay side</a>).</p>
</div>
</main>
<footer class="foot">
<div class="wrap">
<span class="word">Link<b>Spin</b></span>
<a href="/">Home</a>
<a href="/ledger">Live ledger</a>
<a href="/contract">The contract</a>
<a href="/support">Support</a>
<a href="/terms">Terms</a>
<a href="/privacy">Privacy</a>
<a href="/disclaimer">Disclaimer</a>
<span class="grow"></span>
<span class="mono" style="font-size:11px">Advertising services with a performance referral program. Not an investment. Crypto transactions are irreversible.</span>
</div>
</footer>
<script src="/assets/refuel-guide.js?v=20261024rg"></script>
</body>
</html>
+7 -6
View File
@@ -1,18 +1,19 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Reports · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.kv{display:grid;grid-template-columns:minmax(0,1fr) 60px 70px;gap:8px;font-size:12px;align-items:center}
.range{display:flex;border:1px solid var(--line-strong);border-radius:var(--r);overflow:hidden;background:var(--panel-2)} .range button{background:transparent;border:0;color:var(--muted);font-family:var(--mono);font-size:12px;padding:5px 10px;cursor:pointer} .range button.on{background:var(--ink);color:#fff}
.range{display:flex;border:1px solid var(--line-strong);border-radius:var(--r);overflow:hidden;background:var(--panel-2)} .range button{background:transparent;border:0;color:var(--muted);font-family:var(--mono);font-size:12px;padding:5px 10px;cursor:pointer} .range button.on{background:var(--ink);color:var(--on-ink)}
.top .hd,.top .rw{grid-template-columns:minmax(0,1fr) 80px 80px 80px}
.sect{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.ph{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}.legend{display:flex;gap:14px;font-size:11px;color:var(--ink-2)}.legend i{display:inline-block;width:10px;height:10px;vertical-align:middle;margin-right:5px}
@@ -20,7 +21,7 @@
.mini{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}.mini .m{background:var(--panel-2);border:1px solid var(--line);border-radius:6px;padding:8px 10px;display:grid;gap:2px}.mini .m .k{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.mini .m .v{font-family:var(--display);font-weight:700;font-size:20px;color:var(--ink);font-variant-numeric:tabular-nums}
.pages .hd,.pages .rw,.zones .hd,.zones .rw{grid-template-columns:minmax(0,1fr) 60px 60px 60px 60px;gap:8px}
.bsb .hd,.bsb .rw{grid-template-columns:minmax(0,1fr) 60px 60px 56px 56px 50px;gap:8px} .bsp .hd,.bsp .rw{grid-template-columns:minmax(0,1fr) 70px 60px 60px 64px;gap:8px}
.bswin{background:var(--ok);color:#fff;border-radius:3px;padding:1px 6px;font-size:10px;font-weight:700;letter-spacing:.06em;margin-left:6px} .bscache{display:block;font-size:11px;color:var(--warn);margin-top:2px}
.bswin{background:var(--ok);color:var(--ok-ink);border-radius:3px;padding:1px 6px;font-size:10px;font-weight:700;letter-spacing:.06em;margin-left:6px} .bscache{display:block;font-size:11px;color:var(--warn);margin-top:2px}
.srcs .hd,.srcs .rw{grid-template-columns:minmax(0,1fr) 70px 70px 60px;gap:8px} .plc .hd,.plc .rw{grid-template-columns:minmax(0,1fr) 70px 60px;gap:8px}
@media (max-width:900px){.two,.grid2,.sect{grid-template-columns:1fr}.body{padding:12px 16px}.mini{grid-template-columns:repeat(2,minmax(0,1fr))}.pages .hd,.pages .rw,.zones .hd,.zones .rw{grid-template-columns:minmax(0,1fr) 48px 48px 48px 48px;gap:6px;padding:10px 12px;font-size:12px}.bsb .hd,.bsb .rw{grid-template-columns:minmax(0,1fr) 44px 44px 40px 44px 34px;gap:5px;padding:10px 12px;font-size:12px}.bsp .hd,.bsp .rw{grid-template-columns:minmax(0,1fr) 48px 44px 44px 48px;gap:6px;padding:10px 12px;font-size:12px}}
</style>
@@ -41,7 +42,7 @@
<div style="display:grid;gap:16px;align-content:start">
<div class="panel"><h2>Top links</h2><div class="tbl top"><div class="hd"><span>Link</span><span class="r">Unique</span><span class="r">Clicks</span><span class="r">Conv.</span></div><div id="topRows"></div></div></div>
<div class="panel"><h2>Your best hours</h2><div class="bars" id="hourBars" style="grid-template-columns:repeat(24,minmax(0,1fr));height:80px"></div><div class="axis"><span>00</span><span>06</span><span>12</span><span>18</span><span>23</span></div><div class="muted" id="hourNote"></div></div>
<div class="panel"><h2>Conversions</h2><div class="kv" id="convRows"></div><div class="muted">Joins, wallets and purchases matched to a click on one of your links, plus anything a partner reported by postback.</div></div>
<div class="panel"><h2>Conversions</h2><div class="kv" id="convRows"></div><div class="muted">Joins, wallets and purchases matched to a click on one of your links, plus anything a partner reported by postback. Your own goals (subscribers, sales) and cost per goal are on <a href="/conversions">Conversions</a>.</div></div>
</div>
</div>
<!-- Pages: views, uniques, clicks through and leads on the member's bridge / review / squeeze pages (2026-10-10) -->
@@ -89,7 +90,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/reports.js?v=20261020bs3"></script>
</body>
</html>
+3 -2
View File
@@ -1,11 +1,12 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Shorts | LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
<style>
html,body{height:100%;margin:0;overflow:hidden;background:#000}
.sh{position:fixed;inset:0;display:flex;flex-direction:column;background:#000;color:var(--ink,#e8fff7)}
+13 -7
View File
@@ -1,21 +1,22 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Traffic sources · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.ws{display:grid;grid-template-columns:320px minmax(0,1fr);min-height:calc(100vh - 94px)}
.list{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;background:rgba(255,255,255,.55)}
.list{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;background:var(--panel-glass)}
.list .hd{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line)}
.list .hd h2{font-family:var(--display);font-size:20px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin:0}
.list .flt{padding:8px 16px;border-bottom:1px solid var(--line)}
.list .items{overflow:auto}
.item{display:grid;grid-template-columns:minmax(0,1fr) 72px;gap:8px;padding:11px 16px;border-bottom:1px solid var(--line);border-left:3px solid transparent;cursor:pointer}
.item:hover{background:rgba(31,111,235,.05)} .item.on{background:var(--panel);border-left-color:var(--sig)}
.item:hover{background:var(--row-hover)} .item.on{background:var(--panel);border-left-color:var(--sig)}
.item .nm{font-weight:700;display:flex;gap:8px;align-items:center;flex-wrap:wrap} .item .cd{font-family:var(--mono);font-size:11px;color:var(--muted)}
.item .rt{display:grid;justify-items:end;gap:3px} .item .rt .n{font-family:var(--mono)}
.detail{display:flex;flex-direction:column;min-width:0}
@@ -39,9 +40,12 @@
.catf{margin:4px 0 8px}
.catlist{max-height:46vh;overflow:auto;border:1px solid var(--line);border-radius:8px}
.cat{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--line);cursor:pointer}
.cat:last-child{border-bottom:0} .cat:hover{background:rgba(31,111,235,.05)} .cat b{display:block} .cat .site{font-family:var(--mono);font-size:11px;color:var(--muted)}
.cat:last-child{border-bottom:0} .cat:hover{background:var(--row-hover)} .cat b{display:block} .cat .site{font-family:var(--mono);font-size:11px;color:var(--muted)}
.cat .tags{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}
.prev{background:var(--panel-2);border:1px solid var(--line);border-radius:8px;padding:10px 12px;display:grid;gap:6px;font-size:12px}
.gfor{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:12.5px;color:var(--ink-2);background:var(--panel-2);border:1px solid var(--line);border-radius:8px;padding:8px 12px}
.gfor a{font-weight:700}
.cat .fm{display:flex;gap:4px;flex-wrap:wrap;margin-top:3px}
.prev .mono{font-size:11px;overflow-wrap:anywhere}
.prev dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:3px 10px;margin:0} .prev dt{font-family:var(--mono);font-size:11px;color:var(--ink-2)} .prev dd{margin:0;font-family:var(--mono);font-size:11px;overflow-wrap:anywhere}
@media (max-width:900px){.two{grid-template-columns:1fr}.form{grid-template-columns:1fr}.prm .hd,.log .hd,.pe .hd{display:none}.prm .rw{grid-template-columns:1fr}.log .rw{grid-template-columns:1fr 1fr}.pe .rw{grid-template-columns:1fr 1fr}}
@@ -75,6 +79,7 @@
</div>
<div class="dbody">
<div class="tiles" id="tiles"></div>
<div class="gfor" id="dGuide" hidden></div>
<div class="tabs" id="tabs">
<button type="button" class="on" data-tab="url">Campaign URL</button>
<button type="button" data-tab="pb">Postback</button>
@@ -123,7 +128,8 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/sources-screen.js?v=20261012a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/traffic-guide-data.js?v=20261028a"></script>
<script src="/assets/sources-screen.js?v=20261028a"></script>
</body>
</html>
+6 -5
View File
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Support | LinkSpin</title>
@@ -7,9 +7,10 @@
<meta name="robots" content="noindex, follow">
<meta name="theme-color" content="#0B1424">
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
<style>
.sup{max-width:760px}
.sup .tile{padding:0}
@@ -20,11 +21,11 @@
.sup .msg{font-size:13px;color:var(--muted)} .sup .msg.bad{color:var(--bad)}
.sup .hp-field{position:absolute;left:-9999px;width:1px;height:1px;opacity:0;overflow:hidden}
.icon-check{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 0}
.icon-check .ic-btn{font-size:24px;line-height:1;padding:9px 12px;border-radius:8px;border:1px solid var(--line-strong);background:#FFF;cursor:pointer}
.icon-check .ic-btn{font-size:24px;line-height:1;padding:9px 12px;border-radius:8px;border:1px solid var(--line-strong);background:var(--panel);cursor:pointer}
.icon-check .ic-btn:hover{border-color:var(--sig)}
.sup-st{font:700 10px var(--mono);letter-spacing:.06em;text-transform:uppercase;padding:3px 8px;border-radius:4px;border:1px solid var(--line-strong);white-space:nowrap}
.sup-st.open{color:var(--accent-hi);border-color:var(--accent-dim);background:var(--accent-soft)}
.sup-st.waiting_on_member{color:var(--warn);border-color:rgba(194,65,12,.4);background:var(--warn-soft)}
.sup-st.waiting_on_member{color:var(--warn);border-color:var(--warn-line);background:var(--warn-soft)}
.sup-st.closed{color:var(--muted)}
.sup-msg{border:1px solid var(--line);border-radius:8px;padding:12px 14px;background:var(--panel-2)}
.sup-msg.admin{border-color:var(--accent-dim);background:var(--accent-soft)}
@@ -66,7 +67,7 @@
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
</div>
</footer>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/support.js?v=20261016a"></script>
</body>
</html>
+72
View File
@@ -0,0 +1,72 @@
/* LinkSpin landing tag (conversion pixel, 2026-10-23). Paste once on your landing page:
* <script async src="https://linkspin.app/t.js?px=YOUR_PIXEL_ID"></script>
* It reads the click id LinkSpin or InstantAdPay put on the link (lsclk, lsid or clickid in the address), keeps it on YOUR
* site for 30 days (localStorage + a first-party cookie, both named ls_clk), copies it into hidden form fields named lsclk,
* lsid or clickid, and adds it to links that stay on your site. Nothing personal is read or stored.
* It never throws and never blocks your page: every step is wrapped, and it only runs after the page has its scripts.
*/
(function () {
try {
var KEY = 'ls_clk', RX = /^[a-z0-9]{6,24}$/i, DAYS = 30, W = window;
var me = document.currentScript;
if (!me) { var all = document.getElementsByTagName('script'); for (var i = all.length - 1; i >= 0; i--) { if (/\/t\.js(\?|$)/.test(all[i].src || '')) { me = all[i]; break; } } }
if (!me || !me.src) return;
var src = new URL(me.src, location.href), base = src.origin, px = src.searchParams.get('px') || '';
var framed = true; try { framed = W.top !== W.self; } catch (e) { framed = true; }
var https = location.protocol === 'https:';
function setCookie(v) {
try { document.cookie = KEY + '=' + v + '; path=/; max-age=' + (DAYS * 86400) + (https ? (framed ? '; SameSite=None; Secure' : '; SameSite=Lax; Secure') : '; SameSite=Lax'); } catch (e) {}
}
function stored() {
var v = '';
try { var j = JSON.parse(W.localStorage.getItem(KEY) || 'null'); if (j && RX.test(j.id || '') && Date.now() - (j.ts || 0) < DAYS * 864e5) v = j.id; } catch (e) {}
if (!v) { try { var m = /(?:^|;\s*)ls_clk=([a-z0-9]{6,24})/i.exec(document.cookie || ''); if (m) v = m[1]; } catch (e) {} }
return v;
}
function keep(v) { try { W.localStorage.setItem(KEY, JSON.stringify({ id: v, ts: Date.now() })); } catch (e) {} setCookie(v); }
var q = new URLSearchParams(location.search);
var fresh = q.get('lsclk') || q.get('lsid') || '';
var id = '';
if (RX.test(fresh)) { id = fresh; keep(id); }
else {
id = stored();
// a generic clickid only when we hold nothing better (it may be another network's id)
var g = q.get('clickid') || ''; if (!id && RX.test(g)) { id = g; keep(id); fresh = g; }
}
// tell LinkSpin the landing happened (sets its own 30-day cookie and the 24 h match); only for a fresh id
if (fresh && RX.test(fresh) && /^px[a-f0-9]{10}$/.test(px)) { try { var im = new Image(1, 1); im.src = base + '/t.gif?px=' + px + '&c=' + encodeURIComponent(fresh) + '&r=' + Math.random().toString(36).slice(2, 8); } catch (e) {} }
var LS = W.LinkSpin = W.LinkSpin || {};
LS.clickId = function () { return id || stored(); };
LS.goal = function (pixelId, name, value) {
try {
var c = id || stored(); var u = base + '/cv.gif?px=' + encodeURIComponent(pixelId) + (name ? '&goal=' + encodeURIComponent(name) : '') + (value != null && value !== '' ? '&value=' + encodeURIComponent(value) : '') + (c ? '&c=' + encodeURIComponent(c) + '&m=stored' : '') + '&r=' + Math.random().toString(36).slice(2, 8);
var im2 = new Image(1, 1); im2.src = u;
} catch (e) {}
};
if (!id) return;
var NAMES = ['lsclk', 'lsid', 'clickid'];
function fillForms(root) {
try {
var f = (root || document).querySelectorAll('input[name="lsclk"],input[name="lsid"],input[name="clickid"]');
for (var i = 0; i < f.length; i++) if (!f[i].value) f[i].value = id;
} catch (e) {}
}
fillForms();
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', function () { fillForms(); });
document.addEventListener('submit', function (e) { fillForms(e.target); }, true);
var host = location.hostname.replace(/^www\./, '');
function decorate(a) {
try {
if (!a || !a.href || a.getAttribute('data-ls-skip') != null) return;
var u = new URL(a.href, location.href);
if (!/^https?:$/.test(u.protocol) || u.hostname.replace(/^www\./, '') !== host) return;
if (u.pathname === location.pathname && u.search === location.search && u.hash) return; // an anchor on this page
for (var i = 0; i < NAMES.length; i++) if (u.searchParams.has(NAMES[i])) return;
u.searchParams.set('lsclk', id); a.href = u.toString();
} catch (e) {}
}
function onClick(e) { try { var a = e.target && e.target.closest ? e.target.closest('a[href]') : null; if (a) decorate(a); } catch (er) {} }
document.addEventListener('click', onClick, true);
document.addEventListener('auxclick', onClick, true);
} catch (e) { /* never break the member's page */ }
})();
+4 -3
View File
@@ -1,12 +1,13 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Team · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px}
@@ -37,7 +38,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/team.js?v=20261020s"></script>
</body>
</html>
+9 -5
View File
@@ -1,14 +1,15 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Terms of Service | LinkSpin</title>
<meta name="description" content="LinkSpin terms of service.">
<link rel="canonical" href="{{SITE_URL}}/terms">
<meta name="theme-color" content="#0B1424">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700;800&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/pub.css?v=20261007b">
<link rel="stylesheet" href="/assets/pub.css?v=20261101t">
</head>
<body>
<header class="top">
@@ -40,11 +41,14 @@
<p>Ads you submit must be lawful and must not be deceptive, adult, hateful, malicious, or infringing. Ads are auto-approved for speed; we may remove or pause any ad or campaign at any time, and members can report ads for review. You are solely responsible for the ads you run and the sites they point to.</p>
<h2 class="disp">8. Acceptable use</h2>
<p>No fraud, bots, fake traffic, self-dealing to farm rewards, attempts to manipulate the contract, or abuse of other members. We may suspend or terminate accounts that break these rules.</p>
<h2 class="disp">9. No warranty</h2>
<h2 class="disp">9. Prohibited content</h2>
<div id="prohibited"></div>
<p>The following may not appear anywhere on the Platform, in an ad, a campaign, a line banner, a wall offer, a bio or a social link: gambling, casinos, betting, lotteries and sweepstakes; adult or sexual content; drugs and prescription pharmaceuticals; weapons; hate or harassment; malware, phishing and counterfeit goods; misleading financial promises. Profile fields are not a place for links: a bio may not contain a URL or a domain, links belong in the social fields, and profile text, avatar and links are shown publicly only for members who have bought a package. Accounts created to place links in profile fields (link farming) are removed without notice, with their profile text. Content that matches these rules is refused when it is saved; what slips through is removed when found.</p>
<h2 class="disp">10. No warranty</h2>
<p>The Platform is provided "as is," without warranties of any kind. Blockchains, wallets, oracles, and third-party sites can fail or behave unexpectedly. We do not guarantee uptime, delivery volumes, or results.</p>
<h2 class="disp">10. Limitation of liability</h2>
<h2 class="disp">11. Limitation of liability</h2>
<p>To the fullest extent permitted by law, LinkSpin and its operators are not liable for indirect, incidental, or consequential damages, or for losses arising from crypto volatility, irreversible transactions, third-party sites, or your own decisions.</p>
<h2 class="disp">11. Changes and termination</h2>
<h2 class="disp">12. Changes and termination</h2>
<p>We may update these Terms and the Platform, and continued use means you accept the changes. We may discontinue features. The immutable contract's rules cannot be changed by anyone, including us.</p>
<p style="margin-bottom:0">See also the <a href="/disclaimer">Disclaimer</a> and <a href="/privacy">Privacy Policy</a>.</p>
</div>
+71
View File
@@ -0,0 +1,71 @@
<!doctype html>
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Traffic guide · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.tg{padding:16px 24px 32px;display:grid;gap:18px;max-width:1180px}
.tg .lead{max-width:760px;color:var(--ink-2);line-height:1.55}
.tg h2.sx{font-family:var(--display);font-size:20px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin:6px 0 0}
.tg .panel{display:grid;gap:12px}
.offers{display:flex;gap:8px;flex-wrap:wrap}
.offers .chip{font-size:12.5px;padding:6px 13px}
.res{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:16px}
.fit{display:grid;gap:6px}
.fit .r{display:grid;grid-template-columns:132px 64px minmax(0,1fr);gap:10px;align-items:center;text-align:left;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.fit .r .fn{font-weight:700}
.fit .r .why{color:var(--ink-2);font-size:12.5px}
.rate{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border-radius:4px;padding:2px 6px;text-align:center}
.rate.best{background:var(--ok-soft);color:var(--ok)} .rate.good{background:var(--accent-soft);color:var(--accent-hi)}
.rate.weak{background:var(--panel-2);color:var(--muted)} .rate.avoid{background:var(--bad-soft);color:var(--bad)}
.tipbox{background:var(--sig-soft);border:1px solid var(--sig-line);border-radius:8px;padding:10px 12px;font-size:13px;line-height:1.5}
.nets{display:flex;gap:6px;flex-wrap:wrap}
.nets a{font-size:12px;font-weight:700;color:var(--ink-2);border:1px solid var(--line-strong);border-radius:6px;padding:3px 8px;background:var(--panel);text-decoration:none}
.nets a:hover{border-color:var(--accent);color:var(--accent-hi)}
.fmts{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}
.fmt{border:1px solid var(--line);border-radius:10px;background:var(--panel);padding:12px 14px;display:grid;gap:7px;align-content:start;box-shadow:var(--sh)}
.fmt h3{font-family:var(--display);font-size:17px;font-weight:700;letter-spacing:.04em;margin:0}
.fmt p{margin:0;font-size:13px;line-height:1.5;color:var(--ink-2)} .fmt p b{color:var(--ink)}
.ntbl .hd,.ntbl .rw{grid-template-columns:minmax(0,170px) minmax(0,1fr) minmax(0,1.2fr)}
.ntbl .rw .nm b{display:block} .ntbl .rw .nm span{font-family:var(--mono);font-size:11px;color:var(--muted)}
.ntbl .rw .tg2{display:flex;gap:4px;flex-wrap:wrap}
.ntbl .note{font-size:12px;color:var(--ink-2)}
.rules{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
.rules div{border-left:3px solid var(--sig);padding:4px 0 4px 12px} .rules b{display:block;margin-bottom:3px} .rules span{font-size:13px;color:var(--ink-2);line-height:1.5}
@media (max-width:900px){.res{grid-template-columns:1fr}.ntbl .hd{display:none}.ntbl .rw{grid-template-columns:1fr}}
@media (max-width:760px){.tg{padding:12px 16px 28px}.fit .r{grid-template-columns:1fr 64px}.fit .r .why{grid-column:1/-1}}
</style>
</head>
<body>
<div id="page">
<div class="tg">
<div class="lead">Every traffic network sells different kinds of ads, and each kind suits some offers far better than others. Pick what you are promoting to see where it tends to convert, or read the formats and networks below. These are starting points from how the formats usually behave; your own Reports are the final word.</div>
<div class="panel">
<h2>What are you promoting?</h2>
<div class="offers" id="offers"></div>
<div id="result"></div>
</div>
<h2 class="sx" id="formats">The ad formats</h2>
<div class="fmts" id="fmts"></div>
<h2 class="sx" id="networks">The networks</h2>
<div class="chips" id="nfilter"></div>
<div class="tbl ntbl"><div class="hd"><span>Network</span><span>Sells</span><span>Notes</span></div><div id="nrows"></div>
<div class="ft">Formats change; confirm in your own ad panel. Set a network up under Sources so every click is tracked.</div></div>
<h2 class="sx">Ground rules</h2>
<div class="rules" id="rules"></div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/traffic-guide-data.js?v=20261028a"></script>
<script src="/assets/traffic-guide.js?v=20261029b"></script>
</body>
</html>
+4 -3
View File
@@ -1,11 +1,12 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Transaction | LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
</head>
<body>
<div id="nav"></div>
@@ -34,7 +35,7 @@
<p><a href="/ledger">← Back to the live ledger</a> · <a href="/contract">Read the contract review</a></p>
</div>
</section>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/tx.js?v=20260906m"></script>
</body>
</html>
+4 -3
View File
@@ -1,14 +1,15 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Viewing ad — LinkSpin</title>
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
<style>
html,body{height:100%;margin:0;overflow:hidden}
.vw{display:flex;flex-direction:column;height:100vh;height:100dvh;background:var(--bg,#04110c);color:var(--ink,#e8fff7)}
.vw{display:flex;flex-direction:column;height:100vh;height:100dvh;background:var(--ground,#04110c);color:var(--ink,#e8fff7)}
/* right padding keeps the check buttons clear of the dashboard overlay's ✕ close button */
.vbar{flex:0 0 auto;display:flex;align-items:center;gap:14px;padding:10px 68px 10px 16px;
background:var(--panel-solid,#071a12);border-bottom:1px solid var(--line,rgba(59,157,255,.18));flex-wrap:wrap}
+5 -4
View File
@@ -1,12 +1,13 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Banner wall | LinkSpin</title>
<!--OG-->
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
</head>
<body>
<div id="nav"></div>
@@ -47,7 +48,7 @@
</div>
</div>
</section>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/wall.js?v=20261008a"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/wall.js?v=20261030pp"></script>
</body>
</html>
+4 -3
View File
@@ -1,12 +1,13 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Wallet · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:16px}
@@ -31,7 +32,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/wallet-screen.js?v=20261023ov"></script>
</body>
</html>
+19 -20
View File
@@ -1,31 +1,32 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Wallets and buying POL | LinkSpin</title>
<meta name="description" content="Which wallets to use with LinkSpin, how to set one up, and how to buy POL with a card through MoonPay. Member training.">
<meta name="description" content="Which wallets to use with LinkSpin, how to set one up, and how to buy POL with a card. Member training.">
<meta name="robots" content="noindex">
<meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20260916a">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
<style>
.wl-rule{border-left:4px solid #f2c94c;background:rgba(242,201,76,.08);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 28px}
.wl-rule{border-left:4px solid var(--gold-2);background:var(--gold-soft);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 28px}
.wl-rule b{font-family:var(--disp);font-size:17px;display:block;margin-bottom:6px}
.wl-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:0 0 8px}
.wl-grid>div{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px 18px}
.wl-grid h3{margin:0 0 4px;font-size:18px}
.wl-grid .tag{font-family:var(--mono);font-size:11px;color:var(--mint);border:1px solid rgba(59,157,255,.4);border-radius:999px;padding:2px 9px;margin-left:8px;vertical-align:middle}
.wl-grid .tag.warn{color:#f2c94c;border-color:rgba(242,201,76,.5)}
.wl-grid .tag{font-family:var(--mono);font-size:11px;color:var(--mint);border:1px solid var(--mint-line);border-radius:999px;padding:2px 9px;margin-left:8px;vertical-align:middle}
.wl-grid .tag.warn{color:var(--gold-2);border-color:var(--gold-line)}
.wl-grid p{margin:6px 0 0;font-size:14px;color:var(--muted)}
.wl-grid .rec{border-color:var(--mint);box-shadow:0 0 40px rgba(59,157,255,.1)}
.steps{counter-reset:s;margin:0;padding:0;list-style:none}
.steps li{counter-increment:s;position:relative;padding:0 0 16px 46px;font-size:15px;line-height:1.5}
.steps li::before{content:counter(s);position:absolute;left:0;top:0;width:32px;height:32px;border-radius:50%;background:rgba(59,157,255,.12);border:1px solid rgba(59,157,255,.45);color:var(--mint);font-family:var(--disp);font-weight:800;display:flex;align-items:center;justify-content:center;font-size:14px}
.steps li::before{content:counter(s);position:absolute;left:0;top:0;width:32px;height:32px;border-radius:50%;background:var(--mint-soft);border:1px solid var(--mint-line);color:var(--mint);font-family:var(--disp);font-weight:800;display:flex;align-items:center;justify-content:center;font-size:14px}
.steps li b{color:var(--ink)}
.wl-links{margin:10px 0 0;display:flex;gap:6px;flex-wrap:wrap}
.wl-links .btn{margin-top:0}
.note{background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 16px;font-size:14px;color:var(--muted);margin:0 0 12px}
.note{background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 16px;font-size:14px;color:var(--muted);margin:0 0 12px}
.note b{color:var(--ink)}
h2{margin:34px 0 10px;font-size:26px}
.faq details{margin:0 0 8px}
@@ -38,7 +39,7 @@
<section class="hero" style="padding:70px 0 24px">
<p class="eyebrow">Member training</p>
<h1>Wallets, and <em>buying POL</em>.</h1>
<p class="lead">Which wallet to use, how to set it up in five minutes, and how to buy POL with a debit or credit card through MoonPay so it lands in your own wallet.</p>
<p class="lead">Which wallet to use, how to set it up in five minutes, and how to buy POL with a debit or credit card so it lands in your own wallet.</p>
</section>
<div class="card" id="gate"><h3>Members only</h3><p class="muted small">Sign in to your member area to read this guide. <a href="/links">Sign in</a></p></div>
@@ -89,31 +90,29 @@
<li><b>Link it in Members</b>: open the Wallet tab, tap Connect, and sign the free message. Then <b>Switch on payouts</b>, one small transaction that registers your address with the contract. Do both before your people start buying, so their first purchase pays you.</li>
</ol>
<h2>Buy POL with a card through MoonPay</h2>
<p class="muted" style="margin:0 0 14px">MoonPay is a licensed card-to-crypto service. You pay them, they send POL to your wallet. LinkSpin is never in the middle of that payment.</p>
<p style="margin:0 0 18px"><button class="btn" id="wlMoonpay" type="button">💳 Buy POL with a card (MoonPay)</button> <span class="small muted" id="wlMoonpayNote">Opens in a new tab with POL on Polygon selected.</span></p>
<h2>Buying POL with a card</h2>
<p class="muted" style="margin:0 0 14px">Buy POL with a card on any major exchange or card on-ramp, or with your wallet app's own Buy button, then send it to your own wallet on the Polygon network. LinkSpin is never in the middle of that payment.</p>
<ol class="steps">
<li><b>Have your wallet connected first</b> (Wallet tab). Then open <b>Buy packages</b> and look at the live POL price for the package you want. Plan to buy that amount <b>plus 2 or 3 POL</b> for network fees. Trust Wallet users: buy about double.</li>
<li><b>Tap "Buy POL with a card"</b> under the packages. MoonPay opens in a new tab with <b>POL on Polygon</b> selected and <b>your own wallet address filled in</b>. If for any reason it is not filled in, choose POL (Polygon) yourself and paste your address from step 5 above.</li>
<li><b>Enter the amount</b> in dollars or POL and pay with a debit card, credit card, Apple Pay or Google Pay. MoonPay has a minimum order, usually around $30, so the $5 package on its own is below it. Buy enough for the package you actually want.</li>
<li><b>First time only: identity check.</b> MoonPay asks for your email, phone and a photo ID. This is their legal requirement, not ours. It normally takes a few minutes; occasionally a review takes longer, and MoonPay emails you when it clears.</li>
<li><b>Buy POL</b> on any major exchange or card on-ramp, or with the Buy button inside your wallet app. Choose <b>POL on the Polygon network</b>.</li>
<li><b>Send it to your own wallet address</b> (step 5 above), with Polygon picked as the network. Sending on the wrong network can lose the funds.</li>
<li><b>The provider handles the rest.</b> Its ID checks, fees, minimum orders and limits are its own, not ours.</li>
<li><b>Wait for the POL to land.</b> Usually a few minutes. Your wallet balance shows on the Wallet tab and next to your positions.</li>
<li><b>Go back to Buy packages</b> and buy. The wallet asks you to confirm one transaction. The moment it settles, your credits are minted and your line is paid.</li>
</ol>
<div class="note"><b>Already own crypto on an exchange?</b> Coinbase, Kraken, Binance and most others sell POL. Withdraw it to your wallet address and pick the <b>Polygon</b> network on the withdrawal screen. Sending on the wrong network can lose the funds.</div>
<div class="note"><b>Prefer to buy inside the wallet?</b> MetaMask, Trust, SafePal and Phantom all have a Buy button that uses MoonPay or a similar provider. Same rule: POL, Polygon network, your own address.</div>
<h2>Common questions</h2>
<div class="faq">
<details><summary>Do I need a wallet to join?</summary><p>No. Join with your email. The wallet comes out only when you buy a package or switch on payouts.</p></details>
<details><summary>How much POL do I need?</summary><p>The Buy packages tab shows the live POL cost of each package. Buy that plus 2 or 3 POL for fees. There is no other cost.</p></details>
<details><summary>Why did MoonPay decline my card?</summary><p>Some banks block crypto purchases. Try a different card, Apple Pay or Google Pay, or buy on an exchange and withdraw to your wallet on Polygon.</p></details>
<details><summary>Why was my card declined buying POL?</summary><p>Some banks block crypto purchases. Try a different card, Apple Pay or Google Pay, or another exchange or on-ramp, then send the POL to your wallet on Polygon.</p></details>
<details><summary>Can I use the same wallet for more than one position?</summary><p>One address is one position on the contract. For Qualified Start, add extra accounts inside MetaMask, each with its own address, and link them on the Buy packages tab. The three Qualified Start videos in Training walk through it.</p></details>
<details><summary>Where do my payouts go?</summary><p>To the wallet address you switched payouts on with, in the same transaction as the purchase that earned them. Nothing is held on the site.</p></details>
</div>
<p class="small muted" style="margin:26px 0 0">Advertising, not investing. No income is guaranteed; results depend on your effort. Crypto transactions are irreversible and carry risk of loss. MoonPay is an independent, licensed provider; its fees and limits are its own.</p>
<p class="small muted" style="margin:26px 0 0">Advertising, not investing. No income is guaranteed; results depend on your effort. Crypto transactions are irreversible and carry risk of loss. Whichever exchange or on-ramp you use is independent of LinkSpin; its fees and limits are its own.</p>
</div>
<footer>
@@ -121,7 +120,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never share your recovery phrase.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/wallets.js?v=20261018p25"></script>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/wallets.js?v=20261026a"></script>
</body>
</html>
+6 -5
View File
@@ -1,12 +1,13 @@
<!doctype html>
<html lang="en">
<html lang="en" data-theme-base="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Zones · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261020s">
<link rel="stylesheet" href="/assets/cr.css?v=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:16px}
@@ -20,8 +21,8 @@
.fr-steps li{border:1px solid var(--line);border-radius:8px;padding:12px;display:grid;gap:4px;font-size:13px}
.fr-steps li b{display:flex;align-items:center;gap:8px}
.fr-steps li b i{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1.5px solid var(--line-strong);font:700 11px var(--mono);font-style:normal;flex:none}
.fr-steps li.now{border-color:var(--sig);background:var(--sig-soft)} .fr-steps li.now b i{background:var(--sig);border-color:var(--sig);color:#fff}
.fr-steps li.done{opacity:.75} .fr-steps li.done b i{background:var(--ok);border-color:var(--ok);color:#fff}
.fr-steps li.now{border-color:var(--sig);background:var(--sig-soft)} .fr-steps li.now b i{background:var(--sig);border-color:var(--sig);color:var(--sig-ink)}
.fr-steps li.done{opacity:.75} .fr-steps li.done b i{background:var(--ok);border-color:var(--ok);color:var(--ok-ink)}
@media (max-width:1100px){.fr{grid-template-columns:1fr}.fr-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.fr-steps{grid-template-columns:1fr}}
</style>
@@ -41,7 +42,7 @@
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261023a"></script>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/zones-screen.js?v=20261010a"></script>
</body>
</html>
+28
View File
@@ -0,0 +1,28 @@
// carry.ensureOnChain after the send (regression, 2026-10-27): txHash / lastErr were declared inside the try block and read
// after its finally, so EVERY engine activation threw "txHash is not defined" once the tx was mined (memberId not saved, no
// notice, in-flight flag stuck, and a buyer whose sponsor needed activating fell back to #1 in /api/sponsor?intent=buy).
// No real chain: the RPC is a dead local port (the send fails at once) and the stub chain then reports the member as on-chain,
// the same "mined although the follow-up read failed" path as the 2026-10-15 seed. node qa/carry-activate.test.cjs
'use strict';
const assert = require('assert');
const os = require('os');
const fs = require('fs');
const path = require('path');
process.env.ENGINE_KEY = '0x' + '11'.repeat(32); // throwaway key, never funded; the RPC below is unreachable
const carry = require(path.join(__dirname, '..', 'carry.js'));
(async () => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-carry-act-'));
let sent = false; const saved = [];
const acct = { email: 'm@x.co', address: '0x' + '2'.repeat(40), sponsorRef: '', memberId: 0 };
carry.init({ dataDir: dir, siteConfig: () => ({ defaultSponsorId: 1, carryNotices: '0' }),
accounts: { byEmail: async () => Object.assign({}, acct), setMemberId: async (e, id) => { saved.push([e, id]); } },
chain: { getConfig: () => ({ rpc: 'http://127.0.0.1:1', rpcs: ['http://127.0.0.1:1'], chainId: 137, contract: '0x' + '3'.repeat(40) }),
memberCount: async () => 50, memberIdByAccount: async () => { if (!sent) { sent = true; return 0; } return 77; } } });
const id = await carry.ensureOnChain(acct, 0, 'wallet');
assert.strictEqual(id, 77, 'returns the member number instead of throwing');
assert.deepStrictEqual(saved, [['m@x.co', 77]], 'member number saved on the account');
assert.ok(!carry.isBinding('m@x.co'), 'in-flight flag cleared');
const log = carry.status().log; assert.ok(log.some(e => e.type === 'activated' && e.id === 77), 'activation logged');
console.log('carry-activate: ok');
fs.rmSync(dir, { recursive: true, force: true });
})().catch(e => { console.error('carry-activate: FAIL', e.message); process.exit(1); });
+323
View File
@@ -0,0 +1,323 @@
// Conversion pixel (2026-10-23, Marty approved). Three parts, all on throwaway data (no production data, no real members):
// 1) unit: convtrack.js on a temp dir: 30-day window, per-IP rate limit, owner check, InstantAdPay click import rules.
// 2) end to end on a local server.js (JSON store, no DB, no mail key, devCode sign-in, test LS_SYNC_SECRET, seeded
// campaigns.json): ad click -> click id on the target -> goal pixel counts once with method url / stored / cookie /
// soft; dedupe; owner mismatch refused; spin link reached through an ad inherits the ad; cost per goal; goal postback
// attempted (an .invalid host, nothing leaves the machine); InstantAdPay clicks + summary over the signed partner call;
// self click kept as a test; test conversion; CSV. 2026-10-26: own clicks are tests on every click type (owner soft
// key from a session, signed-in clicks on spin links and Banner Spins, a goal finished in the owner's browser, InstantAdPay
// owners pushed with the clicks); Banner Spin straight to a page carries lsclk and reports By Banner Spin.
// 3) browser (Playwright, if present): the landing tag on another origin keeps the id, fills a hidden lsclk field and
// decorates same-site links; the script goal pixel on the thank-you page counts with method 'stored', also framed.
// node qa/convpixel.test.mjs (from the site dir; no internet needed) Env: PORT (default 8973), PW
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import http from 'node:http';
import crypto from 'node:crypto';
import { spawn } from 'node:child_process';
import { createRequire } from 'node:module';
import { pathToFileURL } from 'node:url';
const require = createRequire(import.meta.url);
const site = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '..');
const PORT = Number(process.env.PORT || 8973), PORT2 = PORT + 1;
const SECRET = 'qa-secret-' + crypto.randomBytes(16).toString('hex');
const results = []; let failed = 0;
const check = (ok, what, detail) => { results.push((ok ? 'PASS ' : 'FAIL ') + what + (detail ? ' :: ' + detail : '')); if (!ok) failed++; };
const sleep = ms => new Promise(r => setTimeout(r, ms));
const DAY = 86400000;
// ---------- 1) unit ----------
{
const UD = fs.mkdtempSync(path.join(os.tmpdir(), 'cv-unit-'));
const C = require(path.join(site, 'convtrack.js'));
C.init({ dataDir: UD, noTimers: true, rotator: null });
const fake = (ip, ua) => ({ headers: { 'user-agent': ua || 'UnitUA', 'x-forwarded-for': ip }, socket: {} });
const g = C.createGoal('own@u.test', { name: 'Sale', value: '12.5' });
check(g.ok && /^px[a-f0-9]{10}$/.test(g.goal.px) && g.goal.name === 'sale' && g.goal.value === 12.5, 'goal created: pixel id, name lowercased, value kept', JSON.stringify(g));
check(!!C.createGoal('own@u.test', { name: 'sale' }).error && !!C.createGoal('own@u.test', { name: 'bad name!' }).error, 'duplicate and bad goal names refused');
const px = g.goal.px;
const id = C.recordAdClick({ id: 7, owner: 'own@u.test', name: 'Unit ad', type: 'banner', targetUrl: 'https://x.test/' }, fake('192.0.2.1'), { country: 'US' });
check(/^a[a-f0-9]{11}$/.test(id), 'LinkSpin ad click id format a + 11 hex', id);
// 30-day window: age the click to 31 days
C.lookup(id).ad.ts = Date.now() - 31 * DAY;
let r = C.record({ px, c: id, m: 'url' }, fake('192.0.2.50'), {});
check(r.result === 'nomatch', 'a click older than 30 days does not count', JSON.stringify(r));
C.lookup(id).ad.ts = Date.now() - 29 * DAY;
r = C.record({ px, c: id, m: 'url' }, fake('192.0.2.50'), {});
check(r.result === 'counted' && r.method === 'url', 'the same click at 29 days counts', JSON.stringify(r.result));
check(C.record({ px, c: id, m: 'url' }, fake('192.0.2.50'), {}).result === 'dup', 'counted once per click');
// owner check: someone else's click never counts for this pixel
const other = C.recordAdClick({ id: 8, owner: 'else@u.test', name: 'Other', type: 'banner', targetUrl: 'https://y.test/' }, fake('192.0.2.2'), {});
check(C.record({ px, c: other, m: 'url' }, fake('192.0.2.51'), {}).result === 'refused', "someone else's click is refused");
// InstantAdPay import rules
const now = Date.now();
const n = C.importClicks([{ id: 'i0123456789a', camp: 5, owner: 'Own@U.test', ts: now, sk: 's:' + 'a'.repeat(20), spent: 90 }, { id: 'bad', owner: 'x@y.z', ts: now }, { id: 'i0123456789b', camp: 5, owner: 'own@u.test', ts: now - 40 * DAY }]);
check(n === 1 && C.lookup('i0123456789a') && C.lookup('i0123456789a').owners[0] === 'own@u.test', 'IAP clicks import: good row in (owner lowercased), bad id and >30-day rows dropped', String(n));
check(C.importClicks([{ id: 'i0123456789a', camp: 5, owner: 'own@u.test', ts: now, spent: 120 }]) === 1 && Object.keys(C.lookup('i0123456789a') ? { a: 1 } : {}).length === 1, 'the same IAP click sent twice is an upsert, not a second click');
// per-IP rate limit (20 a minute)
let limited = 0; for (let i = 0; i < 25; i++) if (C.record({ px, c: 'nosuchclick1' }, fake('192.0.2.99'), {}).result === 'limited') limited++;
check(limited === 5, 'per-visitor rate limit: 20 a minute, the rest refused', limited + ' limited');
check(C.record({ px: 'px0000000000', c: id }, fake('192.0.2.98'), {}).result === 'unknown', 'unknown pixel id ignored');
// fix 1 (2026-10-26): own clicks are tests on every click type. The owner is seen signed in from 192.0.2.7 + OwnerUA.
const ownReq = fake('192.0.2.7', 'OwnerUA');
check(C.noteSession('Own@U.test', ownReq) && C.isOwnerSk('own@u.test', C.softKey(ownReq)) && !C.isOwnerSk('else@u.test', C.softKey(ownReq)), 'owner soft key noted from a session (email lowercased), not shared with another owner');
const idOwnSk = C.recordAdClick({ id: 7, owner: 'own@u.test', name: 'Unit ad', type: 'banner', targetUrl: 'https://x.test/' }, ownReq, {});
check(C.lookup(idOwnSk).ad.self === 1, "an ad click from the owner's browser is flagged self even when not signed in");
r = C.record({ px, c: idOwnSk, m: 'url' }, fake('192.0.2.60'), {});
check(r.result === 'counted' && r.conv.self === 1, 'its conversion is kept as a test (self)', JSON.stringify(r.result));
const idStr = C.recordAdClick({ id: 7, owner: 'own@u.test', name: 'Unit ad', type: 'banner', targetUrl: 'https://x.test/' }, fake('192.0.2.61', 'StrangerUA'), {});
r = C.record({ px, c: idStr, m: 'url' }, ownReq, {});
check(r.result === 'counted' && r.conv.self === 1, "a stranger's click converted from the owner's own browser is a test too", JSON.stringify(r.result));
const idStr2 = C.recordAdClick({ id: 7, owner: 'own@u.test', name: 'Unit ad', type: 'banner', targetUrl: 'https://x.test/' }, fake('192.0.2.62', 'StrangerUA'), {});
r = C.record({ px, c: idStr2, m: 'url' }, fake('192.0.2.63', 'StrangerUA'), {});
check(r.result === 'counted' && !r.conv.self, "a stranger's click and conversion still count", JSON.stringify(r.conv && r.conv.self));
const skI = 's:' + 'b'.repeat(20);
check(C.importOwners([{ owner: 'Own@U.test', sk: skI, ts: Date.now() }, { owner: 'x@y.z', sk: 'nope' }]) === 1 && C.isOwnerSk('own@u.test', skI), 'InstantAdPay owner soft keys import (bad rows dropped)');
C.importClicks([{ id: 'i0123456789c', camp: 5, owner: 'own@u.test', ts: Date.now(), sk: skI, self: 0 }]);
check(C.lookup('i0123456789c').ad.self === 1, "an InstantAdPay click from the owner's InstantAdPay browser imports as self");
check(C.markSelfClick('abcdef0123', 'own@u.test', ownReq, '') && C.markSelfClick('abcdef0124', 'own@u.test', fake('192.0.2.64', 'Other'), 'OWN@u.test') && !C.markSelfClick('abcdef0125', 'own@u.test', fake('192.0.2.65', 'Other'), 'else@u.test'), 'spin / Banner Spin clicks marked self by owner soft key or owner session, not by someone else');
// withClickId: the string insert lsconv uses
check(C.withClickId('https://a.test/p?utm=x&q=a%2Cb#top', 'k0123456789a') === 'https://a.test/p?utm=x&q=a%2Cb&lsclk=k0123456789a#top' && C.withClickId('https://a.test/p?lsclk=keep', 'k0123456789a') === 'https://a.test/p?lsclk=keep'
&& C.withClickId('https://a.test', 'k0123456789a') === 'https://a.test?lsclk=k0123456789a' && C.withClickId('not a url', 'k0123456789a') === 'not a url', 'withClickId: params kept byte for byte, before the #hash, an lsclk never replaced, bad URL unchanged');
fs.rmSync(UD, { recursive: true, force: true });
}
// ---------- 2) end to end ----------
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'cv-qa-'));
fs.mkdirSync(path.join(DATA, 'uploads'));
const A = 'convmember@lp.test', B = 'someoneelse@lp.test';
const camp = (id, owner, name, targetUrl, spent) => ({ id, owner, memberId: 0, type: 'banner', name, targetUrl, imageUrl: 'https://img.qa.invalid/b.png', title: null, body: null, width: 728, height: 90, budget: 1000, spent, accrued: 0, imps: 0, clicks: 0, batchImps: 0, status: 'active', created: Date.now() });
fs.writeFileSync(path.join(DATA, 'campaigns.json'), JSON.stringify({ v: 1, nextId: 4, burnsPending: [], campaigns: [
camp(1, A, 'QA banner', 'https://landing.qa.test/page?x=1', 300), camp(2, B, 'Other banner', 'https://other.qa.test/', 50), camp(3, A, 'QA to spin', 'https://landing.qa.test/spin-placeholder', 40)] }));
const env = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, ADMIN_PASSWORD: 'localtest-cv', ADMIN_EMAIL: 'admin@cv.test', SITE_HOST: 'linkspin.test', LS_SYNC_SECRET: SECRET, IAP_URL: 'http://127.0.0.1:9/' });
for (const k of ['NODE_ENV', 'DATABASE_URL', 'ENGINE_KEY', 'OUTBOUND', 'LS_TESTERS', 'CURTAIN', 'NAS_DB_HOST', 'NAS_DB_USER', 'NAS_DB_PASSWORD', 'NAS_DB_NAME', 'SENDGRID_API_KEY', 'OPENROUTER_API_KEY']) delete env[k];
const logFile = path.join(DATA, 'server.log'); const log = fs.createWriteStream(logFile);
const srv = spawn(process.execPath, ['server.js'], { cwd: site, env, stdio: ['ignore', 'pipe', 'pipe'] });
srv.stdout.pipe(log); srv.stderr.pipe(log);
const UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) ConvQA';
function req(method, p, o) {
o = o || {};
return new Promise((resolve, reject) => {
const headers = Object.assign({ 'User-Agent': o.ua || UA }, o.headers || {});
if (o.cookie) headers.Cookie = o.cookie; if (o.ip) headers['X-Forwarded-For'] = o.ip;
let body = o.raw != null ? Buffer.from(o.raw) : o.body; if (body && !Buffer.isBuffer(body)) { body = Buffer.from(JSON.stringify(body)); headers['Content-Type'] = 'application/json'; } else if (body) headers['Content-Type'] = headers['Content-Type'] || 'application/json';
if (body) headers['Content-Length'] = body.length;
const r = http.request({ host: '127.0.0.1', port: PORT, path: p, method, headers }, res => { const ch = []; res.on('data', c => ch.push(c)); res.on('end', () => { const buf = Buffer.concat(ch); let j = null; try { j = JSON.parse(buf.toString()); } catch (e) {} resolve({ status: res.statusCode, headers: res.headers, text: buf.toString(), json: j }); }); });
r.on('error', reject); if (body) r.write(body); r.end();
});
}
const signed = (p, obj, secret) => { const raw = JSON.stringify(obj); const ts = String(Date.now()); const sig = crypto.createHmac('sha256', secret || SECRET).update(ts + '\n' + raw).digest('hex'); return req('POST', p, { raw, headers: { 'X-LS-Ts': ts, 'X-LS-Sig': sig, 'Content-Type': 'application/json' } }); };
const softKey = (ip, ua) => 's:' + crypto.createHash('sha256').update(ip + '|' + ua).digest('hex').slice(0, 20);
const res = r => String(r.headers['x-ls-result'] || '');
const lsclkOf = loc => (/[?&]lsclk=([a-z0-9]+)/i.exec(String(loc || '')) || [])[1] || '';
let browserPart = null;
async function signIn(email, ip) {
const st = await req('POST', '/api/auth/email/start', { ip, body: { email, fts: Date.now() - 8000, hp_field_x9: '', pick: null } });
if (!st.json || !st.json.devCode) throw new Error('no devCode: ' + st.text.slice(0, 200));
const v = await req('POST', '/api/auth/email/verify', { ip, body: { email, code: st.json.devCode } });
return [].concat(v.headers['set-cookie'] || []).map(c => c.split(';')[0]).join('; ');
}
try {
let up = false; for (let i = 0; i < 60; i++) { try { const r = await req('GET', '/api/config'); if (r.status === 200) { up = true; break; } } catch (e) {} await sleep(500); }
if (!up) throw new Error('server did not come up');
const cA = await signIn(A, '10.77.0.1');
check(!!cA, 'member signed in on the local copy');
const g1 = await req('POST', '/api/my/conversions/goals', { cookie: cA, body: { name: 'subscriber', value: '5' } });
check(g1.status === 200 && g1.json.goal && /^px[a-f0-9]{10}$/.test(g1.json.goal.px), 'goal "subscriber" created in the Control Room API', g1.text.slice(0, 160));
const PX = g1.json.goal.px;
const pb = await req('POST', '/api/my/postbacks', { cookie: cA, body: { name: 'QA goal tracker', url: 'https://tracker.qa.invalid/pb?cid={clickid}&e={event}&ls={lsid}&v={payout}', events: ['goal'] } });
check(pb.status === 200, "postback listening to 'goal' created (an .invalid host)", pb.text.slice(0, 160));
// method url: an ad click, then the pixel with the id from the thank-you page's address
const k1 = await req('GET', '/api/ads/click/1', { ip: '203.0.113.21' });
const id1 = lsclkOf(k1.headers.location);
check(k1.status === 302 && /^a[a-f0-9]{11}$/.test(id1) && /[?&]x=1/.test(k1.headers.location) && /^https:\/\/landing\.qa\.test\/page\?/.test(k1.headers.location), 'ad click: 302 to the target with lsclk added and its own params kept', k1.headers.location);
check(/ls\.clk=/.test(String(k1.headers['set-cookie'] || '')), 'ad click sets the ls.clk cookie');
let r = await req('GET', '/cv.gif?px=' + PX + '&goal=subscriber&c=' + id1 + '&m=url', { ip: '198.18.0.1', headers: { Referer: 'https://landing.qa.test/thanks' } });
check(r.status === 200 && r.headers['content-type'] === 'image/gif' && res(r) === 'counted;url', "goal pixel from the member's own domain counts with method 'url'", res(r));
r = await req('GET', '/cv.gif?px=' + PX + '&goal=subscriber&c=' + id1 + '&m=url', { ip: '198.18.0.1' });
check(res(r) === 'dup;url', 'the same click and goal again: not counted twice', res(r));
// method stored
const id2 = lsclkOf((await req('GET', '/api/ads/click/1', { ip: '203.0.113.22' })).headers.location);
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + id2 + '&m=stored', { ip: '198.18.0.2' });
check(res(r) === 'counted;stored', "id the landing tag kept counts with method 'stored'", res(r));
// method cookie: no id on the pixel, LinkSpin's own cookie carries it
const id3 = lsclkOf((await req('GET', '/api/ads/click/1', { ip: '203.0.113.23' })).headers.location);
r = await req('GET', '/cv.gif?px=' + PX, { ip: '198.18.0.3', cookie: 'ls.clk=' + id3 });
check(res(r) === 'counted;cookie', "no id on the page, LinkSpin cookie: method 'cookie'", res(r));
// method soft: same IP + browser within 24 h, nothing else
const ip4 = '203.0.113.24', ua4 = 'Mozilla/5.0 SoftMatch QA';
const id4 = lsclkOf((await req('GET', '/api/ads/click/1', { ip: ip4, ua: ua4 })).headers.location);
r = await req('GET', '/cv.gif?px=' + PX, { ip: ip4, ua: 'Mozilla/5.0 Different browser' });
check(res(r) === 'nomatch', 'a different browser on that network does not match', res(r));
r = await req('GET', '/cv.gif?px=' + PX, { ip: ip4, ua: ua4 });
check(res(r) === 'counted;soft' && !!id4, "same IP + browser within 24 h: method 'soft'", res(r));
// owner mismatch: B's ad click, A's pixel
const idB = lsclkOf((await req('GET', '/api/ads/click/2', { ip: '203.0.113.25' })).headers.location);
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + idB + '&m=url', { ip: '198.18.0.5' });
check(res(r) === 'refused', "a click on someone else's ad is refused by this pixel", res(r));
r = await req('GET', '/cv.gif?px=px0123456789&c=' + id1, { ip: '198.18.0.6' });
check(res(r) === 'unknown' && r.status === 200, 'unknown pixel id: still a gif, nothing recorded', res(r));
// a spin link reached through an ad: the rotator passes a click id on and the conversion credits both
const rc = await req('POST', '/api/my/rotations', { cookie: cA, body: { name: 'Conv QA spin' } });
const rot = rc.json.rotation;
await req('POST', '/api/my/rotations/' + rot.id + '/dest', { cookie: cA, body: { url: 'https://landing.qa.test/lp?y=2', weight: 1 } });
const id5 = lsclkOf((await req('GET', '/api/ads/click/3', { ip: '203.0.113.26' })).headers.location);
const sp = await req('GET', '/r/' + rot.code + '?lsclk=' + id5, { ip: '203.0.113.26' });
const sid = lsclkOf(sp.headers.location);
check(sp.status === 302 && /^[a-f0-9]{10}$/.test(sid) && sid !== id5 && /[?&]y=2/.test(sp.headers.location), 'spin link reached through an ad: destination gets the spin click id (lsclk), its params kept', sp.headers.location);
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + sid + '&m=stored', { ip: '198.18.0.7' });
check(res(r) === 'counted;stored', 'conversion on the spin click counts', res(r));
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + id5 + '&m=url', { ip: '198.18.0.8' });
check(res(r) === 'dup;url', 'the ad click behind it is the same click: not counted again', res(r));
const spPlain = await req('GET', '/r/' + rot.code, { ip: '203.0.113.27' });
check(/^[a-f0-9]{10}$/.test(lsclkOf(spPlain.headers.location)), 'an owner with a goal: plain spin-link clicks carry lsclk too');
// InstantAdPay: signed click push, then a conversion on it, then the summary
const ipI = '203.0.113.30';
const bad = await signed('/api/partner/clicks', { clicks: [] }, 'wrong-secret-wrong-secret-wrong-secret');
check(bad.status === 401, 'partner call with a bad signature refused', String(bad.status));
const iid = 'i' + crypto.randomBytes(6).toString('hex').slice(0, 11);
const pc = await signed('/api/partner/clicks', { clicks: [{ id: iid, camp: 77, cname: 'IAP QA banner', type: 'banner', owner: A, ts: Date.now(), sk: softKey(ipI, UA), c: 'US', dv: 'desktop', pl: 'instantadpay.com/my', target: 'https://landing.qa.test/iap', spent: 200, self: 0 }] });
check(pc.status === 200 && pc.json.n === 1, 'IAP ad click pushed over the signed partner call', pc.text.slice(0, 120));
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + iid + '&m=url', { ip: '198.18.0.9' });
check(res(r) === 'counted;url', 'conversion on an InstantAdPay ad click counts', res(r));
const sum = await signed('/api/partner/conv', { op: 'summary', email: A, days: 30 });
const bc = sum.json && sum.json.byCampaign && sum.json.byCampaign['77'];
check(sum.status === 200 && bc && bc.clicks === 1 && bc.conv[PX] === 1 && (sum.json.goals || []).some(g => g.px === PX), 'IAP summary: goals + campaign 77 shows 1 click, 1 subscriber', JSON.stringify(bc));
const gI = await signed('/api/partner/conv', { op: 'create', email: A, name: 'sale', value: 20 });
check(gI.status === 200 && gI.json.goal && gI.json.goal.name === 'sale', 'IAP can add a goal to the member (LinkSpin holds it)', gI.text.slice(0, 120));
const tI = await signed('/api/partner/conv', { op: 'test', email: A, px: gI.json.goal.px });
const tX = await signed('/api/partner/conv', { op: 'test', email: B, px: gI.json.goal.px });
check(tI.status === 200 && tI.json.ok && tX.status === 400, "IAP test conversion works for the owner, refused for someone else's goal", tX.text.slice(0, 80));
// a test conversion through the real pixel, and the advertiser's own click
r = await req('GET', '/cv.gif?px=' + PX + '&test=1', { ip: '198.18.0.10' });
check(res(r) === 'test', 'test conversion received', res(r));
const own = await req('GET', '/api/ads/click/1', { ip: '10.77.0.1', cookie: cA });
const idSelf = lsclkOf(own.headers.location);
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + idSelf + '&m=url', { ip: '198.18.0.11' });
check(res(r) === 'counted;url;self', "advertiser's own click still gets an id and is recorded (as a test)", res(r));
// fix 1: the owner's own SPIN LINK click (from the browser they signed in with, no cookie on the link domain) is a test
const ownSpin = await req('GET', '/r/' + rot.code, { ip: '10.77.0.1' });
const idOwnSpin = lsclkOf(ownSpin.headers.location);
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + idOwnSpin + '&m=url', { ip: '198.18.0.12' });
check(/^[a-f0-9]{10}$/.test(idOwnSpin) && res(r) === 'counted;url;self', "owner's own spin-link click (owner soft key): its conversion is a test, not counted", res(r));
const ownSpin2 = await req('GET', '/r/' + rot.code, { ip: '10.77.0.99', cookie: cA }); // signed in on this host, another network
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + lsclkOf(ownSpin2.headers.location) + '&m=url', { ip: '198.18.0.13' });
check(res(r) === 'counted;url;self', "owner's own spin-link click while signed in: a test", res(r));
// a stranger's spin click converted from the owner's own browser: a test too
const strangerSpin = await req('GET', '/r/' + rot.code, { ip: '203.0.113.28' });
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + lsclkOf(strangerSpin.headers.location) + '&m=url', { ip: '10.77.0.1' });
check(res(r) === 'counted;url;self', "a goal finished in the owner's own browser is a test", res(r));
// fix 3: Banner Spin straight to a page carries lsclk; a stranger's goal counts under By Banner Spin, the owner's own is a test
const AUTH = { Authorization: 'Bearer localtest-cv' };
const gr = await req('POST', '/api/admin/bannerspins', { headers: AUTH, body: { email: A, grant: 'starter' } });
const bsc = await req('POST', '/api/my/bannerspins', { cookie: cA, body: { name: 'Conv QA banners', size: '468x60', fallback: 'https://landing.qa.test/fallback' } });
const BS = bsc.json && bsc.json.spin;
const bb1 = BS && await req('POST', '/api/my/bannerspins/' + BS.id + '/banner', { cookie: cA, body: { image: 'https://img.qa.invalid/b1.png', target: 'https://landing.qa.test/bs?utm_source=bs&q=a%2Cb#form', label: 'Direct', weight: 10 } });
check(gr.status === 200 && BS && BS.code && bb1 && bb1.status === 200, 'Banner Spin set up for the member (starter grant, one banner straight to a page)', [gr.status, bsc.text.slice(0, 120), bb1 && bb1.text.slice(0, 120)].join(' | '));
const bid = bb1 && bb1.json && ((bb1.json.banner && bb1.json.banner.id) || (bb1.json.spin && bb1.json.spin.banners && bb1.json.spin.banners.slice(-1)[0].id)) || 1;
const bk = await req('GET', '/c/' + BS.code + '?x=' + bid, { ip: '203.0.113.50' });
const idBs = lsclkOf(bk.headers.location);
check(bk.status === 302 && /^k[a-f0-9]{11}$/.test(idBs) && bk.headers.location === 'https://landing.qa.test/bs?utm_source=bs&q=a%2Cb&lsclk=' + idBs + '#form', 'Banner Spin click straight to a page: lsclk added, params kept byte for byte, before the #hash', bk.headers.location);
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + idBs + '&m=stored', { ip: '198.18.0.14' });
check(res(r) === 'counted;stored', 'a goal on the Banner Spin click counts', res(r));
const tagBs = await req('GET', '/t.gif?px=' + PX + '&c=' + idBs, { ip: '198.18.0.15' });
check(res(tagBs) === 'stored', 'the landing tag accepts the Banner Spin click id', res(tagBs));
const bkOwn = await req('GET', '/c/' + BS.code + '?x=' + bid, { ip: '10.77.0.1' });
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + lsclkOf(bkOwn.headers.location) + '&m=url', { ip: '198.18.0.16' });
check(res(r) === 'counted;url;self', "owner's own Banner Spin click: a test, not counted", res(r));
const bb2 = await req('POST', '/api/my/bannerspins/' + BS.id + '/banner', { cookie: cA, body: { image: 'https://img.qa.invalid/b2.png', link: rot.id, label: 'Via spin', weight: 10 } });
const bid2 = bb2.json && ((bb2.json.banner && bb2.json.banner.id) || (bb2.json.spin && bb2.json.spin.banners.slice(-1)[0].id));
const bkSpin = await req('GET', '/c/' + BS.code + '?x=' + bid2, { ip: '203.0.113.51' });
check(bkSpin.status === 302 && /\/r\/[a-z0-9]+$/.test(bkSpin.headers.location || ''), 'a banner pointed at a spin link gets no lsclk of its own (the spin link adds one)', bkSpin.headers.location);
const bkB = await req('GET', '/api/admin/bannerspins', { headers: AUTH });
check(bkB.status === 200, 'admin Banner Spin list still answers');
// the report: counts, methods, cost per goal (campaign 1: 300 credits spent / 4 subscribers = 75)
const rep = (await req('GET', '/api/my/conversions?days=30', { cookie: cA })).json;
const G = rep.byGoal.find(x => x.goal === 'subscriber');
const c1 = G.campaigns.find(c => c.key === 'ls:1'), c3 = G.campaigns.find(c => c.key === 'ls:3'), cI = G.campaigns.find(c => c.key === 'iap:77');
check(G.n === 7, 'report: 7 subscribers counted (4 on campaign 1, 1 via spin link, 1 IAP, 1 Banner Spin); every own click left out (ad, spin link x3, Banner Spin)', 'n=' + G.n);
check(G.banners && G.banners.length === 1 && G.banners[0].code === BS.code && G.banners[0].n === 1, 'by Banner Spin: the straight-to-page banner shows its one goal', JSON.stringify(G.banners));
check(!G.links.some(x => x.n > 1), 'own spin-link clicks are not in the spin-link counts', JSON.stringify(G.links));
check(c1 && c1.n === 4 && c1.spent === 300 && c1.costPer === 75 && c1.clicks === 4, 'cost per goal: 300 credits / 4 = 75 credits, 4 clicks counted (own click left out)', JSON.stringify(c1));
check(c3 && c3.n === 1 && cI && cI.n === 1 && cI.costPer === 200 && cI.site === 'InstantAdPay', 'spin conversion credited to the ad campaign; IAP campaign shows its own cost per goal from the pushed spend', JSON.stringify([c3, cI]));
check(G.links.length === 1 && G.links[0].code === rot.code && G.links[0].n === 1, 'by spin link', JSON.stringify(G.links));
check(G.methods.url === 2 && G.methods.stored === 3 && G.methods.cookie === 1 && G.methods.soft === 1 && rep.selfTests === 5, 'match-method breakdown url 2 / stored 3 / cookie 1 / soft 1, five own-click tests apart (ad, spin x3, Banner Spin)', JSON.stringify([G.methods, rep.selfTests]));
check(G.dests.some(d => d.k === 'landing.qa.test/lp') && G.sources.length > 0, 'by destination page and traffic source', JSON.stringify([G.dests, G.sources]).slice(0, 200));
check(rep.goals.find(g => g.px === PX).lastTest > 0 && rep.goals.find(g => g.px === PX).conv === 7, 'goal row shows the last test and the 30-day count');
const sumSelf = await signed('/api/partner/conv', { op: 'summary', email: A, days: 30 });
check(sumSelf.json && sumSelf.json.selfTests === 5, 'IAP summary carries the own-click test count (selfTests) for the card', JSON.stringify(sumSelf.json && sumSelf.json.selfTests));
const ownI = 'i' + crypto.randomBytes(6).toString('hex').slice(0, 11), skOwnI = 's:' + crypto.randomBytes(10).toString('hex');
const pcOwn = await signed('/api/partner/clicks', { owners: [{ owner: A, sk: skOwnI, ts: Date.now() }], clicks: [{ id: ownI, camp: 77, cname: 'IAP QA banner', type: 'banner', owner: A, ts: Date.now(), sk: skOwnI, self: 0, spent: 200 }] });
r = await req('GET', '/cv.gif?px=' + PX + '&c=' + ownI + '&m=url', { ip: '198.18.0.17' });
check(pcOwn.json && pcOwn.json.owners === 1 && res(r) === 'counted;url;self', "an InstantAdPay click from the owner's InstantAdPay browser (owners pushed with the clicks) is a test", JSON.stringify(pcOwn.json) + ' ' + res(r));
const csv = await req('GET', '/api/my/conversions.csv?days=30', { cookie: cA });
check(csv.status === 200 && /text\/csv/.test(csv.headers['content-type']) && csv.text.trim().split('\n').length === 8 && /,Banner Spin,/.test(csv.text), 'CSV export: header + 7 rows, one from a Banner Spin', String(csv.text.split('\n').length));
const csvB = await req('GET', '/api/my/conversions.csv?days=30', { cookie: await signIn(B, '10.77.0.2') });
check(csvB.text.trim().split('\n').length === 1, "another member's CSV has none of these rows");
// the goal postback was attempted with event = goal name
let plog = []; for (let i = 0; i < 30; i++) { await sleep(500); try { plog = JSON.parse(fs.readFileSync(path.join(DATA, 'postbacks.json'), 'utf8')).log.filter(l => l.event === 'subscriber'); } catch (e) {} if (plog.length >= 7) break; }
check(plog.length >= 7 && plog.every(l => /e=subscriber/.test(l.url)) && plog.some(l => l.lsid === id1), "goal postback fired for the counted conversions, {event} = the goal's name", plog.length + ' attempts ' + (plog[0] ? plog[0].url : ''));
check(!plog.some(l => l.lsid === idSelf), "no postback for the advertiser's own click");
check(!plog.some(l => l.lsid === idOwnSpin || l.lsid === lsclkOf(bkOwn.headers.location)) && plog.some(l => l.lsid === idBs), 'no postback for own spin-link / Banner Spin clicks; the Banner Spin goal fired one');
const tjs = await req('GET', '/t.js'), cjs = await req('GET', '/cv.js');
let parses = true; try { new Function(tjs.text); new Function(cjs.text); } catch (e) { parses = false; }
check(tjs.status === 200 && /javascript/.test(tjs.headers['content-type']) && cjs.status === 200 && parses, 'the landing tag and script pixel are served and parse');
// ---------- 3) browser: landing tag + script pixel on another origin, also framed ----------
const PW = process.env.PW || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright';
if (fs.existsSync(PW + '/index.js')) {
const LS = 'http://127.0.0.1:' + PORT;
const pagesSrv = http.createServer((q, s) => {
const u = new URL(q.url, 'http://x');
const html = u.pathname === '/lp' ? '<!doctype html><title>lp</title><form id="f" action="/thanks"><input type="hidden" name="lsclk" value=""><input name="email" value="a@b.c"></form><a id="in" href="/thanks?step=2">Next</a><a id="out" href="https://elsewhere.qa.invalid/">Out</a><script async src="' + LS + '/t.js?px=' + PX + '"></script>'
: u.pathname === '/thanks' ? '<!doctype html><title>thanks</title><p>Thanks</p><script async src="' + LS + '/cv.js?px=' + PX + '&goal=subscriber"></script>'
: u.pathname === '/frame' ? '<!doctype html><title>frame</title><iframe id="fr" src="http://localhost:' + PORT2 + '/lp?lsclk=' + u.searchParams.get('id') + '" width="600" height="400"></iframe>' : '';
s.writeHead(html ? 200 : 404, { 'Content-Type': 'text/html' }); s.end(html);
}).listen(PORT2);
const { chromium } = (await import(pathToFileURL(PW + '/index.js').href)).default;
const browser = await chromium.launch();
try {
const ctx = await browser.newContext(); const page = await ctx.newPage();
const results2 = [];
page.on('response', rr => { if (/\/cv\.gif\?/.test(rr.url())) results2.push(rr.headers()['x-ls-result'] || ''); });
const idW = lsclkOf((await req('GET', '/api/ads/click/1', { ip: '203.0.113.40' })).headers.location);
await page.goto('http://localhost:' + PORT2 + '/lp?lsclk=' + idW); await page.waitForTimeout(800);
const stored = await page.evaluate(() => { try { return JSON.parse(localStorage.getItem('ls_clk')).id; } catch (e) { return null; } });
const hid = await page.evaluate(() => document.querySelector('input[name=lsclk]').value);
await page.evaluate(() => { document.addEventListener('click', e => e.preventDefault()); document.getElementById('in').dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true })); });
const inHref = await page.evaluate(() => document.getElementById('in').href), outHref = await page.evaluate(() => document.getElementById('out').href);
check(stored === idW && hid === idW, 'landing tag on another origin keeps the id (localStorage) and fills the hidden lsclk field', stored + ' / ' + hid);
check(/lsclk=/.test(inHref) && !/lsclk=/.test(outHref), 'same-site links get lsclk, links to other sites are left alone', inHref + ' | ' + outHref);
await page.goto('http://localhost:' + PORT2 + '/thanks'); await page.waitForTimeout(1200);
check(results2.includes('counted;stored'), "script goal pixel on the thank-you page (no id in its address) counts with method 'stored'", JSON.stringify(results2));
// framed (a traffic exchange): the member's page inside another site's frame
const idF = lsclkOf((await req('GET', '/api/ads/click/1', { ip: '203.0.113.41' })).headers.location);
const ctx2 = await browser.newContext(); const p2 = await ctx2.newPage(); const res3 = [];
p2.on('response', rr => { if (/\/cv\.gif\?/.test(rr.url())) res3.push(rr.headers()['x-ls-result'] || ''); });
const errs = []; p2.on('pageerror', e => errs.push(String(e)));
await p2.goto('http://127.0.0.1:' + PORT2 + '/frame?id=' + idF); await p2.waitForTimeout(1000);
const fr = p2.frames().find(f => /\/lp/.test(f.url()));
await fr.evaluate(() => { location.href = '/thanks'; }); await p2.waitForTimeout(1500);
check(res3.includes('counted;stored') && !errs.length, 'framed in another site: the tag keeps the id and the thank-you pixel counts, no page errors', JSON.stringify(res3) + ' ' + errs.join('; '));
// a broken LinkSpin host never breaks the member's page
const p3 = await ctx.newPage(); const errs3 = []; p3.on('pageerror', e => errs3.push(String(e)));
await p3.setContent('<p id="ok">fine</p><script async src="http://127.0.0.1:1/t.js?px=' + PX + '"></script><script async src="http://127.0.0.1:1/cv.js?px=' + PX + '"></script>'); await p3.waitForTimeout(500);
check(!errs3.length && await p3.evaluate(() => document.getElementById('ok').textContent) === 'fine', "unreachable tag host: the member's page still works, no errors");
} finally { await browser.close(); pagesSrv.close(); }
browserPart = true;
} else { results.push('SKIP browser part (no Playwright at ' + PW + ')'); }
} catch (e) {
check(false, 'run', e && e.stack || String(e));
} finally {
srv.kill(); await sleep(500);
const fails = results.filter(r => r.startsWith('FAIL'));
console.log(results.join('\n'));
console.log('\n' + (results.length - fails.length) + ' passed, ' + fails.length + ' failed' + (fails.length ? ' (server log: ' + logFile + ')' : ''));
if (!fails.length) try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {}
process.exit(failed ? 1 : 0);
}
+1 -1
View File
@@ -13,7 +13,7 @@ const CASES = [
['can i just use coinbase', 'f-coinbase'],
['I already have an InstantAdPay account, will my upline carry over here?', 'f-team-here'],
['How many extra POL should I keep for gas fees?', 'f-how-much-pol'],
['MoonPay declined my bank card', 'f-moonpay-declined'],
['My card was declined when I tried to buy POL', 'f-card-declined'],
['When does the daily set reset each day?', 'f-claim-streak'],
['How many videos can I watch per day?', 'f-visits-videos'],
['How do I rotate several offers behind one short link?', 'c-spin-links'],
+73
View File
@@ -0,0 +1,73 @@
// Network rate on LinkSpin (Marty, 2026-10-27, approved 4:1): views off LinkSpin's own pages cost 1/synRateDivisor of the
// on-site rate. JSON store, NAS stubbed, throwaway data dir. node qa/nas-ratio.test.cjs
// Covers: N=4 NAS views (1 credit per 20 banner views, fractions exact), partner-zone views (2 credits per 40, counted in
// synImps, not in Views here), on-site batches unchanged, budget is the limit, a lowered rate tops NAS up once, N=1 = old rule.
'use strict';
delete process.env.DATABASE_URL;
const fs = require('fs'); const os = require('os'); const path = require('path');
const ok = [], bad = [];
const t = (n, c, extra) => { (c ? ok : bad).push(n + (c || extra === undefined ? '' : ' -> ' + extra)); };
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-nas-ratio-'));
const nas = require('../nas.js');
const rows = {}; const calls = { topUp: [], deactivate: 0 };
nas.enabled = () => true;
nas.impressionsPerCredit = type => type === 'banner' ? 5 : 10;
nas.readServed = async id => { const r = rows[id]; return r ? { assigned: r.assigned, remaining: r.remaining, served: Math.max(0, Math.min(r.assigned, r.assigned - r.remaining)), clicks: 0 } : null; };
nas.deactivate = async id => { const r = rows[id]; const served = Math.max(0, r.assigned - r.remaining); r.remaining = 0; calls.deactivate++; return { ok: true, served }; };
nas.topUp = async (id, add) => { rows[id].assigned += add; rows[id].remaining += add; calls.topUp.push([id, add]); return { ok: true }; };
nas.restart = async (id, base, add) => { rows[id].assigned = base + add; rows[id].remaining = add; return { ok: true }; };
nas.updateCreative = async () => ({ ok: true });
const ads = require('../ads.js');
const zones = require('../zones.js');
const ADV = 'ratio@qa.test', PUB = 'pub@qa.test', FILE = path.join(DATA, 'campaigns.json');
const banner = (id, x) => Object.assign({ id, owner: ADV, memberId: 0, type: 'banner', name: 'QA ' + id, targetUrl: 'https://example.com/', imageUrl: 'https://example.com/b.png', width: 728, height: 90,
budget: 1000, spent: 0, accrued: 0, imps: 0, batchImps: 0, clicks: 0, status: 'active', created: Date.now() }, x || {});
const seed = camps => { fs.writeFileSync(FILE, JSON.stringify({ v: 1, nextId: 9100, campaigns: camps, burnsPending: [] })); ads.init({ dataDir: DATA, chain: { creditBalance: async () => 0 } }); };
const C = id => JSON.parse(fs.readFileSync(FILE, 'utf8')).campaigns.find(c => c.id === id);
const used = c => (c.spent || 0) + (c.accrued || 0);
const req = { headers: { referer: 'https://pubsite.org/page', 'user-agent': 'Mozilla/5.0 (QA)', 'x-forwarded-for': '203.0.113.9' }, socket: {} };
(async () => {
t('default divisor is 4', ads.synRateDivisor() === 4, String(ads.synRateDivisor()));
// partner zones
seed([banner(9001)]);
fs.writeFileSync(path.join(DATA, 'zone-rates.json'), JSON.stringify({ nasOn: 0 }));
zones.init({ dataDir: DATA, ads, siteHost: 'linkspin.test' });
await ads.addEarned(ADV, 100000);
const z = (await zones.create(PUB, { name: 'QA zone', site: 'pubsite.org', size: '728x90' })).zone;
for (let i = 0; i < 39; i++) await zones.serve(z.id, req, {});
let c = C(9001);
t('N=4: 39 partner-zone views charge nothing yet', used(c) === 0, String(used(c)));
await zones.serve(z.id, req, {}); c = C(9001);
t('the 40th completes one batch: 2 credits (1/4 of 2 per 10)', used(c) === 2, String(used(c)));
t('partner-zone views counted in synImps, not in Views here', c.synImps === 40 && c.imps === 0, JSON.stringify({ syn: c.synImps, imps: c.imps }));
for (let i = 0; i < 10; i++) await ads.serve('banner', { width: 728, height: 90 });
c = C(9001);
t('on-site: 10 views still charge 2 credits', used(c) === 4 && c.imps === 10, JSON.stringify({ used: used(c), imps: c.imps }));
// NAS
rows[9002] = { assigned: 20000, remaining: 20000 };
seed([C(9001), banner(9002, { nasAdId: 9002, nasServed: 0 })]);
rows[9002].remaining -= 1010; await ads.reconcileNas();
t('N=4: 1,010 network views charge 50 credits (1 per 20)', used(C(9002)) === 50, String(used(C(9002))));
rows[9002].remaining -= 10; await ads.reconcileNas();
t('10 more complete the 51st credit (fraction carried)', used(C(9002)) === 51, String(used(C(9002))));
// budget is the limit
rows[9003] = { assigned: 200, remaining: 200 };
seed([C(9001), C(9002), banner(9003, { budget: 10, nasAdId: 9003, nasServed: 0 })]);
rows[9003].remaining -= 200; await ads.reconcileNas();
const x = C(9003);
t('budget is the limit: 10 credits, ad out, NAS stopped', used(x) === 10 && x.status === 'out' && calls.deactivate >= 1, JSON.stringify({ used: used(x), st: x.status }));
// old rule, then the rate lowered
ads.setRates({ synRateDivisor: 1 });
rows[9004] = { assigned: 1000, remaining: 1000 };
seed([C(9001), C(9002), C(9003), banner(9004, { nasAdId: 9004, nasServed: 0 })]);
rows[9004].remaining -= 500; await ads.reconcileNas();
t('N=1 (old rule): 500 network views charge 100 credits', used(C(9004)) === 100, String(used(C(9004))));
ads.setRates({ synRateDivisor: 4 });
const b0 = calls.topUp.length; await ads.reconcileNas(); await ads.reconcileNas();
const tu = calls.topUp.slice(b0).filter(q => q[0] === 9004);
t('rate lowered to 1/4: NAS topped up once to what 900 credits now buy (18,000)', tu.length === 1 && rows[9004].remaining === 18000, JSON.stringify({ tu, row: rows[9004] }));
console.log('PASS ' + ok.length);
for (const b of bad) console.log('FAIL ' + b);
try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {}
process.exit(bad.length ? 1 : 0);
})().catch(e => { console.error(e); process.exit(1); });
+56
View File
@@ -0,0 +1,56 @@
// NAS stop trap on LinkSpin (fixed 2026-10-27; the InstantAdPay 2026-09-17 fix was never ported). NAS has no stop flag,
// a stop zeroes `remaining`, and served = assigned - remaining then reads the undelivered rest as DELIVERED. Before the fix:
// pause/end/exhaustion called nas.deactivate with no snapshot, reconcileNas read EVERY status, so a paused ad was charged
// for its zeroed remainder, and a resume/top-up of a stopped ad counted it again. JSON store, NAS stubbed, throwaway data.
// node qa/nas-stop.test.cjs
'use strict';
delete process.env.DATABASE_URL;
const fs = require('fs'); const os = require('os'); const path = require('path');
const ok = [], bad = [];
const t = (n, c, extra) => { (c ? ok : bad).push(n + (c || extra === undefined ? '' : ' -> ' + extra)); };
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-nas-stop-'));
const nas = require('../nas.js');
const rows = {}; const calls = { restart: 0, deactivate: 0 };
nas.enabled = () => true;
nas.impressionsPerCredit = type => type === 'banner' ? 5 : 10;
nas.readServed = async id => { const r = rows[id]; return r ? { assigned: r.assigned, remaining: r.remaining, served: Math.max(0, Math.min(r.assigned, r.assigned - r.remaining)), clicks: 0 } : null; };
nas.deactivate = async id => { const r = rows[id]; const served = Math.max(0, r.assigned - r.remaining); r.remaining = 0; calls.deactivate++; return { ok: true, served }; };
nas.topUp = async (id, add) => { rows[id].assigned += add; rows[id].remaining += add; return { ok: true }; };
nas.restart = async (id, base, add) => { rows[id].assigned = base + add; rows[id].remaining = add; calls.restart++; return { ok: true }; };
nas.updateCreative = async () => ({ ok: true });
const ads = require('../ads.js');
const ADV = 'stop@qa.test', FILE = path.join(DATA, 'campaigns.json');
const banner = (id, x) => Object.assign({ id, owner: ADV, memberId: 0, type: 'banner', name: 'QA ' + id, targetUrl: 'https://example.com/', imageUrl: 'https://example.com/b.png', width: 728, height: 90,
budget: 1000, spent: 0, accrued: 0, imps: 0, batchImps: 0, clicks: 0, status: 'active', nasAdId: id, nasServed: 0, created: Date.now() }, x || {});
const seed = camps => { fs.writeFileSync(FILE, JSON.stringify({ v: 1, nextId: 9100, campaigns: camps, burnsPending: [] })); ads.init({ dataDir: DATA, chain: { creditBalance: async () => 0 } }); };
const C = id => JSON.parse(fs.readFileSync(FILE, 'utf8')).campaigns.find(c => c.id === id);
const used = c => (c.spent || 0) + (c.accrued || 0);
(async () => {
seed([banner(9001), banner(9002, { budget: 100 })]);
await ads.addEarned(ADV, 10000);
ads.setRates({ synRateDivisor: 1 }); // the stop/restart logic at the on-site rate (qa/nas-ratio.test.cjs covers the network rate)
rows[9001] = { assigned: 5000, remaining: 5000 }; rows[9002] = { assigned: 500, remaining: 500 };
rows[9001].remaining -= 1000; await ads.reconcileNas();
t('1,000 real NAS views charge 200 credits', used(C(9001)) === 200, String(used(C(9001))));
await ads.setStatus(ADV, 9001, 'paused');
t('pause records the TRUE 1,000 served, not the 5,000 allocation', C(9001).nasServed === 1000, String(C(9001).nasServed));
await ads.reconcileNas();
t('a paused ad is not charged for its zeroed remainder', used(C(9001)) === 200, String(used(C(9001))));
const r0 = calls.restart; await ads.setStatus(ADV, 9001, 'active'); await ads.reconcileNas();
t('resume restarts the stopped ad from the true count', calls.restart === r0 + 1 && rows[9001].assigned === 5000 && rows[9001].remaining === 4000, JSON.stringify(rows[9001]));
t('no phantom delivery or charge after the resume', C(9001).nasServed === 1000 && used(C(9001)) === 200, C(9001).nasServed + ' / ' + used(C(9001)));
rows[9001].remaining -= 500; await ads.reconcileNas();
t('real views after the resume still charge (500 = 100 credits)', used(C(9001)) === 300, String(used(C(9001))));
// exhaustion: budget 100 = 500 views; NAS serves 300, a budget top-up of on-site spend exhausts it on the next reconcile
const c2 = C(9002); c2.spent = 60; const s = JSON.parse(fs.readFileSync(FILE, 'utf8')); s.campaigns[s.campaigns.findIndex(x => x.id === 9002)] = c2; fs.writeFileSync(FILE, JSON.stringify(s)); ads.init({ dataDir: DATA, chain: { creditBalance: async () => 0 } });
rows[9002].remaining -= 300; const d0 = calls.deactivate; await ads.reconcileNas();
const x = C(9002);
t('exhausted: charge capped at the budget and the NAS ad stopped', used(x) === 100 && x.status === 'out' && calls.deactivate === d0 + 1, JSON.stringify({ used: used(x), st: x.status }));
t('exhausted: served kept at the TRUE 300', x.nasServed === 300, String(x.nasServed));
await ads.reconcileNas();
t('an exhausted (out) ad is never reconciled again', C(9002).nasServed === 300 && used(C(9002)) === 100, String(C(9002).nasServed));
console.log('PASS ' + ok.length);
for (const b of bad) console.log('FAIL ' + b);
try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {}
process.exit(bad.length ? 1 : 0);
})().catch(e => { console.error(e); process.exit(1); });
+231
View File
@@ -0,0 +1,231 @@
// Profile policy + link-farm scan (2026-10-30 incident: 106 free accounts used bios and socials as casino backlinks).
// Same file in both repos (InstantAdPay site/qa and LinkSpin site/qa); it works out which site it is in.
// node qa/profile-policy.test.cjs (also part of `bash qa/run.sh member`)
// Part A, no server: prohibited.js (URL bio refused, casino bio refused, clean bio accepted, Unicode terms, no false hit on
// "Essex"), spamscan.classify on a six-account fixture (3 farm patterns, a sponsored member with a link, a buyer with a
// link, an allowlisted farm), the quarantine rule, the 06:30 once-a-day claim, the Telegram text, and the byte-for-byte
// check of prohibited.js + spamscan.js against the sibling checkout when it is there.
// Part B, a LOCAL copy (throwaway DATA_DIR, JSON store, devCode sign-in, the other site pointed at a dead port):
// a fresh sponsorless account's first save with a link is quarantined (200 + notice) and never rendered; a clean bio saves;
// then a URL bio and a casino bio are refused; a free member's wall and JSON carry nothing from the profile and the fixed
// description; a buyer's JSON carries bio + socials and the wall still has the fixed description; a deleted or unknown name
// is a real 404 with X-Robots-Tag noindex; the line banner refuses a casino target; the admin scan lists the quarantined
// account, Allow removes it; the admin member card shows the flag. Exit code 1 on any failure.
'use strict';
const fs = require('fs');
const os = require('os');
const path = require('path');
const http = require('http');
const crypto = require('crypto');
const { spawn } = require('child_process');
const ROOT = path.join(__dirname, '..');
const isLS = fs.existsSync(path.join(ROOT, 'iapsync.js'));
const SITE = isLS ? 'LinkSpin' : 'InstantAdPay';
const SIBLING = isLS ? path.join(ROOT, '..', '..', 'onchain-ad-membership', 'site') : path.join(ROOT, '..', '..', 'linkspin', 'site');
delete process.env.DATABASE_URL;
let fails = 0, n = 0;
async function t(name, fn) { n++; try { await fn(); console.log('ok', name); } catch (e) { fails++; console.log('FAIL', name, '::', e.message); } }
const eq = (a, b, m) => { if (a !== b) throw new Error((m || '') + ' expected ' + JSON.stringify(b) + ' got ' + JSON.stringify(a)); };
const truthy = (v, m) => { if (!v) throw new Error(m || 'expected truthy'); };
const P = require(path.join(ROOT, 'prohibited.js'));
const spamscan = require(path.join(ROOT, 'spamscan.js'));
(async () => {
// ---------------- Part A ----------------
await t('bio with a URL is refused with the bio-link message', () => {
for (const b of ['Visit https://casino-vip.com now', 'see www.example.com', 'my site example.com/offers', 'best deals at nice-shop.xyz', 'mail bob@gmail.com']) {
const r = P.checkBio(b, SITE); eq(r.error, 'Links go in the social fields, not the bio.', b);
}
});
await t('casino bio is refused with the Terms message', () => {
const r = P.checkBio('The best casino bonuses and slots in town', SITE);
eq(r.error, 'That content is not allowed on ' + SITE + ' profiles (see Terms).'); eq(r.reason, 'term:casino');
eq(P.checkBio('NỔ HŨ ĐỔI THƯỞNG uy tín', SITE).reason, 'term:nổ hũ', 'Vietnamese, upper case');
eq(P.checkBio('apostas online', SITE).reason, 'term:apostas');
eq(P.checkBio('we sell backlinks', SITE).reason, 'term:backlinks');
eq(P.checkBio('ca​sino', SITE).reason, 'term:casino', 'zero-width joiner stripped');
});
await t('clean bio is accepted; Essex, Sussex and sloppy punctuation are not links or terms', () => {
for (const b of ['Building a team on Polygon, paid the moment a package clears.', 'Essex marketer, Middlesex born, Sussex raised', 'I love ads.One day I will win', 'Price $9.99 v2.0 Oct.30 no.1', 'e.g. this, i.e. that', ''])
eq(P.checkBio(b, SITE).ok, true, b);
});
await t('campaign fields and social URLs: prohibited terms only, with the field named', () => {
const r = P.checkFields({ name: 'Spring push', title: 'Free slots tonight', targetUrl: 'https://example.com' }, SITE);
eq(r.field, 'title'); eq(r.error, 'That content is not allowed on ' + SITE + ' (see Terms, Prohibited content).');
eq(P.checkFields({ website: 'https://my-casino.bet/' }, SITE, { profile: true }).error, 'That content is not allowed on ' + SITE + ' profiles (see Terms).');
eq(P.checkFields({ name: 'Spring push', targetUrl: 'https://example.com/landing' }, SITE).ok, true);
});
await t('cleanProfile drops a linked or prohibited bio and a prohibited social, keeps the rest', () => {
const c = P.cleanProfile({ avatarUrl: 'https://img.example.com/a.png', bio: 'see casino.com', socials: { website: 'https://good.example.com/', twitter: 'https://x.com/slots_king' } }, SITE);
eq(c.bio, null); eq(c.avatarUrl, 'https://img.example.com/a.png'); eq(c.socials.website, 'https://good.example.com/'); eq(c.socials.twitter, undefined);
truthy(c.dropped.includes('bio:url') && c.dropped.some(d => d.startsWith('socials.twitter:term')), c.dropped.join(','));
});
// the fixture: who the detector must and must not flag
const DAY = 86400000, now = Date.now();
const F = [
{ email: 'farm1@x.test', username: 'farm1', memberId: 0, address: null, sponsorRef: 'someone', created: now - 3 * DAY, lastSeen: now - 3 * DAY + 60 * 60000, bio: 'Best casino bonuses', socials: JSON.stringify({ website: 'https://casino-x.com/' }) },
{ email: 'farm2@x.test', username: 'farm2', memberId: 0, address: null, sponsorRef: 'someone', created: now - 2 * DAY, lastSeen: now - 2 * DAY + 4 * 60000, bio: 'Local plumber in Austin', socials: JSON.stringify({ website: 'https://austin-plumber.example/' }) },
{ email: 'farm3@x.test', username: 'farm3', memberId: 0, address: null, sponsorRef: '', created: now - 1 * DAY, lastSeen: now - 1 * DAY + 3 * 60 * 60000, bio: 'Read my blog at huvip-blog.com', socials: null },
{ email: 'real@x.test', username: 'real', memberId: 0, address: null, sponsorRef: 'someone', created: now - 10 * DAY, lastSeen: now - 60000, bio: 'Team builder, here to learn', socials: JSON.stringify({ website: 'https://real-member.example/' }) },
{ email: 'buyer@x.test', username: 'buyer', memberId: 44, address: null, sponsorRef: '', created: now - 5 * DAY, lastSeen: now - 5 * DAY + 60000, bio: 'see my-site.com', socials: JSON.stringify({ website: 'https://my-site.com/' }) },
{ email: 'cryptogoat76@gmail.com', username: 'goat', memberId: 0, address: null, sponsorRef: '', created: now - 1 * DAY, lastSeen: now - 1 * DAY + 60000, bio: 'poker nights', socials: JSON.stringify({ website: 'https://poker.example/' }) },
];
await t('classify: three farm patterns flagged, sponsored member and buyer not, allowlisted skipped', () => {
const allow = new Set(spamscan.DEFAULT_ALLOW);
const v = Object.fromEntries(F.map(a => [a.username, spamscan.classify(a, allow, now)]));
truthy(v.farm1.candidate && v.farm1.reasons[0] === 'prohibited:casino', 'farm1 ' + v.farm1.reasons);
truthy(v.farm2.candidate && v.farm2.reasons.includes('quick'), 'farm2 ' + v.farm2.reasons);
truthy(v.farm3.candidate && v.farm3.reasons.includes('no-sponsor') && v.farm3.links[0] === 'huvip-blog.com', 'farm3 ' + v.farm3.reasons + ' ' + v.farm3.links);
eq(v.real.candidate, false, 'real member with a link'); eq(v.real.reasons.length, 0);
eq(v.buyer.candidate, false, 'buyer with a link');
eq(v.goat.candidate, false, 'allowlisted'); eq(v.goat.allowlisted, true);
eq(v.farm1.links[0], 'https://casino-x.com/');
});
await t('quarantine rule: brand-new, sponsorless, walletless, first save with a link', () => {
const fresh = { memberId: 0, address: null, sponsorRef: '', created: now - 3600000, bio: null, socials: null };
eq(spamscan.shouldQuarantine(fresh, 'see my-blog.com', null, now), true, 'bio url');
eq(spamscan.shouldQuarantine(fresh, 'hello', { website: 'https://my-blog.com/' }, now), true, 'website social');
eq(spamscan.shouldQuarantine(fresh, 'hello', { twitter: 'https://x.com/me' }, now), true, 'X social');
eq(spamscan.shouldQuarantine(fresh, 'hello', { telegram: 'https://t.me/me' }, now), false, 'telegram is not a farm field');
eq(spamscan.shouldQuarantine(fresh, 'hello world', null, now), false, 'no link');
eq(spamscan.shouldQuarantine(Object.assign({}, fresh, { sponsorRef: 'marty' }), 'see my-blog.com', null, now), false, 'has a sponsor');
eq(spamscan.shouldQuarantine(Object.assign({}, fresh, { created: now - 25 * 3600000 }), 'see my-blog.com', null, now), false, 'older than 24 h');
eq(spamscan.shouldQuarantine(Object.assign({}, fresh, { bio: 'old bio' }), 'see my-blog.com', null, now), false, 'not the first save');
eq(spamscan.shouldQuarantine(Object.assign({}, fresh, { address: '0xabc' }), 'see my-blog.com', null, now), false, 'has a wallet');
eq(spamscan.shouldQuarantine(Object.assign({}, fresh, { memberId: 3 }), 'see my-blog.com', null, now), false, 'bought');
});
function bench(o) {
o = o || {}; const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'spamscan-'));
const sent = []; const site = { spamScanAllow: spamscan.DEFAULT_ALLOW.join(', ') }; const claims = o.claims || new Set();
spamscan.init({ dataDir: dir, site: SITE, siteUrl: 'https://' + SITE.toLowerCase() + '.test', otherSite: isLS ? 'InstantAdPay' : 'LinkSpin',
accounts: { listAll: async () => o.accounts || F }, siteConfig: () => site, saveSite: p => Object.assign(site, p), notify: async text => { sent.push(text); },
marks: { claim: async k => { if (o.claimFalse) return false; if (claims.has(k)) return false; claims.add(k); return true; } }, alsoOn: async e => e === 'farm1@x.test' ? true : false });
return { dir, sent, site, claims };
}
const at = (h, m) => { // a timestamp on today's Central date at h:m Central
const d = new Date(); const ct = new Date(d.toLocaleString('en-US', { timeZone: 'America/Chicago' })); const diff = d.getTime() - ct.getTime();
ct.setHours(h, m, 0, 0); return ct.getTime() + diff;
};
await t('tick: nothing before 06:30, one run from 06:30 on, never twice in a day, result file written, one Telegram with the site name', async () => {
const b = bench();
let r = await spamscan.tick(at(6, 0)); eq(r.skipped, true, 'before 06:30'); eq(b.sent.length, 0);
r = await spamscan.tick(at(6, 31)); truthy(r.candidates, 'ran'); eq(r.candidates.length, 3, 'three candidates'); eq(r.skipped, 1, 'one allowlisted');
eq(b.sent.length, 1, 'one telegram'); truthy(b.sent[0].startsWith(SITE + ' link-farm scan (') && /: 3 new, 0 still watched, 0 left the list$/.test(b.sent[0].split('\n')[0]), b.sent[0].split('\n')[0]);
truthy(b.sent[0].includes('Review in Admin > Members > Link-farm list'), 'review line'); truthy(b.sent[0].includes('@farm1 | joined ') && b.sent[0].includes('| https://casino-x.com/ | also on ' + (isLS ? 'InstantAdPay' : 'LinkSpin')), b.sent[0]);
r = await spamscan.tick(at(9, 0)); eq(r.skipped, true, 'second tick same day'); eq(b.sent.length, 1, 'still one telegram');
const file = JSON.parse(fs.readFileSync(path.join(b.dir, 'wall-spam-scan.json'), 'utf8'));
eq(file.candidates.length, 3); eq(file.candidates.find(c => c.email === 'farm1@x.test').alsoOn, true); eq(file.scanned, 6);
truthy(b.claims.has('spamscan:' + spamscan.dayOf(at(6, 31))), 'claim key is the Central day');
});
await t('tick: a second app copy that loses the claim does not run or notify', async () => {
const b = bench({ claimFalse: true });
const r = await spamscan.tick(at(7, 0)); eq(r.skipped, true); eq(r.claimedElsewhere, true); eq(b.sent.length, 0);
});
await t('run: no candidates means no Telegram; Allow removes a candidate on the next run', async () => {
const b = bench({ accounts: F.filter(a => a.username === 'real' || a.username === 'buyer') });
const r = await spamscan.run(); eq(r.candidates.length, 0); eq(b.sent.length, 0);
const b2 = bench(); await spamscan.run(); eq(spamscan.view().last.candidates.length, 3);
spamscan.setAllow('farm2@x.test', true); truthy(spamscan.allowlist().includes('farm2@x.test')); truthy(b2.site.spamScanAllow.includes('farm2@x.test'), 'saved to the site setting');
await spamscan.run({ quiet: true }); eq(spamscan.view().last.candidates.length, 2); eq(spamscan.view().last.skipped, 2);
spamscan.setAllow('farm2@x.test', false); eq(spamscan.allowlist().includes('farm2@x.test'), false);
});
await t('shared modules are byte-for-byte copies of the sibling checkout (prohibited.js, spamscan.js)', () => {
if (!fs.existsSync(SIBLING)) { console.log(' (sibling checkout not found at ' + SIBLING + ', skipped)'); return; }
for (const f of ['prohibited.js', 'spamscan.js', path.join('qa', 'profile-policy.test.cjs')]) {
const h = p => crypto.createHash('sha1').update(fs.readFileSync(p, 'utf8').replace(/\r\n/g, '\n')).digest('hex');
const a = path.join(ROOT, f), b = path.join(SIBLING, f);
if (!fs.existsSync(b)) throw new Error(f + ' missing in sibling');
eq(h(a), h(b), f + ' differs from the sibling copy');
}
});
// ---------------- Part B ----------------
const PORT = Number(process.env.PP_PORT || (isLS ? 8807 : 8806)); const ADMIN = 'localtest';
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'pp-' + SITE.toLowerCase() + '-')); fs.mkdirSync(path.join(DATA, 'uploads'), { recursive: true });
// a paying member, seeded straight into the JSON store (memberId > 0): profile must render for them
const seed = { v: 2, byEmail: {}, byAddress: {}, byCode: {}, positions: {}, joins: 0 };
seed.byEmail['buyer@example.com'] = { email: 'buyer@example.com', code: 'buyr01', username: 'buyerwall', memberId: 7, sponsorRef: '', created: now - 30 * DAY, lastSeen: now - DAY,
bio: 'Clean bio from a paying member', socials: JSON.stringify({ website: 'https://example.com/', twitter: 'https://x.com/buyer' }), avatarUrl: 'https://example.com/a.png' };
seed.byCode.buyr01 = 'buyer@example.com';
fs.writeFileSync(path.join(DATA, 'accounts.json'), JSON.stringify(seed));
const env = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, NODE_ENV: 'development', ADMIN_EMAIL: 'qa-admin@example.com', ADMIN_PASSWORD: ADMIN,
LS_URL: 'http://127.0.0.1:1', IAP_URL: 'http://127.0.0.1:1', LS_SYNC_SECRET: '' });
delete env.DATABASE_URL;
const srv = spawn(process.execPath, ['server.js'], { cwd: ROOT, env, stdio: ['ignore', 'pipe', 'pipe'] });
let log = ''; srv.stdout.on('data', d => { log += d; }); srv.stderr.on('data', d => { log += d; });
const req = (method, p, o) => new Promise((resolve, reject) => { o = o || {};
const headers = Object.assign({ 'User-Agent': 'Mozilla/5.0 QA', 'X-Forwarded-For': o.ip || '10.9.0.1' }, o.headers || {}); if (o.cookie) headers.Cookie = o.cookie;
let body = o.body; if (body) { body = Buffer.from(JSON.stringify(body)); headers['Content-Type'] = 'application/json'; headers['Content-Length'] = body.length; }
const r = http.request({ host: '127.0.0.1', port: PORT, path: p, method, headers }, res => { const ch = []; res.on('data', c => ch.push(c)); res.on('end', () => { const text = Buffer.concat(ch).toString(); let json = null; try { json = JSON.parse(text); } catch (e) {} resolve({ status: res.statusCode, headers: res.headers, text, json }); }); });
r.on('error', reject); if (body) r.write(body); r.end(); });
const adminH = { Authorization: 'Bearer ' + ADMIN };
let ipn = 1;
async function signIn(email) {
const ip = '10.9.' + (ipn++) + '.7';
const s = await req('POST', '/api/auth/email/start', { ip, body: { email, fts: Date.now() - 8000, fage: 8000, hp_field_x9: '' } });
if (!s.json || !s.json.devCode) throw new Error('no devCode for ' + email + ': ' + s.text.slice(0, 200));
const v = await req('POST', '/api/auth/email/verify', { ip, body: { email, code: s.json.devCode } });
return [].concat(v.headers['set-cookie'] || []).map(x => x.split(';')[0]).join('; ');
}
const meta = (html, name) => { const m = new RegExp('<meta (?:name|property)="' + name + '" content="([^"]*)"').exec(html); return m ? m[1] : null; };
try {
let up = false; for (let i = 0; i < 60 && !up; i++) { try { up = (await req('GET', '/api/config')).status === 200; } catch (e) { await new Promise(r => setTimeout(r, 500)); } }
if (!up) throw new Error('local server did not come up:\n' + log.slice(-1500));
await req('PATCH', '/api/admin/site', { headers: adminH, body: { fraudMaxSignupsPerIpDay: 20 } });
const fixed = nm => nm + '’s ad wall on ' + SITE + ': the network’s member ads, paid out on Polygon the moment a package clears.';
await t('local: unknown or deleted wall name is a real 404 with X-Robots-Tag noindex', async () => {
const r = await req('GET', '/wall/huvipblog'); eq(r.status, 404); truthy(/noindex/.test(String(r.headers['x-robots-tag'])), 'x-robots-tag ' + r.headers['x-robots-tag']);
truthy(r.text.includes('No wall under that name'), 'body'); eq((await req('GET', '/api/wall/huvipblog')).status, 404);
});
await t('local: fresh sponsorless account, first save with a link: quarantined, saved, notice, nothing public', async () => {
const ck = await signIn('fresh@example.com');
eq((await req('POST', '/api/my/profile', { cookie: ck, body: { username: 'freshlink' } })).status, 200);
const r = await req('POST', '/api/my/profile-details', { cookie: ck, body: { bio: 'Read my blog at huvip-blog.com', socials: { website: 'https://huvip-blog.com/' } } });
eq(r.status, 200, r.text); eq(r.json.quarantined, true); eq(r.json.notice, 'Your profile links will appear after your first ad package.'); eq(r.json.account.profileQuarantined, true);
const w = await req('GET', '/api/wall/freshlink'); eq(w.status, 200); eq(w.json.bought, false); eq(w.json.bio, null); eq(w.json.socials, null); eq(w.json.avatarUrl, null);
const h = await req('GET', '/wall/freshlink'); eq(h.status, 200); eq(meta(h.text, 'description'), fixed('@freshlink')); eq(meta(h.text, 'og:description'), fixed('@freshlink'));
truthy(!h.text.includes('huvip-blog'), 'bio text must not be in the page'); truthy(!/noindex/i.test(h.text) && !r.headers['x-robots-tag'], 'wall stays indexable');
const m = await req('GET', '/api/admin/member?email=fresh@example.com', { headers: adminH }); eq(m.json.account.profileQuarantined, true, 'admin card flag');
});
await t('local: clean bio saves; then a URL bio and a casino bio are refused; a casino social is refused', async () => {
const ck = await signIn('clean@example.com');
await req('POST', '/api/my/profile', { cookie: ck, body: { username: 'cleanmember' } });
let r = await req('POST', '/api/my/profile-details', { cookie: ck, body: { bio: 'Team builder on Polygon, paid when a package clears.' } }); eq(r.status, 200, r.text); eq(r.json.quarantined, undefined);
r = await req('POST', '/api/my/profile-details', { cookie: ck, body: { bio: 'Visit https://my-shop.example.com for deals' } }); eq(r.status, 400); eq(r.json.error, 'Links go in the social fields, not the bio.');
r = await req('POST', '/api/my/profile-details', { cookie: ck, body: { bio: 'Best casino bonuses and slots' } }); eq(r.status, 400); eq(r.json.error, 'That content is not allowed on ' + SITE + ' profiles (see Terms).');
r = await req('POST', '/api/my/profile-details', { cookie: ck, body: { socials: { website: 'https://top-casino.bet/' } } }); eq(r.status, 400); eq(r.json.error, 'That content is not allowed on ' + SITE + ' profiles (see Terms).');
const w = await req('GET', '/api/wall/cleanmember'); eq(w.json.bought, false); eq(w.json.bio, null, 'free member: no bio on the public JSON');
const h = await req('GET', '/wall/cleanmember'); eq(h.status, 200); eq(meta(h.text, 'description'), fixed('@cleanmember')); truthy(!h.text.includes('Team builder on Polygon'), 'free member: no bio in the page');
r = await req('POST', '/api/my/linebanner', { cookie: ck, body: { targetUrl: 'https://casino-royale.example/' } }); eq(r.status, 400); truthy(/not allowed/.test(r.json.error), r.json.error);
});
await t('local: a paying member gets bio, socials and avatar in the JSON; the wall keeps the fixed description and title carries the handle', async () => {
const w = await req('GET', '/api/wall/buyerwall'); eq(w.status, 200, w.text); eq(w.json.bought, true); eq(w.json.bio, 'Clean bio from a paying member'); eq(w.json.socials.website, 'https://example.com/'); eq(w.json.avatarUrl, 'https://example.com/a.png');
const h = await req('GET', '/wall/buyerwall'); eq(h.status, 200); eq(meta(h.text, 'description'), fixed('@buyerwall')); eq(meta(h.text, 'og:image'), 'https://example.com/a.png');
truthy(/<title>@buyerwall’s ad wall \| /.test(h.text), 'title'); truthy(!h.text.includes('Clean bio from a paying member'), 'bio never in the meta');
const js = fs.readFileSync(path.join(ROOT, 'public', 'assets', 'wall.js'), 'utf8');
truthy(js.includes('rel="sponsored ugc noopener"') && !js.includes('rel="noopener nofollow me"'), 'outbound profile links are sponsored ugc');
truthy(/w\.bought && w\.socials/.test(js) && /\(w\.bought && w\.bio\)/.test(js), 'wall.js renders profile only when bought');
truthy(fs.readFileSync(path.join(ROOT, 'public', 'wall.html'), 'utf8').includes('wall.js?v=20261030pp'), 'wall.js version bumped');
});
await t('local: admin scan lists the quarantined account, not the buyer or the clean member; Allow removes it', async () => {
let r = await req('POST', '/api/admin/spamscan/run', { headers: adminH, body: {} }); eq(r.status, 200, r.text);
const emails = r.json.last.candidates.map(c => c.email); truthy(emails.includes('fresh@example.com'), emails.join(',')); truthy(!emails.includes('buyer@example.com') && !emails.includes('clean@example.com'), emails.join(','));
const c = r.json.last.candidates.find(x => x.email === 'fresh@example.com'); truthy(c.reasons.includes('quarantined') && c.reasons.includes('no-sponsor'), c.reasons.join(',')); eq(c.firstLink, 'https://huvip-blog.com/'); truthy('alsoOn' in c, 'also-on column present');
truthy(fs.existsSync(path.join(DATA, 'wall-spam-scan.json')), 'result file');
r = await req('POST', '/api/admin/spamscan/allow', { headers: adminH, body: { email: 'fresh@example.com' } }); truthy(r.json.allow.includes('fresh@example.com'));
r = await req('POST', '/api/admin/spamscan/run', { headers: adminH, body: {} }); truthy(!r.json.last.candidates.some(x => x.email === 'fresh@example.com'), 'allowed account gone');
r = await req('POST', '/api/admin/spamscan/allow', { headers: adminH, body: { email: 'fresh@example.com', remove: true } }); truthy(!r.json.allow.includes('fresh@example.com'));
r = await req('DELETE', '/api/admin/member?email=fresh@example.com', { headers: adminH }); eq(r.status, 200, r.text);
eq((await req('GET', '/wall/freshlink')).status, 404, 'deleted wall is a 404');
eq((await req('DELETE', '/api/admin/member?email=buyer@example.com', { headers: adminH })).status, 400, 'on-chain member refused');
});
} catch (e) { fails++; console.log('FAIL local copy ::', e.message); }
finally { try { srv.kill(); } catch (e) {} await new Promise(r => setTimeout(r, 300)); try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} }
if (fails && /error|Error/.test(log)) console.log('--- server log tail ---\n' + log.slice(-2500));
console.log(fails ? fails + ' of ' + n + ' checks FAILED' : 'profile policy + link-farm scan: all ' + n + ' checks passed');
process.exit(fails ? 1 : 0);
})();
+123
View File
@@ -0,0 +1,123 @@
// Refill notices (refill.js) on throwaway data: stubbed ads/accounts/chain/mail, a temp DATA_DIR, file marks.
// Run: node qa/refill.test.cjs
'use strict';
const fs = require('fs');
const os = require('os');
const path = require('path');
const assert = require('assert');
const ROOT = path.join(__dirname, '..');
const DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-refill-'));
let fails = 0, n = 0;
async function t(name, fn) { n++; try { await fn(); console.log('ok', name); } catch (e) { fails++; console.log('FAIL', name, '::', e.message); } }
function fresh(mod) { const p = require.resolve(path.join(ROOT, mod)); delete require.cache[p]; return require(p); }
const now = Date.now();
function world() {
const W = {
campaigns: [
{ id: 1, owner: 'a@x.test', type: 'banner', name: 'Alpha banner', budget: 1000, spent: 850, imps: 4000, clicks: 30, status: 'active', created: now - 20 * 864e5 },
{ id: 2, owner: 'a@x.test', type: 'text', name: 'Alpha text', budget: 500, spent: 500, imps: 5000, clicks: 12, status: 'out', created: now - 20 * 864e5 },
{ id: 3, owner: 'b@x.test', type: 'banner', name: 'Bravo', budget: 2500, spent: 2500, imps: 12000, clicks: 80, status: 'out', created: now - 20 * 864e5 },
{ id: 4, owner: 'house@linkspin', house: true, type: 'banner', name: 'House', budget: 100, spent: 100, status: 'out', created: now },
{ id: 5, owner: 'c@x.test', type: 'banner', name: 'Charlie', budget: 1000, spent: 100, status: 'active', created: now },
],
credits: { 'a@x.test': 40, 'b@x.test': 1200, 'c@x.test': 0 },
unsub: new Set(['b@x.test']),
inbox: [], mail: [], events: [],
};
W.deps = {
dataDir: DIR, siteUrl: 'https://linkspin.app', houseOwner: 'house@linkspin',
siteConfig: () => W.cfg || {},
ads: { adminList: async () => W.campaigns.map(c => Object.assign({}, c)) },
accounts: { byEmail: async e => ({ email: e, memberId: { 'a@x.test': 11, 'b@x.test': 12, 'c@x.test': 13 }[e] || 0 }), positions: async () => [] },
chain: { recentEvents: () => W.events, catalog: async () => [{ priceCents: 1000, creditAmount: 1000 }, { priceCents: 2500, creditAmount: 2500 }] },
mailer: { hasKey: () => true, send: async (to, subject, text) => { W.mail.push({ to, subject, text }); } },
drip: { isUnsubscribed: async e => W.unsub.has(e), unsubUrl: e => 'https://linkspin.app/unsubscribe?e=' + e },
creditsFor: async e => W.credits[e] || 0,
message: async (to, subject, html) => { W.inbox.push({ to, subject, html }); },
};
return W;
}
(async () => {
const marks = fresh('marks.js'); marks.init({ dataDir: DIR });
let W = world();
const refill = fresh('refill.js');
refill.init(Object.assign({ marks }, W.deps));
await t('one message per owner per pass; out beats low; house and healthy ads skipped', async () => {
const r = await refill.tick();
assert.strictEqual(r.sent, 2);
assert.deepStrictEqual(W.inbox.map(x => x.to).sort(), ['a@x.test', 'b@x.test']);
const a = W.inbox.find(x => x.to === 'a@x.test');
assert.ok(/finished delivering/.test(a.subject), a.subject);
assert.ok(/Alpha text/.test(a.html) && !/Alpha banner/.test(a.html), 'only the out campaign in the out notice');
});
await t('email respects unsubscribes; the on-site notice still goes', async () => {
assert.ok(W.inbox.some(x => x.to === 'b@x.test'));
assert.ok(!W.mail.some(x => x.to === 'b@x.test'));
const m = W.mail.find(x => x.to === 'a@x.test');
assert.ok(m && /Stop these emails/.test(m.text));
});
await t('relaunch line with 100+ credits, buy link below', async () => {
const b = W.inbox.find(x => x.to === 'b@x.test'); assert.ok(/without buying anything/.test(b.html) && /linkspin\.app\/ads/.test(b.html));
const a = W.mail.find(x => x.to === 'a@x.test'); assert.ok(/needs a package first/.test(a.text) && /linkspin\.app\/credits/.test(a.text));
});
await t('campaign lines say what each delivered; packages from the catalog', async () => {
const a = W.mail.find(x => x.to === 'a@x.test');
assert.ok(/"Alpha text" \(text\): 500 of 500 credits delivered, 5,000 impressions, 12 clicks/.test(a.text), a.text);
assert.ok(/\$25 {2}-> {2}2,500 credits/.test(a.text));
});
await t('no em dashes, no income promises', async () => {
for (const m of W.mail.concat(W.inbox)) { const s = (m.text || m.html) + m.subject; assert.ok(!/—/.test(s), 'em dash'); assert.ok(!/(earn|make) (money|\$)|guarantee/i.test(s), 'income claim'); }
});
await t('next pass: the low notice for the other ad, then nothing', async () => {
const r = await refill.tick(); assert.strictEqual(r.sent, 1);
assert.ok(/nearly out/.test(W.inbox[W.inbox.length - 1].subject));
const r2 = await refill.tick(); assert.strictEqual(r2.sent, 0);
});
await t('settings switch off: nothing sent', async () => {
W.cfg = { refillNotices: '0' }; W.campaigns.push({ id: 6, owner: 'c@x.test', type: 'banner', name: 'Charlie 2', budget: 100, spent: 100, status: 'out', created: now });
const r = await refill.tick(); assert.strictEqual(r.sent, 0); W.cfg = {};
});
await t('conversion: a purchase after the send', async () => {
W.events.push({ type: 'Purchase', buyerId: 12, priceCents: 2500, tx: '0xbuy', ts: Date.now() + 1000 });
await refill.tick();
const s = refill.stats(); const b = s.recent.find(x => x.owner === 'b@x.test');
assert.ok(b.converted && b.converted.kind === 'purchase', JSON.stringify(b));
assert.strictEqual(s.totals.purchasesUsd, 25);
});
await t('idle follow-up after 7 days, once, only with 100+ credits and nothing running', async () => {
// a's out record: make it 8 days old, give a credits, stop a's running ad
const f = path.join(DIR, 'refill.json'); const S = JSON.parse(fs.readFileSync(f, 'utf8'));
for (const r of Object.values(S.records)) if (r.owner === 'a@x.test' && r.state === 'out') r.ts = Date.now() - 8 * 864e5;
fs.writeFileSync(f, JSON.stringify(S));
W.credits['a@x.test'] = 700; W.campaigns.find(c => c.id === 1).status = 'paused';
const before = W.inbox.length; await refill.tick();
const idle = W.inbox.slice(before).filter(x => x.to === 'a@x.test');
assert.strictEqual(idle.length, 1); assert.ok(/700 credits are sitting idle/.test(idle[0].subject));
const b2 = W.inbox.length; await refill.tick(); assert.strictEqual(W.inbox.length, b2);
});
await t('admin stats', async () => {
const s = refill.stats(); assert.ok(s.enabled); assert.ok(s.byState.idle.sent === 1); assert.ok(s.totals.sent >= 4);
});
await t('streak hook line lands in the bonus block', async () => {
const r2 = fresh('refill.js'); r2.init(Object.assign({}, W.deps, { streakLine: async () => ({ text: 'Refuel streak: month 2.', html: '<b>Refuel streak</b>: month 2.' }) }));
const m = await r2.compose('a@x.test', [W.campaigns[0]], 'low', 50);
assert.ok(/Refuel streak: month 2\./.test(m.text) && /Refuel streak<\/b>/.test(m.html));
});
await t('two app copies on one volume: one message, not two', async () => {
const D2 = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-refill2-'));
const W2 = world(); W2.deps.dataDir = D2;
const mk = () => { const m = fresh('marks.js'); m.init({ dataDir: D2 }); const r = fresh('refill.js'); r.init(Object.assign({}, W2.deps, { marks: m })); return r; };
const A = mk(), B = mk();
await Promise.all([A.tick(), B.tick()]);
const per = {}; for (const x of W2.inbox) per[x.to] = (per[x.to] || 0) + 1;
assert.deepStrictEqual(per, { 'a@x.test': 1, 'b@x.test': 1 }, JSON.stringify(per));
assert.strictEqual(W2.mail.length, 1);
});
console.log('\n' + (n - fails) + '/' + n + ' passed');
try { fs.rmSync(DIR, { recursive: true, force: true }); } catch (e) {}
process.exit(fails ? 1 : 0);
})();
+19
View File
@@ -0,0 +1,19 @@
// Engine Room on LinkSpin: engine.js, kit.js, admin-kits.js and engine-room.js are the SAME files as InstantAdPay's.
// This checks they have not drifted, then runs InstantAdPay's engine test (it covers build() and the LinkSpin facts).
// Run: node qa/refuel-engine.test.cjs
'use strict';
const fs = require('fs');
const path = require('path');
const { spawnSync } = require('child_process');
const ROOT = path.join(__dirname, '..');
const IAP = path.join(ROOT, '..', '..', 'onchain-ad-membership', 'site');
if (!fs.existsSync(path.join(IAP, 'engine.js'))) { console.log('skip: InstantAdPay repo not beside this one'); process.exit(0); }
let fails = 0;
for (const f of ['engine.js', 'kit.js', 'public/assets/admin-kits.js', 'public/assets/engine-room.js']) {
const same = fs.readFileSync(path.join(ROOT, f)).equals(fs.readFileSync(path.join(IAP, f)));
console.log((same ? 'ok ' : 'FAIL ') + f + (same ? ' matches InstantAdPay' : ' differs from InstantAdPay: copy the newer one across'));
if (!same) fails++;
}
const r = spawnSync(process.execPath, [path.join(IAP, 'qa', 'refuel-engine.test.cjs')], { encoding: 'utf8' });
process.stdout.write(r.stdout || ''); if (r.status !== 0) fails++;
process.exit(fails ? 1 : 0);
+81
View File
@@ -0,0 +1,81 @@
// Refuel Kit on LinkSpin: kit.js (shared with InstantAdPay) + kitspin.js "Load into my Banner Spin" against the REAL
// bannerspin.js, throwaway data, LinkSpin placeholder art. Entitlement is stubbed here (InstantAdPay's refuel.js decides it;
// qa/refuel.test.cjs covers that path). Run: node qa/refuel-kit.test.cjs
'use strict';
const fs = require('fs');
const os = require('os');
const path = require('path');
const assert = require('assert');
const { execSync } = require('child_process');
const ROOT = path.join(__dirname, '..');
let fails = 0, n = 0;
async function t(name, fn) { n++; try { await fn(); console.log('ok', name); } catch (e) { fails++; console.log('FAIL', name, '::', e.stack.split('\n').slice(0, 2).join(' | ')); } }
function fresh(mod) { const p = require.resolve(path.join(ROOT, mod)); delete require.cache[p]; return require(p); }
let qrcode = null; for (const p of ['qrcode', path.join(ROOT, '..', '..', 'onchain-ad-membership', 'site', 'node_modules', 'qrcode')]) { try { qrcode = require(p); break; } catch (e) {} }
let ffmpegOk = true; try { execSync('ffmpeg -version', { stdio: 'ignore' }); } catch (e) { ffmpegOk = false; }
if (!qrcode || !ffmpegOk) { console.log('skip: needs ffmpeg and the qrcode package (here or in the InstantAdPay repo)'); process.exit(0); }
function world(opts) {
opts = opts || {};
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-kit-')); const up = path.join(dir, 'uploads'); fs.mkdirSync(up);
const W = { dir, up, months: Object.assign({}, opts.months || { '2026-11': 1 }), ownBuy: opts.ownBuy !== false };
W.BS = fresh('bannerspin.js'); W.BS.init({ dataDir: dir, uploadsDir: up, schedule: false, facts: async () => ({ ownBuy: W.ownBuy, buyers: 0 }), rotator: { findMine: () => null } });
W.K = fresh('kit.js');
W.K.init({ dataDir: dir, program: 'linkspin', publicDir: path.join(ROOT, 'public'), siteUrl: 'https://linkspin.app', qrcode,
entitled: async () => ({ on: true, months: W.months, today: '2026-11-10' }),
linkFor: async () => ({ username: 'sam', link: 'https://linkspin.app/join/sam' }) });
W.K.usePlaceholder('2026-11'); W.K.saveKit({ month: '2026-11', theme: 'Harvest', released: true });
W.load = b => require(path.join(ROOT, 'kitspin.js')).load(Object.assign({ kit: W.K, bannerspin: W.BS, uploadsDir: up, email: 's@x.test', month: '2026-11' }, b || {}));
return W;
}
(async () => {
await t('LinkSpin art only: the placeholder kit is the LinkSpin banners', async () => {
const W = world(); const k = W.K.listKits()[0];
assert.strictEqual(k.program, 'linkspin'); assert.ok(k.complete);
const base = fs.readFileSync(path.join(W.dir, 'kits', '2026-11', '728x90.png')); assert.ok(base.equals(fs.readFileSync(path.join(ROOT, 'public', 'banners', 'linkspin-728x90.png'))));
});
await t('locked kit and locked Banner Spin tier both refuse', async () => {
const W = world({ months: {} }); assert.ok(/next counted refuel/.test((await W.load()).error));
const W2 = world({ ownBuy: false }); const r = await W2.load(); assert.strictEqual(r.status, 403); assert.ok(/\$25/.test(r.error));
});
await t('Starter tier: uses an existing Banner Spin of the right size, creates new ones while the tier allows, says why when it cannot; 1200x630 is not a Banner Spin size', async () => {
const W = world();
const own = await W.BS.create('s@x.test', { name: 'My leaderboard', size: '728x90' }); assert.ok(own.ok);
const r = await W.load();
const by = Object.fromEntries(r.results.map(x => [x.size, x]));
assert.deepStrictEqual(Object.keys(by).sort(), ['160x600', '300x250', '468x60', '728x90']);
assert.strictEqual(by['728x90'].spinId, own.spin.id); assert.strictEqual(by['728x90'].created, false);
const made = r.results.filter(x => x.created).length; const refused = r.results.filter(x => x.error);
assert.strictEqual(made, 1, 'Starter holds 2 Banner Spins: one existed, one more created'); assert.strictEqual(refused.length, 2); assert.ok(/Starter tier holds 2/.test(refused[0].error));
const spins = await W.BS.list('s@x.test'); const b = spins.find(s => s.id === own.spin.id).banners[0];
assert.strictEqual(b.label, 'Refuel Kit 2026-11'); assert.strictEqual(b.target, 'https://linkspin.app/join/sam'); assert.ok(/^\/uploads\/[a-f0-9]{24}\.png$/.test(b.image));
assert.ok(fs.existsSync(path.join(W.up, b.image.slice(9)))); assert.strictEqual(b.w, 728); assert.ok(b.bytes <= W.BS.MAX_BYTES);
});
await t('Starter tier: the result says up front what loaded, what did not and why, and what to do; the panel pre-picks 728x90 + 300x250', async () => {
const W = world(); const KS = require(path.join(ROOT, 'kitspin.js'));
const room = await KS.room('s@x.test', W.BS);
assert.deepStrictEqual([room.tier, room.spins, room.used, room.all], ['Starter', 2, 0, false]);
assert.deepStrictEqual(room.suggested, ['728x90', '300x250']);
const r = await W.load();
assert.ok(/^Loaded: 728x90 \(new Banner Spin "Refuel Kit 728x90"\) and 300x250/.test(r.message), r.message);
assert.ok(/Not loaded: 468x60 and 160x600\. Your Starter tier holds 2 Banner Spins/.test(r.message), r.message);
assert.ok(/pick the sizes you want most/.test(r.message) && /Builder .* holds 5/.test(r.message), r.message);
const r2 = await W.load({ sizes: ['728x90', '300x250'] }); assert.ok(/^Loaded: 728x90 \(already in/.test(r2.message) && !/Not loaded/.test(r2.message), r2.message);
const after = await KS.room('s@x.test', W.BS); assert.deepStrictEqual(after.suggested, ['728x90', '300x250'], 'Banner Spins with room stay ticked');
});
await t('loading the same kit twice adds nothing twice', async () => {
const W = world(); await W.BS.create('s@x.test', { name: 'L', size: '728x90' }); await W.BS.create('s@x.test', { name: 'M', size: '300x250' });
await W.load({ sizes: ['728x90', '300x250'] }); const r2 = await W.load({ sizes: ['728x90', '300x250'] });
assert.ok(r2.results.every(x => x.already));
const spins = await W.BS.list('s@x.test'); assert.deepStrictEqual(spins.map(s => s.banners.length), [1, 1]);
});
await t('the animated version (month 3+) loads as a GIF within the 150 KB Banner Spin limit, or is refused plainly', async () => {
const W = world({ months: { '2026-11': 3 } }); await W.BS.create('s@x.test', { name: 'R', size: '300x250' });
const r = await W.load({ sizes: ['300x250'], variant: 'gif' }); const x = r.results[0];
if (x.error) assert.ok(/150 KB/.test(x.error), x.error);
else { const b = (await W.BS.list('s@x.test'))[0].banners[0]; assert.ok(/\.gif$/.test(b.image)); }
});
console.log('\n' + (n - fails) + '/' + n + ' passed');
process.exit(fails ? 1 : 0);
})();
+133
View File
@@ -0,0 +1,133 @@
// Monthly Refuel, LinkSpin side (refuel.js) against InstantAdPay's REAL refuel.js (sibling repo) wired in-process in
// place of the signed HTTP calls. Throwaway data dirs; no network. Run: node qa/refuel.test.cjs
'use strict';
const fs = require('fs');
const os = require('os');
const path = require('path');
const assert = require('assert');
const ROOT = path.join(__dirname, '..');
const IAP_ROOT = path.join(ROOT, '..', '..', 'onchain-ad-membership', 'site');
if (!fs.existsSync(path.join(IAP_ROOT, 'refuel.js'))) { console.log('skip: InstantAdPay repo not beside this one'); process.exit(0); }
let fails = 0, n = 0;
async function t(name, fn) { n++; try { await fn(); console.log('ok', name); } catch (e) { fails++; console.log('FAIL', name, '::', e.stack.split('\n').slice(0, 2).join(' | ')); } }
function fresh(file) { const p = require.resolve(file); delete require.cache[p]; return require(p); }
const ct = (day, hour) => { const [y, m, d] = day.split('-').map(Number); return Date.UTC(y, m - 1, d, (hour == null ? 12 : hour) + 6); };
process.env.LS_SYNC_SECRET = 'x'.repeat(40);
function world(opts) {
opts = opts || {};
const W = { lsEarned: [], lsLog: [], lsInbox: [], lsMail: [], iapEarned: [], down: false, posts: 0, dropAck: false };
// InstantAdPay side
W.iapDir = fs.mkdtempSync(path.join(os.tmpdir(), 'iap-rf-'));
const iapMarks = fresh(path.join(IAP_ROOT, 'marks.js')); iapMarks.init({});
W.IAP = fresh(path.join(IAP_ROOT, 'refuel.js'));
W.iapCfg = { refuelStreak: '1' };
W.IAP.init({ dataDir: W.iapDir, db: require(path.join(IAP_ROOT, 'db.js')), marks: iapMarks, siteConfig: () => W.iapCfg,
accounts: { byMemberId: async () => null, byEmail: async e => ({ email: e, username: 'sam' }) },
ads: { addEarned: async (email, credits, o) => { W.iapEarned.push({ email, credits, ref: o.log.ref }); } },
message: async () => {}, featuredPerDay: () => 40 });
// the signed partner endpoints, in-process (same routing as InstantAdPay server.js)
const post = async (pth, b) => {
W.posts++;
if (W.down) throw new Error('InstantAdPay 502');
const op = pth.replace('/api/partner/refuel/', '');
if (op === 'purchase') { const r = await W.IAP.record({ site: 'linkspin', email: b.email, tx: b.tx, cents: b.cents, credits: b.credits, ts: b.ts }); return Object.assign({ ok: true }, r, { items: r.on ? await W.IAP.outbox('linkspin', b.email) : [] }); }
if (op === 'outbox') return { ok: true, on: W.IAP.cfg().on, items: W.IAP.cfg().on ? await W.IAP.outbox('linkspin') : [] };
if (op === 'ack') { if (W.dropAck) throw new Error('ack lost'); return { ok: true, acked: await W.IAP.ack('linkspin', b.refs) }; }
if (op === 'status') return Object.assign({ ok: true }, await W.IAP.view(b.email));
throw new Error('404');
};
// LinkSpin side: one volume, any number of app copies
W.lsDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-rf-'));
W.lsCfg = { refuelStreak: opts.lsOff ? '0' : '1' };
W.copy = () => {
const marks = fresh(path.join(ROOT, 'marks.js')); marks.init({ dataDir: W.lsDir });
const R = fresh(path.join(ROOT, 'refuel.js'));
R.init({ dataDir: W.lsDir, siteConfig: () => W.lsCfg, marks, siteUrl: 'https://linkspin.app', post,
accounts: { byMemberId: async id => id === 4 ? { email: 's@x.test', memberId: 4 } : null, positionByMember: async () => null, byEmail: async e => ({ email: e }) },
ads: { addEarned: async (email, credits, o) => { W.lsEarned.push({ email, credits, purchased: !!(o && o.purchased) }); }, logCredit: async (email, delta, reason) => { W.lsLog.push({ email, delta, reason }); } },
message: async (to, subject, html) => { W.lsInbox.push({ to, subject, html }); },
mailer: { hasKey: () => true, send: async (to, subject, text) => { W.lsMail.push({ to, subject, text }); } },
drip: { isUnsubscribed: async () => false, unsubUrl: () => 'https://linkspin.app/unsubscribe' } });
return R;
};
W.ev = (tx, cents, day) => ({ type: 'Purchase', buyerId: 4, tx, priceCents: cents, creditAmount: cents, ts: ct(day) });
return W;
}
(async () => {
await t('LinkSpin switch off: nothing reported, nothing pulled, card hidden', async () => {
const W = world({ lsOff: true }); const R = W.copy();
assert.strictEqual(await R.onPurchase(W.ev('0x1', 2500, '2026-11-02')), null);
assert.deepStrictEqual(await R.tick(), { on: false }); assert.deepStrictEqual(await R.status('s@x.test'), { on: false });
assert.strictEqual(W.posts, 0);
});
await t('InstantAdPay switch off: the report comes back on:false, nothing granted', async () => {
const W = world(); W.iapCfg.refuelStreak = '0'; const R = W.copy();
const r = await R.onPurchase(W.ev('0x1', 2500, '2026-11-02')); assert.strictEqual(r.on, false); assert.strictEqual(W.lsEarned.length, 0);
assert.strictEqual(fs.readdirSync(path.join(W.lsDir, 'refuel-pending')).length, 0);
});
await t('a $25 LinkSpin package: month 1 +10% applied on LinkSpin, purchased-grade, logged, notice; $10 ignored', async () => {
const W = world(); const R = W.copy();
assert.strictEqual(await R.onPurchase(W.ev('0x0', 1000, '2026-11-02')), null);
const r = await R.onPurchase(W.ev('0x1', 2500, '2026-11-02'));
assert.strictEqual(r.kind, 'refuel');
assert.deepStrictEqual(W.lsEarned, [{ email: 's@x.test', credits: 250, purchased: true }]);
assert.ok(/^Refuel streak month 1: \+10% on your \$25 package$/.test(W.lsLog[0].reason));
assert.ok(/Refuel counted/.test(W.lsInbox[0].subject));
assert.strictEqual((await W.IAP.outbox('linkspin')).length, 0, 'acked');
});
await t('cross-site both engines: InstantAdPay first, LinkSpin second -> LinkSpin +15%, InstantAdPay topped up by the difference', async () => {
const W = world(); const R = W.copy();
await W.IAP.record({ site: 'iap', email: 's@x.test', tx: '0xI', cents: 2000, credits: 2000, ts: ct('2026-11-02') });
await R.onPurchase(W.ev('0xL', 2500, '2026-11-08'));
assert.strictEqual(W.lsEarned[0].credits, 375);
assert.deepStrictEqual(W.iapEarned.map(x => [x.ref, x.credits]), [['rf:iap:0xI', 200], ['rftop:iap:0xL', 100]]);
});
await t('cross-site both engines the other way: LinkSpin first, InstantAdPay second -> LinkSpin top-up arrives through the outbox pull', async () => {
const W = world(); const R = W.copy();
await R.onPurchase(W.ev('0xL', 2500, '2026-11-02'));
await W.IAP.record({ site: 'iap', email: 's@x.test', tx: '0xI', cents: 2000, credits: 2000, ts: ct('2026-11-04') });
assert.strictEqual(W.iapEarned[0].credits, 300);
await R.tick();
assert.deepStrictEqual(W.lsEarned.map(x => x.credits), [250, 125]); // 10% then topped up to 15% of 2,500
assert.ok(/Twin Engine top-up/.test(W.lsLog[1].reason));
await R.tick(); assert.strictEqual(W.lsEarned.length, 2, 'nothing twice');
});
await t('two LinkSpin app copies see the same purchase: one report, one grant', async () => {
const W = world(); const A = W.copy(), B = W.copy();
await Promise.all([A.onPurchase(W.ev('0x1', 5000, '2026-11-02')), B.onPurchase(W.ev('0x1', 5000, '2026-11-02'))]);
assert.strictEqual(W.lsEarned.length, 1); assert.strictEqual(W.lsEarned[0].credits, 500);
await Promise.all([A.tick(), B.tick()]); assert.strictEqual(W.lsEarned.length, 1);
});
await t('InstantAdPay down: the report waits in a pending file and goes through on the next tick', async () => {
const W = world(); const R = W.copy();
W.down = true; const r = await R.onPurchase(W.ev('0x1', 2500, '2026-11-02')); assert.ok(r.queued);
assert.strictEqual(fs.readdirSync(path.join(W.lsDir, 'refuel-pending')).length, 1); assert.strictEqual(R.adminView().pending[0].tries, 1);
W.down = false; await R.tick();
assert.strictEqual(W.lsEarned.length, 1); assert.strictEqual(fs.readdirSync(path.join(W.lsDir, 'refuel-pending')).length, 0);
});
await t('a lost ack: the row comes back on the next pull and is acked without being applied twice', async () => {
const W = world(); const R = W.copy();
W.dropAck = true; await R.onPurchase(W.ev('0x1', 2500, '2026-11-02'));
assert.strictEqual(W.lsEarned.length, 1); assert.strictEqual((await W.IAP.outbox('linkspin')).length, 1);
W.dropAck = false; await R.tick();
assert.strictEqual(W.lsEarned.length, 1); assert.strictEqual((await W.IAP.outbox('linkspin')).length, 0);
});
await t('reminders for a LinkSpin-home member go out from LinkSpin (notice + email with unsubscribe), once', async () => {
const W = world(); const R = W.copy();
await R.onPurchase(W.ev('0x1', 2500, '2026-11-02'));
await W.IAP.tick(ct('2026-11-27', 10));
await R.tick(); await R.tick();
const rem = W.lsInbox.filter(m => /refuel day is/i.test(m.subject)); assert.strictEqual(rem.length, 1);
assert.ok(W.lsMail.some(m => /refuel day is/i.test(m.subject) && /unsubscribe/.test(m.text)));
});
await t('status + streak line for the Credits card and the refill notice', async () => {
const W = world(); const R = W.copy();
await R.onPurchase(W.ev('0x1', 2500, '2026-11-02'));
const v = await R.status('s@x.test'); assert.ok(v.on && v.active && v.streak === 1 && v.cycle.linkspin.refueled);
const sl = await R.streakLine('s@x.test'); assert.ok(/^Refuel streak: (month 1|1 month)/.test(sl.text), sl.text);
});
console.log('\n' + (n - fails) + '/' + n + ' passed');
process.exit(fails ? 1 : 0);
})();
+38 -1
View File
@@ -5,14 +5,23 @@
# bash qa/run.sh earn # local copy: earning flows end to end (~2-3 min)
# bash qa/run.sh all # public + member + earn
# bash qa/run.sh kb # chat knowledge base: retrieval unit test + chat endpoint e2e on a local copy with a mock OpenRouter
# bash qa/run.sh sponsorfollow # sponsor follow rule + network tank unit tests + carry hold guard
# bash qa/run.sh sponsorfollow # sponsor follow rule + network tank unit tests + carry hold guard + carry activation regression
# bash qa/run.sh tankhold # holding tank: network alignment first, plain-activation hold (never a purchase), 24-hour rotation, payouts on at assignment (unit with a mocked clock + fake engine, then a local copy with a mock InstantAdPay)
# bash qa/run.sh lsid # page-builder lead -> rotator conversion + postback, audience pixel events and cookieless hits
# bash qa/run.sh convpixel # conversion pixel: ad click ids, landing tag + goal pixel (url/stored/cookie/soft), dedupe, window, owner check, cost per goal, IAP partner calls, browser + framed
# bash qa/run.sh nas # Network Ad Space billing: stop snapshot, active-only reconcile, restart without phantom delivery, the 1/N network + partner-zone rate (stubbed NAS, throwaway data)
# bash qa/run.sh loginqueue # prepaid login-slot queue: ads.js unit test (two app copies promoting at once) + HTTP/Ads-screen e2e on a local copy
# bash qa/run.sh override # level-4 override: week math, hunt, house, dust carry, cap, balance, two concurrent payers (fake chain + signer, throwaway data)
# bash qa/run.sh policy # profile policy + link-farm scan: prohibited list, bio links, quarantine, 06:30 claim, walls of free/paying members, 404 walls (unit + local copy; also runs in member)
# bash qa/run.sh fuel # Fuel Your Offers: refill notices, refuel streak, Refuel Kit, Engine Room (unit + two-copy tests, throwaway data)
# bash qa/run.sh theme # light/dark themes: WCAG contrast of the main text/background pairs on the member area + public pages, both themes (local copy)
# QA_THEME=dark bash qa/run.sh member # walk every pane in one theme; screenshots land as *-dark.png / *-light.png
# Each local run boots server.js on its own port with a throwaway data dir (JSON store, no DB, no
# mail key, devCode sign-in), so nothing touches production data. Reports land in qa/out/.
set -u
cd "$(dirname "$0")/.."
# no node_modules in this checkout: borrow InstantAdPay's (same ethers major) so ethers-based tests can load
[ -d node_modules ] || [ -n "${NODE_PATH:-}" ] || { [ -d ../../onchain-ad-membership/site/node_modules ] && export NODE_PATH="$(cd ../../onchain-ad-membership/site/node_modules && pwd)"; }
MODE="${1:-all}"
OUT="qa/out"; mkdir -p "$OUT"
TMP="${TMPDIR:-${TEMP:-/tmp}}/iap-qa-$$"
@@ -30,18 +39,46 @@ stop_local() { # $1 = port
rm -rf "$TMP-$1"
}
# Syntax gate, every mode (2026-10-29): /traffic-guide shipped with a parse error in traffic-guide.js (a // comment inside a
# one-liner) and rendered empty for everyone for a day. node --check costs nothing and catches it before any walk runs.
syntax_gate() {
local bad=0 f
for f in *.js lib/*.js public/*.js public/assets/*.js; do
[ -f "$f" ] || continue
node --check "$f" 2>"$OUT/syntax.err" || { echo "[bug] SYNTAX $f :: $(grep -m1 -E 'Error' "$OUT/syntax.err")"; bad=1; }
done
rm -f "$OUT/syntax.err"
[ "$bad" = 0 ] && echo "syntax gate: every script parses" || status=1
}
syntax_gate
if [ "$MODE" = "public" ]; then
node qa/walk.mjs public || status=1
elif [ "$MODE" = "fuel" ]; then
for f in qa/refill.test.cjs qa/refuel*.test.cjs; do [ -f "$f" ] && { node "$f" || status=1; }; done
elif [ "$MODE" = "theme" ]; then
start_local 8797 && { LOCAL=http://127.0.0.1:8797 node qa/theme-contrast.mjs || status=1; }; stop_local 8797
elif [ "$MODE" = "override" ]; then
node qa/override.test.cjs || status=1
elif [ "$MODE" = "member" ]; then
start_local 8796 && { LOCAL=http://127.0.0.1:8796 node qa/walk.mjs member || status=1; }; stop_local 8796
node qa/profile-policy.test.cjs || status=1
elif [ "$MODE" = "policy" ]; then
node qa/profile-policy.test.cjs || status=1
elif [ "$MODE" = "sponsorfollow" ]; then
node qa/sponsorfollow.test.cjs || status=1
node qa/carry-hold.test.cjs || status=1
node qa/carry-activate.test.cjs || status=1
elif [ "$MODE" = "tankhold" ]; then
node qa/tank-hold.test.mjs || status=1
elif [ "$MODE" = "nas" ]; then
node qa/nas-stop.test.cjs || status=1
node qa/nas-ratio.test.cjs || status=1
elif [ "$MODE" = "loginqueue" ]; then
node qa/loginqueue.test.cjs || status=1
node qa/loginqueue.e2e.mjs || status=1
elif [ "$MODE" = "convpixel" ]; then
node qa/convpixel.test.mjs || status=1
elif [ "$MODE" = "lsid" ]; then
node qa/lsid-pixel.test.mjs || status=1
elif [ "$MODE" = "kb" ]; then
+296
View File
@@ -0,0 +1,296 @@
// Holding tank on LinkSpin (2026-10-27): network ALIGNMENT first, the plain-activation hold, the 24-hour rotation, and
// payouts switched on the moment someone is assigned. node qa/tank-hold.test.mjs (or: bash qa/run.sh tankhold)
// Marty's rules under test: align with the network sponsor first; NEVER hold a purchase ("they'll just pay number one");
// hold only the free Switch on payouts for someone nobody knows; never fall back to #1 for an assigned member.
// Part A, no server: the real tank.js + carry.js with in-memory accounts, a fake chain, a fake engine sender (no key, no
// RPC) and a MOCKED CLOCK (tank.setClock); marks.js on a throwaway dir for the cross-copy claims.
// Part B, LOCAL copy (throwaway DATA_DIR, JSON store, devCode sign-in, no ENGINE_KEY, a throwaway LS_SYNC_SECRET and
// IAP_URL pointed at a mock InstantAdPay on 127.0.0.1 that answers sponsor-facts): /api/me + /api/sponsor per intent,
// live alignment, a sponsored member never held, admin tank, the Credits screen in a browser. Never production.
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import http from 'node:http';
import crypto from 'node:crypto';
import { spawn } from 'node:child_process';
import { createRequire } from 'node:module';
import { pathToFileURL } from 'node:url';
const SITE = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '..');
const require = createRequire(path.join(SITE, 'package.json'));
delete process.env.DATABASE_URL; delete process.env.ENGINE_KEY; delete process.env.ENGINE_KEY_FILE;
let fails = 0; const ok = (cond, label, extra) => { console.log((cond ? 'PASS ' : 'FAIL ') + label + (extra && !cond ? ' ' + extra : '')); if (!cond) fails++; };
const sleep = ms => new Promise(r => setTimeout(r, ms));
const H = 3600000;
const addr = () => '0x' + crypto.randomBytes(20).toString('hex');
// ---------------- Part A ----------------
function fakeAccounts() {
const by = new Map(); let n = 100;
const pub = a => a ? Object.assign({}, a) : null;
const find = f => { for (const a of by.values()) if (f(a)) return pub(a); return null; };
return {
_by: by,
add(email, o) { const a = Object.assign({ email, username: email.split('@')[0].replace(/[^a-z0-9_]/g, ''), code: 'c' + (n++), sponsorRef: '', memberId: 0, address: null, created: Date.now() - 30 * 86400000, lastSeen: Date.now() - H }, o || {}); by.set(email, a); return pub(a); },
async byEmail(e) { return pub(by.get(String(e || '').toLowerCase())); },
async byUsername(u) { const x = String(u || '').toLowerCase(); return find(a => a.username === x); },
async byCode(c) { const x = String(c || '').toLowerCase(); return find(a => a.code === x); },
async byMemberId(id) { return find(a => Number(a.memberId) === Number(id) && id > 0); },
async setSponsorRef(e, ref) { const a = by.get(e); if (!a) return { error: 'No such account.' }; a.sponsorRef = String(ref || '').toLowerCase(); return { ok: true }; },
async setMemberId(e, id) { const a = by.get(e); if (a) a.memberId = Number(id) || 0; return { ok: true }; },
async listAll() { return [...by.values()].map(pub); },
async sponsorOf(e) { const a = by.get(e); if (!a || !a.sponsorRef) return null; return (await this.byUsername(a.sponsorRef)) || (await this.byCode(a.sponsorRef)); }
};
}
function bench() {
for (const f of ['tank.js', 'carry.js', 'marks.js']) delete require.cache[require.resolve(path.join(SITE, f))];
const tank = require(path.join(SITE, 'tank.js')); const carry = require(path.join(SITE, 'carry.js')); const marks = require(path.join(SITE, 'marks.js'));
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-tankhold-'));
marks.init({ dataDir: dir });
const accounts = fakeAccounts(); const events = []; const chats = []; const mails = []; const alerts = []; const assigned = []; const net = {}; const iap = new Set();
const blocked = new Set(); const onchain = new Map(); const sends = []; const env = { now: Date.now(), failSends: 0 }; let nextId = 500;
const chain = { recentEvents: () => events.slice().reverse(), getConfig: () => ({ explorer: 'https://polygonscan.com' }), memberCount: async () => 10000,
memberIdByAccount: async a => onchain.get(String(a).toLowerCase()) || 0 };
carry.init({ dataDir: dir, accounts, chain, siteConfig: () => ({ defaultSponsorId: 1, carryNotices: '0' }), messages: { deliver: async () => {} },
tankGate: (a, o) => tank.gate(a, o), claim: k => marks.claim(k), now: () => env.now, payoutBlocked: async id => blocked.has(id),
sendActivate: async (address, sponsorId) => { sends.push({ address: address.toLowerCase(), sponsorId }); await sleep(5);
if (env.failSends > 0) { env.failSends--; return { id: 0, txHash: null, lastErr: new Error('gas price spike (test)') }; }
const id = nextId++; onchain.set(address.toLowerCase(), id); return { id, txHash: '0x' + crypto.randomBytes(32).toString('hex'), lastErr: null }; } });
tank.init({ dataDir: dir, accounts, chain,
messages: { sendChat: async (id, from, to, text) => { chats.push({ from, to, text }); }, lastFrom: async () => 0 },
mailer: { hasKey: () => true, send: async (to, subject, text) => { mails.push({ to, subject, text }); } }, site: 'https://linkspin.test',
hooks: { network: async e => net[e] || null, iapOwns: async e => iap.has(e), payoutBlocked: async id => blocked.has(id), companyId: () => 1,
lifted: e => carry.activateAssigned(e), claim: k => marks.claim(k), bound: async a => onchain.get(String(a.address).toLowerCase()) || 0,
assigned: r => { assigned.push(r); }, adminAlert: t => { alerts.push(t); } } });
tank.setClock(() => env.now);
let block = 1000;
const buyer = (email, memberId, o) => { const w = addr(); const a = accounts.add(email, Object.assign({ memberId, address: w, lastSeen: env.now - H }, o || {})); onchain.set(w, memberId); events.push({ type: 'Purchase', buyerId: memberId, priceCents: 2500, block: block++ }); return a; };
return { tank, carry, marks, accounts, events, chats, mails, alerts, assigned, net, iap, blocked, onchain, sends, env, buyer, dir };
}
async function partA() {
console.log('-- Part A: tank.js + carry.js, mocked clock, fake engine');
{ // the hold is for the plain activation only; a purchase never waits
const B = bench(); const { tank, carry, accounts, env, sends } = B; const t0 = env.now;
accounts.add('free@x.co');
const h0 = await tank.holdFor(await accounts.byEmail('free@x.co'));
ok(h0 && h0.hold && h0.hold.since === null, 'tank member without a wallet: hold record, no clock yet');
accounts._by.get('free@x.co').address = addr();
const id0 = await carry.ensureOnChain(await accounts.byEmail('free@x.co'), 0, 'wallet');
ok(id0 === 0 && sends.length === 0, 'wallet linked, nobody known: the engine does NOT switch payouts on under #1');
const h1 = await tank.holdFor(await accounts.byEmail('free@x.co'));
ok(h1.hold && h1.hold.since === t0 && h1.hold.until === t0 + 24 * H, 'clock started at the wallet link, until = +24 h');
ok(carry.status().log.some(e => e.type === 'tankHold' && e.email === 'free@x.co'), 'the hold is logged in carry state');
accounts.add('kid@x.co', { sponsorRef: 'someone', address: addr() });
ok((await tank.holdFor(await accounts.byEmail('kid@x.co'))) === null, 'a member with a sponsor is never held');
// a sponsor placed on the contract because someone below is BUYING: never held (today's fallback stands)
accounts.add('upl@x.co', { address: addr() }); accounts.add('buyer@x.co', { sponsorRef: 'upl', address: addr() });
const sid = await carry.ensureOnChain(await accounts.byEmail('upl@x.co'), 0);
ok(sid > 0 && sends.length === 1 && sends[0].sponsorId === 1, 'tank member whose referral is buying: activated (under #1, the purchase is never held)', JSON.stringify(sends));
const w = await tank.waiting(); const fr = w.find(x => x.email === 'free@x.co');
ok(w[0] && w[0].email === 'free@x.co' && fr.ready && fr.holdUntil === t0 + 24 * H && fr.wallet, 'waiting(): ready member on top with holdUntil');
}
{ // ALIGN FIRST: the network knows a sponsor
const B = bench(); const { tank, carry, accounts, net, sends } = B;
B.buyer('boss@x.co', 31);
accounts.add('t1@x.co', { address: addr() }); net['t1@x.co'] = { sponsorEmail: 'boss@x.co', via: 'same email' };
const id = await carry.ensureOnChain(await accounts.byEmail('t1@x.co'), 0, 'wallet');
ok(id > 0 && sends.length === 1 && sends[0].sponsorId === 31 && (await accounts.byEmail('t1@x.co')).sponsorRef === 'boss', 'InstantAdPay knows the sponsor: aligned and switched on under #31, not held, not #1', JSON.stringify(sends));
ok((await tank.adminView()).aligned[0].why.includes('aligned to network sponsor @boss from InstantAdPay'), 'alignment recorded with the reason');
accounts.add('t2@x.co', { address: addr() }); net['t2@x.co'] = { sponsorEmail: 'boss@x.co', via: 'same wallet' };
const h2 = await tank.holdFor(await accounts.byEmail('t2@x.co'));
ok(h2 && h2.aligned && h2.aligned.via === 'same wallet', '/api/me path: aligned (by wallet), not held');
await sleep(40);
ok(sends.some(s => s.sponsorId === 31 && s.address === (B.accounts._by.get('t2@x.co').address)), '...and payouts switched on under the aligned sponsor right away');
accounts.add('t3@x.co'); net['t3@x.co'] = { sponsorEmail: 'nobody@x.co' };
ok((await tank.holdFor(await accounts.byEmail('t3@x.co'))).hold, 'network sponsor with no LinkSpin account: held');
accounts.add('t4@x.co', { sponsorRef: 'boss' });
const rel = await tank.release('boss@x.co', 't4@x.co'); ok(rel && rel.ok, 'release to the tank (setup)', JSON.stringify(rel));
net['t4@x.co'] = { sponsorEmail: 'boss@x.co' };
ok((await tank.holdFor(await accounts.byEmail('t4@x.co'))).hold, 'never aligned back to a sponsor who released them');
accounts.add('t5@x.co'); accounts.add('child@x.co', { sponsorRef: 't5', memberId: 33 }); net['t5@x.co'] = { sponsorEmail: 'child@x.co' };
ok((await tank.holdFor(await accounts.byEmail('t5@x.co'))).hold, 'never aligned under their own downline');
}
{ // 24-hour rotation + activation right away under the adopter
const B = bench(); const { tank, accounts, env, sends, chats, mails } = B; const t0 = env.now;
accounts.add('free@x.co', { address: addr() });
B.buyer('a@x.co', 11); B.buyer('b@x.co', 12); B.buyer('c@x.co', 13);
B.buyer('d@x.co', 14, { lastSeen: env.now - 8 * 86400000 }); B.buyer('e@x.co', 1); B.buyer('f@x.co', 16); B.blocked.add(16);
const tk = await tank.readyTick();
ok(tk.fresh.length === 1 && tk.fresh[0].email === 'free@x.co', 'readyTick announces the ready member once', JSON.stringify(tk.fresh));
ok((await tank.readyTick()).fresh.length === 0, '...and not twice');
ok(tk.assigned.length === 0, 'not assigned before 24 h');
env.now = t0 + 24 * H - 10 * 60000;
const r1 = await tank.readyTick();
ok(r1.assigned.length === 1 && r1.assigned[0].adopter === 'a@x.co', '24 h: first in rotation = earliest qualified (A)', JSON.stringify(r1.assigned));
const fa = await accounts.byEmail('free@x.co');
ok(fa.sponsorRef === 'a' && fa.memberId > 0, 'assigned AND on the contract right away', JSON.stringify({ s: fa.sponsorRef, id: fa.memberId }));
ok(sends.length === 1 && sends[0].sponsorId === 11, 'engine activation under the adopter #11, never #1', JSON.stringify(sends));
const ch = chats.find(c => c.from === 'a@x.co' && c.to === 'free@x.co');
ok(ch && /Your payouts are now on under @a/.test(ch.text) && /https:\/\/polygonscan\.com\/tx\/0x[0-9a-f]{64}/.test(ch.text), 'assignment chat says payouts are on under @a with the Polygonscan link', ch && ch.text);
ok(mails.some(m => m.to === 'free@x.co' && /Your payouts are now on under @a/.test(m.text)) && mails.some(m => m.to === 'a@x.co' && /their payouts are switched on under you/.test(m.text)), 'both sides emailed (member email carries the payouts line)');
ok((await tank.adminView()).adoptions[0].note === 'auto-assigned after 24 hours in the tank', 'adoption record note');
ok(B.assigned.length === 1, 'assigned hook fired (Telegram pickup "(auto-assigned)")');
// B next; then C (stale D, company E, no-payout F skipped); then back to A
accounts.add('free2@x.co', { address: addr() }); await tank.readyTick(); env.now += 24 * H;
const r2 = await tank.readyTick(); ok(r2.assigned.length === 1 && r2.assigned[0].adopter === 'b@x.co', 'rotation: B next', JSON.stringify(r2.assigned));
accounts.add('free3@x.co', { address: addr() }); await tank.readyTick(); env.now += 24 * H;
const r3 = await tank.readyTick(); ok(r3.assigned.length === 1 && r3.assigned[0].adopter === 'c@x.co', 'rotation: C (stale, company and no-payout chain skipped)', JSON.stringify(r3.assigned));
// activation fails (gas): stays assigned, retried next tick, never #1
B.env.failSends = 1; for (const em of ['a@x.co', 'b@x.co', 'c@x.co']) accounts._by.get(em).lastSeen = env.now - H;
accounts.add('free4@x.co', { address: addr() }); await tank.readyTick(); env.now += 24 * H;
for (const em of ['a@x.co', 'b@x.co', 'c@x.co']) accounts._by.get(em).lastSeen = env.now - H;
const n0 = sends.length; const r4 = await tank.readyTick();
const f4 = await accounts.byEmail('free4@x.co');
ok(r4.assigned.length === 1 && r4.assigned[0].adopter === 'a@x.co' && f4.sponsorRef === 'a' && !f4.memberId, 'rotation wraps to A; activation failed, sponsor kept, not on the contract yet', JSON.stringify({ a: r4.assigned, f4 }));
env.now += 15 * 60000; const r5 = await tank.readyTick(); // the next tick, a new claim window
const f4b = await accounts.byEmail('free4@x.co');
ok(f4b.memberId > 0 && sends.slice(n0).every(s => s.sponsorId === 11), 'retried on a later tick and switched on under A (#11), never #1', JSON.stringify(sends.slice(n0)));
ok(chats.some(c => c.to === 'free4@x.co' && /Your LinkSpin payouts are now on under @a/.test(c.text)), 'follow-up chat once the retried activation lands');
// A full (2 open), B + C stale: nobody eligible -> keep holding, one admin alert
accounts._by.get('b@x.co').lastSeen = env.now - 8 * 86400000; accounts._by.get('c@x.co').lastSeen = env.now - 8 * 86400000;
accounts.add('free5@x.co', { address: addr() }); await tank.readyTick(); env.now += 24 * H;
const r6 = await tank.readyTick(); const f5 = await accounts.byEmail('free5@x.co');
ok(r6.assigned.length === 0 && r6.held === 1 && !f5.sponsorRef && !f5.memberId, 'nobody eligible: keeps holding, never the company');
ok(B.alerts.length === 1 && /free5@x\.co/.test(B.alerts[0]), 'admin alerted once');
await tank.readyTick(); await tank.sweep(); ok(B.alerts.length === 1, 'no second alert');
void r5;
}
{ // manual adoption of a ready member: payouts on right away, follow-up chat with the link
const B = bench(); const { tank, accounts, sends, chats } = B;
accounts.add('m1@x.co', { address: addr() }); B.buyer('ad@x.co', 41); await tank.readyTick();
const r = await tank.adopt('ad@x.co', 'm1', 'Hi there');
ok(r.ok, 'manual adopt ok', JSON.stringify(r)); await sleep(60);
const m1 = await accounts.byEmail('m1@x.co');
ok(m1.memberId > 0 && sends.length === 1 && sends[0].sponsorId === 41, 'manual adoption: engine activation under the adopter #41', JSON.stringify(sends));
ok(chats.some(c => c.from === 'ad@x.co' && c.to === 'm1@x.co' && /payouts are now on under @ad/.test(c.text) && /polygonscan\.com\/tx\//.test(c.text)), 'member told in chat: payouts on under @ad with the Polygonscan link');
}
{ // cross-site + cross-copy guards
const B = bench(); const { tank, carry, accounts, env, sends, iap } = B;
accounts.add('both@x.co', { address: addr() }); B.buyer('a@x.co', 11); iap.add('both@x.co');
const t1 = await tank.readyTick(); ok(t1.fresh.length === 0, 'someone in the InstantAdPay tank: not announced here (InstantAdPay posts it)');
env.now += 24 * H; const t2 = await tank.readyTick();
ok(t2.assigned.length === 0 && t2.deferred === 1 && !(await accounts.byEmail('both@x.co')).sponsorRef, 'InstantAdPay owns the auto-assign: LinkSpin defers');
iap.delete('both@x.co');
await B.marks.claim('tankauto:both@x.co:' + Math.floor(env.now / 600000)); // the other app copy already took this window
const t3 = await tank.readyTick(); ok(t3.assigned.length === 0, 'deploy overlap: the window claimed by another copy, this copy does not assign');
env.now += 15 * 60000; for (const a of accounts._by.values()) if (a.email === 'a@x.co') a.lastSeen = env.now - H;
const t4 = await tank.readyTick(); ok(t4.assigned.length === 1, 'next window: assigned once');
// two concurrent activations of the same member: one send
accounts.add('dup@x.co', { address: addr(), sponsorRef: 'a' });
const [x, y] = await Promise.all([carry.activateAssigned('dup@x.co'), carry.activateAssigned('dup@x.co')]);
ok(sends.filter(s => s.address === accounts._by.get('dup@x.co').address).length === 1 && ((x.id && !y.id) || (!x.id && y.id)), 'two concurrent activations: exactly one engine send', JSON.stringify([x, y]));
accounts.add('dup2@x.co', { address: addr(), sponsorRef: 'a' });
await B.marks.claim('tankact:dup2@x.co:' + Math.floor(env.now / 600000));
const z = await carry.activateAssigned('dup2@x.co'); ok(!z.id && z.retry, 'another app copy holds the activation claim: nothing sent, retried later', JSON.stringify(z));
B.blocked.add(11); accounts.add('nop@x.co', { address: addr(), sponsorRef: 'a' });
const q = await carry.activateAssigned('nop@x.co'); ok(!q.id && /no-payout/.test(q.error), 'sponsor on a no-payout chain: not activated', JSON.stringify(q));
accounts.add('nowal@x.co', { address: addr(), sponsorRef: 'shellsp' }); accounts.add('shellsp@x.co', { username: 'shellsp' });
const n = await carry.activateAssigned('nowal@x.co'); ok(!n.id && n.retry && /no wallet/.test(n.error), 'sponsor without a wallet: not activated (never #1), retried', JSON.stringify(n));
}
}
// ---------------- Part B ----------------
async function partB() {
console.log('-- Part B: local copy + mock InstantAdPay');
const PORT = Number(process.env.TANKHOLD_PORT || 8803), IAPPORT = PORT + 1;
const BASE = 'http://127.0.0.1:' + PORT; const ADMIN_PW = 'localtest-th';
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'ls-tankhold-srv-')); fs.mkdirSync(path.join(DATA, 'uploads'));
const SECRET = crypto.randomBytes(24).toString('hex'); // throwaway
const iapRows = {}; let factsCalls = 0;
const mock = http.createServer((req, res) => { let d = ''; req.on('data', c => d += c); req.on('end', () => {
const sig = crypto.createHmac('sha256', SECRET).update(String(req.headers['x-ls-ts'] || '') + '\n' + d).digest('hex');
if (sig !== req.headers['x-ls-sig']) { res.writeHead(401); return res.end('{"error":"bad signature"}'); }
let b = {}; try { b = JSON.parse(d || '{}'); } catch (e) {}
let out = { ok: true, proto: 2 };
if (req.url === '/api/partner/sponsor-facts') { factsCalls++; out = { ok: true, proto: 2, platform: 'instantadpay', rows: (b.emails || []).map(e => iapRows[e]).filter(Boolean), view: {} }; }
res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify(out)); }); });
await new Promise(r => mock.listen(IAPPORT, '127.0.0.1', r));
const env = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, ADMIN_PASSWORD: ADMIN_PW, ADMIN_EMAIL: 'admin@th.test', LS_SYNC_SECRET: SECRET, IAP_URL: 'http://127.0.0.1:' + IAPPORT });
for (const k of ['NODE_ENV', 'DATABASE_URL', 'ENGINE_KEY', 'ENGINE_KEY_FILE', 'OUTBOUND', 'LS_TESTERS', 'CURTAIN', 'NAS_DB_HOST', 'NAS_DB_USER', 'NAS_DB_PASSWORD', 'NAS_DB_NAME', 'SENDGRID_KEY', 'SENDGRID_API_KEY', 'OPENROUTER_API_KEY']) delete env[k];
const srv = spawn(process.execPath, ['server.js'], { cwd: SITE, env, stdio: ['ignore', 'pipe', 'pipe'] });
let log = ''; srv.stdout.on('data', d => log += d); srv.stderr.on('data', d => log += d);
let browser = null;
const req = (method, p, o) => new Promise((resolve, reject) => { o = o || {};
const headers = Object.assign({ 'User-Agent': 'Mozilla/5.0 QA', 'X-Forwarded-For': o.ip || '10.8.0.1' }, o.headers || {}); if (o.cookie) headers.Cookie = o.cookie;
let body = o.body; if (body) { body = Buffer.from(JSON.stringify(body)); headers['Content-Type'] = 'application/json'; headers['Content-Length'] = body.length; }
const r = http.request({ host: '127.0.0.1', port: PORT, path: p, method, headers }, res => { const ch = []; res.on('data', c => ch.push(c)); res.on('end', () => { const buf = Buffer.concat(ch); let j = null; try { j = JSON.parse(buf.toString()); } catch (e) {} resolve({ status: res.statusCode, headers: res.headers, json: j, text: buf.toString() }); }); });
r.on('error', reject); if (body) r.write(body); r.end(); });
let ipn = 1;
async function signIn(email, extraCookie) {
const ip = '10.8.' + (ipn++) + '.7';
const s = await req('POST', '/api/auth/email/start', { ip, cookie: extraCookie, body: { email, fts: Date.now() - 8000, hp_field_x9: '' } });
if (!s.json || !s.json.devCode) throw new Error('no devCode for ' + email + ': ' + s.text.slice(0, 200));
const v = await req('POST', '/api/auth/email/verify', { ip, cookie: extraCookie, body: { email, code: s.json.devCode } });
const c = [].concat(v.headers['set-cookie'] || []).map(x => x.split(';')[0]).join('; ');
return extraCookie ? c + '; ' + extraCookie : c;
}
const { ethers } = require('ethers');
async function linkWallet(cookie) {
const w = ethers.Wallet.createRandom();
const c = await req('POST', '/api/auth/challenge', { cookie, body: { address: w.address } });
const signature = await w.signMessage(c.json.message);
return (await req('POST', '/api/auth/verify', { cookie, body: { address: w.address, signature } })).json;
}
const ADMIN = { Authorization: 'Bearer ' + ADMIN_PW };
try {
let up = false; for (let i = 0; i < 60 && !up; i++) { try { up = (await req('GET', '/api/config')).status === 200; } catch (e) { await sleep(500); } }
if (!up) throw new Error('local server did not come up:\n' + log.slice(-1500));
// 1. nobody knows them: tankHold on /api/me, the free activation held, a purchase NOT held
const tc = await signIn('qa-tank@example.com');
await req('POST', '/api/my/profile', { cookie: tc, body: { username: 'qatankone' } });
const lw = await linkWallet(tc); ok(lw && lw.linked, 'tank member links a wallet', JSON.stringify(lw));
const me = (await req('GET', '/api/me', { cookie: tc })).json;
ok(me && me.tankHold && me.tankHold.until - me.tankHold.since === 24 * H, '/api/me answers tankHold with a 24-hour clock', JSON.stringify(me && me.tankHold));
ok(me && me.sponsorBlocked !== 'tankHold', '/api/me never blocks (the buy flow reads it)', JSON.stringify({ b: me && me.sponsorBlocked }));
const act = (await req('GET', '/api/sponsor?intent=activate', { cookie: tc })).json;
ok(act && act.sponsorBlocked === 'tankHold' && !act.sponsorId && act.tankHold && act.tankHold.until === me.tankHold.until, 'Switch on payouts (intent=activate): held, no fallback sponsor', JSON.stringify({ id: act && act.sponsorId, b: act && act.sponsorBlocked }));
const buy = (await req('GET', '/api/sponsor?intent=buy', { cookie: tc })).json;
ok(buy && !buy.sponsorBlocked && !buy.tankHold, 'a PURCHASE (intent=buy) is never held, no hold text', JSON.stringify({ id: buy && buy.sponsorId, b: buy && buy.sponsorBlocked, h: buy && buy.tankHold }));
const adm = (await req('GET', '/api/admin/tank', { headers: ADMIN })).json;
const row = adm && adm.waiting && adm.waiting.find(w => w.email === 'qa-tank@example.com');
ok(row && row.ready && row.holdUntil === me.tankHold.until, 'admin tank: Ready with holdUntil');
// 2. InstantAdPay knows their sponsor (live signed sponsor-facts): aligned, not held
const bc = await signIn('qa-boss@example.com'); await req('POST', '/api/my/profile', { cookie: bc, body: { username: 'qaboss' } });
iapRows['qa-tank2@example.com'] = { email: 'qa-tank2@example.com', sponsorEmail: 'qa-boss@example.com', sponsorRef: 'qaboss', memberId: 0, wallet: true, joinedVia: null, lastSeen: Date.now() };
const tc2 = await signIn('qa-tank2@example.com');
const me2 = (await req('GET', '/api/me', { cookie: tc2 })).json;
ok(me2 && !me2.tankHold && me2.sponsorName === '@qaboss', 'IAP knows the sponsor: aligned on /api/me, not held', JSON.stringify({ h: me2 && me2.tankHold, n: me2 && me2.sponsorName }));
const act2 = (await req('GET', '/api/sponsor?intent=activate', { cookie: tc2 })).json;
ok(act2 && act2.sponsorBlocked !== 'tankHold', '...and the free activation is not held', JSON.stringify(act2 && act2.sponsorBlocked));
const adm2 = (await req('GET', '/api/admin/tank', { headers: ADMIN })).json;
ok(adm2.aligned && adm2.aligned.some(x => x.email === 'qa-tank2@example.com' && x.to === 'qa-boss@example.com' && x.via === 'InstantAdPay sponsor'), 'admin tank lists the alignment (via InstantAdPay sponsor)');
ok(factsCalls >= 1, 'the live lookup went to the (mock) InstantAdPay, signed');
// 3. joined through a link: never held
const jc = await signIn('qa-kid@example.com', 'iap.sponsor=qaboss'); await linkWallet(jc);
const me3 = (await req('GET', '/api/me', { cookie: jc })).json;
ok(me3 && !me3.tankHold, 'member who joined through a sponsor link: no hold', JSON.stringify(me3 && me3.tankHold));
// 4. the Credits screen: hold note, no Switch on payouts button, the buy button still there
const PW = process.env.PW || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright';
let chromium = null; try { chromium = (await import(pathToFileURL(PW + '/index.js').href)).default.chromium; } catch (e) { console.log('SKIP browser check (no Playwright at ' + PW + ')'); }
if (chromium) {
browser = await chromium.launch();
const ctx = await browser.newContext({ viewport: { width: 390, height: 900 } });
await ctx.addInitScript(() => { try { sessionStorage.setItem('ls.la', '1'); } catch (e) {} });
await ctx.addCookies(tc.split('; ').filter(Boolean).map(kv => { const i = kv.indexOf('='); return { name: kv.slice(0, i), value: kv.slice(i + 1), domain: '127.0.0.1', path: '/' }; }));
const page = await ctx.newPage(); const errs = []; page.on('pageerror', e => errs.push(e.message));
await page.goto(BASE + '/credits', { waitUntil: 'load' });
await page.waitForFunction(() => { const w = document.getElementById('walletBox'); return w && w.textContent.trim().length > 0; }, null, { timeout: 30000 }).catch(() => {}); await page.waitForTimeout(500);
const st = await page.evaluate(() => { const n = document.getElementById('tankHoldNote'); const hb = document.getElementById('holdBox');
return { note: n ? n.textContent : null, act: !!document.getElementById('activateBtn'), buy: !!document.getElementById('buyBtn'), hold: hb && !hb.hidden ? hb.textContent : null, wb: (document.getElementById('walletBox') || {}).textContent || null, url: location.href }; });
ok(st.note && st.note.startsWith("You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours).") && /Time left: \d+ h \d+ min\./.test(st.note), 'Credits: hold text with time left', JSON.stringify(st));
ok(!st.act && st.buy && !st.hold, 'Credits: no Switch on payouts button, Buy still there, no hold box on the buy side', JSON.stringify(st));
try { fs.mkdirSync(path.join(SITE, 'qa/out'), { recursive: true }); await page.screenshot({ path: path.join(SITE, 'qa/out/tank-hold-credits.png'), fullPage: true }); } catch (e) {}
ok(!errs.length, 'no page errors', errs.join(' | ').slice(0, 200));
}
} finally {
if (browser) await browser.close().catch(() => {});
try { srv.kill(); } catch (e) {}
mock.close(); await sleep(500);
try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {}
}
}
await partA();
if (process.argv[2] !== 'unit') await partB();
console.log(fails ? '\n' + fails + ' FAILED' : '\nall passed');
process.exit(fails ? 1 : 0);
+138
View File
@@ -0,0 +1,138 @@
// Theme contrast check (2026-11-01): loads the member area and the public pages in both themes with Playwright, samples
// the main text/background pairs (body text, muted text, links, buttons, chips, tags, table text, panel headings,
// stage pills, fields) and reports the WCAG contrast ratio per pair, pass/fail at 4.5:1 (3:1 for large text:
// 24px+, or 18.66px+ bold). Also probes the token pairs directly (every .tag/.chip/.stg/.btn variant is injected
// once so a pair is measured even when the page has no live example). Runs against a local copy:
// bash qa/run.sh theme (boots server.js on :8797 with throwaway data, signs in, walks both themes)
// Env: LOCAL (default http://127.0.0.1:8797), OUT (default qa/out), PW (playwright dir). Exit 1 when any pair fails.
import { pathToFileURL } from 'node:url';
import fs from 'node:fs';
const PW = process.env.PW || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright';
const { chromium } = (await import(pathToFileURL(PW + '/index.js').href)).default;
const LOCAL = process.env.LOCAL || 'http://127.0.0.1:8797';
const OUT = process.env.OUT || 'qa/out';
fs.mkdirSync(OUT, { recursive: true });
// selectors sampled on every page (text element -> its effective background)
const SAMPLE = ['body', 'p', 'li', 'td', 'th', 'label', 'small', 'h1', 'h2', 'h3', 'h4', 'a', 'button', '.btn', '.muted', '.ink2', '.small', '.sec', '.eyebrow',
'.tag', '.chip', '.chip-t', '.pill', '.stg', '.st', '.badge', '.lbl', '.tile .k', '.tile .v', '.tile .delta', '.panel h2', '.ph h2', '.ph h3', '.card h3', '.card-head .sub',
'.tbl .hd', '.tbl .rw', '.tbl .ft', '.led', '.led b', '.code', '.axis', '.note', '.field', 'input', 'textarea', 'select', '.topbar .crumb', '.topbar h1', '.topbar .readout', '.topbar .who',
'.strip', '.strip b', '.rail a', '.nav a', '.foot', '.foot a', '.hero .lede', '.pkg .k', '.pkg .price', '.pkg .cr', '.feed .row', '.feed .when', '.stat .n', '.stat .l', '.statx .nv', '.statx .lb',
'.pb-head', '.pb-text', '.angle-hook', '.angle-tag', '.lin-row .em', '.lin-row .id', '.gs-step', '.tk-tier', '.wall-pos', '.wc-check', '.bio-meta p', '.bo-menu button', '.tabs button', '.subtab',
'.theme-seg button', '.arrive', '.prelaunch', '.prelaunch a', '.callout', '.obj summary', '.chat-badge', '.cmp td', '.ticker span', '.checks li', '.platecard p', '.closer p', 'footer', 'footer a'];
// probes injected once per page so every variant gets a reading (class list, text, size hint)
const PROBES = [
['tag', 'Tag'], ['tag ok', 'Tag ok'], ['tag warn', 'Tag warn'], ['tag bad', 'Tag bad'], ['tag dim', 'Tag dim'], ['tag t', 'Tag t'],
['chip', 'Chip'], ['chip on', 'Chip on'], ['chip-t', 'Chip-t'], ['chip-t on', 'Chip-t on'], ['pill', 'Pill'], ['badge', 'Badge'], ['badge amber', 'Badge amber'],
['btn', 'Button'], ['btn pri', 'Primary'], ['btn blue', 'Blue'], ['btn sec', 'Sec'], ['btn small sec', 'Small sec'],
['st active', 'active'], ['st paused', 'paused'], ['st out', 'out'], ['st rejected', 'rejected'],
['muted', 'Muted text'], ['ink2', 'Ink 2'], ['ok', 'ok text'], ['warn', 'warn text'], ['bad', 'bad text'], ['sec', 'Section label'], ['note', 'Note'], ['err', 'Error'],
['code', 'code text'], ['field', 'field text'], ['callout', 'Callout'], ['lin-verdict', 'verdict'], ['tk-tier', 'tier'], ['angle-hook', 'hook'], ['angle-tag', 'angle tag'],
['stg', 'stage', 'joined'], ['stg', 'stage', 'wallet'], ['stg', 'stage', 'payouts'], ['stg', 'stage', 'bought'], ['stg', 'stage', 'building'], ['stg', 'stage', 'quiet'], ['stg', 'stage', 'live'], ['stg', 'stage', 'low'], ['stg', 'stage', 'out'], ['stg', 'stage', 'paused'], ['stg', 'stage', 'ended'], ['stg', 'stage', 'sched'],
['stg quiet', 'quiet'], ['chip warm', 'warm chip'], ['chip flat', 'flat chip'], ['pipe-card nm', 'name'], ['theme-seg-probe', 'seg'],
];
const browser = await chromium.launch();
const results = [];
async function sample(page, label) {
const rows = await page.evaluate(({ SAMPLE, PROBES }) => {
const parse = c => { const m = String(c).match(/rgba?\(([^)]+)\)/); if (!m) return null; const p = m[1].split(/[,\s/]+/).filter(Boolean).map(Number); return { r: p[0], g: p[1], b: p[2], a: p.length > 3 ? p[3] : 1 }; };
const over = (fg, bg) => ({ r: fg.r * fg.a + bg.r * (1 - fg.a), g: fg.g * fg.a + bg.g * (1 - fg.a), b: fg.b * fg.a + bg.b * (1 - fg.a), a: 1 });
const lum = c => { const f = v => { v /= 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); }; return 0.2126 * f(c.r) + 0.7152 * f(c.g) + 0.0722 * f(c.b); };
const ratio = (a, b) => { const l1 = lum(a), l2 = lum(b); return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05); };
const hex = c => '#' + [c.r, c.g, c.b].map(v => Math.round(v).toString(16).padStart(2, '0')).join('');
// gradients: average the colour stops (good enough for the two-stop panel/button gradients used here)
// gradients: average the non-transparent colour stops (a transparent stop is not a colour the text sits on)
const gradColour = img => { const stops = [...img.matchAll(/rgba?\([^)]+\)/g)].map(m => parse(m[0])).filter(c => c && c.a > 0); if (!stops.length) return null; const n = stops.length; return { r: stops.reduce((s, c) => s + c.r, 0) / n, g: stops.reduce((s, c) => s + c.g, 0) / n, b: stops.reduce((s, c) => s + c.b, 0) / n, a: stops.reduce((s, c) => s + c.a, 0) / n }; };
const bgOf = el => { // walk up, compositing translucent layers over what lies beneath
const layers = []; let e = el;
while (e && e !== document.documentElement.parentNode) {
const cs = getComputedStyle(e); const bc = parse(cs.backgroundColor); const bi = cs.backgroundImage;
let c = null;
if (bi && bi !== 'none' && /gradient/.test(bi) && !/radial-gradient\(circle,/.test(bi)) c = gradColour(bi);
if (bc && bc.a > 0) c = c && c.a < 1 ? over(c, bc) : (c || bc);
if (c && c.a > 0) { layers.push(c); if (c.a >= 1) break; }
e = e.parentElement;
}
let out = { r: 255, g: 255, b: 255, a: 1 };
const body = parse(getComputedStyle(document.body).backgroundColor); if (body && body.a > 0 && !layers.some(l => l.a >= 1)) out = body;
for (let i = layers.length - 1; i >= 0; i--) out = over(layers[i], out);
return out;
};
const vis = el => { const r = el.getBoundingClientRect(); const cs = getComputedStyle(el); return r.width > 0 && r.height > 0 && cs.visibility !== 'hidden' && cs.display !== 'none' && el.closest('[hidden]') === null; };
const hasText = el => [...el.childNodes].some(n => n.nodeType === 3 && n.textContent.trim().length > 0) || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName);
// probes
const host = document.createElement('div'); host.id = 'contrastProbes'; host.style.cssText = 'position:absolute;left:0;top:0;padding:8px;display:flex;flex-wrap:wrap;gap:6px;z-index:9999;background:var(--panel,transparent)';
const panel = document.querySelector('.panel,.card,.tile,.tbl') || document.body; panel.appendChild(host);
const hasSeg = !!document.querySelector('link[href*="/assets/cr.css"]'); // the theme switch lives on Control Room pages only
for (const [cls, text, st] of PROBES) { if (cls === 'theme-seg-probe' && !hasSeg) continue; const el = document.createElement(cls.startsWith('btn') ? 'button' : 'span'); el.className = cls.replace('theme-seg-probe', ''); if (cls === 'theme-seg-probe') { el.className = 'seg theme-seg'; el.innerHTML = '<button data-theme="x" class="on">On</button><button data-theme="y">Off</button>'; } else el.textContent = text; if (st) el.setAttribute('data-st', st); el.setAttribute('data-probe', (st ? cls + ' ' + st : cls)); host.appendChild(el); }
const out = []; const seen = new Set();
const els = [];
for (const sel of SAMPLE) for (const el of document.querySelectorAll(sel)) els.push([sel, el]);
for (const el of host.querySelectorAll('[data-probe],[data-theme]')) els.push(['probe ' + (el.getAttribute('data-probe') || el.parentElement.getAttribute('data-probe') + ' ' + el.className), el]);
for (const [sel, el] of els) {
if (!vis(el) || !hasText(el)) continue;
const cs = getComputedStyle(el); const fg = parse(cs.color); if (!fg) continue;
let bg = bgOf(el);
// placeholder-only inputs: still measure the text colour against the field background
const fgc = fg.a < 1 ? over(fg, bg) : fg;
const size = parseFloat(cs.fontSize), weight = parseInt(cs.fontWeight, 10) || 400;
const large = size >= 24 || (size >= 18.66 && weight >= 700);
const r = ratio(fgc, bg);
const key = sel + '|' + hex(fgc) + '|' + hex(bg) + '|' + large;
if (seen.has(key)) continue; seen.add(key);
out.push({ sel, text: (el.textContent || el.placeholder || '').trim().slice(0, 28), fg: hex(fgc), bg: hex(bg), ratio: Math.round(r * 100) / 100, size: Math.round(size * 10) / 10, weight, large, need: large ? 3 : 4.5 });
}
host.remove();
return out;
}, { SAMPLE, PROBES });
for (const r of rows) results.push(Object.assign({ page: label }, r));
}
async function run(theme) {
const ctx = await browser.newContext({ viewport: { width: 1280, height: 950 } });
await ctx.addInitScript(t => { try { localStorage.setItem('ls.theme', t); } catch (e) {} }, theme);
const page = await ctx.newPage(); page.on('dialog', d => d.accept());
const T = theme.toUpperCase() + ' ';
// public pages first (no session)
for (const p of ['/', '/join/martbost', '/wall/martbost', '/publishers', '/refuel']) {
await page.goto(LOCAL + p, { waitUntil: 'domcontentloaded' }).catch(() => {}); await page.waitForTimeout(1200);
await sample(page, T + p);
}
// Control Room sign-in
await page.goto(LOCAL + '/links', { waitUntil: 'networkidle' });
if (await page.$('#siEmail')) {
await page.fill('#siEmail', 'qa-contrast-' + theme + '@example.com'); await page.click('#siGo'); // one account per theme: the account value wins over the local one at sign-in
await page.waitForSelector('#siCodeRow:not([hidden])', { timeout: 15000 }); await page.click('#siGo');
await page.waitForSelector('#siEmail', { state: 'detached', timeout: 10000 }).catch(() => {});
await page.waitForTimeout(800);
if (await page.$('#dlg-username')) { await page.fill('#dlg-username', 'qac' + theme); await page.click('#dlgOk'); await page.waitForTimeout(1200); }
await page.evaluate(t => fetch('/api/my/profile', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ theme: t }) }), theme); await page.waitForTimeout(300);
}
for (const sc of ['links', 'ads', 'credits', 'reports', 'team', 'wallet']) {
await page.goto(LOCAL + '/' + sc, { waitUntil: 'networkidle' }).catch(() => {}); await page.waitForTimeout(900);
await page.evaluate(() => document.querySelectorAll('.modal-back,.lgate').forEach(m => m.hidden = true));
const applied = await page.evaluate(() => document.documentElement.getAttribute('data-theme')); if (applied !== theme) results.push({ page: T + '/' + sc, sel: 'THEME', text: 'data-theme=' + applied, fg: '-', bg: '-', ratio: 0, size: 0, weight: 0, large: false, need: 1 });
await sample(page, T + '/' + sc);
}
await page.goto(LOCAL + '/tools', { waitUntil: 'load' }); await page.waitForTimeout(2500);
for (const pn of ['overview', 'promo', 'pipeline', 'line', 'profile']) {
await page.click('.bo-menu [data-pane="' + pn + '"]').catch(() => {}); await page.waitForTimeout(900);
await page.evaluate(() => document.querySelectorAll('.modal-back,.lgate').forEach(m => m.hidden = true));
await sample(page, T + '/tools#' + pn);
}
await page.screenshot({ path: OUT + '/contrast-' + theme + '-tools.png' }).catch(() => {});
await ctx.close();
}
await run('light');
await run('dark');
await browser.close();
const fails = results.filter(r => r.ratio < r.need);
const lines = ['===== THEME CONTRAST ' + new Date().toISOString() + ' =====', 'pairs: ' + results.length + ' | fail: ' + fails.length,
'', 'FAILS (ratio < need):', ...fails.sort((a, b) => a.ratio - b.ratio).map(f => `[fail] ${f.page} :: ${f.sel} "${f.text}" ${f.fg} on ${f.bg} = ${f.ratio}:1 (need ${f.need}, ${f.size}px/${f.weight})`),
'', 'WORST 25 OVERALL:', ...results.slice().sort((a, b) => a.ratio - b.ratio).slice(0, 25).map(f => `${f.ratio}:1 ${f.page} :: ${f.sel} "${f.text}" ${f.fg} on ${f.bg} (${f.size}px/${f.weight}${f.large ? ' large' : ''})`),
'', 'ALL PAIRS:', ...results.map(f => `${f.ratio < f.need ? 'FAIL' : 'ok '} ${f.ratio}:1 ${f.page} :: ${f.sel} "${f.text}" ${f.fg} on ${f.bg} (${f.size}px/${f.weight}${f.large ? ' large' : ''})`)];
fs.writeFileSync(OUT + '/theme-contrast.txt', lines.join('\n') + '\n');
console.log(lines.slice(0, Math.min(lines.length, 60 + fails.length)).join('\n'));
process.exit(fails.length ? 1 : 0);
+51 -12
View File
@@ -4,16 +4,21 @@
// node qa/walk.mjs all -> both
// Env: LIVE (default https://instantadpay.com), LOCAL (default http://127.0.0.1:8796), OUT (report dir),
// PW (playwright package dir; default D:/Projects/MarketingAgent/qa-tester/node_modules/playwright)
// QA_THEME=light|dark|auto (2026-11-01): set localStorage ls.theme before the first navigation so every pane is walked and
// screenshotted in that theme; screenshots get a -<theme> suffix so both sets survive in qa/out
// Exit code 1 when any [bug] finding remains after noise filtering.
import { pathToFileURL } from 'node:url';
import fs from 'node:fs';
const PW = process.env.PW || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright';
const { chromium } = (await import(pathToFileURL(PW + '/index.js').href)).default;
const MODE = process.argv[2] || 'all';
const LIVE = process.env.LIVE || 'https://instantadpay.com';
const LIVE = process.env.LIVE || 'https://linkspin.app'; // this is LinkSpin's harness: the IAP default was a copy-paste leftover (2026-10-29)
const LOCAL = process.env.LOCAL || 'http://127.0.0.1:8796';
const OUT = process.env.OUT || 'qa/out';
fs.mkdirSync(OUT, { recursive: true });
const THEME = ['light', 'dark', 'auto'].includes(process.env.QA_THEME || '') ? process.env.QA_THEME : '';
const SUF = THEME ? '-' + THEME : '';
const themed = async ctx => { if (THEME) await ctx.addInitScript(t => { try { localStorage.setItem('ls.theme', t); } catch (e) {} }, THEME); return ctx; };
const findings = [];
const note = (sev, where, what) => findings.push({ sev, where, what });
const NOISE = /walletconnect|reown|web3modal|coingecko|fonts\.|\/api\/feed\/live|\/api\/auth\/logout|\/api\/me(\?|$)|\/api\/my\/support/; // /api/me aborts when the shell reloads after sign-in; the support desk is not reachable from a local copy
@@ -28,7 +33,7 @@ function watch(page, base) {
if (/status of (400|401|404)/.test(m.text()) || /status of 503/.test(m.text()) && /\/api\/my\/support/.test(loc)) return; // expected API answers surface as console noise
bag.console.push(m.text());
});
page.on('requestfailed', r => { const u = r.url(); if (u.startsWith(base) && !NOISE.test(u)) bag.failed.push(u + ' ' + (r.failure() && r.failure().errorText)); });
page.on('requestfailed', r => { const u = r.url(); const err = (r.failure() && r.failure().errorText) || ''; if (err === 'net::ERR_ABORTED') return; /* a request the page cancelled by navigating away (a poll or a save still in flight): never a server failure (2026-11-01) */ if (u.startsWith(base) && !NOISE.test(u)) bag.failed.push(u + ' ' + err); });
page.on('response', r => { const st = r.status(); const u = r.url(); if (st >= 500 && u.startsWith(base) && !(st === 503 && /\/api\/my\/support/.test(u))) bag.status.push(st + ' ' + u); });
return bag;
}
@@ -46,7 +51,8 @@ async function domChecks(page, label) {
const overflow = document.documentElement.scrollWidth > document.documentElement.clientWidth + 2;
return { brokenImgs, unfilled, overflow, title: document.title };
});
if (r.brokenImgs.length) note('bug', label, 'broken images: ' + r.brokenImgs.slice(0, 3).join(', '));
const imgs = label.startsWith('LOCAL') ? r.brokenImgs.filter(s => !/\/api\/qr\?/.test(s)) : r.brokenImgs; // the qrcode module is not installed in a local checkout, so /api/qr answers 404 there
if (imgs.length) note('bug', label, 'broken images: ' + imgs.slice(0, 3).join(', '));
if (r.unfilled) note('warn', label, r.unfilled + ' element(s) still showing the loading ellipsis');
if (r.overflow) note('warn', label, 'page scrolls horizontally');
return r;
@@ -56,11 +62,11 @@ const hide = page => page.evaluate(() => { document.querySelectorAll('.modal-bac
const browser = await chromium.launch();
if (MODE === 'public' || MODE === 'all') {
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } });
const ctx = await themed(await browser.newContext({ viewport: { width: 1280, height: 900 } }));
const page = await ctx.newPage(); const bag = watch(page, LIVE);
const PUBLIC = ['/', '/ledger', '/contract', '/terms', '/privacy', '/disclaimer', '/wall/martbost', '/join/martbost',
'/join/martbost?v=instant', '/join/martbost?v=adspend', '/join/martbost?v=free', '/join/martbost?v=ledger', '/join/martbost?v=two',
'/admin', '/my', '/shorts', '/nope-404'];
'/traffic-guide', '/refuel', '/conversion-tracking', '/admin', '/my', '/shorts', '/nope-404'];
for (const p of PUBLIC) {
const label = 'LIVE ' + p;
try {
@@ -78,18 +84,18 @@ if (MODE === 'public' || MODE === 'all') {
flush(bag, label); console.log('ok', label, '|', d.title);
} catch (e) { note('bug', label, 'navigation failed: ' + e.message.slice(0, 160)); flush(bag, label); }
}
const m = await browser.newContext({ viewport: { width: 390, height: 844 }, isMobile: true });
const m = await themed(await browser.newContext({ viewport: { width: 390, height: 844 }, isMobile: true }));
const mp = await m.newPage(); const mbag = watch(mp, LIVE);
for (const p of ['/', '/join/martbost?v=instant', '/wall/martbost', '/my']) {
await mp.goto(LIVE + p, { waitUntil: 'domcontentloaded', timeout: 45000 }).catch(e => note('bug', 'LIVE mobile ' + p, e.message));
await mp.waitForTimeout(2000); await domChecks(mp, 'LIVE mobile ' + p); flush(mbag, 'LIVE mobile ' + p);
await mp.screenshot({ path: OUT + '/mobile' + p.replace(/[^a-z0-9]+/gi, '-') + '.png' }).catch(() => {});
await mp.screenshot({ path: OUT + '/mobile' + p.replace(/[^a-z0-9]+/gi, '-') + SUF + '.png' }).catch(() => {});
}
await ctx.close(); await m.close();
}
if (MODE === 'member' || MODE === 'all') {
const ctx = await browser.newContext({ viewport: { width: 1280, height: 950 } });
const ctx = await themed(await browser.newContext({ viewport: { width: 1280, height: 950 } }));
const page = await ctx.newPage(); const bag = watch(page, LOCAL);
page.on('dialog', d => d.accept());
const L = 'LOCAL ';
@@ -101,7 +107,7 @@ if (MODE === 'member' || MODE === 'all') {
flush(bag, L + 'sign-in');
const username = async () => { if (await page.$('#dlg-username')) { await page.fill('#dlg-username', 'qawalker'); await page.click('#dlgOk'); await page.waitForTimeout(1200); } };
// every Control Room screen on the rail
for (const sc of ['links', 'sources', 'pages', 'zones', 'ads', 'credits', 'reports', 'team', 'wallet', 'help']) {
for (const sc of ['links', 'sources', 'pages', 'zones', 'ads', 'credits', 'reports', 'conversions', 'team', 'wallet', 'help']) {
const label = L + '/' + sc;
await page.goto(LOCAL + '/' + sc, { waitUntil: 'networkidle' }); await page.waitForTimeout(800); await username(); await hide(page);
if (await page.$('#siEmail')) note('bug', label, 'asked to sign in again');
@@ -109,7 +115,7 @@ if (MODE === 'member' || MODE === 'all') {
if (!ok && sc === 'help' && !process.env.HELPDESK_URL) note('warn', label, 'support desk not reachable from a local copy (expected)');
else if (!ok) note('bug', label, 'screen did not render (or said could not load)');
await domChecks(page, label); flush(bag, label);
await page.screenshot({ path: OUT + '/cr-' + sc + '.png' }).catch(() => {});
await page.screenshot({ path: OUT + '/cr-' + sc + SUF + '.png' }).catch(() => {});
console.log('ok', label);
}
// the classic panes that live at /tools behind the Control Room tabs
@@ -125,12 +131,45 @@ if (MODE === 'member' || MODE === 'all') {
for (const s of subs) { try { await s.click(); await page.waitForTimeout(500); } catch (e) {} }
if (subs.length) await domChecks(page, label + ' (sub-tabs)');
flush(bag, label);
await page.screenshot({ path: OUT + '/tools-' + pn + '.png' }).catch(() => {});
await page.screenshot({ path: OUT + '/tools-' + pn + SUF + '.png' }).catch(() => {});
console.log('ok', label, 'subtabs:', subs.length);
}
await page.click('.bo-menu [data-pane="promo"]'); await page.waitForTimeout(800);
if (!(await page.$$('#promoPosts .promo-block')).length) note('bug', L + 'promo', 'no post cards rendered');
const chat = await page.$('#chatMenuBtn'); if (chat) { await chat.click(); await page.waitForTimeout(800); await domChecks(page, L + 'messages'); flush(bag, L + 'messages'); await page.keyboard.press('Escape'); }
// theme switch (2026-11-01): the topbar control and the Profile card both exist, a click flips data-theme at once and saves to the account
{
const label = L + 'theme switch';
await page.evaluate(() => document.querySelectorAll('.chat-drawer,.modal-back,.lgate').forEach(m => m.hidden = true)); // the Messages drawer from the step above sits over the topbar
const seg = await page.$('#crTheme [data-theme="dark"]'); const prof = await page.$('#pane-profile .theme-seg [data-theme="light"]');
if (!seg) note('bug', label, 'no Light/Dark/Auto control in the topbar'); if (!prof) note('bug', label, 'no Light/Dark/Auto control on the Profile pane');
if (seg && prof) {
const saved1 = page.waitForResponse(r => r.url().includes('/api/my/profile'), { timeout: 10000 }).catch(() => null); await seg.click(); await saved1; await page.waitForTimeout(300);
const t1 = await page.evaluate(() => [document.documentElement.getAttribute('data-theme'), localStorage.getItem('ls.theme')]);
if (t1[0] !== 'dark' || t1[1] !== 'dark') note('bug', label, 'Dark did not apply (data-theme=' + t1[0] + ', ls.theme=' + t1[1] + ')');
await page.waitForTimeout(600); const acct = await (await page.request.get(LOCAL + '/api/me')).json();
if (acct.theme !== 'dark') note('bug', label, 'account did not store the theme (got ' + acct.theme + ')');
const onProfile = await page.evaluate(() => { const b = document.querySelector('#pane-profile .theme-seg [data-theme="dark"]'); return b && b.classList.contains('on'); });
if (!onProfile) note('bug', label, 'Profile control did not repaint after a topbar change');
await page.click('.bo-menu [data-pane="profile"]'); await page.waitForTimeout(400); const saved2 = page.waitForResponse(r => r.url().includes('/api/my/profile'), { timeout: 10000 }).catch(() => null); await prof.click(); await saved2; await page.waitForTimeout(300);
const t2 = await page.evaluate(() => document.documentElement.getAttribute('data-theme'));
if (t2 !== 'light') note('bug', label, 'Light from the Profile card did not apply (data-theme=' + t2 + ')');
// restore the walk's theme so the remaining screenshots match the set
await page.evaluate(t => { if (t) window.LSTheme.set(t); else { localStorage.removeItem('ls.theme'); window.LSTheme.apply(); } }, THEME);
if (THEME) await page.evaluate(t => fetch('/api/my/profile', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ theme: t }) }).then(r => r.status), THEME); // awaited: a save still in flight would abort on the next navigation
await page.waitForTimeout(400);
}
flush(bag, label); console.log('ok', label);
}
// public home, the member's wall and a campaign (join) page on the local copy, in this theme
for (const p of ['/', '/wall/qawalker', '/join/qawalker', '/join/qawalker?v=instant']) {
const label = L + p;
await page.goto(LOCAL + p, { waitUntil: 'domcontentloaded' }).catch(e => note('bug', label, 'navigation failed: ' + e.message.slice(0, 120))); await page.waitForTimeout(1500);
await domChecks(page, label); flush(bag, label);
await page.screenshot({ path: OUT + '/public' + p.replace(/[^a-z0-9]+/gi, '-').replace(/-$/, '') + SUF + '.png', fullPage: p === '/' }).catch(() => {});
console.log('ok', label);
}
await page.goto(LOCAL + '/tools', { waitUntil: 'load' }); await page.waitForTimeout(1500);
// the messages drawer can sit over the footer, so fire the link's own click handler
if (await page.$('#logoutLink')) { await page.evaluate(() => document.getElementById('logoutLink').click()); await page.waitForTimeout(1500); }
await page.goto(LOCAL + '/links', { waitUntil: 'networkidle' });
@@ -145,7 +184,7 @@ if (MODE === 'member' || MODE === 'all') {
const vis = await page.evaluate(id => { const el = document.getElementById('pane-' + id); return el && !el.hidden && el.offsetHeight > 40; }, pn);
if (!vis) note('bug', label, 'pane did not render');
await domChecks(page, label); flush(bag, label);
await page.screenshot({ path: OUT + '/admin-' + pn + '.png' }).catch(() => {});
await page.screenshot({ path: OUT + '/admin-' + pn + SUF + '.png' }).catch(() => {});
console.log('ok', label);
}
await page.click('.bo-menu [data-pane="house"]'); await page.waitForTimeout(500);
+274
View File
@@ -0,0 +1,274 @@
// Campaign refill notices on LinkSpin (Marty approved the Fuel Your Offers build, 2026-10-24). Copied from InstantAdPay's
// refill.js: until now a LinkSpin ad that spent its budget simply went dark, and the only sign was the "Running low" /
// "Out of credits" light on the Ads screen, which nobody sees unless they open it.
//
// Three moments, ONE email + ONE on-site notice per owner per pass (never one per campaign):
// low an active campaign past refillLowPct (80%) of its budget delivered
// out a campaign at status 'out'
// idle 7 days after an unanswered 'out' notice, the owner still holds 100+ credits and has nothing running
// Each message names every ad and what it delivered, then either "relaunch now, no purchase needed" (100+ credits
// free) or the buy link, then the packages. Email skips anyone who unsubscribed (drip); the on-site notice always goes.
//
// Every send is recorded and watched for 45 days for what the owner did next: a package bought on any of their
// positions (purchase), a campaign created after the send (relaunch), a named stopped ad back to active (resumed),
// a named ad's budget raised (topup). That is the conversion history in DATA_DIR/refill.json.
//
// Deploy overlap: two copies of the app run for ~30 s on each deploy. Every send is claimed first (marks.js:
// event_marks in MySQL, or an exclusive file on the shared volume), so only one copy writes to a person.
//
// Settings (siteConfig): refillNotices '1'|'0' (default on), refillLowPct (80).
// Hook: X.streakLine(owner) -> { text, html } | null adds the member's refuel-streak line to the bonus block (stage 2).
'use strict';
const fs = require('fs');
const path = require('path');
let X = {}, FILE = null, S = null;
const DAY = 86400000;
const LOOKBACK = 45 * DAY;
const MAX_PER_TICK = 25;
const IDLE_AFTER = 7 * DAY;
const IDLE_MIN_CREDITS = 100;
// LinkSpin packages when the chain catalog cannot be read (one credit = one cent: 100 credits per dollar on every size)
const FALLBACK_PACKS = [10, 25, 50, 100, 250, 500].map(p => ({ price: p, credits: p * 100 }));
function init(opts) { X = opts; FILE = path.join(opts.dataDir, 'refill.json'); S = load(); }
function load() { try { const s = JSON.parse(fs.readFileSync(FILE, 'utf8')); s.sent = s.sent || {}; s.records = s.records || {}; s.seq = s.seq || 0; return s; } catch (e) { return { sent: {}, records: {}, seq: 0 }; } }
function save() { try { const tmp = FILE + '.' + process.pid + '.tmp'; fs.writeFileSync(tmp, JSON.stringify(S)); fs.renameSync(tmp, FILE); } catch (e) {} }
function cfg() {
const c = (X.siteConfig && X.siteConfig()) || {};
return {
on: String(c.refillNotices == null ? '1' : c.refillNotices) === '1',
lowPct: Math.min(99, Math.max(50, Number(c.refillLowPct) || 80)),
};
}
const SITE = () => String(X.siteUrl || 'https://linkspin.app').replace(/\/+$/, '');
const n0 = v => (typeof v === 'number' && isFinite(v) ? v : 0);
const money = n => Number(n || 0).toLocaleString('en-US');
// LinkSpin's admin list (ads.pubC) already folds accrued into spent
const delivered = c => n0(c.spent);
const unit = c => c.type === 'video' ? 'watches' : 'impressions';
const key = (id, state) => id + ':' + state;
const esc = s => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
const nameOf = c => c.name || c.title || ('campaign #' + c.id);
// the packages, from the chain catalog (cached an hour), so the list is never hand-typed
let packCache = { at: 0, list: null };
async function packs() {
if (packCache.list && Date.now() - packCache.at < 3600000) return packCache.list;
let list = null;
try {
const cat = X.chain && X.chain.catalog ? await X.chain.catalog() : null;
const rows = (cat && (cat.products || cat)) || [];
list = rows.filter(p => p && p.priceCents > 0 && p.creditAmount > 0).map(p => ({ price: p.priceCents / 100, credits: Number(p.creditAmount) }))
.sort((a, b) => a.price - b.price);
} catch (e) { list = null; }
if (!list || !list.length) list = FALLBACK_PACKS;
packCache = { at: Date.now(), list };
return list;
}
async function streakLine(owner) {
if (typeof X.streakLine !== 'function') return null;
try { return await X.streakLine(owner); } catch (e) { return null; }
}
async function ladderText(owner) {
const rows = (await packs()).map(p => ' $' + money(p.price) + ' -> ' + money(p.credits) + ' credits');
const sl = await streakLine(owner);
return 'LinkSpin packages, and what each one adds to your balance:\n\n' + rows.join('\n')
+ '\n\nA credit is one cent of ad delivery. Packages of $25 and up also unlock Banner Spin.'
+ (sl && sl.text ? '\n\n' + sl.text : '');
}
async function ladderHtml(owner) {
const rows = (await packs()).map(p => '<tr><td style="padding:6px 14px 6px 0"><b>$' + money(p.price) + '</b></td><td style="padding:6px 0">' + money(p.credits) + ' credits</td></tr>').join('');
const sl = await streakLine(owner);
return '<p><b>LinkSpin packages, and what each one adds to your balance:</b></p><table style="border-collapse:collapse">' + rows + '</table>'
+ '<p style="color:#556">A credit is one cent of ad delivery. Packages of $25 and up also unlock Banner Spin.</p>'
+ (sl && sl.html ? '<p>' + sl.html + '</p>' : '');
}
function lineOf(c) {
const bits = [money(Math.round(delivered(c))) + ' of ' + money(Math.round(n0(c.budget))) + ' credits delivered'];
if (n0(c.imps)) bits.push(money(n0(c.imps)) + ' ' + unit(c));
if (n0(c.clicks)) bits.push(money(n0(c.clicks)) + ' clicks');
return { name: nameOf(c), type: c.type || 'ad', bits };
}
async function compose(owner, list, state, credits) {
const many = list.length > 1;
const first = nameOf(list[0]);
const totalImps = list.reduce((n, c) => n + n0(c.imps), 0);
const totalClicks = list.reduce((n, c) => n + n0(c.clicks), 0);
const canRelaunch = credits >= IDLE_MIN_CREDITS;
const subject = state === 'idle' ? money(Math.round(credits)) + ' credits are sitting idle on your LinkSpin account'
: state === 'out' ? (many ? 'Your LinkSpin ads have finished delivering' : 'Your LinkSpin ad "' + first + '" has finished delivering')
: (many ? 'Your LinkSpin ads are nearly out of credits' : 'Your LinkSpin ad "' + first + '" is nearly out of credits');
const opener = state === 'idle'
? 'A week ago ' + (many ? 'your ads' : 'your ad "' + first + '"') + ' finished delivering, and nothing has run since. Your credits are still there, and nobody is seeing your link while they sit.'
: state === 'out'
? (many ? 'Your ' + list.length + ' campaigns have spent their full budget and stopped. They delivered everything you paid for.' : 'That campaign spent its full budget and stopped. It delivered everything you paid for.')
: (many ? 'Your ' + list.length + ' campaigns are close to spending their full budget. When they do, they stop.' : 'That campaign is close to spending its full budget. When it does, it stops.');
const totals = (totalImps || totalClicks) ? 'Between them so far: ' + money(totalImps) + (list.every(c => c.type === 'video') ? ' watches' : ' impressions') + ' and ' + money(totalClicks) + ' clicks.' : '';
const adsUrl = SITE() + '/ads', buyUrl = SITE() + '/credits';
const next = state === 'idle'
? money(Math.round(credits)) + ' credits are ready to run. A banner or text ad takes a minute to set up and starts showing the moment you launch it, no purchase needed: ' + adsUrl
: canRelaunch
? 'You still have ' + money(Math.round(credits)) + ' credits free, which is enough to put an ad back up right now without buying anything. Open Ads and start one: ' + adsUrl
: 'Your free balance is down to ' + money(Math.round(credits)) + ' credits, so the next campaign needs a package first: ' + buyUrl;
const lines = list.map(lineOf);
const ladderT = await ladderText(owner), ladderH = await ladderHtml(owner);
const tail = 'Every package pays your sponsor line in the same on-chain transaction. Ad credits buy delivery only.';
const text = [opener, totals, next].filter(Boolean).join('\n\n')
+ '\n\nWhat each one did:\n' + lines.map(l => ' "' + l.name + '" (' + l.type + '): ' + l.bits.join(', ')).join('\n')
+ '\n\n' + ladderT + '\n\n' + tail;
const html = '<p>' + esc(opener) + '</p>' + (totals ? '<p>' + esc(totals) + '</p>' : '')
+ '<p>' + esc(next).replace(/(https:\/\/[^\s]+)/g, '<a href="$1">$1</a>') + '</p>'
+ '<p><b>What each one did:</b></p><ul>' + lines.map(l => '<li>' + esc(l.name) + ' (' + esc(l.type) + '): ' + esc(l.bits.join(', ')) + '</li>').join('') + '</ul>'
+ ladderH + '<p style="color:#556">' + tail + '</p>';
return { subject, text, html };
}
// ---- the pass -------------------------------------------------------------------------------
let running = false;
async function tick() {
if (running || !cfg().on) return { sent: 0 };
running = true;
try {
S = load(); // the other copy of the app may have written since we last looked
const c = cfg();
const all = await X.ads.adminList(5000);
const mine = all.filter(x => !x.house && x.owner && x.owner !== X.houseOwner && x.type !== 'game');
const due = new Map();
for (const cm of mine) {
const b = n0(cm.budget); if (b <= 0) continue;
let state = null;
if (cm.status === 'out') state = 'out';
else if (cm.status === 'active' && delivered(cm) >= b * (c.lowPct / 100)) state = 'low';
if (!state) continue;
if (S.sent[key(cm.id, state)]) continue;
if (state === 'low' && S.sent[key(cm.id, 'out')]) continue;
const g = due.get(cm.owner) || {}; (g[state] = g[state] || []).push(cm); due.set(cm.owner, g);
}
let sent = 0;
for (const [owner, byState] of due) {
if (sent >= MAX_PER_TICK) break;
for (const state of ['out', 'low']) {
const list = byState[state]; if (!list || !list.length) continue;
const ok = await notify(owner, list, state).catch(e => { console.error('refill notify', e.message); return false; });
if (ok) sent++;
break; // one state per owner per pass: "out" is the louder message
}
}
await checkConversions(all);
sent += await followUps(all, sent);
save();
if (sent) console.log('refill notices sent:', sent);
return { sent };
} finally { running = false; }
}
async function followUps(all, alreadySent) {
const now = Date.now(); let sent = 0;
const due = Object.values(S.records).filter(r => r.state === 'out' && !r.converted && !r.followUp && now - r.ts >= IDLE_AFTER && now - r.ts < LOOKBACK);
for (const r of due) {
if (alreadySent + sent >= MAX_PER_TICK) break;
const live = all.some(c => c.owner === r.owner && !c.house && c.status === 'active');
if (live) { r.followUp = 'running'; continue; }
let credits = 0; try { credits = await X.creditsFor(r.owner); } catch (e) {}
if (credits < IDLE_MIN_CREDITS) { r.followUp = 'nocredits'; continue; }
const list = r.campaigns.map(x => all.find(c => c.id === x.id) || x);
const ok = await notify(r.owner, list, 'idle', r.id).catch(e => { console.error('refill follow-up', e.message); return false; });
r.followUp = ok ? S.seq : 'claimed';
if (ok) sent++;
}
return sent;
}
async function notify(owner, list, state, parentId) {
// claim before anything goes out: one copy of the app per message, ever
const claimKey = 'refill:' + (state === 'idle' ? 'idle:' + parentId : list.map(c => c.id).sort((a, b) => a - b).join(',') + ':' + state);
const mine = X.marks ? await X.marks.claim(claimKey) : true;
if (!mine) { if (state !== 'idle') for (const cm of list) S.sent[key(cm.id, state)] = S.sent[key(cm.id, state)] || -1; return false; }
const acct = await X.accounts.byEmail(owner); if (!acct) return false;
const stopped = X.drip && X.drip.isUnsubscribed ? await X.drip.isUnsubscribed(owner).catch(() => false) : false;
let credits = 0; try { credits = await X.creditsFor(owner); } catch (e) {}
const m = await compose(owner, list, state, credits);
try { await X.message(owner, m.subject, m.html); } catch (e) { console.error('refill inbox', e.message); }
const canMail = !stopped && X.mailer && X.mailer.hasKey();
if (canMail) {
const foot = X.drip && X.drip.unsubUrl ? '\n\nStop these emails: ' + X.drip.unsubUrl(owner) : '';
try { await X.mailer.send(owner, m.subject, m.text + foot + '\n\nLinkSpin'); } catch (e) { console.error('refill mail', e.message); }
}
const rec = {
id: ++S.seq, owner, state, ts: Date.now(), emailed: !!canMail, unsubscribed: !!stopped,
campaigns: list.map(c => ({ id: c.id, name: c.name || null, type: c.type || null, budget: Math.round(n0(c.budget)), delivered: Math.round(delivered(c)), imps: n0(c.imps), clicks: n0(c.clicks) })),
creditsAtSend: Math.round(credits), memberId: acct.memberId || 0, converted: null, parent: parentId || null,
};
if (state !== 'idle') for (const cm of list) S.sent[key(cm.id, state)] = rec.id;
S.records[rec.id] = rec;
save();
return true;
}
// ---- did anything come of it? ---------------------------------------------------------------
async function checkConversions(allIn) {
const open = Object.values(S.records).filter(r => !r.converted && Date.now() - r.ts < LOOKBACK);
if (!open.length) return;
const all = allIn || await X.ads.adminList(5000);
const evs = (X.chain.recentEvents(1e9) || []).filter(e => e.type === 'Purchase');
for (const r of open) {
const since = r.ts;
let ids = [r.memberId].filter(Boolean);
try { const ps = await X.accounts.positions(r.owner); ids = [...new Set([...ids, ...ps.map(p => p.memberId).filter(Boolean)])]; } catch (e) {}
const buy = evs.find(e => ids.includes(Number(e.buyerId)) && norm(e) > since);
if (buy) { mark(r, 'purchase', { cents: n0(buy.priceCents), tx: buy.tx || null }); continue; }
const fresh = all.find(c => c.owner === r.owner && !c.house && n0(c.created) > since);
if (fresh) { mark(r, 'relaunch', { campaignId: fresh.id, name: fresh.name || null }); continue; }
if (r.state === 'out' || r.state === 'idle') {
const revived = all.find(c => c.status === 'active' && r.campaigns.some(x => x.id === c.id) && delivered(c) < n0(c.budget));
if (revived) { mark(r, 'resumed', { campaignId: revived.id, name: revived.name || null }); continue; }
}
const topped = all.find(c => { const was = r.campaigns.find(x => x.id === c.id); return was && n0(c.budget) > was.budget; });
if (topped) mark(r, 'topup', { campaignId: topped.id, added: Math.round(n0(topped.budget) - r.campaigns.find(x => x.id === topped.id).budget) });
}
}
const norm = e => { let t = n0(e.ts); if (t < 1e12) t *= 1000; return t; };
function mark(r, kind, detail) {
r.converted = { kind, at: Date.now(), hours: Math.round((Date.now() - r.ts) / 3600000), detail: detail || null };
console.log('refill converted:', kind, 'after', r.converted.hours + 'h');
}
// ---- what the admin sees --------------------------------------------------------------------
function stats() {
S = load();
const recs = Object.values(S.records).sort((a, b) => b.ts - a.ts);
const by = { out: { sent: 0, converted: 0 }, low: { sent: 0, converted: 0 }, idle: { sent: 0, converted: 0 } };
const kinds = {}; let revenueCents = 0; const hours = [];
for (const r of recs) {
const b = by[r.state] || (by[r.state] = { sent: 0, converted: 0 });
b.sent++;
if (r.converted) {
b.converted++; kinds[r.converted.kind] = (kinds[r.converted.kind] || 0) + 1; hours.push(r.converted.hours);
if (r.converted.kind === 'purchase') revenueCents += n0(r.converted.detail && r.converted.detail.cents);
}
}
const conv = recs.filter(r => r.converted).length;
return {
enabled: cfg().on, lowPct: cfg().lowPct,
totals: { sent: recs.length, emailed: recs.filter(r => r.emailed).length, converted: conv, ratePct: recs.length ? Math.round(conv / recs.length * 100) : 0,
purchasesUsd: Math.round(revenueCents / 100), medianHours: hours.length ? hours.sort((a, b) => a - b)[Math.floor(hours.length / 2)] : null },
byState: by, byKind: kinds,
recent: recs.slice(0, 60).map(r => ({ id: r.id, owner: r.owner, state: r.state, at: r.ts, emailed: r.emailed, credits: r.creditsAtSend,
campaigns: r.campaigns.length, names: r.campaigns.map(c => c.name || ('#' + c.id)).slice(0, 4), imps: r.campaigns.reduce((n, c) => n + c.imps, 0), converted: r.converted })),
};
}
function resetConversions(kinds) {
S = load();
const want = new Set(kinds && kinds.length ? kinds : ['relaunch']);
let n = 0;
for (const r of Object.values(S.records)) if (r.converted && want.has(r.converted.kind)) { r.converted = null; n++; }
save();
return { cleared: n };
}
module.exports = { init, tick, stats, resetConversions, compose, _packs: packs };

Some files were not shown because too many files have changed in this diff Show More