From b4a13f77a3668530041dc3f4d0b39149e779be81 Mon Sep 17 00:00:00 2001 From: SamSpring Date: Sun, 18 Oct 2026 01:49:06 +0300 Subject: [PATCH] Add Phosphor Green website theme toggle --- site/index.html | 18 ++++++++++++------ site/site.js | 22 ++++++++++++++++++++++ site/styles.css | 17 +++++++++++++++++ 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/site/index.html b/site/index.html index 3893d30..8ad3d02 100644 --- a/site/index.html +++ b/site/index.html @@ -8,15 +8,21 @@ Retrolemetry — A retro console for your Mac - - + + + +
Retrolemetry - +
@@ -27,11 +33,11 @@

Your tiny screen,
alive.

macOS 14+ · Apple silicon & Intel · Free & open source

The first public download is in preparation. Source builds are available on GitHub.

-
Retrolemetry showing CPU, memory, disk, uptime, load and network readings in cyan and magenta.
Live System Metrics
+
Retrolemetry showing CPU, memory, disk, uptime, load and network readings in cyan and magenta.
Live System Metrics

Real readings

CPU, memory, disk, network, GPU counters, uptime and optional battery flow—shown locally without analytics.

diff --git a/site/site.js b/site/site.js index a7e9e91..1b1f5f5 100644 --- a/site/site.js +++ b/site/site.js @@ -1,4 +1,26 @@ "use strict"; +const themeToggle = document.querySelector("#theme-toggle"); +const themeLabel = document.querySelector("#theme-label"); +function applyTheme(theme) { + const isPhosphor = theme === "phosphor"; + document.documentElement.dataset.theme = isPhosphor ? "phosphor" : "synthwave"; + themeLabel.textContent = isPhosphor ? "Synthwave" : "Phosphor Green"; + themeToggle.setAttribute("aria-label", `Switch to ${themeLabel.textContent} theme`); + document.querySelector('meta[name="theme-color"]').content = isPhosphor ? "#020a04" : "#020707"; + for (const image of document.querySelectorAll(".app-preview")) { + image.alt = `${image.dataset.alt} in ${isPhosphor ? "phosphor green" : "cyan and magenta"}.`; + } +} +if (themeToggle && themeLabel) { + applyTheme(document.documentElement.dataset.theme); + themeToggle.hidden = false; + themeToggle.addEventListener("click", () => { + const theme = document.documentElement.dataset.theme === "phosphor" ? "synthwave" : "phosphor"; + applyTheme(theme); + try { localStorage.setItem("retrolemetry.siteTheme", theme); } catch (_) {} + }); +} + const statusLine = document.querySelector("#release-status"); const download = document.querySelector("#download"); fetch("release.json").then(response => { diff --git a/site/styles.css b/site/styles.css index 4daba6f..804e29c 100644 --- a/site/styles.css +++ b/site/styles.css @@ -6,3 +6,20 @@ header{display:flex;align-items:center;justify-content:space-between;gap:28px;pa @media(max-width:1000px){.page{padding:0 28px}.hero{grid-template-columns:1fr;gap:52px;padding:72px 0}.hero-copy{text-align:center}.intro,.release-status{margin-left:auto;margin-right:auto}.gallery,.features{gap:26px;padding-left:0;padding-right:0}h1{font-size:clamp(56px,10vw,84px)}} @media(max-width:650px){.page{padding:0 20px}header{padding:22px 0}.brand{font-size:22px;gap:9px}.brand img{width:40px;height:40px}nav{font-size:13px}.hero{padding:60px 0 48px;gap:40px}h1{font-size:clamp(43px,13vw,62px);letter-spacing:-2.6px}.intro{font-size:20px;margin:24px 0 28px}.button{width:100%;font-size:19px}.requirements,.release-status{font-size:14px}.gallery{grid-template-columns:1fr;padding-bottom:56px}.features{grid-template-columns:1fr;gap:34px;padding:48px 0}h2{font-size:25px;margin-bottom:10px}.features p{font-size:17px}.privacy-note{font-size:14px;margin:28px 0 38px}footer{align-items:flex-start;flex-direction:column;gap:16px;font-size:14px;padding:0 0 30px}} @media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}} + +/* The page and console previews share the same two display palettes. */ +.theme-filters{position:absolute;pointer-events:none;overflow:hidden} +header{flex-wrap:wrap} +nav{display:flex;align-items:center;gap:24px} +.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-width:176px;min-height:44px;padding:10px 16px;border:1px solid #91ad9a66;border-radius:999px;background:#0a1510;color:var(--ink);font:inherit;font-size:15px;font-weight:600;cursor:pointer} +.theme-toggle[hidden]{display:none} +.theme-toggle:hover{background:#14261a;border-color:var(--green)} +.theme-toggle:focus-visible{outline:3px solid var(--cyan);outline-offset:5px} +.theme-dot{width:10px;height:10px;border-radius:50%;background:#67ff79;box-shadow:0 0 10px #67ff7940} +:root[data-theme="phosphor"]{--ink:#d9ffdf;--body:#bbdfc0;--muted:#9bbca1;--green:#57ff6e;--cyan:#a7ff9e;--pink:#45d85a;--rule:#74ff8c35;background:#020a04} +:root[data-theme="phosphor"] body{background:#020a04;background-image:radial-gradient(circle at 12% 10%,#125b2b66,transparent 31rem),radial-gradient(circle at 88% 12%,#123d1d4d,transparent 34rem),linear-gradient(#020a04,#041008 65%,#020704)} +:root[data-theme="phosphor"] .button{background:linear-gradient(110deg,#75ff83,#b0ff9d)} +:root[data-theme="phosphor"] .button:hover{background:#bdffad} +:root[data-theme="phosphor"] .app-preview{filter:url(#phosphor-preview)} +:root[data-theme="phosphor"] .theme-dot{background:linear-gradient(135deg,#50eaff 50%,#ff3ca8 50%);box-shadow:none} +@media(max-width:650px){nav{width:100%;justify-content:space-between;gap:16px;font-size:14px}.theme-toggle{min-width:160px;font-size:14px}}