@vibechain/os 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/AGENTS.md +139 -208
  2. package/README.md +131 -54
  3. package/SECURITY.md +45 -20
  4. package/dist/app-client.d.ts +4 -1
  5. package/dist/app-client.js +4 -1
  6. package/dist/app-host.d.ts +111 -9
  7. package/dist/app-host.js +339 -58
  8. package/dist/app-protocol.d.ts +2 -0
  9. package/dist/app-runtime.d.ts +18 -2
  10. package/dist/app-runtime.js +75 -11
  11. package/dist/app-wire.d.ts +194 -0
  12. package/dist/app-wire.js +253 -0
  13. package/dist/browser.d.ts +2 -0
  14. package/dist/browser.js +2 -0
  15. package/dist/bundle.js +6 -6
  16. package/dist/canvas.d.ts +2 -2
  17. package/dist/canvas.js +3 -1
  18. package/dist/check.d.ts +12 -0
  19. package/dist/check.js +167 -0
  20. package/dist/cli-publish.d.ts +24 -0
  21. package/dist/cli-publish.js +288 -0
  22. package/dist/cli-session.d.ts +108 -0
  23. package/dist/cli-session.js +245 -0
  24. package/dist/cli.d.ts +10 -0
  25. package/dist/cli.js +46 -10
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.js +3 -0
  28. package/dist/listing.d.ts +3 -3
  29. package/dist/listing.js +1 -1
  30. package/dist/loop.d.ts +18 -2
  31. package/dist/loop.js +13 -1
  32. package/dist/manifest.d.ts +90 -4
  33. package/dist/manifest.js +340 -5
  34. package/dist/os.d.ts +56 -0
  35. package/dist/os.js +354 -0
  36. package/dist/preview-parent.d.ts +36 -0
  37. package/dist/preview-parent.js +122 -11
  38. package/dist/preview-ui.js +1 -1
  39. package/dist/preview.js +25 -7
  40. package/dist/redact.d.ts +6 -0
  41. package/dist/redact.js +16 -0
  42. package/dist/runtime-policy.d.ts +20 -0
  43. package/dist/runtime-policy.js +45 -0
  44. package/dist/scaffold.d.ts +13 -2
  45. package/dist/scaffold.js +99 -29
  46. package/dist/submit-notice.d.ts +26 -0
  47. package/dist/submit-notice.js +34 -0
  48. package/dist/templates/plain/game.js +18 -0
  49. package/dist/testing.d.ts +63 -0
  50. package/dist/testing.js +157 -1
  51. package/dist/transport.d.ts +20 -0
  52. package/dist/transport.js +71 -19
  53. package/dist/vibemarket-os.js +1 -0
  54. package/dist/worker.d.ts +18 -0
  55. package/dist/worker.js +34 -0
  56. package/examples/paw-beat/README.md +20 -8
  57. package/examples/paw-beat/cat.ts +665 -89
  58. package/examples/paw-beat/game.ts +162 -28
  59. package/examples/paw-beat/index.html +114 -40
  60. package/examples/paw-beat/main.ts +264 -149
  61. package/examples/paw-beat/music.ts +314 -65
  62. package/examples/paw-beat/stage.ts +560 -0
  63. package/examples/paw-beat/store/icon.png +0 -0
  64. package/examples/paw-beat/store/screenshot-1.webp +0 -0
  65. package/examples/paw-beat/store/screenshot-2.webp +0 -0
  66. package/examples/paw-beat/vibemarket.json +2 -2
  67. package/examples/vibexp-app/README.md +20 -4
  68. package/examples/vibexp-app/index.html +3 -2
  69. package/examples/vibexp-app/plain/game.ts +20 -0
  70. package/examples/vibexp-app/plain/index.html +6 -0
  71. package/examples/vibexp-app/plain/vibemarket.json +17 -0
  72. package/examples/vibexp-app/src/main.ts +46 -31
  73. package/examples/vibexp-app/store/icon.png +0 -0
  74. package/examples/vibexp-app/store/screenshot-1.png +0 -0
  75. package/examples/vibexp-app/three/README.md +21 -0
  76. package/examples/vibexp-app/three/index.html +4 -0
  77. package/examples/vibexp-app/three/src/main.ts +45 -0
  78. package/examples/vibexp-app/three/vibemarket.json +19 -0
  79. package/examples/vibexp-app/vibemarket.json +27 -1
  80. package/package.json +8 -3
  81. package/examples/chonk-stack/card-slice.ts +0 -17
  82. package/examples/chonk-stack/cat3d.ts +0 -57
  83. package/examples/chonk-stack/game.css +0 -174
  84. package/examples/chonk-stack/index.html +0 -32
  85. package/examples/chonk-stack/main.ts +0 -149
  86. package/examples/chonk-stack/model.ts +0 -40
  87. package/examples/chonk-stack/renderer.ts +0 -263
  88. package/examples/chonk-stack/skins.ts +0 -47
  89. package/examples/chonk-stack/vibemarket.json +0 -21
  90. package/examples/collection-room/index.html +0 -3
  91. package/examples/collection-room/main.ts +0 -31
  92. package/examples/collection-room/vibemarket.json +0 -12
  93. package/examples/tsconfig.json +0 -4
@@ -0,0 +1,6 @@
1
+ <!doctype html>
2
+ <meta charset="utf-8">
3
+ <title>Tap the Cat</title>
4
+ <button id="cat" style="font: 32px sans-serif; width: 100%; height: 100vh">Tap the cat</button>
5
+ <script src="vibemarket-os.js"></script>
6
+ <script src="game.js"></script>
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": 3,
3
+ "id": "tap-the-cat",
4
+ "version": "1.0.0",
5
+ "name": "Tap the Cat",
6
+ "tagline": "Thirty seconds. One cat. Tap.",
7
+ "entry": "index.html",
8
+ "window": { "width": 480, "height": 360, "resizable": false },
9
+ "store": {
10
+ "icon": "icon.png",
11
+ "screenshots": ["screenshot.png"],
12
+ "description": "Tap the cat as many times as you can in thirty seconds, then try to beat your best.",
13
+ "category": "game",
14
+ "rating": { "violence": "none", "language": "none", "mature": false },
15
+ "support": "you@example.com"
16
+ }
17
+ }
@@ -1,37 +1,52 @@
1
- import { connectVibeMarketApp, GAME_SCORE_LIMIT } from "@vibechain/os";
1
+ import { connect, GAME_SCORE_LIMIT } from "@vibechain/os";
2
+ import { fitCanvas } from "@vibechain/os/canvas";
2
3
 
