Files
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

42 lines
2.6 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>Transaction | 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@500;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=ls20261101t">
</head>
<body>
<div id="nav"></div>
<section>
<div class="wrap" style="max-width:860px">
<div class="sectionhead" style="text-align:left">
<h2>One transaction, <em>fully public</em></h2>
<p>Pulled straight from the chain this site settles on. Every field below is read from the node,
not from our database.</p>
</div>
<div class="card">
<p><span class="badge" id="txStatus">looking it up…</span>
<span class="small muted" id="txChain"></span></p>
<p class="mono small" id="txHash" style="overflow-wrap:anywhere"></p>
<div class="tablewrap"><table id="txTable" hidden>
<tbody></tbody>
</table></div>
<p class="small muted" id="txHint" hidden>Nothing under that hash on this chain yet. If the
transaction just happened, give the next block a moment and refresh.</p>
</div>
<div class="card" id="evCard" hidden>
<h3>What this transaction did</h3>
<p class="muted small">The contract events inside it, decoded to plain language.</p>
<div class="feed" id="evFeed"></div>
</div>
<p><a href="/ledger">← Back to the live ledger</a> · <a href="/contract">Read the contract review</a></p>
</div>
</section>
<script src="/assets/common.js?v=20261101t"></script>
<script src="/assets/tx.js?v=20260906m"></script>
</body>
</html>