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>
This commit is contained in:
+9
-8
@@ -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 | InstantAdPay</title>
|
||||
<meta name="description" content="Which wallets to use with InstantAdPay, how to set one up, and how to buy POL with a card through MoonPay. 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")||"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="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
|
||||
<link rel="icon" type="image/png" href="/logo-icon.png">
|
||||
<link rel="stylesheet" href="/assets/site.css?v=20260910j">
|
||||
<link rel="stylesheet" href="/assets/site.css?v=20261101th">
|
||||
<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(67,232,195,.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(67,232,195,.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(67,232,195,.12);border:1px solid rgba(67,232,195,.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-2);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}
|
||||
@@ -122,7 +123,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/welcome.js?v=20260923b"></script>
|
||||
<script src="/assets/common.js?v=20261101th"></script><script src="/assets/welcome.js?v=20261101th"></script>
|
||||
<script src="/assets/wallets.js?v=20260911b"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user