3
- const count = document.querySelector<HTMLOutputElement>("#count");
4
- const button = document.querySelector<HTMLButtonElement>("#stamp");
5
- const status = document.querySelector<HTMLElement>("#status");
6
- const start = document.querySelector<HTMLButtonElement>("#start"), finish = document.querySelector<HTMLButtonElement>("#finish");
7
- const intro = document.querySelector<HTMLElement>("#intro"), round = document.querySelector<HTMLElement>("#round");
8
- if (!count || !button || !status || !start || !finish || !intro || !round) throw Error("Starter markup is missing.");
9
- const sdk = await connectVibeMarketApp();
10
- const checkpoint = await sdk.checkpoint.read();
11
- let stamps = checkpoint !== null && typeof checkpoint === "object" && !Array.isArray(checkpoint)
12
- && typeof checkpoint.stamps === "number" && Number.isSafeInteger(checkpoint.stamps) && checkpoint.stamps >= 0 && checkpoint.stamps <= GAME_SCORE_LIMIT ? checkpoint.stamps : 0;
13
- const paint = () => { count.value = String(stamps); };
14
- paint();
15
- const playing = checkpoint !== null && typeof checkpoint === "object" && !Array.isArray(checkpoint) && checkpoint.playing === true;
16
- intro.hidden = playing; round.hidden = !playing;
17
- button.disabled = false;
18
- finish.disabled = false;
4
+ /** What Stamp Club saves: the best round, kept by the host between opens (signed-in players). */
5
+ interface Save { best: number }
6
+ interface Stamp { x: number; y: number; hue: number }
7
+ const element = <T extends HTMLElement>(id: string) => { const node = document.getElementById(id); if (!node) throw Error(`Starter markup is missing #${id}.`); return node as T; };
8
+ const board = element<HTMLCanvasElement>("board"), count = element<HTMLOutputElement>("count"), status = element("status");
9
+ const start = element<HTMLButtonElement>("start"), finish = element<HTMLButtonElement>("finish");
10
+ const context = board.getContext("2d");
11
+ if (!context) throw Error("This browser cannot draw 2D canvas.");
12
+
13
+ const os = await connect();
14
+ const saved = await os.load<Save>();
15
+ let best = typeof saved?.best === "number" ? saved.best : 0, stamps: Stamp[] = [], playing = false, scale = 1;
16
+
17
+ function draw() {
18
+ context!.setTransform(scale, 0, 0, scale, 0, 0);
19
+ context!.clearRect(0, 0, board.width, board.height);
20
+ context!.font = "bold 28px Arial"; context!.textAlign = "center"; context!.textBaseline = "middle";
21
+ for (const stamp of stamps) {
22
+ context!.fillStyle = `hsl(${stamp.hue} 70% 45%)`;
23
+ context!.beginPath(); context!.arc(stamp.x, stamp.y, 22, 0, Math.PI * 2); context!.fill();
24
+ context!.fillStyle = "#fff"; context!.fillText("★", stamp.x, stamp.y + 1);
25
+ }
26
+ count.value = String(stamps.length);
27
+ }
28
+ fitCanvas(os, board, { onResize: fit => { scale = fit.pixelRatio; draw(); } });
29
+ const say = (text: string) => { status.textContent = text; };
30
+ say(best ? `Your best round: ${best} stamps.` : "Start a round, then press the board to place stamps.");
19
31
  start.disabled = false;
20
32
  start.addEventListener("click", () => {
21
- start.disabled = true;
22
- void sdk.checkpoint.write({ stamps, playing: true }).then(() => { intro.hidden = true; round.hidden = false; })
23
- .catch(() => { status.textContent = "This app session ended. Restore the window to reconnect."; start.disabled = false; });
33
+ stamps = []; playing = true; start.disabled = true; finish.disabled = false; draw();
34
+ say("Press the board to place stamps. Finish when you are done.");
24
35
  });
