Files
instantadpay/public/refuel.html
T
martbost 1aec9caf6c Theme switch: auto | light | dark, stored in localStorage iap.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, dark everywhere on InstantAdPay; 1 = follow the device). It mirrors LinkSpin's themehead.js with only the storage key (iap.theme), the global (window.IAPTheme) and the event name (iap-theme) changed. The script sets data-theme on <html> from iap.theme (auto follows prefers-color-scheme and tracks changes live). tools/stamp-theme-head.cjs writes it into all 28 static site.css pages before the first stylesheet with data-theme-base="dark" on <html>; the blog, the 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 (without it the script is silently blocked).

Account side: accounts.theme (JSON store and MySQL, alterSafe theme VARCHAR(8)), in the public account JSON and /api/me; POST /api/my/profile {theme} rides the existing profile save path, never touches the username, and does not tap changed() (appearance is not mirrored to LinkSpin, same as LinkSpin's side). common.js owns the client side for every page: paints every .theme-seg, saves a click to the account, and IAP.themeSync lets the account value win over the local one at sign-in (a local choice is pushed up when the account has none yet); my.js calls it from render(). The Light / Dark / Auto segmented control sits in the member-area header (#boTheme) and in a Profile pane "Appearance" card, and in the admin header for the same session. shorts.html pins the dark ink set on its black video stage; view.html stops reading an undefined --bg. ?v= tags bumped on every changed stylesheet and script (20261101th): site.css on all 28 pages, common.js on 25, welcome.js on 17, support.js, my.js, engine-room.js, admin.js, admin-kits.js, blog-page.js.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 11:55:06 -06:00

44 lines
4.1 KiB
HTML

<!doctype html>
<html lang="en" data-theme-base="dark">
<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>Refuel · InstantAdPay verified visit</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.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.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="/assets/site.css?v=20261101th">
<style>
html,body{height:100%}
body{margin:0;display:flex;flex-direction:column;background:#0b1020;color:#e6edf3}
.rf-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;background:#0E1730;border-bottom:1px solid #22304f;font-size:13px}
.rf-bar b{color:#fff}.rf-bar .rf-url{color:#8fa3c4;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rf-frame{flex:1;min-height:0;background:#fff;position:relative}
.rf-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.rf-dock{padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px));background:#0E1730;border-top:1px solid #22304f}
.rf-row{display:grid;grid-template-columns:48px 1fr;gap:12px;align-items:center}
.rf-ring{width:48px;height:48px;border-radius:50%;background:conic-gradient(#FF6A1A var(--p,0%),#22304f 0);display:grid;place-items:center;font:800 13px ui-monospace,Menlo,Consolas,monospace;position:relative}
.rf-ring:after{content:"";position:absolute;inset:5px;border-radius:50%;background:#0E1730}.rf-ring span{position:relative;z-index:1}
.rf-dock p{margin:0;font-size:13px;color:#afc0d8}.rf-dock p b{color:#fff}
.rf-opts{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.rf-opts button{font-size:24px;padding:8px 14px;border-radius:10px;border:1px solid #22304f;background:#141F3A;cursor:pointer}
.rf-btn{display:block;width:100%;margin-top:10px;padding:13px;border-radius:12px;border:0;font:800 15px system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#fff;background:linear-gradient(180deg,#FFB088,#FF6A1A 55%,#D44E00);cursor:pointer}
.rf-btn[disabled]{opacity:.45}
.rf-btn.ghost{background:transparent;border:1px solid #22304f;color:#afc0d8;font-size:13px;padding:10px}
.rf-msg{padding:24px 18px;text-align:center}
.rf-msg h1{font-size:22px;margin:0 0 8px}.rf-msg p{color:#afc0d8}
a.rf-open{color:#8FF0FF;font-size:12px}
</style>
</head>
<body>
<div class="rf-bar"><span>InstantAdPay · <b>verified visit</b> · refuel for Drip Runner</span><span class="rf-url" id="rfUrl"></span></div>
<div class="rf-frame" id="rfFrame"></div>
<div class="rf-dock" id="rfDock">
<div class="rf-row"><div class="rf-ring" id="rfRing"><span id="rfN">…</span></div><div><p><b id="rfTitle">Loading the sponsor page…</b></p><p id="rfHint">Stay on this page. The timer only runs while it is in front.</p><a class="rf-open" id="rfOpen" href="#" target="_blank" rel="noopener" hidden>Page not showing? Open it in a new tab (the timer keeps running here).</a></div></div>
<div id="rfCheck" hidden><p id="rfPrompt" style="margin-top:10px"></p><div class="rf-opts" id="rfOpts"></div></div>
<button class="rf-btn" id="rfDone" type="button" disabled>Waiting…</button>
<button class="rf-btn ghost" id="rfBack" type="button" hidden>Back to the game</button>
</div>
<script src="/assets/refuel.js?v=20261029ww"></script>
</body>
</html>