Files
oikos/web/vendor/examples/canvas.html
dtoro 8ff382a50d
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled
0.28.1 — vendor @joan/procedural-glyph-engine for portable SPA builds (fixes deploy)
The procedural-glyph-engine dep pointed at a non-portable file:/private/tmp/orby-pkg
path, breaking npm ci in Docker and every main deploy since v0.20.0 (the build
cache masked it until it busted ~Aug 5). Vendor Orby v5.0.0 into web/vendor/,
switch the dep to file:../vendor, and use npm install in the web Dockerfile
(file: deps need install, not ci). Cherry-picked from 3cd4cf9.
2026-08-08 21:41:51 +02:00

51 lines
1.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Orby · Canvas example</title>
<link rel="stylesheet" href="./example.css" />
</head>
<body>
<main>
<h1>Native canvas</h1>
<p>
One long-lived engine instance moves between semantic states while
preserving its seeded visual identity.
</p>
<div class="glyph-stage">
<canvas id="aiGlyph" width="440" height="440" aria-label="Animated AI state"></canvas>
</div>
<div class="actions" role="group" aria-label="Choose a semantic state">
<button type="button" data-sprite="ai.idle">Ready</button>
<button type="button" data-sprite="ai.thinking">Thinking</button>
<button type="button" data-sprite="ai.progress">Progress</button>
<button type="button" data-sprite="status.success">Done</button>
</div>
<p id="stateStatus" role="status">Current state: ai.idle</p>
</main>
<script type="module">
import { createGlyph } from "../src/joan-engine.js";
const glyph = createGlyph("#aiGlyph", {
sprite: "ai.idle",
seed: "self-service-example",
gridSize: 68,
});
const status = document.querySelector("#stateStatus");
document.querySelectorAll("[data-sprite]").forEach((button) => {
button.addEventListener("click", async () => {
const sprite = button.dataset.sprite;
status.textContent = `Transitioning to ${sprite}`;
await glyph.transitionTo(sprite);
status.textContent = `Current state: ${sprite}`;
});
});
window.addEventListener("pagehide", () => glyph.destroy(), { once: true });
</script>
</body>
</html>