25
- finish.addEventListener("click", () => {
26
- button.disabled = true; finish.disabled = true;
27
- void sdk.game.finish({ score: stamps }).catch(() => { status.textContent = "The game session ended. Check the host result before retrying."; });
36
+ board.addEventListener("pointerdown", event => {
37
+ if (!playing || !os.active || stamps.length >= GAME_SCORE_LIMIT) return;
38
+ const box = board.getBoundingClientRect();
39
+ stamps.push({ x: event.clientX - box.left, y: event.clientY - box.top, hue: (stamps.length * 47) % 360 });
40
+ draw();
28
41
  });
29
- button.addEventListener("click", () => {
30
- button.disabled = true;
31
- void sdk.checkpoint.write({ stamps: stamps + 1, playing: true }).then(() => { stamps++; paint(); status.textContent = "Saved in this open VibeMarket OS window. Try minimizing and restoring it."; })
32
- .catch(() => { status.textContent = "This app session ended. Restore the window to reconnect."; })
33
- .finally(() => { button.disabled = !sdk.lifecycle.current().active || stamps === GAME_SCORE_LIMIT; });
42
+ finish.addEventListener("click", async () => {
43
+ playing = false; finish.disabled = true;
44
+ try {
45
+ if (stamps.length > best) { best = stamps.length; await os.save({ best } satisfies Save); }
46
+ await os.finish({ score: stamps.length });
47
+ } catch { say("The app session ended. Check the host's result before retrying."); }
34
48
  });
35
- sdk.lifecycle.onChanged(state => { button.disabled = !state.active || stamps === GAME_SCORE_LIMIT; });
36
- window.addEventListener("pagehide", () => sdk.destroy(), { once: true });
37
- await sdk.ready();
49
+ os.onPause(() => { say("Paused while the window is in the background."); });
50
+ os.onResume(() => { say(playing ? "Back again: keep stamping." : `Your best round: ${best} stamps.`); });
51
+ window.addEventListener("pagehide", () => os.close(), { once: true });
52
+ await os.ready();
@@ -0,0 +1,21 @@
1
+ # Card Spinner
2
+
3
+ The Three.js starter of `os init --template three`: a card that spins in 3D. When `vibemarket.json` links a vmOS pack, the card shows that pack's first card art; otherwise it draws a placeholder face.
4
+
5
+ Run `npm install`, `npm run build`, then `npm run dev`, and open the printed **127.0.0.1** URL.
6
+
7
+ ## Showing a pack's cards
8
+
9
+ Add the pack's slug (the last part of its `vibechain.com/os/pack/<slug>` link) to `vibemarket.json`:
10
+
11
+ ```json
12
+ "packs": ["rooftop-rats"]
13
+ ```
14
+
15
+ `os.pack(slug)` then returns the pack's public card list with art URLs, and `os.showPack(slug)` (after a click) opens the pack in VibeMarket. A pack you did not create is linked only after its creator approves the request your submission sends. To read which cards the player holds, also set `"cards": "linked"` (the linked packs) or `"cards": "all"` (every vmOS pack the player holds). The preview fakes six cards per linked pack.
16
+
17
+ Card art is served from your app's own address with `Access-Control-Allow-Origin: *`, so it works as a WebGL texture: Three.js's `TextureLoader` sets `crossOrigin = "anonymous"` for you. An `<img>` you make yourself needs `img.crossOrigin = "anonymous"` before `src`.
18
+
19
+ ## Before you submit to VibeStore
20
+
21
+ Replace the placeholder `id`, `name`, `tagline`, `store.description`, `store.support`, the icon and the screenshot, as the Stamp Club starter's README lists. `npm run check` lists every problem first. A person reviews every version, and approval is publication: an approved version is copied to public IPFS.
@@ -0,0 +1,4 @@
1
+ <!doctype html>
2
+ <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Card Spinner</title>
3
+ <style>html,body{margin:0;height:100%;background:#10131c;color:#e8ecf5;font:14px Arial;overflow:hidden}canvas{display:block;width:100%;height:100%}p{position:fixed;left:0;right:0;bottom:8px;margin:0;text-align:center;opacity:.8}</style></head>
4
+ <body><canvas id="scene"></canvas><p id="status" role="status">Connecting to the host…</p><script type="module" src="./main.js"></script></body></html>
@@ -0,0 +1,45 @@
1
+ import * as THREE from "three";
2
+ import { connect, OsError, type PackCard } from "@vibechain/os";
3
+ import { fitCanvas } from "@vibechain/os/canvas";
4
+ import { createLoop } from "@vibechain/os/loop";
5
+
6
+ const canvas = document.getElementById("scene") as HTMLCanvasElement, status = document.getElementById("status") as HTMLElement;
7
+ const os = await connect();
8
+
9
+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });
10
+ const scene = new THREE.Scene(), camera = new THREE.PerspectiveCamera(40, 1, 0.1, 100);
11
+ camera.position.set(0, 0, 6);
12
+ scene.add(new THREE.AmbientLight(0xffffff, 1.6));
13
+ const light = new THREE.DirectionalLight(0xffffff, 2); light.position.set(2, 3, 4); scene.add(light);
14
+
15
+ /** A placeholder face drawn on a canvas, used when no linked pack has art. */
16
+ function placeholder(): THREE.Texture {
17
+ const face = document.createElement("canvas"); face.width = 320; face.height = 448;
18
+ const draw = face.getContext("2d")!;
19
+ draw.fillStyle = "#3b5bdb"; draw.fillRect(0, 0, face.width, face.height);
20
+ draw.fillStyle = "#fff"; draw.font = "bold 48px Arial"; draw.textAlign = "center"; draw.fillText("vmOS", face.width / 2, face.height / 2);
21
+ return new THREE.CanvasTexture(face);
22
+ }
23
+ /** The first card with art of the first linked pack, or null. */
24
+ async function firstCard(): Promise<PackCard | null> {
25
+ try {
26
+ for (const summary of await os.packs()) {
27
+ const card = (await os.pack(summary.id)).cards.find(item => item.art !== null);
28
+ if (card) return card;
29
+ }
30
+ } catch (error) { if (!(error instanceof OsError) || error.code !== "unsupported") throw error; }
31
+ return null;
32
+ }
33
+ const card = await firstCard();
34
+ const texture = card?.art ? await new THREE.TextureLoader().loadAsync(card.art) : placeholder();
35
+ texture.colorSpace = THREE.SRGBColorSpace;
36
+ const front = new THREE.MeshStandardMaterial({ map: texture }), edge = new THREE.MeshStandardMaterial({ color: 0x222833 });
37
+ const mesh = new THREE.Mesh(new THREE.BoxGeometry(2.5, 3.5, 0.04), [edge, edge, edge, edge, front, front]);
38
+ scene.add(mesh);
39
+ status.textContent = card ? `${card.name} · ${card.rarity}` : "Link a pack in vibemarket.json to show its art.";
40
+
41
+ fitCanvas(os, canvas, { onResize: ({ width, height }) => { renderer.setSize(width, height, false); camera.aspect = width / height; camera.updateProjectionMatrix(); } });
42
+ let angle = 0;
43
+ const loop = createLoop(os, { update: stepMs => { angle += stepMs / 1000; }, render: () => { mesh.rotation.y = angle; renderer.render(scene, camera); } });
44
+ window.addEventListener("pagehide", () => { loop.stop(); os.close(); }, { once: true });
45
+ await os.ready();
@@ -0,0 +1,19 @@
1
+ {
2
+ "schemaVersion": 3,
3
+ "id": "card-spinner",
4
+ "version": "1.0.0",
5
+ "name": "Card Spinner",
6
+ "tagline": "A vmOS card, spinning in 3D.",
7
+ "entry": "index.html",
8
+ "window": { "width": 640, "height": 480, "resizable": true },
9
+ "store": {
10
+ "icon": "store/icon.png",
11
+ "screenshots": ["store/screenshot-1.png"],
12
+ "description": "Replace this description before you submit. It is the placeholder text of the VibeMarket OS Three.js starter: a card spinning in 3D, drawn with the art of a vmOS pack when vibemarket.json links one. Describe your own app here in plain text.",
13
+ "category": "app",
14
+ "rating": { "violence": "none", "language": "none", "mature": false },
15
+ "support": "https://example.com/replace-with-your-support-page"
16
+ },
17
+ "packs": [],
18
+ "cards": "none"
19
+ }
@@ -1 +1,27 @@
1
- {"schemaVersion":1,"sdkVersion":1,"id":"stamp-club","version":"1.0.0","name":"Stamp Club","tagline":"A tiny VibeMarket OS app with restorable state.","category":"vibexp-app","entry":"index.html","permissions":[],"collectionId":null}
1
+ {
2
+ "schemaVersion": 3,
3
+ "id": "stamp-club",
4
+ "version": "1.0.0",
5
+ "name": "Stamp Club",
6
+ "tagline": "A tiny VibeMarket OS app with a saved best.",
7
+ "entry": "index.html",
8
+ "window": {
9
+ "width": 640,
10
+ "height": 480,
11
+ "resizable": true
12
+ },
13
+ "store": {
14
+ "icon": "store/icon.png",
15
+ "screenshots": [
16
+ "store/screenshot-1.png"
17
+ ],
18
+ "description": "Replace this description before you submit. It is the placeholder text of the VibeMarket OS starter app, Stamp Club: start a round, press the board to place stamps, finish to report a score, and your best round is saved for the next time you open it. Describe your own app here in plain text.",
19
+ "category": "app",
20
+ "rating": {
21
+ "violence": "none",
22
+ "language": "none",
23
+ "mature": false
24
+ },
25
+ "support": "https://example.com/replace-with-your-support-page"
26
+ }
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibechain/os",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -18,7 +18,8 @@
18
18
  "AGENTS.md",
19
19
  "SECURITY.md",
20
20
  "LICENSE",
21
- "examples"
21
+ "examples/paw-beat",
22
+ "examples/vibexp-app"
22
23
  ],
23
24
  "exports": {
24
25
  ".": {
@@ -33,6 +34,10 @@
33
34
  "types": "./dist/listing.d.ts",
34
35
  "import": "./dist/listing.js"
35
36
  },
37
+ "./policy": {
38
+ "types": "./dist/runtime-policy.d.ts",
39
+ "import": "./dist/runtime-policy.js"
40
+ },
36
41
  "./loop": {
37
42
  "types": "./dist/loop.d.ts",
38
43
  "import": "./dist/loop.js"
@@ -51,7 +56,7 @@
51
56
  "vibemarket-game": "./dist/bin.js"
52
57
  },
53
58
  "scripts": {
54
- "build": "tsc && esbuild src/preview-parent.ts --bundle --minify --format=esm --target=es2022 --outfile=dist/preview-ui.js",
59
+ "build": "tsc && esbuild src/preview-parent.ts --bundle --minify --format=esm --target=es2022 --outfile=dist/preview-ui.js && esbuild src/browser.ts --bundle --minify --format=iife --global-name=VibemarketOS --target=es2022 --outfile=dist/vibemarket-os.js && esbuild examples/vibexp-app/plain/game.ts --format=iife --target=es2022 --outfile=dist/templates/plain/game.js",
55
60
  "typecheck": "tsc --noEmit",
56
61
  "review": "pnpm typecheck && tsc -p examples/tsconfig.json && vitest run --coverage",
57
62
  "check:package": "publint --pack npm && attw --pack --profile esm-only",
@@ -1,17 +0,0 @@
1
- import { START_WIDTH, type CardLayer } from './model';
2
-
3
- export interface CardSlice { left: number; right: number }
4
- /** UV width follows physical width, so the card's print never gets squeezed. */
5
- export function centeredCardSlice(width: number): CardSlice {
6
- if (!Number.isFinite(width) || width <= 0 || width > START_WIDTH) throw new Error('Invalid card slice width');
7
- const span = width / START_WIDTH;
8
- return { left: (1 - span) / 2, right: (1 + span) / 2 };
9
- }
10
- /** A landed piece and its falling offcut retain complementary parts of the incoming print. */
11
- export function cutCardSlice(card: Pick<CardLayer, 'x' | 'width'>, piece: Pick<CardLayer, 'x' | 'width'>): CardSlice {
12
- const source = centeredCardSlice(card.width);
13
- if (![card.x, piece.x, piece.width].every(Number.isFinite) || piece.width <= 0
14
- || piece.x < card.x - 1e-7 || piece.x + piece.width > card.x + card.width + 1e-7) throw new Error('Piece is outside the card');
15
- const left = source.left + (piece.x - card.x) / START_WIDTH;
16
- return { left: Math.max(0, left), right: Math.min(1, left + piece.width / START_WIDTH) };
17
- }
@@ -1,57 +0,0 @@
1
- import * as THREE from "three";
2
- import { SKINS } from "./skins";
3
-
4
- /** Procedural author-owned character: no host renderer or remote model. */
5
- export function createChonk() {
6
- const root = new THREE.Group();
7
- const fur = new THREE.MeshPhysicalMaterial({ color: SKINS[0].fur, roughness: 0.4, clearcoat: 0.45 });
8
- const belly = new THREE.MeshStandardMaterial({ color: SKINS[0].belly, roughness: 0.55 });
9
- const pink = new THREE.MeshStandardMaterial({ color: "#ff94bd", roughness: 0.4 });
10
- const black = new THREE.MeshPhysicalMaterial({ color: "#100e29", roughness: 0.25, clearcoat: 0.4, envMapIntensity: 0.2 });
11
- const white = new THREE.MeshBasicMaterial({ color: "#ffffff" });
12
- const gold = new THREE.MeshStandardMaterial({ color: "#ffc54f", metalness: 0.8, roughness: 0.19 });
13
- const stripe = new THREE.MeshStandardMaterial({ color: "#96623d", roughness: 0.55 });
14
- const ball = new THREE.SphereGeometry(1, 24, 16);
15
- const mesh = (geometry: THREE.BufferGeometry, material: THREE.Material, position: number[], scale = [1, 1, 1]) => {
16
- const item = new THREE.Mesh(geometry, material); item.position.set(position[0], position[1], position[2]); item.scale.set(scale[0], scale[1], scale[2]); item.castShadow = true; root.add(item); return item;
17
- };
18
- mesh(ball, fur, [0, 0.68, 0], [0.91, 0.67, 0.71]);
19
- mesh(ball, belly, [0, 0.6, 0.54], [0.61, 0.44, 0.25]);
20
- mesh(ball, fur, [0, 1.36, 0.08], [1.03, 0.75, 0.76]);
21
- const ear = new THREE.ConeGeometry(0.39, 0.8, 3);
22
- for (const side of [-1, 1]) {
23
- const outer = mesh(ear, fur, [side * 0.67, 1.99, 0.07]); outer.rotation.z = side * -0.24; outer.rotation.y = Math.PI;
24
- const inner = mesh(ear, pink, [side * 0.67, 2.02, 0.18], [0.58, 0.66, 0.58]); inner.rotation.copy(outer.rotation);
25
- mesh(ball, fur, [side * 0.56, 0.12, 0.39], [0.35, 0.16, 0.35]);
26
- mesh(ball, belly, [side * 0.24, 1.11, 0.75], [0.35, 0.23, 0.13]);
27
- mesh(ball, pink, [side * 0.59, 1.2, 0.65], [0.17, 0.085, 0.05]);
28
- mesh(ball, black, [side * 0.38, 1.45, 0.745], [0.12, 0.17, 0.075]);
29
- mesh(ball, white, [side * 0.38 - 0.035, 1.5, 0.81], [0.037, 0.05, 0.015]);
30
- for (let i = 0; i < 3; i++) {
31
- const line = new THREE.Line(new THREE.BufferGeometry().setFromPoints([new THREE.Vector3(side * 0.58, 1.04 + i * 0.09, 0.7), new THREE.Vector3(side * 1.13, 0.98 + i * 0.15, 0.65)]), new THREE.LineBasicMaterial({ color: "#fff7eb" })); root.add(line);
32
- }
33
- }
34
- mesh(ball, pink, [0, 1.18, 0.865], [0.09, 0.065, 0.055]);
35
- for (const side of [-1, 1]) {
36
- const smile = new THREE.Mesh(new THREE.TorusGeometry(0.115, 0.013, 5, 12, Math.PI), black); smile.rotation.z = Math.PI; smile.position.set(side * 0.106, 1.052, 0.873); root.add(smile);
37
- }
38
- const tailCurve = new THREE.CatmullRomCurve3([new THREE.Vector3(0.5, 0.35, -0.4), new THREE.Vector3(1.1, 0.4, -0.65), new THREE.Vector3(1.35, 0.9, -0.4), new THREE.Vector3(1.1, 1.05, -0.28)]);
39
- mesh(new THREE.TubeGeometry(tailCurve, 16, 0.17, 8, false), fur, [0, 0, 0]);
40
- const glasses = new THREE.Group(), shades = new THREE.Group(), jewelry = new THREE.Group(), stripes = new THREE.Group(), bracelets = new THREE.Group();
41
- root.add(glasses, shades, jewelry, stripes, bracelets);
42
- for (const side of [-1, 1]) {
43
- const lens = new THREE.Mesh(new THREE.TorusGeometry(0.24, 0.028, 6, 24), black); lens.position.set(side * 0.37, 1.45, 0.85); glasses.add(lens);
44
- const shade = new THREE.Mesh(new THREE.BoxGeometry(0.48, 0.29, 0.06), black); shade.position.set(side * 0.37, 1.44, 0.855); shade.rotation.z = side * 0.07; shades.add(shade);
45
- const bracelet = new THREE.Mesh(new THREE.TorusGeometry(0.23, 0.055, 6, 16), pink); bracelet.rotation.x = Math.PI / 2; bracelet.position.set(side * 0.56, 0.17, 0.39); bracelets.add(bracelet);
46
- }
47
- const bridge = new THREE.Mesh(new THREE.BoxGeometry(0.25, 0.03, 0.04), black); bridge.position.set(0, 1.47, 0.86); glasses.add(bridge); shades.add(bridge.clone());
48
- const chain = new THREE.Mesh(new THREE.TorusGeometry(0.6, 0.055, 7, 28), gold); chain.rotation.x = Math.PI / 2.8; chain.position.set(0, 0.92, 0.25); jewelry.add(chain);
49
- const charm = new THREE.Mesh(new THREE.OctahedronGeometry(0.14), gold); charm.position.set(0, 0.49, 0.77); jewelry.add(charm);
50
- for (const x of [-0.23, 0, 0.23]) { const mark = new THREE.Mesh(new THREE.CapsuleGeometry(0.047, 0.18, 3, 6), stripe); mark.position.set(x, 1.89, 0.49); mark.rotation.x = -0.65; stripes.add(mark); }
51
- return { root, skin(index: number) {
52
- const look = SKINS[index] ?? SKINS[0]; fur.color.set(look.fur); belly.color.set(look.belly);
53
- fur.metalness = index === 5 ? 0.45 : 0; fur.roughness = index === 5 ? 0.22 : 0.4;
54
- glasses.visible = index === 3; shades.visible = index === 4; jewelry.visible = index === 5; stripes.visible = index === 1 || index === 5; bracelets.visible = index === 2;
55
- stripe.color.set(index === 5 ? "#b68c28" : "#96623d");
56
- } };
57
- }
@@ -1,174 +0,0 @@
1
- :root { color-scheme: dark; font-family: Arial, Helvetica, sans-serif; color: #f6efff; background: #090519; font-synthesis: none; --foil: #f47bd5; --cyan: #87fff0; --lime: #bdff63; --muted: #b8a8d4; }
2
- * { box-sizing: border-box; }
3
- html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
4
- button { font: inherit; color: inherit; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
5
- button:disabled { cursor: default; }
6
- button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
7
- button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
8
- [hidden] { display: none !important; }
9
- #stack { position: relative; width: 100%; height: 100%; isolation: isolate; overflow: hidden; }
10
- #board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; }
11
- .top { position: absolute; left: 28px; right: 28px; top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 28px; pointer-events: none; z-index: 3; }
12
- .wordmark { color: #fff4fb; font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: -1px; line-height: 1; display: grid; flex-shrink: 0; }
13
- .wordmark span { font: 8px monospace; letter-spacing: 2px; margin-top: 7px; color: var(--cyan); }
14
- .top-right { display: flex; align-items: center; gap: 20px; }
15
- .best-stat { text-align: right; }
16
- .best-stat span { display: block; color: var(--muted); font: 8px monospace; letter-spacing: 1.1px; }
17
- .best-stat b { display: block; margin-top: 5px; font: 700 24px/1 monospace; font-variant-numeric: tabular-nums; }
18
- .top-right button { pointer-events: auto; width: 44px; height: 44px; border: 1px solid #9f80c766; border-radius: 12px; background: #170c31d9; display: grid; place-items: center; }
19
- .top-right button:hover { background: #39214e; }
20
- .run-hud { display: none; align-items: center; gap: clamp(20px, 3vw, 46px); padding: 16px 24px; border: 1px solid #977aa544; border-radius: 16px; background: linear-gradient(120deg,#23142fe8,#0c091ee8); box-shadow: inset 0 1px #fff1,0 8px 30px #04010b44; }
21
- .is-playing .run-hud, .is-paused .run-hud { display: flex; }
22
- .is-ended .top { display: none; }
23
- .score { display: flex; align-items: center; gap: 12px; }
24
- .score strong { min-width: 38px; font: 900 italic 48px/.9 Arial,sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -2px; color: #fff4fa; }
25
- .score > span { font: 9px/1.5 monospace; letter-spacing: 1.6px; color: var(--muted); }
26
- .width-stat { width: clamp(85px, 11vw, 160px); }
27
- .stat-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 9px monospace; letter-spacing: 1px; color: var(--muted); }
28
- .stat-label b { font-size: 11px; font-weight: normal; letter-spacing: 0; color: #fff4fa; }
29
- #width-meter { margin-top: 10px; height: 7px; border-radius: 2px; background: #67527844; overflow: hidden; }
30
- #width-fill { display: block; height: 100%; background: var(--cyan); transform-origin: left; transition: transform .25s ease-out, background .2s; }
31
- #width-meter[data-narrow=true] #width-fill { background: var(--foil); }
32
- .streak-stat { position: relative; width: 120px; }
33
- #streak-pips { display: flex; gap: 5px; margin-top: 10px; }
34
- #streak-pips i { height: 7px; flex: 1; background: #67527844; border-radius: 2px; transform: skewX(-15deg); transition: background .15s; }
35
- #streak-pips i[data-lit=true] { background: var(--lime); box-shadow: 0 0 10px #bdff6333; }
36
- .streak-help { position: absolute; top: calc(100% + 25px); right: 0; white-space: nowrap; font: 8px monospace; letter-spacing: .8px; color: var(--muted); }
37
- .overlay { position: absolute; inset: 0; display: flex; align-items: center; flex-direction: column; justify-content: center; pointer-events: none; z-index: 2; }
38
- .overlay button { pointer-events: auto; }
39
- .intro-copy { position: absolute; left: 6%; top: 21%; text-align: left; pointer-events: none; }
40
- .eyebrow { display: block; font: 9px monospace; letter-spacing: 2.3px; }
41
- .intro-copy .eyebrow { color: var(--cyan); font-size: 10px; letter-spacing: 3px; }
42
- h1 { font: 900 italic clamp(42px,5.8vw,81px)/.88 Arial,sans-serif; letter-spacing: -4px; margin: 22px 0; }
43
- h1 em { color: var(--foil); text-shadow: 0 0 40px #ed45cc44; font-size: .72em; letter-spacing: -3px; }
44
- p { font-size: 13px; line-height: 1.5; }
45
- .primary { background: var(--lime); color: #18102d; padding: 17px 23px; border-radius: 10px; min-width: 210px; display: flex; justify-content: space-between; align-items: center; gap: 28px; font-size: 14px; font-weight: bold; font-style: italic; text-transform: uppercase; box-shadow: 0 0 24px #beff6320,0 5px 0 #6c853344; transition: translate .15s, background .15s; }
46
- .primary:hover { background: #d3ff93; translate: 0 -2px; }
47
- .primary:active { translate: 0 2px; }
48
- .primary span { font-style: normal; }
49
- #intro > .primary { position: absolute; left: 6%; bottom: 24%; }
50
- #intro > small { position: absolute; left: 6%; bottom: calc(24% - 25px); font: 8px monospace; letter-spacing: 1.8px; color: var(--muted); }
51
- h2 { font-size: 40px; letter-spacing: -2px; margin: 14px 0 0; }
52
- .overlay h2 { color: #fff4fa; font-style: italic; text-transform: uppercase; }
53
- #result, .pause-overlay { background: #0905199e; backdrop-filter: blur(5px); }
54
- .result-card, .pause-card { width: min(360px,calc(100% - 40px)); text-align: center; border: 1px solid #b68ace66; background: linear-gradient(155deg,#39233be8,#100a22f0); border-radius: 22px; padding: 30px; box-shadow: 0 30px 90px #0007,inset 0 1px #fff1; }
55
- .result-card .eyebrow, .pause-card .eyebrow { color: var(--cyan); }
56
- .result-card h2 { font-size: 30px; letter-spacing: -1.2px; }
57
- .result-score { display: grid; gap: 8px; padding: 24px 0; }
58
- .result-score strong { font: 900 italic 92px/.85 Arial,sans-serif; letter-spacing: -5px; }
59
- .result-score span { font: 8px monospace; letter-spacing: 2px; color: var(--muted); }
60
- .result-stats { display: flex; justify-content: space-between; border-top: 1px solid #977aa544; padding-top: 17px; margin-bottom: 24px; }
61
- .result-stats > span { display: grid; gap: 8px; font: 7px monospace; letter-spacing: 1px; color: var(--muted); }
62
- .result-stats b { color: #fff4fa; font: 18px monospace; }
63
- .result-card .primary, .pause-card .primary { width: 100%; min-width: 0; }
64
- .pause-card .primary { margin-top: 30px; }
65
- .bottom { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); width: min(680px,calc(100% - 56px)); display: grid; grid-template-columns: 1fr 1.15fr .85fr; align-items: stretch; gap: 8px; padding: 8px; z-index: 3; border: 1px solid #977aa55c; border-radius: 18px; background: linear-gradient(110deg,#25172ee8,#0c091eed); box-shadow: 0 12px 36px #0006,inset 0 1px #fff1; }
66
- .is-intro .bottom, .is-ended .bottom, .is-paused .bottom { width: min(420px,calc(100% - 56px)); grid-template-columns: 1.2fr 1fr; }
67
- .cat-button { display: flex; align-items: center; background: transparent; border-radius: 11px; color: #f7efff; text-align: left; padding: 2px 8px 2px 2px; gap: 8px; min-width: 0; }
68
- .cat-button:hover, .shop-button:hover { background: #684d772e; }
69
- .cat-button canvas { width: 48px; height: 44px; flex-shrink: 0; }
70
- .cat-button small { display: flex; gap: 8px; font: 8px monospace; letter-spacing: .8px; margin-bottom: 5px; color: var(--muted); white-space: nowrap; }
71
- .cat-button b { font-size: 12px; white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
72
- .cat-button svg { width: 15px; height: 15px; margin-left: auto; color: var(--muted); }
73
- .shop-button { background: transparent; border-radius: 11px; color: #f6efff; padding: 8px 10px; font-size: 11px; font-weight: bold; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 10px; }
74
- .shop-button > svg { width: 27px; height: 27px; color: var(--foil); }
75
- .shop-button > span { text-align: left; }
76
- .drop-button { padding: 16px 18px; min-height: 56px; border-radius: 10px; background: var(--lime); color: #201432; box-shadow: 0 0 24px #baff5f14,inset 0 -3px #0002; font-weight: bold; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-transform: uppercase; font-style: italic; transition: background .15s; }
77
- .drop-button:hover { background: #d3ff93; }
78
- .drop-button:active { background: #a8eb4f; }
79
- .drop-button kbd { font: 8px monospace; padding: 4px 6px; border: 1px solid #20143244; border-radius: 4px; }
80
- #callout { position: absolute; top: 20%; left: 0; right: 0; text-align: center; font: 900 italic clamp(20px,3vw,29px) Arial,sans-serif; pointer-events: none; color: var(--lime); text-shadow: 0 0 24px #bfff7d66; }
81
- #collection { width: min(600px,calc(100% - 28px)); max-height: calc(100% - 36px); overflow: auto; border: 1px solid #74529399; border-radius: 20px; background: #160c29f5; color: #f7efff; padding: 26px; box-shadow: 0 35px 110px #01000699; }
82
- #collection::backdrop { background: #070216aa; backdrop-filter: blur(8px); }
83
- #collection header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
84
- #collection .eyebrow { color: var(--cyan); }
85
- #collection header h2 { font: 900 italic 28px Arial,sans-serif; letter-spacing: -1.5px; }
86
- #collection header button { background: #322045; color: #fff; border-radius: 12px; width: 44px; height: 44px; font-size: 25px; flex-shrink: 0; }
87
- .collection-summary { display: flex; justify-content: space-between; font: 9px monospace; color: var(--muted); margin-top: 22px; }
88
- #skins { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
89
- #skins button { position: relative; display: flex; flex-direction: column; align-items: center; border-radius: 12px; padding: 10px 5px 14px; background: #2a1841; border: 1px solid #7b5da659; border-top: 2px solid var(--skin-color); min-width: 0; }
90
- #skins button[aria-pressed=true] { border-color: var(--lime); background: #2c382b; box-shadow: 0 0 22px #adff6616; }
91
- #skins button[aria-pressed=true] small { color: var(--lime); }
92
- #skins button:disabled { background: #211530; }
93
- #skins button:disabled canvas { opacity: .42; }
94
- .skin-rarity { font: 7px monospace; letter-spacing: 1.1px; color: var(--skin-color); }
95
- #skins canvas { width: 90px; max-width: 100%; height: 85px; margin-top: 8px; }
96
- #skins b { font-size: 11px; margin-top: 8px; text-align: center; color: #f6eaff; }
97
- #skins small { font: 7px monospace; letter-spacing: .7px; margin-top: 7px; color: var(--muted); }
98
- #collection p { font-size: 11px; color: var(--muted); margin: 18px 0; }
99
- #collection > .primary { width: 100%; margin-top: 14px; }
100
- #error { position: absolute; bottom: 108px; left: 20px; right: 20px; border-radius: 12px; padding: 12px 16px; background: #251433f2; color: #ffdee9; border: 1px solid #b46798; font-size: 11px; z-index: 5; margin: 0; }
101
- #error button { margin-left: 10px; text-decoration: underline; background: none; min-height: 24px; }
102
- @media (max-width: 950px) {
103
- .is-playing .wordmark, .is-paused .wordmark { display: none; }
104
- .run-hud { flex: 1; justify-content: space-between; }
105
- .top { gap: 20px; }
106
- .top-right { gap: 14px; }
107
- }
108
- @media (max-width: 650px) {
109
- .intro-copy { left: 0; right: 0; top: 13%; text-align: center; }
110
- .intro-copy .eyebrow { font-size: 8px; letter-spacing: 2.5px; }
111
- h1 { font-size: 52px; letter-spacing: -3px; margin: 17px 0 10px; }
112
- h1 em { letter-spacing: -2px; }
113
- #intro > .primary { left: 50%; transform: translateX(-50%); bottom: 20%; padding: 15px 20px; }
114
- #intro > small { left: 0; right: 0; bottom: calc(20% - 25px); text-align: center; }
115
- .wordmark { font-size: 17px; }
116
- .wordmark span { font-size: 6px; }
117
- .top { top: 16px; left: 16px; right: 16px; gap: 8px; }
118
- .is-playing .best-stat, .is-paused .best-stat { display: none; }
119
- .run-hud { border: 0; background: transparent; box-shadow: none; padding: 0; gap: 12px; }
120
- .score { display: grid; gap: 5px; }
121
- .score strong { font-size: 38px; min-width: 25px; }
122
- .score > span { font-size: 7px; letter-spacing: .4px; white-space: nowrap; }
123
- .score > span br { display: none; }
124
- .width-stat { width: 75px; min-width: 55px; flex: 1; }
125
- .stat-label { font-size: 8px; letter-spacing: 0; gap: 4px; }
126
- .stat-label b { font-size: 10px; }
127
- .streak-stat { width: 65px; flex-shrink: 0; }
128
- .streak-help { top: calc(100% + 10px); font-size: 7px; letter-spacing: .3px; }
129
- #width-meter, #streak-pips { margin-top: 8px; }
130
- .top-right button { border-radius: 10px; }
131
- .bottom { width: calc(100% - 28px); bottom: 14px; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; border-radius: 16px; }
132
- .is-intro .bottom, .is-ended .bottom, .is-paused .bottom { width: calc(100% - 28px); }
133
- .drop-button { grid-row: 2; grid-column: 1 / -1; justify-content: center; gap: 16px; min-height: 48px; padding: 12px 16px; }
134
- .drop-button kbd { display: none; }
135
- .cat-button { padding-right: 6px; gap: 6px; }
136
- .cat-button canvas { width: 40px; height: 38px; }
137
- .cat-button small { font-size: 7px; gap: 5px; }
138
- .cat-button b { font-size: 11px; max-width: 104px; }
139
- .cat-button svg { display: none; }
140
- .shop-button { justify-self: end; gap: 8px; font-size: 11px; }
141
- .shop-button > svg { width: 23px; height: 23px; }
142
- #callout { top: 18%; }
143
- #collection { padding: 20px; }
144
- #collection header h2 { font-size: 24px; }
145
- #collection .eyebrow { font-size: 7px; letter-spacing: 1.5px; }
146
- #skins { gap: 6px; }
147
- #skins b { font-size: 9px; }
148
- #skins canvas { width: 75px; height: 70px; }
149
- #skins small, .skin-rarity { font-size: 7px; }
150
- .collection-summary { font-size: 8px; }
151
- .eyebrow { font-size: 8px; }
152
- .is-playing #error { bottom: 140px; }
153
- }
154
- @media (max-height: 530px) {
155
- .top { top: 12px; }
156
- .bottom { bottom: 12px; }
157
- .run-hud { padding-top: 10px; padding-bottom: 10px; }
158
- .result-card { padding: 20px; width: 300px; }
159
- .result-score { padding: 14px 0; }
160
- .result-score strong { font-size: 56px; }
161
- .result-stats { margin-bottom: 16px; padding-top: 12px; }
162
- .result-card h2 { font-size: 26px; }
163
- .is-ended .bottom { display: none; }
164
- }
165
- @media (max-height: 530px) and (min-width: 651px) {
166
- h1 { font-size: 50px; }
167
- #intro > .primary { bottom: 24%; }
168
- #intro > small { bottom: calc(24% - 22px); }
169
- #callout { top: 27%; }
170
- }
171
- @media (prefers-reduced-motion: reduce) {
172
- *, *:before, *:after { transition: none !important; animation: none !important; }
173
- #result, .pause-overlay, #collection::backdrop { backdrop-filter: none; }
174
- }
@@ -1,32 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Chonk Stack</title><link rel="stylesheet" href="./game.css"></head>
4
- <body>
5
- <main id="stack" aria-label="Chonk Stack">
6
- <canvas id="board" aria-label="Your tower of trading cards"></canvas>
7
- <header class="top">
8
- <div class="wordmark">CHONK<span>STACK / 3D</span></div>
9
- <div class="run-hud" aria-label="Run stats">
10
- <div class="score" aria-live="polite" aria-atomic="true"><strong id="score">0</strong><span>CARDS <br>HIGH</span></div>
11
- <div class="width-stat"><div class="stat-label"><span>WIDTH</span><b id="width-value">100%</b></div><div id="width-meter" role="meter" aria-label="Remaining card width" aria-valuemin="0" aria-valuemax="100" aria-valuenow="100"><i id="width-fill"></i></div></div>
12
- <div class="streak-stat"><div class="stat-label"><span>PERFECT</span><b id="combo">×0</b></div><div id="streak-pips" aria-hidden="true"><i></i><i></i><i></i></div><span class="streak-help" id="streak-help">3 IN A ROW → WIDER CARD</span></div>
13
- </div>
14
- <div class="top-right"><div class="best-stat"><span>SESSION BEST</span><b id="best">0</b></div><button id="pause" aria-label="Pause game" hidden><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M8 6v12M16 6v12"/></svg></button></div>
15
- </header>
16
- <section id="intro" class="overlay">
17
- <div class="intro-copy"><span class="eyebrow">AFTER HOURS ARCADE</span><h1>STACK THE<br><em>IMPOSSIBLE.</em></h1></div>
18
- <button id="play" class="primary">Let’s stack <span>↗</span></button><small>TAP OR SPACE TO DROP</small>
19
- </section>
20
- <section id="result" class="overlay" hidden aria-label="Run result"><div class="result-card"><span id="result-label" class="eyebrow">RUN COMPLETE</span><h2 id="result-title">Nice stack.</h2><div class="result-score"><strong id="result-score">0</strong><span>CARDS HIGH</span></div><div class="result-stats"><span>BEST STREAK <b id="result-streak">×0</b></span><span>SESSION BEST <b id="result-best">0</b></span></div><button id="again" class="primary">Play again <span>↻</span></button></div></section>
21
- <section id="paused" class="overlay pause-overlay" hidden><div class="pause-card"><span class="eyebrow">TOWER SAVED</span><h2>Paused.</h2><button id="resume" class="primary">Resume <span>▶</span></button></div></section>
22
- <div id="callout" aria-live="polite"></div>
23
- <footer class="bottom">
24
- <button id="wardrobe" class="cat-button" aria-haspopup="dialog"><canvas id="avatar" width="100" height="90" aria-hidden="true"></canvas><span><small>YOUR CHONK <span id="wardrobe-count">1/6</span></small><b id="cat-name">Cloud</b></span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 5h5v5H5zM14 5h5v5h-5zM5 14h5v5H5zM14 14h5v5h-5z"/></svg></button>
25
- <button id="drop" class="drop-button" hidden><span>Drop card</span><kbd>SPACE</kbd><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 4v16m-6-6 6 6 6-6"/></svg></button>
26
- <button id="shop" class="shop-button"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m4 6 12-3 4 15-12 3zM8 8h8M10 16h5"/></svg><span>After Hours ↗</span></button>
27
- </footer>
28
- <dialog id="collection" aria-labelledby="collection-title"><header><div><span class="eyebrow">AFTER HOURS COLLECTION</span><h2 id="collection-title">YOUR CHONKS.</h2></div><button id="close-collection" aria-label="Close collection">×</button></header><div class="collection-summary"><span id="owned-count">1 / 6 available</span><span>Cosmetic skins</span></div><div id="skins"></div><p>Collect a card from an After Hours pack to unlock its chonk.</p><button id="collection-shop" class="primary">Explore packs <span>↗</span></button></dialog>
29
- <p id="error" role="alert" hidden></p>
30
- </main>
31
- <script defer src="./game.js"></script>
32
- </body></html>