Files
linkspin/public/traffic-guide.html
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

72 lines
5.4 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>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>