Files
linkspin/public/ads.html
T
martbost e545343fe0 Michael Camire fixes + hub shells in the tank (Marty 2026-11-14, LinkSpin Support)
1. Top-up across positions: an ad burns from ONE position, and topUpCampaign only looked at the ad's
   own position (or the main one when the list row had no memberId), so credits bought on a linked
   position could never top up the ad. Ported from InstantAdPay 2026-09-27 (Jim Watts): the ad's real
   member id is read from the campaign row; when it cannot cover, the refusal names where the free
   credits are and offers switchOptions; with the member's yes (switchTo, only a position on the
   account) moveFunding settles what the ad already ran up on the OLD position, moves the ad, then
   tops up. Ads screen asks in-page (own dialog) and retries. Create already had the largest-position guard.
2. Toasts: errors stay until closed (close button, role=alert), other notes 3.5 to 9 s by length.
3. Banner Spin per-banner clicks: his 3 clicks were all unmatched (no view on record for that browser),
   so they landed on the fallback row and every banner said 0. Click matching now also tries the same
   connection (daily-salted IP-only hash) when the browser key finds nothing (mail/exchange app view,
   click opened in the phone browser), view notes last 60 min instead of 15, and the stats split
   'Fallback shown' from 'Clicks not tied to a banner' so the rows add up to the total. History is not
   backfilled: views were never stored per visitor, so old clicks cannot be tied reliably.
4. Holding tank: hub-made waiting accounts with no sponsor are in the tank (waiting, rescue, readyTick
   read listAll with { shells: true }; 'hub-shell' no longer holds anyone back). Locked / sponsored /
   unknown, grace, 2-adoption cap unchanged; readyTick still never switches a shell on;
   accounts.listAll default unchanged (mailings skip shells).

Assets: cr.css, cr-shell.js, ads-screen.js ?v=20261114tu, banner-spin.js ?v=20261114bc.
QA: walk member 0 bugs (36 ok), netconv 57/57, networksso ALL PASSED, tank-hold all passed (new hub
shell part), profile policy 16/16, new topup-positions 8/8, new bannerspin-attrib 7/7, bannerspin e2e
75/75, hubsync 15 checks, tank-cap 15/15, sponsorfollow 30/30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 11:59:38 -06:00

84 lines
8.7 KiB
HTML

<!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>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=20261114tu">
<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) */
.body{padding:16px 24px;display:grid;gap:16px;container:adsbody/inline-size}
.two{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}
.side{display:grid;gap:16px;align-content:start}
.cl{container:camptbl/inline-size}
.cl .hd,.cl .rw{grid-template-columns:minmax(150px,1.4fr) minmax(110px,1fr) 104px 64px 56px 96px 128px}
/* side cards drop under the table once beside it the table would fall under its seven-column width */
@container adsbody (max-width:1180px){.two{grid-template-columns:minmax(0,1fr)}.side{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}}
/* narrower than seven columns fit: each campaign becomes a two-column card */
@container camptbl (max-width:820px){.cl .hd{display:none}.cl .rw{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.cl .rw > :first-child{grid-column:1/-1}.cl .rw > .r{text-align:left}.cl .rw > :nth-child(4)::before{content:"views "}.cl .rw > :nth-child(5)::before{content:"clicks "}.cl .rw > .r::before{color:var(--muted);font:700 10.5px var(--mono);letter-spacing:.08em;text-transform:uppercase}}
.cl .rw > *{min-width:0;overflow-wrap:anywhere}
.thumb{width:72px;height:36px;object-fit:contain;background:var(--inset);border:1px solid var(--chrome-line);border-radius:4px;display:block}
.bar{margin-top:6px}
.field{width:100%;box-sizing:border-box}
#composer[hidden]{display:none}
.where{display:grid;gap:9px}.where div{display:flex;gap:10px;align-items:flex-start}.where b{min-width:60px;color:var(--accent-hi);font:700 11px var(--mono);letter-spacing:.06em;text-transform:uppercase;padding-top:2px}
[data-st="queued"]{--st:#7c3aed} [data-st="cancelled"]{--st:#94a3b8} /* prepaid login-slot line (2026-10-23) */
@media (max-width:900px){.body{padding:12px 16px}}
</style>
</head>
<body>
<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>
<div class="muted" id="typeNote"></div>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:12px">
<label class="lbl">Name<input class="field" id="fName" maxlength="60" placeholder="Fall promo"></label>
<label class="lbl">Budget, credits<input class="field mono" id="fBudget" type="number" min="10" step="1" value="50"></label>
<label class="lbl">Daily cap, credits (optional)<input class="field mono" id="fCap" type="number" min="10" step="1" placeholder="none"></label>
<label class="lbl">Show to<select class="field" id="fGeo"><option value="">Everyone</option><option value="1">Tier 1 countries</option><option value="1,2">Tier 1 and 2</option></select></label>
<label class="lbl">Audience<select class="field" id="fAud"><option value="">Everyone</option></select></label>
<label class="lbl" id="fAudModeRow" hidden>Audience rule<select class="field" id="fAudMode"><option value="include">Show only to them</option><option value="exclude">Never show to them</option></select></label>
</div>
<div style="display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:12px;margin-top:12px" class="tgt">
<label class="lbl">Where the click goes<input class="field mono" id="fTarget" placeholder="https://"></label>
<label class="lbl">Or a spin link<select class="field" id="fSpin"><option value="">pick a spin</option></select></label>
</div>
<div id="bannerFields" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:12px">
<label class="lbl">Size<select class="field" id="fSize"></select></label>
<label class="lbl">Image URL<input class="field mono" id="fImage" placeholder="https://"></label>
<label class="lbl">Or upload (PNG, JPG, WebP, GIF up to 3 MB)<input class="field" id="fFile" type="file" accept="image/png,image/jpeg,image/webp,image/gif"></label>
</div>
<div id="textFields" hidden style="display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:12px;margin-top:12px">
<label class="lbl">Headline (60)<input class="field" id="fTitle" maxlength="60"></label>
<label class="lbl">One line (140)<input class="field" id="fBody" maxlength="140"></label>
</div>
<div id="prev" style="margin-top:12px"></div>
<div style="display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;align-items:center"><button class="btn pri" type="button" id="fGo">Launch</button><button class="btn ghost" type="button" id="fCancel">Cancel</button><span class="led" id="fCost"></span></div>
</div>
<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>
</div>
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261114tu"></script>
<script src="/assets/ads-screen.js?v=20261114tu"></script>
<script src="/assets/fuel.js?v=20261113sso"></script>
<script src="/assets/engine-room.js?v=20261113sso"></script>
</body>
</html>