Files
oikos/web/vendor/examples/web-component.html
dtoro 3cd4cf98c3 chore: vendor @joan/procedural-glyph-engine for portable builds
Move @joan/procedural-glyph-engine from absolute path dep
(/private/tmp/orby-pkg) to vendored local dep (web/vendor/) so the
SPA builds in Docker and on other machines without the temp dir.

- Vendor Orby v5.0.0 into web/vendor/
- Switch package.json dep to file:../vendor
- Update Dockerfile to COPY vendor into build context
- Use npm install instead of npm ci (file: deps need install)
- Fix missing trailing newline in Dockerfile
2026-08-05 17:27:04 +02:00

49 lines
1.7 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Orby · Web component example</title>
<link rel="stylesheet" href="./example.css" />
<script type="module" src="../src/web-component-register.js"></script>
</head>
<body>
<main>
<h1>Web component</h1>
<p>
Drop the dependency-free custom element into a page, then drive its
attributes or call the forwarded engine methods.
</p>
<div class="glyph-stage">
<joan-glyph
id="glyph"
sprite="ai.ambient-thinking"
seed="self-service-component"
resolution="68"
orb-boundary="gestalt"
></joan-glyph>
</div>
<div class="actions" role="group" aria-label="Choose a semantic state">
<button type="button" data-sprite="ai.ambient-idle">Ambient ready</button>
<button type="button" data-sprite="ai.ambient-thinking">Thinking</button>
<button type="button" data-sprite="status.success">Done</button>
</div>
<p id="stateStatus" role="status">Current state: ai.ambient-thinking</p>
</main>
<script type="module">
const glyph = document.querySelector("#glyph");
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}`;
});
});
</script>
</body>
</html>