Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,54 @@ hide:
<rect x="8" y="24" width="84" height="12" fill="#FFFDF7"/>
<rect x="12" y="34" width="76" height="6" fill="#D5E3EE"/>
</g>
<g class="sf-px-stars">
<rect x="172" y="22" width="4" height="4" fill="#FEF08A"/>
<rect x="248" y="54" width="3" height="3" fill="#FFFDF7"/>
<rect x="336" y="18" width="4" height="4" fill="#FDE047"/>
<rect x="614" y="20" width="4" height="4" fill="#FFFDF7"/>
<rect x="688" y="58" width="3" height="3" fill="#FEF08A"/>
<rect x="768" y="82" width="4" height="4" fill="#FFFDF7"/>
</g>
</svg>

<button type="button" class="sf-celestial" aria-label="Switch to dark mode" title="Switch to dark mode" aria-pressed="false">
<svg class="sf-celestial-svg sf-celestial-sun" viewBox="0 0 24 24" aria-hidden="true" shape-rendering="crispEdges">
<rect x="11" y="1" width="2" height="3" fill="#EA7A2E"/>
<rect x="11" y="20" width="2" height="3" fill="#EA7A2E"/>
<rect x="1" y="11" width="3" height="2" fill="#EA7A2E"/>
<rect x="20" y="11" width="3" height="2" fill="#EA7A2E"/>
<rect x="4" y="4" width="2" height="2" fill="#F59E0B"/>
<rect x="18" y="4" width="2" height="2" fill="#F59E0B"/>
<rect x="4" y="18" width="2" height="2" fill="#F59E0B"/>
<rect x="18" y="18" width="2" height="2" fill="#F59E0B"/>
<rect x="8" y="6" width="8" height="12" fill="#1E242B"/>
<rect x="6" y="8" width="12" height="8" fill="#1E242B"/>
<rect x="7" y="7" width="10" height="10" fill="#1E242B"/>
<rect x="9" y="7" width="6" height="10" fill="#F59E0B"/>
<rect x="7" y="9" width="10" height="6" fill="#F59E0B"/>
<rect x="8" y="8" width="8" height="8" fill="#FACC15"/>
<rect x="9" y="9" width="5" height="5" fill="#FEF08A"/>
</svg>
<svg class="sf-celestial-svg sf-celestial-moon" viewBox="0 0 24 24" aria-hidden="true" shape-rendering="crispEdges">
<rect x="18" y="3" width="2" height="2" fill="#FEF08A"/>
<rect x="19" y="8" width="1" height="1" fill="#FFFDF7"/>
<rect x="4" y="17" width="2" height="2" fill="#FEF08A"/>
<rect x="9" y="4" width="6" height="2" fill="#1E242B"/>
<rect x="7" y="6" width="8" height="2" fill="#1E242B"/>
<rect x="5" y="8" width="8" height="8" fill="#1E242B"/>
<rect x="7" y="16" width="8" height="2" fill="#1E242B"/>
<rect x="9" y="18" width="8" height="2" fill="#1E242B"/>
<rect x="15" y="15" width="3" height="3" fill="#1E242B"/>
<rect x="9" y="5" width="5" height="2" fill="#FACC15"/>
<rect x="7" y="7" width="5" height="3" fill="#FACC15"/>
<rect x="6" y="9" width="4" height="6" fill="#FDE047"/>
<rect x="7" y="14" width="5" height="3" fill="#FACC15"/>
<rect x="9" y="16" width="7" height="3" fill="#FACC15"/>
<rect x="14" y="15" width="3" height="2" fill="#FDE047"/>
<rect x="8" y="9" width="2" height="4" fill="#FEF9C3"/>
</svg>
</button>

