1aec9caf6c
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>
54 lines
3.8 KiB
HTML
54 lines
3.8 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">
|
|
<title>Shorts | InstantAdPay</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="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=20261101th">
|
|
<style>
|
|
html,body{height:100%;margin:0;overflow:hidden;background:#000}
|
|
/* the Shorts stage is a black video player in both themes, so its text keeps the dark ink set whatever data-theme says (2026-11-01) */
|
|
.sh{--ink:#eef7f3;--muted:#8ba69c;--mint:#43e8c3;--mint-ink:#03211a;--mint-hi:#8ffbe3;--amber:#ffb238;--panel-solid:#0b1512;--line:rgba(84,150,128,.16);--line-strong:rgba(84,150,128,.36);--mint-line-2:rgba(67,232,195,.6);--mint-soft:rgba(67,232,195,.09)}
|
|
.sh{position:fixed;inset:0;display:flex;flex-direction:column;background:#000;color:var(--ink,#e8fff7)}
|
|
.sh-bar{flex:0 0 auto;display:flex;align-items:center;gap:12px;padding:10px 16px;background:var(--panel-solid,#071a12);
|
|
border-bottom:1px solid var(--line,rgba(67,232,195,.18));flex-wrap:wrap}
|
|
.sh-brand{font-family:var(--disp,sans-serif);font-weight:800;font-size:15px}
|
|
.sh-brand em{color:var(--mint,#43e8c3);font-style:normal}
|
|
.sh-stat{margin-left:auto;font-family:var(--mono,monospace);font-size:13px;color:var(--muted,#8ba69c)}
|
|
.sh-stage{flex:1;display:flex;align-items:center;justify-content:center;position:relative;min-height:0}
|
|
.sh-video{max-height:100%;max-width:min(100%,440px);width:100%;background:#000;border-radius:0}
|
|
.sh-over{position:absolute;left:0;right:0;bottom:0;padding:18px;background:linear-gradient(transparent,rgba(0,0,0,.75));
|
|
display:flex;flex-direction:column;gap:10px}
|
|
.sh-title{font-weight:700}
|
|
.sh-timer{font-family:var(--mono,monospace);font-size:13px;color:var(--amber,#ffb238)}
|
|
.sh-row{display:flex;gap:10px;flex-wrap:wrap}
|
|
.sh-msg{padding:30px;text-align:center;color:var(--muted,#8ba69c);font-size:16px}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="sh">
|
|
<div class="sh-bar">
|
|
<span class="sh-brand">Instant<em>AdPay</em> · Shorts</span>
|
|
<span class="sh-stat" id="shStat">…</span>
|
|
<a class="btn small sec" href="/my#earn">Done</a>
|
|
</div>
|
|
<div class="sh-stage" id="shStage">
|
|
<div class="sh-msg" id="shMsg">Loading your first short…</div>
|
|
<video class="sh-video" id="shVideo" playsinline hidden></video>
|
|
<div class="sh-over" id="shOver" hidden>
|
|
<div class="sh-title" id="shTitle"></div>
|
|
<div class="sh-timer" id="shTimer"></div>
|
|
<div class="sh-row">
|
|
<a class="btn small" id="shCta" target="_blank" rel="noopener nofollow" hidden>Learn more</a>
|
|
<button class="btn small sec" id="shNext" type="button" hidden>Next short →</button>
|
|
</div>
|
|
<a href="#" id="shReport" class="sh-report">⚠ report this short</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="/assets/shorts.js?v=20260916a"></script>
|
|
</body>
|
|
</html>
|