7c0bbf4bb2
Fresh debrand branch from storytold/gridcraft main (the October branch is kept as debrand-2026-10). By hand: the Discord and getartcraft links in About and the Help menu, the update check (Help item, Automate ribbon button, the check at start; an update would install an upstream build). Mechanical rules in .debrand (docs/brand removed as its licence asks of forks; README promotion blocks; i18n strings; installer suite folder CraftApps). LICENSE-*, NOTICE, ATTRIBUTION.md and the copyright line are unchanged. Theme: the chrome is Catppuccin Latte (light) and Mocha (dark) with a mauve accent; the sheet stays white. The web build's theme is System by default; framed by a same-origin page (the Hub), index.html answers prefers-color-scheme from that page's dark class and raises the change event when it flips, so the app follows it live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63 lines
3.0 KiB
HTML
63 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>GridCraft</title>
|
|
<script>
|
|
// Catppuccin follows the page around the app. Framed by a same-origin page (the Hub), the app's "system" theme
|
|
// is that page's: prefers-color-scheme answers from its <html> `dark` class (Mocha when set, Latte when not), and
|
|
// a change of that class raises the media query's change event, so the app switches live. Opened on its own,
|
|
// the real system setting applies. Runs before the app's module, which reads the scheme through matchMedia.
|
|
(() => {
|
|
let host = null
|
|
try { host = parent !== window ? parent.document.documentElement : null } catch { host = null }
|
|
if (!host) return
|
|
const hostDark = () => host.classList.contains('dark')
|
|
const paint = dark => { document.documentElement.style.background = dark ? '#1e1e2e' : '#eff1f5' }
|
|
const real = window.matchMedia.bind(window)
|
|
const lists = new Map() // one list per scheme, so an app that asks every frame gets the same object
|
|
window.matchMedia = query => {
|
|
const m = /^\s*\(\s*prefers-color-scheme\s*:\s*(dark|light)\s*\)\s*$/i.exec(String(query))
|
|
if (!m) return real(query)
|
|
const dark = m[1].toLowerCase() === 'dark'
|
|
if (!lists.has(dark)) {
|
|
const list = real(query)
|
|
Object.defineProperty(list, 'matches', { configurable: true, get: () => hostDark() === dark })
|
|
lists.set(dark, list)
|
|
}
|
|
return lists.get(dark)
|
|
}
|
|
let last = hostDark()
|
|
paint(last)
|
|
new MutationObserver(() => {
|
|
const now = hostDark()
|
|
if (now === last) return
|
|
last = now
|
|
paint(now)
|
|
for (const list of lists.values()) {
|
|
const event = new Event('change')
|
|
Object.defineProperty(event, 'matches', { value: list.matches })
|
|
Object.defineProperty(event, 'media', { value: list.media })
|
|
list.dispatchEvent(event)
|
|
}
|
|
window.dispatchEvent(new Event('resize')) // a nudge for apps that only redraw on input
|
|
}).observe(host, { attributes: true, attributeFilter: ['class'] })
|
|
})()
|
|
</script>
|
|
<link data-trunk rel="icon" href="../../assets/app-icon/gridcraft.ico" />
|
|
<link data-trunk rel="rust" data-bin="gridcraft-web" data-wasm-opt="z" data-weak-refs />
|
|
<style>
|
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #eff1f5; }
|
|
@media (prefers-color-scheme: dark) { html, body { background: #1e1e2e; } #gridcraft_loading { color: #a6adc8; } }
|
|
#gridcraft_canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
|
#gridcraft_loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
color: #5c5f77; font: 14px system-ui, sans-serif; pointer-events: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="gridcraft_canvas"></canvas>
|
|
<div id="gridcraft_loading">Loading GridCraft…</div>
|
|
</body>
|
|
</html>
|