<div class="sf-hero-logo-wrap">
<img class="sf-hero-logo" src="assets/logo.png" alt="Steerable logo" />
</div>
Expand Down
46 changes: 46 additions & 0 deletions docs/ja/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,54 @@ hide:
<rect x="8" y="24" width="84" height="12" fill="#FFFDF7"/>
<rect x="12" y="34" width="76" height="6" fill="#D5E3EE"/>
</g>
<g class="sf-px-stars">
<rect x="172" y="22" width="4" height="4" fill="#FEF08A"/>
<rect x="248" y="54" width="3" height="3" fill="#FFFDF7"/>
<rect x="336" y="18" width="4" height="4" fill="#FDE047"/>
<rect x="614" y="20" width="4" height="4" fill="#FFFDF7"/>
<rect x="688" y="58" width="3" height="3" fill="#FEF08A"/>
<rect x="768" y="82" width="4" height="4" fill="#FFFDF7"/>
</g>
</svg>

<button type="button" class="sf-celestial" aria-label="ダークモードに切替" title="ダークモードに切替" aria-pressed="false">
<svg class="sf-celestial-svg sf-celestial-sun" viewBox="0 0 24 24" aria-hidden="true" shape-rendering="crispEdges">
<rect x="11" y="1" width="2" height="3" fill="#EA7A2E"/>
<rect x="11" y="20" width="2" height="3" fill="#EA7A2E"/>
<rect x="1" y="11" width="3" height="2" fill="#EA7A2E"/>
<rect x="20" y="11" width="3" height="2" fill="#EA7A2E"/>
<rect x="4" y="4" width="2" height="2" fill="#F59E0B"/>
<rect x="18" y="4" width="2" height="2" fill="#F59E0B"/>
<rect x="4" y="18" width="2" height="2" fill="#F59E0B"/>
<rect x="18" y="18" width="2" height="2" fill="#F59E0B"/>
<rect x="8" y="6" width="8" height="12" fill="#1E242B"/>
<rect x="6" y="8" width="12" height="8" fill="#1E242B"/>
<rect x="7" y="7" width="10" height="10" fill="#1E242B"/>
<rect x="9" y="7" width="6" height="10" fill="#F59E0B"/>
<rect x="7" y="9" width="10" height="6" fill="#F59E0B"/>
<rect x="8" y="8" width="8" height="8" fill="#FACC15"/>
<rect x="9" y="9" width="5" height="5" fill="#FEF08A"/>
</svg>
<svg class="sf-celestial-svg sf-celestial-moon" viewBox="0 0 24 24" aria-hidden="true" shape-rendering="crispEdges">
<rect x="18" y="3" width="2" height="2" fill="#FEF08A"/>
<rect x="19" y="8" width="1" height="1" fill="#FFFDF7"/>
<rect x="4" y="17" width="2" height="2" fill="#FEF08A"/>
<rect x="9" y="4" width="6" height="2" fill="#1E242B"/>
<rect x="7" y="6" width="8" height="2" fill="#1E242B"/>
<rect x="5" y="8" width="8" height="8" fill="#1E242B"/>
<rect x="7" y="16" width="8" height="2" fill="#1E242B"/>
<rect x="9" y="18" width="8" height="2" fill="#1E242B"/>
<rect x="15" y="15" width="3" height="3" fill="#1E242B"/>
<rect x="9" y="5" width="5" height="2" fill="#FACC15"/>
<rect x="7" y="7" width="5" height="3" fill="#FACC15"/>
<rect x="6" y="9" width="4" height="6" fill="#FDE047"/>
<rect x="7" y="14" width="5" height="3" fill="#FACC15"/>
<rect x="9" y="16" width="7" height="3" fill="#FACC15"/>
<rect x="14" y="15" width="3" height="2" fill="#FDE047"/>
<rect x="8" y="9" width="2" height="4" fill="#FEF9C3"/>
</svg>
</button>

<div class="sf-hero-logo-wrap">
<img class="sf-hero-logo" src="../assets/logo.png" alt="Steerable logo" />
</div>
Expand Down
59 changes: 59 additions & 0 deletions docs/javascripts/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,64 @@
});
}

function initCelestialToggle() {
var btn = document.querySelector(".sf-celestial");
if (!btn || btn.dataset.sfInit === "1") return;
btn.dataset.sfInit = "1";

var lang = getPageLang();
var labels = {
en: { toDark: "Switch to dark mode", toLight: "Switch to light mode" },
zh: { toDark: "切换到黑天模式", toLight: "切换到白天模式" },
ja: { toDark: "ダークモードに切替", toLight: "ライトモードに切替" }
};
var copy = labels[lang] || labels.en;

function isDark() {
return document.body.getAttribute("data-md-color-scheme") === "slate";
}

function syncLabel() {
var dark = isDark();
var text = dark ? copy.toLight : copy.toDark;
btn.setAttribute("aria-pressed", dark ? "true" : "false");
btn.setAttribute("aria-label", text);
btn.setAttribute("title", text);
}

btn.addEventListener("click", function () {
var targetScheme = isDark() ? "default" : "slate";
var radio = document.querySelector(
'input[name="__palette"][data-md-color-scheme="' + targetScheme + '"]'
);
if (radio) {
radio.click();
} else {
document.body.setAttribute("data-md-color-scheme", targetScheme);
}
syncLabel();
});

if (typeof MutationObserver !== "undefined" && !window.__sfPaletteObs) {
window.__sfPaletteObs = new MutationObserver(function () {
var current = document.querySelector(".sf-celestial");
if (!current) return;
var dark = isDark();
var l = labels[getPageLang()] || labels.en;
var text = dark ? l.toLight : l.toDark;
current.setAttribute("aria-pressed", dark ? "true" : "false");
current.setAttribute("aria-label", text);
current.setAttribute("title", text);
});
window.__sfPaletteObs.observe(document.body, {
attributes: true,
attributeFilter: ["data-md-color-scheme"]
});
}

syncLabel();
}

function initLanguagePreference() {
if (window.__sfLangBound) return;
window.__sfLangBound = true;
Expand All @@ -462,6 +520,7 @@
function boot() {
initLanguagePreference();
if (!document.querySelector(".sf-hero")) return;
initCelestialToggle();
initRunTerminal();
initBenchmarkInteractions();
initLoopStage();
Expand Down
69 changes: 68 additions & 1 deletion docs/stylesheets/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,67 @@ body:has(.sf-hero) .md-button--primary:hover {
}

[data-md-color-scheme="slate"] .sf-px-clouds {
opacity: 0.28;
opacity: 0.45;
}

.sf-px-stars {
opacity: 0;
transition: opacity 0.25s ease;
}

[data-md-color-scheme="slate"] .sf-px-stars {
opacity: 0.95;
}

/* Pixel Sun / Moon theme toggle floating in the hero sky */
button.sf-celestial {
position: absolute;
top: 1.05rem;
right: 11.4rem;
z-index: 3;
display: inline-flex;
align-items: center;
justify-content: center;
width: 3rem;
height: 3rem;
padding: 0;
margin: 0;
border: 0;
background: transparent;
cursor: pointer;
transition: transform 0.14s ease, filter 0.14s ease;
}

button.sf-celestial:hover {
transform: translateY(-2px) scale(1.08);
filter: drop-shadow(3px 3px 0 #1e242b);
}

button.sf-celestial:active {
transform: translate(1px, 1px) scale(0.98);
}

button.sf-celestial:focus-visible {
outline: 3px solid var(--px-blue);
outline-offset: 2px;
}

.sf-celestial-svg {
width: 100%;
height: 100%;
display: block;
}

.sf-celestial-moon {
display: none;
}

[data-md-color-scheme="slate"] .sf-celestial-sun {
display: none;
}

[data-md-color-scheme="slate"] .sf-celestial-moon {
display: block;
}

.sf-px-ground {
Expand Down Expand Up @@ -1649,6 +1709,13 @@ a.sf-brand-item:hover span {
opacity: 0.45;
}

button.sf-celestial {
top: 0.65rem;
right: 0.65rem;
width: 2.25rem;
height: 2.25rem;
}

.sf-hero-logo-wrap {
padding: 0.3rem;
margin-bottom: 0.35rem;
Expand Down
46 changes: 46 additions & 0 deletions docs/zh/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,54 @@ hide:
<rect x="8" y="24" width="84" height="12" fill="#FFFDF7"/>
<rect x="12" y="34" width="76" height="6" fill="#D5E3EE"/>
</g>
<g class="sf-px-stars">
<rect x="172" y="22" width="4" height="4" fill="#FEF08A"/>
<rect x="248" y="54" width="3" height="3" fill="#FFFDF7"/>
<rect x="336" y="18" width="4" height="4" fill="#FDE047"/>
<rect x="614" y="20" width="4" height="4" fill="#FFFDF7"/>
<rect x="688" y="58" width="3" height="3" fill="#FEF08A"/>
<rect x="768" y="82" width="4" height="4" fill="#FFFDF7"/>
</g>
</svg>

<button type="button" class="sf-celestial" aria-label="切换到黑天模式" title="切换到黑天模式" aria-pressed="false">
<svg class="sf-celestial-svg sf-celestial-sun" viewBox="0 0 24 24" aria-hidden="true" shape-rendering="crispEdges">
<rect x="11" y="1" width="2" height="3" fill="#EA7A2E"/>
<rect x="11" y="20" width="2" height="3" fill="#EA7A2E"/>
<rect x="1" y="11" width="3" height="2" fill="#EA7A2E"/>
<rect x="20" y="11" width="3" height="2" fill="#EA7A2E"/>
<rect x="4" y="4" width="2" height="2" fill="#F59E0B"/>
<rect x="18" y="4" width="2" height="2" fill="#F59E0B"/>
<rect x="4" y="18" width="2" height="2" fill="#F59E0B"/>
<rect x="18" y="18" width="2" height="2" fill="#F59E0B"/>
<rect x="8" y="6" width="8" height="12" fill="#1E242B"/>
<rect x="6" y="8" width="12" height="8" fill="#1E242B"/>
<rect x="7" y="7" width="10" height="10" fill="#1E242B"/>
<rect x="9" y="7" width="6" height="10" fill="#F59E0B"/>
<rect x="7" y="9" width="10" height="6" fill="#F59E0B"/>
<rect x="8" y="8" width="8" height="8" fill="#FACC15"/>
<rect x="9" y="9" width="5" height="5" fill="#FEF08A"/>
</svg>
<svg class="sf-celestial-svg sf-celestial-moon" viewBox="0 0 24 24" aria-hidden="true" shape-rendering="crispEdges">
<rect x="18" y="3" width="2" height="2" fill="#FEF08A"/>
<rect x="19" y="8" width="1" height="1" fill="#FFFDF7"/>
<rect x="4" y="17" width="2" height="2" fill="#FEF08A"/>
<rect x="9" y="4" width="6" height="2" fill="#1E242B"/>
<rect x="7" y="6" width="8" height="2" fill="#1E242B"/>
<rect x="5" y="8" width="8" height="8" fill="#1E242B"/>
<rect x="7" y="16" width="8" height="2" fill="#1E242B"/>
<rect x="9" y="18" width="8" height="2" fill="#1E242B"/>
<rect x="15" y="15" width="3" height="3" fill="#1E242B"/>
<rect x="9" y="5" width="5" height="2" fill="#FACC15"/>
<rect x="7" y="7" width="5" height="3" fill="#FACC15"/>
<rect x="6" y="9" width="4" height="6" fill="#FDE047"/>
<rect x="7" y="14" width="5" height="3" fill="#FACC15"/>
<rect x="9" y="16" width="7" height="3" fill="#FACC15"/>
<rect x="14" y="15" width="3" height="2" fill="#FDE047"/>
<rect x="8" y="9" width="2" height="4" fill="#FEF9C3"/>
</svg>
</button>

<div class="sf-hero-logo-wrap">
<img class="sf-hero-logo" src="../assets/logo.png" alt="Steerable logo" />
</div>
Expand Down
Loading
Loading