Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(pill): give the rigged mascot a stage at /pill
nirholas269d10bb86ac
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 97cee4ebc..9a28ec442 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,7 +6,10 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-08-24+- **Docs · Rigging the pump.fun pill mascot** (`/docs/pill-mascot`): How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.+- **The pump.fun Pill, Rigged** (`/pill`): three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.- **$THREE now carries its pump.fun verification badge, read live from pump.fun**: pump.fun verifies a project's coin as officially belonging to that project, which is what tells a buyer the real $THREE apart from the copies that share its name and ticker. That badge now appears next to $THREE on the token page and on the holder dashboard. It is never hardcoded: the platform reads pump.fun's own verification flag on every stats request and renders the badge only while pump.fun publishes it, so a badge on three.ws always means the same thing as a badge on pump.fun. (`/three-token`) `[feature, improvement]`+- **The pump.fun pill mascot is now a rigged, drivable avatar at /pill**: pump.fun verified $THREE as officially ours, so we rigged their pill mascot and built it a stage. Walk it around with WASD or a touch joystick, run, jump, wave, dance, and drag to orbit. The model arrived as a static 297,000-triangle capsule with four stubby nubs, which our humanoid auto-rigger cannot read because there is no neck, no head and no long limbs to find. It now carries a 52-bone skeleton with canonical bone names, six clips authored for its own proportions, and 44,544 triangles in a 2.6 MB file, which means the entire three.ws animation library retargets onto it as well. Download the GLB from the page and open it in Blender, Unity, or anything that reads glTF. (`/pill`) `[feature, improvement]`## 2026-08-22diff --git a/STRUCTURE.md b/STRUCTURE.mdindex b8a2b2fbb..3d5d428df 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -25,6 +25,7 @@ bottom.| React avatar creator | [avatar-sdk/](avatar-sdk) `→ /react` `/creator` | Published as `@three-ws/avatar` | Same package, React subpath || Avatar CLI (manifests in the build pipeline) | [packages/avatar-cli/](packages/avatar-cli), landing [pages/avatar-cli.html](pages/avatar-cli.html) `→ /avatar-cli`, styles [public/avatar-cli.css](public/avatar-cli.css), page runtime [src/avatar-cli-page.js](src/avatar-cli-page.js) | Published as `@three-ws/avatar-cli` | The terminal half of the avatar story, and the half that makes an avatar auditable. Four commands over one file: `init` scaffolds a schema-valid manifest from a wallet plus a mesh (reading the GLB once to compute its SHA-256 and size, so the document cannot disagree with the bytes it was built from), `validate` checks it against [packages/avatar-schema/](packages/avatar-schema) and exits non-zero so it works as a build gate, `hash` prints a bare digest that composes in a shell, and `preview` emits a resolver URL, an `<agent-3d>` snippet paired with the loader that registers it, and a zero-install iframe. Offline and deterministic throughout: no account, no API key, no network call, which is what makes it safe in a release script. `preview` warns instead of printing a dead snippet when `mesh.uri` is still a local `file://` path. The landing page proves the emitted markup by rendering it live rather than screenshotting it. Docs: [docs/avatar-cli.md](docs/avatar-cli.md) `→ /docs/avatar-cli`, tutorial [docs/tutorials/ship-an-avatar-manifest.md](docs/tutorials/ship-an-avatar-manifest.md). Tests: [packages/avatar-cli/test/](packages/avatar-cli/test) || Rig Doctor (will this GLB animate?) | [pages/rig-doctor.html](pages/rig-doctor.html) `→ /rig-doctor`, analysis [src/rig-report.js](src/rig-report.js), page runtime [src/rig-doctor-page.js](src/rig-doctor-page.js), styles [public/rig-doctor.css](public/rig-doctor.css) | Live | The answer to the most expensive silent failure on the platform: a rig loads, renders, and never moves, because clips address bones by name and this skeleton calls them something else. Drop a `.glb` and the page reads its glTF JSON chunk in the browser, names the authoring convention (twelve fingerprints, from Mixamo and Ready Player Me to Unreal, VRM, MMD, Biped, Rigify, and HumanIK), and scores four limb groups independently against the 52-joint canonical set, because "62% covered" is not actionable and "your legs will not move" is. The verdict mirrors the runtime gate in [src/animation-manager.js](src/animation-manager.js) exactly (a skinned mesh plus 8 mapped joints), so it predicts rather than approximates. It then does two things a report cannot: mounts the real [src/avatar-pose.js](src/avatar-pose.js) stage on a blob URL of the file so the user watches their own rig perform the actual clip library, and runs [src/glb-canonicalize.js](src/glb-canonicalize.js) in-browser to hand back a repaired GLB with canonical joint names. Nothing is uploaded: the only network calls are for the clip library and the sample rigs. Also emits a schema-v1 manifest, an `<agent-3d>` snippet, and the matching [packages/avatar-cli/](packages/avatar-cli) commands. Docs: [docs/rig-doctor.md](docs/rig-doctor.md) `→ /docs/rig-doctor`. Tests: [tests/rig-report.test.js](tests/rig-report.test.js) |+| The pump.fun pill (`/pill`) | [pages/pill.html](pages/pill.html) `→ /pill` + [src/pill.js](src/pill.js) + [src/pill.css](src/pill.css), rigger [scripts/rig-pill-mascot.py](scripts/rig-pill-mascot.py), decimator [scripts/decimate-glb.mjs](scripts/decimate-glb.mjs), assets [public/avatars/pumpfun-pill-cupsey.glb](public/avatars/pumpfun-pill-cupsey.glb) (rigged) + `pumpfun-pill-cupsey-static.glb` (the rigger's input) | Live | pump.fun verified $THREE as officially ours, and this is the thank-you: their pill mascot rigged, animated, and drivable in the browser. WASD or a touch joystick walks it, Shift runs, Space jumps, drag orbits, and the toolbar fires wave/jump/dance. The stage plays the model's own six embedded clips, so it needs no retargeting at load and no clip fetch. The model could not go through [workers/rig](workers/rig): a capsule with four stubby nubs has no neck, no separate head and no long limbs for a humanoid predictor to find, so it got its own pipeline. That pipeline is general to capsule-with-nubs mascots, not to this character: limbs discovered from the mesh's distance transform, medial curves traced with a minimum-cost path, skin weights decided by walking each vertex inward to the medial axis of the part it is skin for (straight-line and geodesic distance both weld the raised hand to the cheek it rests against), and the neutral standing pose baked into the shipped geometry so bind and rest coincide. Canonical bone names mean the whole clip library retargets onto it at 100% coverage. Docs: [docs/pill-mascot.md](docs/pill-mascot.md) `→ /docs/pill-mascot`. Tests: [tests/pill-rig.test.js](tests/pill-rig.test.js) || Talking page guide | [page-agent-sdk/](page-agent-sdk) | Published as `@three-ws/page-agent` | Drop-in rigged 3D agent that narrates any page + visitor avatar picker. `<page-agent>` web component. Rigged-only catalog. `preset="…"` resolves one of 5 personas (greeting/role/suggested-prompt chips/tool allowlist) — see [page-agent-sdk/README.md#persona-presets](page-agent-sdk/README.md#persona-presets). See [page-agent-sdk/PUBLISHING.md](page-agent-sdk/PUBLISHING.md) || Guided site tour | [tour-sdk/](tour-sdk) | Published as `@three-ws/tour` | 3D guide walks a live site, spotlights sections, narrates each. One-tag CDN build + free roam || Concierge (embeddable AI support chat) | [concierge-sdk/](concierge-sdk), backend [api/concierge.js](api/concierge.js) `→ /api/concierge`, landing [pages/concierge.html](pages/concierge.html) `→ /concierge`, first-party CDN copy `→ /concierge/concierge.global.js` (mirrored by [concierge-sdk/build.mjs](concierge-sdk/build.mjs)) | Published as `@three-ws/concierge` | An AI concierge for ANY website: floating launcher, chat panel with a rigged 3D avatar bust (blink/idle/viseme lipsync via the page-agent stage lineage), SSE-streamed answers grounded in the live page (ask-time DOM harvest + host `knowledge`, no crawler), speaks while streaming (sentence-level TTS handoff), push-to-talk mic, themes/accent/position, avatar picker or custom GLB. Backend is anonymous + CORS-`*` (third-party origins by design) with its own rate buckets (`limits.conciergeIp`/`conciergeGlobal`), no platform-side content filter on the visitor question, and streaming failover over the shared free-first chain (api/_lib/llm.js). Shopping mode (Shopify): when embedded on a Shopify storefront it auto-detects the store (`window.Shopify` / `shop` config) and becomes a shopping assistant, reading the store's public `/products.json` + `/collections.json` + `/policies/*` at ask-time (no key, no crawler, same-origin), retrieving the relevant products per question via keyword+intent search ([concierge-sdk/src/shopify.js](concierge-sdk/src/shopify.js)), grounding the answer in them, and rendering real product cards (image/live price/link + on-store `/cart/add.js` add-to-cart). The endpoint accepts a bounded `shopping` payload and swaps the system prompt to a store assistant. `<three-concierge>` element, `data-concierge` one-tag auto-init, or `new Concierge({...})`. Also reachable from any AI agent via the MCP server [packages/concierge-mcp/](packages/concierge-mcp) (`@three-ws/concierge-mcp`, registry `io.github.nirholas/concierge-mcp`): `concierge_ask` (ask any site's concierge, grounded in the fetched page), `concierge_embed` (generate the embed), `concierge_avatars`. Examples: [concierge-sdk/examples/](concierge-sdk/examples) (one-tag, web component, imperative, custom avatar, React, self-hosted backend). Docs: [docs/concierge.md](docs/concierge.md), tutorial [docs/tutorials/build-a-site-concierge.md](docs/tutorials/build-a-site-concierge.md). Tests: [concierge-sdk/test/](concierge-sdk/test), [tests/api-concierge.test.js](tests/api-concierge.test.js), [packages/concierge-mcp/test/](packages/concierge-mcp/test) |diff --git a/data/changelog.json b/data/changelog.jsonindex 4778e491f..8a04a5e1a 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-08-24",+ "title": "The pump.fun pill mascot is now a rigged, drivable avatar at /pill",+ "summary": "pump.fun verified $THREE as officially ours, so we rigged their pill mascot and built it a stage. Walk it around with WASD or a touch joystick, run, jump, wave, dance, and drag to orbit. The model arrived as a static 297,000-triangle capsule with four stubby nubs, which our humanoid auto-rigger cannot read because there is no neck, no head and no long limbs to find. It now carries a 52-bone skeleton with canonical bone names, six clips authored for its own proportions, and 44,544 triangles in a 2.6 MB file, which means the entire three.ws animation library retargets onto it as well. Download the GLB from the page and open it in Blender, Unity, or anything that reads glTF.",+ "tags": [+ "feature",+ "improvement"+ ],+ "link": "/pill"+ },{"date": "2026-08-24","title": "$THREE now carries its pump.fun verification badge, read live from pump.fun",diff --git a/data/pages.json b/data/pages.jsonindex a9104bb4b..3ff59a02c 100644--- a/data/pages.json+++ b/data/pages.json@@ -2218,6 +2218,14 @@"priority": 0.6,"changefreq": "weekly","added": "2026-07-31"+ },+ {+ "path": "/pill",+ "title": "The pump.fun Pill, Rigged",+ "description": "three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.",+ "priority": 0.7,+ "changefreq": "monthly",+ "added": "2026-08-24"}]},@@ -4542,7 +4550,7 @@},{"path": "/docs/huggingface",- "title": "Docs \u00b7 three.ws on Hugging Face",+ "title": "Docs · three.ws on Hugging Face","description": "Hugging Face is where the machine-learning community publishes models, demos, and engineering writing. three.ws publishes there under its organization account, and this is the index of the article, the avatar rigs, and the Space.","priority": 0.6,"changefreq": "monthly"@@ -5154,6 +5162,14 @@"priority": 0.6,"changefreq": "monthly","added": "2026-08-21"+ },+ {+ "path": "/docs/pill-mascot",+ "title": "Docs · Rigging the pump.fun pill mascot",+ "description": "How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.",+ "priority": 0.5,+ "changefreq": "monthly",+ "added": "2026-08-24"}]},diff --git a/docs/nav.json b/docs/nav.jsonindex b6b392510..6a4f06218 100644--- a/docs/nav.json+++ b/docs/nav.json@@ -248,6 +248,10 @@{"label": "Avatar thumbnails","path": "avatar-thumbnails"+ },+ {+ "label": "Rigging a mascot",+ "path": "pill-mascot"}]},diff --git a/docs/pill-mascot.md b/docs/pill-mascot.mdnew file mode 100644index 000000000..f644fecfc--- /dev/null+++ b/docs/pill-mascot.md@@ -0,0 +1,140 @@+# Rigging the pump.fun pill mascot++**[The pill](https://three.ws/pill) is a static capsule with four nubs that now walks, runs, waves, jumps and dances. This is how it got there, and how to do the same thing to a character our humanoid auto-rigger refuses.**++pump.fun verified $THREE as officially ours. The mascot they use is a rounded green-and-white capsule with a painted face, two stubby arms and two stubby legs, sculpted mid-stride. We rigged it and put it on a stage at [/pill](https://three.ws/pill).++The interesting part is not the result, it is why the normal path did not work and what replaced it. If you have a mascot, a logo character, a blob, a plush, or anything else that reads as a character to a person and as noise to a rigger, this page is for you.++**On this page:** [Why auto-rigging failed](#why-the-normal-path-failed) · [The pipeline](#the-pipeline) · [Running it](#running-it) · [What ships](#what-ships) · [Reusing it](#reusing-it-on-your-own-character)++Related: [the avatar pipeline](./avatar-pipeline.md) covers the normal humanoid path (generate, auto-rig, skin, animate). [Rig Doctor](./rig-doctor.md) tells you whether a finished `.glb` will actually animate here. [The 3D asset pipeline](./3d-asset-pipeline.md) covers FBX and GLB conversion upstream of all of it.++---++## Why the normal path failed++three.ws auto-rigs humanoids with Make-It-Animatable (`workers/rig`). It predicts joint positions for a 52-bone Mixamo skeleton from the shape of a body: a head on a neck, a torso, two long arms, two long legs, standing roughly upright.++The pill has none of those landmarks.++- **No neck and no separate head.** The white "head" is the top half of one continuous capsule. There is no narrowing anywhere for a neck predictor to find.+- **Nubs, not limbs.** Each arm is about 0.1 units thick and 0.47 long on a body 2.1 units tall. As a fraction of the figure, they are closer to fingers than to arms.+- **A sculpted action pose.** The right arm is thrown up beside the head, the right leg is kicked out to the side. Riggers expect a T-pose or an A-pose, and prediction quality falls apart away from one.+- **297,000 triangles.** Scan-quality density for a shape a hundredth of that describes exactly.++Feeding that to a humanoid predictor produces a skeleton in roughly the right bounding box and wrong everywhere that matters. So the pill got a purpose-built pipeline: [`scripts/rig-pill-mascot.py`](https://github.com/nirholas/three.ws/blob/main/scripts/rig-pill-mascot.py).++---++## The pipeline++### 1. Decimate first++[`scripts/decimate-glb.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/decimate-glb.mjs) takes the mesh from 296,962 triangles to 44,544 and the file from 12.58 MB to 1.68 MB, with no visible difference: the mascot's detail lives entirely in its texture, and quadric simplification is nearly free on a smooth organic surface.++Order matters. Simplification rewrites the vertex list, and skin weights are per-vertex, so decimating a rigged model destroys its rig. The script refuses to run on a mesh that already has `JOINTS_0`.++### 2. Find the limbs from the inside++The mesh is voxelized and its euclidean distance transform taken, which gives every interior voxel its distance to the surface: the shape's own thickness field. The body is everything thicker than a limb. Remove that and its fillet, and exactly four connected components are left over: the four nubs. No landmark detection, no template, no assumption about what a limb looks like.++The result is stable across a wide range of thresholds, which is the sign that the split is a real feature of the shape rather than a tuned constant.++### 3. Trace each nub back into the body++From each nub's tip, a minimum-cost path back to the body core (`skimage.graph.route_through_array`, with cost weighted to prefer thick interior) follows the limb's actual medial curve. That is how the mascot's bent foot ends up with a bent foot bone instead of a straight line through it, and how the knee lands where the leg actually bends.++Joints are then dropped along that curve: hip, knee, ankle, toe for legs; shoulder, elbow, wrist for arms, plus five three-joint finger chains inside each mitt.++### 4. Skin by what is inside, not what is nearby++This is the step that decides whether the rig looks rigged or looks melted.++In the sculpted pose, the mascot's raised hand rests **against the side of its head**. Straight-line distance says those two surfaces are neighbours. Geodesic distance through the mesh says the same thing, because they are touching. Skin either way and lowering the arm drags a crater across the cheek.++So membership is decided somewhere else entirely: each vertex climbs the thickness field's gradient inward until it reaches the medial axis of whatever part it is skin for. A hand vertex lands on the hand's axis. A cheek vertex lands on the body's. Those are half a body apart, and the head stays still.++That classification is a watershed, so it has hard edges. Two neighbouring vertices on the crotch webbing can climb to different ridges, and an unsmoothed seam tears into a fin the moment the leg swings. The classification is blurred across the surface before it is used, at a radius derived from the mesh's own vertex spacing so the same code behaves identically on the 300k-triangle original and its 45k-triangle decimation.++### 5. Bind mid-stride, rest standing++glTF stores the **bind pose** (inverse bind matrices) separately from the **rest pose** (node transforms), and three.ws's retargeter replays clip motion as a delta on the *rest* pose. A walk cycle applied on top of a mid-stride sculpt walks mid-stride: one arm stays in the air the whole time.++So the rigger binds against the sculpted pose, where the geometry actually is, solves a neutral standing pose, and bakes that pose into the shipped vertex positions. The file you download stands with its legs under its hips and its arms out, and its bind pose and rest pose are the same thing. Every clip after that starts from somewhere sane.++Blending a 50-degree leg correction closes the crevice between leg and belly, and linear blend skinning resolves a closing crevice by stretching it. The bake measures each vertex's neighbourhood before and after and relaxes only the vertices whose local spacing collapsed, leaving the 97% that posed cleanly untouched.++### 6. Animate for the proportions it has++Six clips ship inside the GLB: `idle`, `walk`, `run`, `wave`, `jump`, `dance`. They are authored as offsets from the rest pose, in code, against a mascot with nub limbs and no neck. A human mocap walk retargets onto this rig correctly and still looks wrong, because it was performed by something with knees.++`wave` deliberately returns the character to the pose it was sculpted in.++---++## Running it++The rigger needs a small scientific Python stack that is not part of the repo's npm tree:++```bash+pip install numpy scipy scikit-image trimesh pygltflib Pillow+```++Then, from the repo root:++```bash+# 1. Decimate the raw model (skip if yours is already reasonable)+node scripts/decimate-glb.mjs raw-mascot.glb public/avatars/my-mascot-static.glb --ratio=0.15++# 2. Rig it+python3 scripts/rig-pill-mascot.py public/avatars/my-mascot-static.glb \+ --out public/avatars/my-mascot.glb --debug-dir /tmp/rig-debug+```++`--debug-dir` writes two orthographic sheets, `sculpted.png` and `neutral.png`, with the skeleton drawn over the mesh in front, side and top view. Look at them before you look at the render: a joint in the wrong place is obvious there and ambiguous in a shaded viewport.++The run prints what it found, and those lines are the check that it understood the model:++```+ facing [0. 0. 1.] from 347 face pixels (painted 3.6 deg off axis)+ RightLeg root [-0.313 -0.364 -0.008] tip [-0.565 -0.844 0.016] r=0.136+ LeftArm root [ 0.359 -0.016 -0.008] tip [ 0.791 -0.22 0.028] r=0.100+ skeleton: 52 bones+ skinned: 46/52 bones carry weight above 2%+```++Forward is detected from the model's own texture: the eyes and mouth are the only near-black pixels on the head, so their centroid off the body axis gives the facing direction, snapped to the nearest world axis (the platform's convention is that avatars face +Z).++---++## What ships++`/avatars/pumpfun-pill-cupsey.glb`, 2.6 MB:++| | |+|---|---|+| Skeleton | 52 bones, `mixamorig:` names |+| Triangles | 44,544 |+| Clips | `idle`, `walk`, `run`, `wave`, `jump`, `dance` |+| Clip-library coverage | 100% (53 of 53 tracks map) |+| Validator | 0 errors |++The static input is kept beside it as `/avatars/pumpfun-pill-cupsey-static.glb` so the rig is reproducible from the repo.++The coverage number is the one that outlives this page. Because the skeleton uses the canonical bone names, [`src/glb-canonicalize.js`](https://github.com/nirholas/three.ws/blob/main/src/glb-canonicalize.js) maps every joint 1:1 and the whole three.ws clip library retargets onto the pill: it is not limited to the six clips it ships with. Load it in the [Animation Studio](https://three.ws/pose) and try any of them.++Finger chains are part of that. Thirty of the 53 tracks in every baked clip address a finger joint, and [`src/animation-retarget.js`](https://github.com/nirholas/three.ws/blob/main/src/animation-retarget.js) drops any clip whose coverage falls under 50%. A mascot with mitts still needs finger bones inside those mitts, or it throws away the entire library. They also give the mitt a soft squish when a clip curls a hand, which is a nicer result than the alternative.++---++## Reusing it on your own character++`scripts/rig-pill-mascot.py` is written for the capsule-with-nubs family, not for the pill specifically. Nothing in it is keyed to this model: no hardcoded joint positions, no baked-in dimensions, no character name. It will rig any mesh that satisfies these:++- **One body mass and exactly four limbs.** The limb finder expects four leftover components and stops with a clear error if it finds a different number. A five-limbed character needs the bone map extended; a two-limbed one needs the skeleton definition trimmed.+- **Limbs meaningfully thinner than the body.** The split is `thickness > 0.26` in model units by default (`BODY_THICKNESS`). A character whose arms are as thick as its torso has no such split to find.+- **A sealed surface.** Small holes are closed automatically before the flood fill; a hole you could see through is refused rather than guessed at.+- **A visible face.** Forward is read from dark pixels on the head. A character with no painted face falls back to +Z.++If your character is genuinely humanoid, do not use this. Use the [standard auto-rigger](./avatar-pipeline.md), which is a one-call API and better at humanoids than this script will ever be.diff --git a/pages/pill.html b/pages/pill.htmlnew file mode 100644index 000000000..90869eeb4--- /dev/null+++ b/pages/pill.html@@ -0,0 +1,214 @@+<!doctype html>+<html lang="en">+ <head>+ <script>/* three.ws theme boot: no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>The pump.fun pill, rigged · three.ws</title>+ <meta+ name="description"+ content="pump.fun verified $THREE as officially ours. We rigged their pill mascot to say thanks: a 52-bone skeleton, six hand-built clips, and a stage you can walk it around in your browser."+ />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/pill" />+ <meta property="og:title" content="The pump.fun pill, rigged · three.ws" />+ <meta+ property="og:description"+ content="pump.fun verified $THREE as officially ours. So we rigged their pill mascot: arms, legs, six clips, and a stage you can walk it around."+ />+ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&t=The+pump.fun+pill%2C+rigged&d=pump.fun+verified+%24THREE.+We+rigged+their+mascot%3A+52+bones%2C+six+clips%2C+and+a+stage+you+can+walk+it+around.&p=%2Fpill" />+ <meta property="og:image:width" content="1200" />+ <meta property="og:image:height" content="630" />+ <meta name="twitter:card" content="summary_large_image" />+ <meta name="twitter:site" content="@trythreews" />+ <meta name="twitter:title" content="The pump.fun pill, rigged · three.ws" />+ <meta+ name="twitter:description"+ content="pump.fun verified $THREE as officially ours. So we rigged their pill mascot and gave it legs. Walk it around in your browser."+ />+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&t=The+pump.fun+pill%2C+rigged&d=pump.fun+verified+%24THREE.+We+rigged+their+mascot%3A+52+bones%2C+six+clips%2C+and+a+stage+you+can+walk+it+around.&p=%2Fpill" />+ <meta name="theme-color" content="#0a0a0a" />+ <link rel="icon" href="/favicon.ico" sizes="any" />+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />+ <link rel="manifest" href="/manifest.webmanifest" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/src/pill.css" />+ <link rel="stylesheet" href="/footer.css" />+ <script defer src="/footer-newsletter.js"></script>+ <link rel="canonical" href="https://three.ws/pill" />+ <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"The pump.fun pill, rigged","description":"pump.fun verified $THREE as officially ours. We rigged their pill mascot: a 52-bone skeleton, six hand-built clips, and a browser stage you can walk it around.","url":"https://three.ws/pill","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />+ </head>+ <body>+ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>++ <main class="pill-shell">+ <section class="pill-hero">+ <p class="pill-kicker">+ <svg class="pill-check" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">+ <path d="M10 0a10 10 0 1 0 0 20A10 10 0 0 0 10 0Zm4.7 7.6-5.5 5.6a1 1 0 0 1-1.4 0L5.3 10.7a1 1 0 1 1 1.4-1.4l1.8 1.8 4.8-4.9a1 1 0 1 1 1.4 1.4Z" />+ </svg>+ $THREE is verified on pump.fun+ </p>+ <h1 class="pill-title">So we gave their pill <em>arms and legs</em></h1>+ <p class="pill-sub">+ pump.fun verified <strong>$THREE</strong> as officially ours. A thank-you note felt thin coming from+ a 3D platform, so we ran their mascot through our own rig pipeline instead. It has a skeleton now.+ Drive it around.+ </p>+ </section>++ <div class="pill-stage" id="pill-stage" data-state="loading">+ <canvas+ id="pill-canvas"+ tabindex="0"+ role="application"+ aria-label="3D stage. The pump.fun pill mascot, rigged and drivable."+ aria-describedby="pill-stage-help"+ ></canvas>+ <p id="pill-stage-help" class="pill-sr">+ A green and white capsule character with a smiling painted face, two stubby arms and two+ stubby legs, standing on a round stage. Use W, A, S and D or the arrow keys to walk it,+ Shift to run, Space to jump, E to wave and Q to dance. The buttons below play the same+ animations.+ </p>++ <div class="pill-status" id="pill-status">+ <p>Waking the pill up</p>+ <div class="pill-progress" id="pill-progress"></div>+ </div>++ <div class="pill-hint" id="pill-hint">+ <span><kbd>W</kbd> <kbd>A</kbd> <kbd>S</kbd> <kbd>D</kbd> walk</span>+ <span><kbd>Shift</kbd> run</span>+ <span><kbd>Space</kbd> jump</span>+ <span>drag to orbit</span>+ </div>++ <div class="pill-joystick" id="pill-joystick" hidden></div>++ <div class="pill-clips" id="pill-clips" role="group" aria-label="Play an animation">+ <button type="button" data-clip="idle" aria-pressed="true">Idle</button>+ <button type="button" data-clip="walk" aria-pressed="false">Walk</button>+ <button type="button" data-clip="run" aria-pressed="false">Run</button>+ <button type="button" data-clip="wave" aria-pressed="false">Wave<kbd>E</kbd></button>+ <button type="button" data-clip="jump" aria-pressed="false">Jump<kbd>Space</kbd></button>+ <button type="button" data-clip="dance" aria-pressed="false">Dance<kbd>Q</kbd></button>+ </div>+ </div>++ <section class="pill-section">+ <h2>What the check mark actually buys you</h2>+ <p>+ pump.fun verification marks a coin as officially belonging to the project behind it. That is the line+ between the real <strong>$THREE</strong> and the copies that share its name and its ticker, and it is+ the single fastest way for a buyer to tell them apart before spending anything.+ </p>+ <p>+ $THREE is the only coin this platform promotes, and it lives at+ <code>FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump</code>. The badge now shows next to it on the+ <a href="/three-token">token page</a>, read live from pump.fun on every stats request rather than+ hardcoded, so a badge here always means the same thing as a badge there. Everything else minted+ through three.ws is a user's launch, and every one of them is listed with its creator on+ <a href="/launches">Agent Launches</a>.+ </p>+ </section>++ <section class="pill-section">+ <h2>How the pill got a skeleton</h2>+ <p>+ The mascot arrived the way generated and scanned models usually do: one sealed shell, no bones, no+ joints, frozen mid-stride, and dense enough to choke a phone. Our humanoid auto-rigger looks for a+ head on a neck and two long arms, and a capsule with four nubs has none of that. So it got its own+ pipeline, and that pipeline is in the repo:+ <a href="https://github.com/nirholas/three.ws/blob/main/scripts/rig-pill-mascot.py">scripts/rig-pill-mascot.py</a>.+ </p>+ <ol class="pill-steps">+ <li>+ <b>Find the limbs without being told where they are.</b> Voxelize the mesh, take its distance+ transform, and the body is everything thicker than a limb. The four nubs fall out as whatever is+ left over.+ </li>+ <li>+ <b>Trace each nub back into the body.</b> A minimum-cost path that prefers thick interior follows+ the limb's real curve instead of guessing a straight line, which is how the bent foot ends up+ with a bent foot bone.+ </li>+ <li>+ <b>Skin it by what is inside, not what is nearby.</b> The sculpted pose rests one hand against+ the side of the head. Any distance measure calls those two surfaces neighbours and welds them,+ so the weights are decided by walking each vertex inward to the axis of the part it is skin for.+ Through the mesh, that hand is a whole arm away from that cheek.+ </li>+ <li>+ <b>Bind mid-stride, rest standing.</b> glTF keeps the bind pose and the rest pose separate, and+ our retargeter replays clip motion as a delta on the rest pose. A walk cycle has to start from+ legs-under-hips, so the neutral stance is baked into the shipped geometry.+ </li>+ <li>+ <b>Animate for the proportions it actually has.</b> Six clips, authored against a mascot with+ nub limbs and no neck rather than borrowed from a human mocap library: idle, walk, run, wave,+ jump, dance.+ </li>+ </ol>+ <ul class="pill-stats">+ <li><b>52</b><span>Mixamo-named bones</span></li>+ <li><b>44,544</b><span>triangles, down from 296,962</span></li>+ <li><b>2.6 MB</b><span>rigged, down from 12.6 MB static</span></li>+ <li><b>6</b><span>clips baked into the file</span></li>+ <li><b>100%</b><span>of the three.ws clip library retargets onto it</span></li>+ </ul>+ <p>+ That last number is the one that matters past this page. The skeleton uses the canonical bone names,+ so the pill is not limited to the six clips it ships with: every animation on the platform drives it,+ including the ones you have not made yet. Full write-up in+ <a href="/docs/pill-mascot">the docs</a>.+ </p>+ </section>++ <section class="pill-section">+ <h2>Do this to your own character</h2>+ <p>+ Nothing on this page is a one-off favour. The same tools are open to anyone with a GLB and a+ character worth animating.+ </p>+ <div class="pill-cards">+ <a class="pill-card" href="/pose">+ <h3>Pose it <span aria-hidden="true">→</span></h3>+ <p>Open the pill in the Animation Studio and drive it with the full clip library.</p>+ </a>+ <a class="pill-card" href="/forge">+ <h3>Forge a character <span aria-hidden="true">→</span></h3>+ <p>Text or an image in, a textured 3D model out. Free lane, no account.</p>+ </a>+ <a class="pill-card" href="/docs/avatar-pipeline">+ <h3>Rig any GLB <span aria-hidden="true">→</span></h3>+ <p>Send a static humanoid model to the auto-rigger and get a skinned, clip-ready avatar back.</p>+ </a>+ <a class="pill-card" href="/walk">+ <h3>Put it on your site <span aria-hidden="true">→</span></h3>+ <p>One script tag drops a walking avatar onto any page, yours or someone else's.</p>+ </a>+ <a class="pill-card" href="/avatars/pumpfun-pill-cupsey.glb" type="model/gltf-binary" download>+ <h3>Download the GLB <span aria-hidden="true">↓</span></h3>+ <p>2.6 MB, rigged, six clips included. Open it in Blender, Unity, or anything that reads glTF.</p>+ </a>+ <a class="pill-card" href="/launches">+ <h3>See what agents launched <span aria-hidden="true">→</span></h3>+ <p>Every coin minted through three.ws, with the agent that minted it.</p>+ </a>+ </div>+ </section>+ </main>++ <script type="module" src="/src/pill.js"></script>+ <script src="/brand.js" defer></script>+ <div id="footer-container"></div>+ <script src="/footer.js"></script>+ <script type="module" src="/i18n.js"></script>+ </body>+</html>diff --git a/public/changelog.json b/public/changelog.jsonindex fd5361433..380f73ce1 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,11 +1,31 @@{- "generated_at": "2026-08-24T15:23:37.960Z",+ "generated_at": "2026-08-24T17:17:28.140Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},"entries": [+ {+ "date": "2026-08-24",+ "type": "launch",+ "title": "Docs · Rigging the pump.fun pill mascot",+ "summary": "How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.",+ "link": "/docs/pill-mascot",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-08-24",+ "type": "launch",+ "title": "The pump.fun Pill, Rigged",+ "summary": "three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.",+ "link": "/pill",+ "tags": [+ "launch"+ ]+ },{"date": "2026-08-24","type": "update",@@ -17,6 +37,17 @@"improvement"]},+ {+ "date": "2026-08-24",+ "type": "update",+ "title": "The pump.fun pill mascot is now a rigged, drivable avatar at /pill",+ "summary": "pump.fun verified $THREE as officially ours, so we rigged their pill mascot and built it a stage. Walk it around with WASD or a touch joystick, run, jump, wave, dance, and drag to orbit. The model arrived as a static 297,000-triangle capsule with four stubby nubs, which our humanoid auto-rigger cannot read because there is no neck, no head and no long limbs to find. It now carries a 52-bone skeleton with canonical bone names, six clips authored for its own proportions, and 44,544 triangles in a 2.6 MB file, which means the entire three.ws animation library retargets onto it as well. Download the GLB from the page and open it in Blender, Unity, or anything that reads glTF.",+ "link": "/pill",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-08-22","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 61101ca95..16365db8d 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -6,6 +6,22 @@<atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/><description>What's new on three.ws: features, improvements, and releases, newest first.</description><language>en</language>+ <item>+ <title>Docs · Rigging the pump.fun pill mascot</title>+ <link>https://three.ws/docs/pill-mascot</link>+ <guid isPermaLink="false">2026-08-24:Docs · Rigging the pump.fun pill mascot</guid>+ <pubDate>Mon, 24 Aug 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.</description>+ </item>+ <item>+ <title>The pump.fun Pill, Rigged</title>+ <link>https://three.ws/pill</link>+ <guid isPermaLink="false">2026-08-24:The pump.fun Pill, Rigged</guid>+ <pubDate>Mon, 24 Aug 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.</description>+ </item><item><title>$THREE now carries its pump.fun verification badge, read live from pump.fun</title><link>https://three.ws/three-token</link>@@ -14,6 +30,14 @@<category>feature</category><description>pump.fun verifies a project's coin as officially belonging to that project, which is what tells a buyer the real $THREE apart from the copies that share its name and ticker. That badge now appears next to $THREE on the token page and on the holder dashboard. It is never hardcoded: the platform reads pump.fun's own verification flag on every stats request and renders the badge only while pump.fun publishes it, so a badge on three.ws always means the same thing as a badge on pump.fun.</description></item>+ <item>+ <title>The pump.fun pill mascot is now a rigged, drivable avatar at /pill</title>+ <link>https://three.ws/pill</link>+ <guid isPermaLink="false">2026-08-24:The pump.fun pill mascot is now a rigged, drivable avatar at /pill</guid>+ <pubDate>Mon, 24 Aug 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>pump.fun verified $THREE as officially ours, so we rigged their pill mascot and built it a stage. Walk it around with WASD or a touch joystick, run, jump, wave, dance, and drag to orbit. The model arrived as a static 297,000-triangle capsule with four stubby nubs, which our humanoid auto-rigger cannot read because there is no neck, no head and no long limbs to find. It now carries a 52-bone skeleton with canonical bone names, six clips authored for its own proportions, and 44,544 triangles in a 2.6 MB file, which means the entire three.ws animation library retargets onto it as well. Download the GLB from the page and open it in Blender, Unity, or anything that reads glTF.</description>+ </item><item><title>Any AI agent can now buy a 3D model from us in one call</title><link>https://three.ws/docs/okx-marketplace</link>diff --git a/public/features.json b/public/features.jsonindex 3b7949027..d51dfa0fa 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-24T15:23:37.938Z",+ "generated_at": "2026-08-24T17:17:28.122Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",@@ -2725,6 +2725,16 @@"indexable": true,"tags": [],"showcase": false+ },+ {+ "path": "/pill",+ "title": "The pump.fun Pill, Rigged",+ "description": "three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.",+ "added": "2026-08-24",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false}]},@@ -6676,6 +6686,16 @@"indexable": true,"tags": [],"showcase": false+ },+ {+ "path": "/docs/pill-mascot",+ "title": "Docs · Rigging the pump.fun pill mascot",+ "description": "How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.",+ "added": "2026-08-24",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false}]},diff --git a/public/llms-full.txt b/public/llms-full.txtindex afca1476d..e4282fe8d 100644--- a/public/llms-full.txt+++ b/public/llms-full.txt@@ -1649,6 +1649,12 @@ URL: https://three.ws/play/solverThe /play world economy, solved. Exact expected cash and XP per hour for every tree, rock and pond at every skill level, the optimal fish-and-cook time split, what the store costs in minutes and swings, the wheel's true expected value in store prices, and per-kill combat worth. Computed in closed form from the game's own tables, never measured.+### The pump.fun Pill, Rigged++URL: https://three.ws/pill++three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.+## Agent ToolsManage, talk to, and deploy individual agents.@@ -4037,6 +4043,12 @@ URL: https://three.ws/docs/triageHow incoming issues and pull requests get sorted, what every label means, how to claim work, and the response times contributors can expect.+### Docs · Rigging the pump.fun pill mascot++URL: https://three.ws/docs/pill-mascot++How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.+## BlogLong-form announcements, launches, and writing from three.ws.diff --git a/public/llms.txt b/public/llms.txtindex 531adfbce..97ece52f6 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -308,6 +308,7 @@ On-chain features: pay-per-call, token launches, vanity wallets.- [Exit Lab](https://three.ws/exit-lab): Replay the fleet's real closed trades under a different exit policy. Move the stop-loss, trailing stop, take-initials ladder and moon-bag floor and see what the SOL already spent would have returned.- [The in-game economy](https://three.ws/play/economy): Every price, prize and gate in the /play world economy: what the general store pays for gathered goods, what it sells, how the bank protects cash through death, what the $THREE cosmetics boutique charges, and the full Wheel of Fortune paytable with real per-outcome odds. Read live from the same tables the game server prices trades with.- [The economy solver](https://three.ws/play/solver): The /play world economy, solved. Exact expected cash and XP per hour for every tree, rock and pond at every skill level, the optimal fish-and-cook time split, what the store costs in minutes and swings, the wheel's true expected value in store prices, and per-kill combat worth. Computed in closed form from the game's own tables, never measured.+- [The pump.fun Pill, Rigged](https://three.ws/pill): three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.## Agent Tools@@ -707,6 +708,7 @@ Docs, tutorials, and reference.- [Docs · Community](https://three.ws/docs/community): Where the three.ws community talks: GitHub Discussions, the Telegram community, the X community, the IBM Community group, and the release channel, with guidance on which room fits which question.- [Docs · Your first contribution](https://three.ws/docs/first-contribution): Clone to open pull request in about 15 minutes, with a complete worked example: teaching the avatar retargeter a bone-naming convention it did not know, plus the test that proves it.- [Docs · Triage](https://three.ws/docs/triage): How incoming issues and pull requests get sorted, what every label means, how to claim work, and the response times contributors can expect.+- [Docs · Rigging the pump.fun pill mascot](https://three.ws/docs/pill-mascot): How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.## Blogdiff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex 9992a41b2..fbb271398 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -83,7 +83,7 @@<main class="sm-wrap"><div class="sm-hero"><h1>Sitemap</h1>- <p>All 833 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <p>All 835 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p><div class="sm-formats"><a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a><a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>@@ -95,7 +95,7 @@</div><div class="sm-filter"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>- <input id="sm-filter-input" type="search" placeholder="Filter 833 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />+ <input id="sm-filter-input" type="search" placeholder="Filter 835 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" /><kbd aria-hidden="true">/</kbd></div><p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>@@ -103,6 +103,22 @@<h2 id="sm-new-title">Newest<a class="sm-new-more" href="/changelog">full changelog →</a></h2><p class="sm-section-desc">The 9 most recently launched pages, straight to the live surface.</p><ul class="sm-list">+ <li>+ <a href="/pill">+ <span class="sm-new-date">Aug 24, 2026</span>+ <span class="sm-title">The pump.fun Pill, Rigged</span>+ <span class="sm-path">/pill</span>+ <span class="sm-desc">three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.</span>+ </a>+ </li>+ <li>+ <a href="/docs/pill-mascot">+ <span class="sm-new-date">Aug 24, 2026</span>+ <span class="sm-title">Docs · Rigging the pump.fun pill mascot</span>+ <span class="sm-path">/docs/pill-mascot</span>+ <span class="sm-desc">How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.</span>+ </a>+ </li><li><a href="/docs/liquid-glass"><span class="sm-new-date">Aug 21, 2026</span>@@ -159,22 +175,6 @@<span class="sm-desc">The Trench Car is the default car in every coin world: ambient traffic drives it and it is parked for you to take the wheel. How to drive, how a car is assembled from spec, physics and mesh, how the model is staged, and how to add another.</span></a></li>- <li>- <a href="/docs/skill-bundles">- <span class="sm-new-date">Aug 16, 2026</span>- <span class="sm-title">Docs · Skill bundles</span>- <span class="sm-path">/docs/skill-bundles</span>- <span class="sm-desc">How a bundle of an agent's skills is priced from that agent's own sales rather than a rule of thumb: the median-basket and flat-discount bases, the public pricing and backtest endpoint, the owner endpoints that publish and retire a bundle, and the on-chain checkout that unlocks every skill in one payment.</span>- </a>- </li>- <li>- <a href="/docs/avatar-artifact">- <span class="sm-new-date">Aug 16, 2026</span>- <span class="sm-title">Docs · Avatar Artifact viewer</span>- <span class="sm-path">/docs/avatar-artifact</span>- <span class="sm-desc">The standalone avatar viewer you paste into any site as a one-line iframe: its ?agent= and ?model= parameters, the hosts a model may come from, how a clip-less rig still comes to life, and the sentence the page shows for every way it can fail.</span>- </a>- </li></ul></section><nav class="sm-toc" aria-label="Sections">@@ -1150,7 +1150,7 @@<section class="sm-section" id="crypto"><header>- <h2>Crypto<span class="sm-count" data-count>136</span></h2>+ <h2>Crypto<span class="sm-count" data-count>137</span></h2><p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p></header><ul class="sm-list">@@ -2106,6 +2106,13 @@<span class="sm-desc">The /play world economy, solved. Exact expected cash and XP per hour for every tree, rock and pond at every skill level, the optimal fish-and-cook time split, what the store costs in minutes and swings, the wheel's true expected value in store prices, and per-kill combat worth. Computed in closed form from the game's own tables, never measured.</span></a></li>+ <li>+ <a href="/pill">+ <span class="sm-title">The pump.fun Pill, Rigged</span>+ <span class="sm-path">/pill</span>+ <span class="sm-desc">three.ws is verified on pump.fun. Their pill mascot, rigged with a 52-bone skeleton and six hand-built clips, on a stage you can walk it around in the browser.</span>+ </a>+ </li></ul></section>@@ -2276,7 +2283,7 @@<section class="sm-section" id="learn"><header>- <h2>Learn<span class="sm-count" data-count>372</span></h2>+ <h2>Learn<span class="sm-count" data-count>373</span></h2><p class="sm-section-desc">Docs, tutorials, and reference.</p></header><ul class="sm-list">@@ -4884,6 +4891,13 @@<span class="sm-desc">How incoming issues and pull requests get sorted, what every label means, how to claim work, and the response times contributors can expect.</span></a></li>+ <li>+ <a href="/docs/pill-mascot">+ <span class="sm-title">Docs · Rigging the pump.fun pill mascot</span>+ <span class="sm-path">/docs/pill-mascot</span>+ <span class="sm-desc">How a static capsule mascot with four nubs became a 52-bone, six-clip avatar: limb discovery from a distance transform, medial-axis skinning, and a bind pose that differs from the rest pose on purpose.</span>+ </a>+ </li></ul></section>diff --git a/src/pill.css b/src/pill.cssnew file mode 100644index 000000000..49dc43ae6--- /dev/null+++ b/src/pill.css@@ -0,0 +1,255 @@+/* /pill: the pump.fun pill mascot, rigged and drivable.+ Canonical :root tokens stay the base; the accent layer here is the mascot's+ own green rather than the site iris, because on this page the character is+ the brand (the B02 rule for surfaces that need their own accent). */++/* The shell paints the page canvas rather than leaving it to `color-scheme`.+ Not cosmetic: with no colour actually painted, a contrast checker has nothing+ to measure against and reports every line on the page as failing. Scoped with+ :has() so it only applies where this stylesheet's page is; browsers without+ it fall back to the UA canvas, exactly as before. */+html:has(.pill-shell) { background: var(--bg-0, #0a0a0a); }++.pill-shell {+ --pill-green: #2fd35f;+ --pill-green-deep: #14a544;+ --pill-grad: linear-gradient(120deg, var(--pill-green), #7ef0a6);+ max-width: 1180px;+ margin: 0 auto;+ padding: var(--space-lg, 28px) var(--space-md, 16px) var(--space-2xl, 64px);+ /* No global body rule ships with the shell, so the page sets its own. */+ font-family: var(--font-body, 'Inter', system-ui, sans-serif);+}++/* ── Hero ─────────────────────────────────────────────────────────────── */+.pill-hero { text-align: center; margin-bottom: var(--space-lg, 24px); }+.pill-kicker {+ display: inline-flex; align-items: center; gap: 8px;+ font-size: var(--text-2xs, 0.68rem); letter-spacing: 0.14em; text-transform: uppercase;+ color: var(--ink-dim, #999); margin: 0 0 var(--space-sm, 12px);+ padding: 6px 14px 6px 10px;+ border: 1px solid rgba(47, 211, 95, 0.32);+ border-radius: var(--radius-pill, 999px);+ background: rgba(47, 211, 95, 0.08);+}+.pill-check {+ width: 16px; height: 16px; flex: none;+ color: var(--pill-green);+}+.pill-title {+ font-family: var(--font-display, 'Space Grotesk', sans-serif);+ font-size: clamp(2.1rem, 5.6vw, 3.5rem); font-weight: 700; line-height: 1.03;+ letter-spacing: -0.02em; margin: 0 0 var(--space-sm, 12px); color: var(--ink, #e8e8e8);+}+.pill-title em {+ font-style: normal;+ background: var(--pill-grad);+ -webkit-background-clip: text; background-clip: text; color: transparent;+}+.pill-sub {+ max-width: 690px; margin: 0 auto;+ color: var(--ink-dim, #999); font-size: var(--text-lg, 1.02rem); line-height: 1.55;+}+.pill-sub strong { color: var(--ink, #e8e8e8); font-weight: 600; }++/* ── Stage ────────────────────────────────────────────────────────────── */+.pill-stage {+ position: relative;+ aspect-ratio: 16 / 10;+ max-height: min(70vh, 620px);+ margin: var(--space-lg, 24px) 0 var(--space-md, 16px);+ border: 1px solid var(--stroke, rgba(255, 255, 255, 0.08));+ border-radius: var(--radius-lg, 16px);+ overflow: hidden;+ background:+ radial-gradient(120% 90% at 50% 0%, rgba(47, 211, 95, 0.13), transparent 62%),+ var(--surface-1, #0d1014);+ touch-action: none;+ contain: layout paint;+}+.pill-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }+.pill-stage canvas:active { cursor: grabbing; }+.pill-stage canvas:focus-visible { outline: 2px solid var(--pill-green); outline-offset: -3px; }++/* The stage's text alternative: real content for a screen reader, no pixels. */+.pill-sr {+ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;+ overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;+}++.pill-status {+ position: absolute; inset: 0;+ display: flex; flex-direction: column; align-items: center; justify-content: center;+ gap: var(--space-sm, 12px); text-align: center; padding: var(--space-lg, 24px);+ color: var(--ink-dim, #999); font-size: var(--text-sm, 0.86rem);+}+.pill-status[hidden] { display: none; }+.pill-progress {+ --pill-progress: 0%;+ width: min(220px, 60%); height: 3px; border-radius: 999px;+ background: rgba(255, 255, 255, 0.09); overflow: hidden;+}+.pill-progress::after {+ content: ''; display: block; height: 100%;+ width: var(--pill-progress);+ background: var(--pill-grad);+ transition: width 0.2s ease;+}+.pill-poster { max-width: min(360px, 70%); height: auto; border-radius: var(--radius-md, 12px); }+.pill-fallback-note { margin: 0; max-width: 42ch; }++/* Controls */+.pill-clips {+ position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);+ display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;+ padding: 6px; max-width: calc(100% - 24px);+ border: 1px solid var(--stroke, rgba(255, 255, 255, 0.1));+ border-radius: var(--radius-pill, 999px);+ background: color-mix(in srgb, var(--surface-2, #14181d) 82%, transparent);+ backdrop-filter: blur(10px);+}+.pill-clips button {+ appearance: none; border: 0; cursor: pointer;+ padding: 7px 14px; border-radius: var(--radius-pill, 999px);+ font: inherit; font-size: var(--text-xs, 0.78rem); font-weight: 600;+ letter-spacing: 0.01em;+ color: var(--ink-dim, #a8a8a8); background: transparent;+ transition: color 0.16s ease, background 0.16s ease, transform 0.12s ease;+}+.pill-clips button:hover { color: var(--ink, #ececec); background: rgba(255, 255, 255, 0.07); }+.pill-clips button:active { transform: translateY(1px); }+.pill-clips button:focus-visible { outline: 2px solid var(--pill-green); outline-offset: 2px; }+.pill-clips button[aria-pressed='true'] {+ color: #04170b; background: var(--pill-grad);+}+.pill-clips kbd {+ display: inline-block; margin-left: 6px; opacity: 0.6;+ font: inherit; font-size: 0.86em;+}++.pill-hint {+ position: absolute; top: 14px; left: 14px;+ display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 28px);+ font-size: var(--text-2xs, 0.68rem); color: var(--ink-dim, #8d8d8d);+ transition: opacity 0.5s ease 1.2s;+}+.pill-hint[data-used='true'] { opacity: 0; pointer-events: none; }+.pill-hint span {+ padding: 4px 9px; border-radius: var(--radius-pill, 999px);+ border: 1px solid var(--stroke, rgba(255, 255, 255, 0.08));+ background: color-mix(in srgb, var(--surface-2, #14181d) 76%, transparent);+}+.pill-joystick {+ position: absolute; left: 18px; bottom: 74px;+ width: 132px; height: 132px;+}+.pill-joystick[hidden] { display: none; }++@media (max-width: 700px) {+ .pill-stage { aspect-ratio: 4 / 5; max-height: 74vh; }+ .pill-hint { display: none; }+ /* One scrolling row, not three wrapped ones: a toolbar that grows upward+ collides with the joystick and buries the mascot behind its own controls. */+ .pill-clips {+ left: 0; right: 0; bottom: 0; transform: none;+ max-width: none; border-radius: 0;+ border-left: 0; border-right: 0; border-bottom: 0;+ flex-wrap: nowrap; justify-content: flex-start;+ overflow-x: auto; scrollbar-width: none; padding: 8px 10px;+ }+ .pill-clips::-webkit-scrollbar { display: none; }+ .pill-clips button { flex: none; }+ .pill-clips kbd { display: none; }+ .pill-joystick { left: 12px; bottom: 62px; width: 104px; height: 104px; }+}++/* ── Sections ─────────────────────────────────────────────────────────── */+.pill-section { margin-top: var(--space-2xl, 56px); }+.pill-section h2 {+ font-family: var(--font-display, 'Space Grotesk', sans-serif);+ font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 650; letter-spacing: -0.01em;+ margin: 0 0 var(--space-sm, 12px); color: var(--ink, #e8e8e8);+}+.pill-section p { font-family: inherit; color: var(--ink-dim, #9a9a9a); line-height: 1.62; margin: 0 0 var(--space-sm, 12px); max-width: 68ch; }+.pill-section a { color: var(--ink, #e8e8e8); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(47, 211, 95, 0.55); }+.pill-section a:hover { text-decoration-color: var(--pill-green); }++.pill-stats {+ display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));+ gap: var(--space-sm, 12px); list-style: none; margin: var(--space-md, 18px) 0 0; padding: 0;+}+.pill-stats li {+ padding: var(--space-md, 16px);+ border: 1px solid var(--stroke, rgba(255, 255, 255, 0.07));+ border-radius: var(--radius-md, 12px);+ background: var(--surface-1, rgba(255, 255, 255, 0.03));+}+.pill-stats b {+ display: block;+ font-family: var(--font-display, 'Space Grotesk', sans-serif);+ font-size: 1.5rem; font-weight: 700; color: var(--ink, #ececec); line-height: 1.1;+}+.pill-stats span {+ display: block; margin-top: 4px;+ font-size: var(--text-2xs, 0.7rem); letter-spacing: 0.08em; text-transform: uppercase;+ color: var(--ink-dim, #8d8d8d);+}++.pill-steps { list-style: none; margin: var(--space-md, 18px) 0 0; padding: 0; counter-reset: pill-step; }+.pill-steps li {+ position: relative; padding: 0 0 var(--space-md, 18px) 42px;+ color: var(--ink-dim, #9a9a9a); line-height: 1.6;+}+.pill-steps li::before {+ counter-increment: pill-step; content: counter(pill-step);+ position: absolute; left: 0; top: 0;+ width: 28px; height: 28px; border-radius: 50%;+ display: grid; place-items: center;+ font-size: var(--text-xs, 0.76rem); font-weight: 700; color: #04170b;+ background: var(--pill-grad);+}+.pill-steps li::after {+ content: ''; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 1px;+ background: linear-gradient(rgba(47, 211, 95, 0.35), transparent);+}+.pill-steps li:last-child { padding-bottom: 0; }+.pill-steps li:last-child::after { display: none; }+.pill-steps b { color: var(--ink, #e4e4e4); font-weight: 650; }++.pill-cards {+ display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));+ gap: var(--space-sm, 12px); margin-top: var(--space-md, 18px);+}+.pill-card {+ display: block; padding: var(--space-md, 18px);+ border: 1px solid var(--stroke, rgba(255, 255, 255, 0.07));+ border-radius: var(--radius-md, 12px);+ background: var(--surface-1, rgba(255, 255, 255, 0.03));+ color: inherit; text-decoration: none;+ transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;+}+.pill-card:hover {+ border-color: rgba(47, 211, 95, 0.45);+ background: rgba(47, 211, 95, 0.05);+ transform: translateY(-2px);+}+.pill-card:focus-visible { outline: 2px solid var(--pill-green); outline-offset: 3px; }+.pill-card h3 {+ margin: 0 0 6px; font-size: var(--text-md, 0.98rem); font-weight: 650; color: var(--ink, #ececec);+}+.pill-card p { margin: 0; font-size: var(--text-sm, 0.86rem); color: var(--ink-dim, #8f8f8f); line-height: 1.5; }+.pill-card span[aria-hidden] { color: var(--pill-green); }++@media (prefers-reduced-motion: reduce) {+ .pill-card, .pill-clips button, .pill-hint { transition: none; }+ .pill-card:hover { transform: none; }+}++:root[data-theme='light'] .pill-stage {+ background:+ radial-gradient(120% 90% at 50% 0%, rgba(20, 165, 68, 0.12), transparent 62%),+ var(--surface-1, #f3f4f6);+}+:root[data-theme='light'] .pill-kicker { background: rgba(20, 165, 68, 0.09); border-color: rgba(20, 165, 68, 0.3); }+:root[data-theme='light'] .pill-check { color: var(--pill-green-deep); }+:root[data-theme='light'] .pill-title em { background: linear-gradient(120deg, var(--pill-green-deep), #2fd35f); -webkit-background-clip: text; background-clip: text; }diff --git a/src/pill.js b/src/pill.jsnew file mode 100644index 000000000..d0fb91a5a--- /dev/null+++ b/src/pill.js@@ -0,0 +1,488 @@+/**+ * /pill: the pump.fun pill mascot, rigged and drivable.+ *+ * pump.fun verified $THREE as officially ours, and the obvious way to say thank you+ * on a 3D platform is not a press release: it is their mascot, rigged properly,+ * standing in a stage you can walk it around. The model ships from+ * `/avatars/pumpfun-pill-cupsey.glb` with a 52-bone Mixamo-named skeleton and+ * six clips baked in (scripts/rig-pill-mascot.py), so this page needs no+ * retargeting at load: it plays the model's own animations.+ *+ * Everything here is one canvas and one keyboard handler. WASD or the arrows+ * drive it, Shift runs, Space jumps, drag orbits, and the toolbar fires the+ * one-shots. Touch gets a real joystick (nipplejs, already in the tree for+ * /walk) rather than a "desktop only" apology.+ *+ * Failure is designed. No WebGL, a blocked GPU, or a GLB that will not load all+ * fall back to the poster still with a line saying what happened -- the page is+ * a thank-you note first and a demo second, and it has to read either way.+ */++import { log } from './shared/log.js';++const MODEL_URL = '/avatars/pumpfun-pill-cupsey.glb';+const POSTER_URL = '/avatars/thumbs/pumpfun-pill-cupsey.png';++// Ground radius, in model units. The mascot is ~2.1 units tall, so this is a+// stage a little over four of it across: big enough to build up a run, small+// enough that it never wanders out of frame.+const STAGE_RADIUS = 7;+const WALK_SPEED = 1.05;+const RUN_SPEED = 2.45;+// Metres each clip covers per second at timeScale 1, measured off the baked+// stride. Playback is scaled by actual speed / this, so the feet never skate.+const WALK_STRIDE_RATE = 0.95;+const RUN_STRIDE_RATE = 2.3;+const TURN_RATE = 9.0; // radians per second++const KEY_AXES = {+ KeyW: [0, 1], ArrowUp: [0, 1],+ KeyS: [0, -1], ArrowDown: [0, -1],+ KeyA: [-1, 0], ArrowLeft: [-1, 0],+ KeyD: [1, 0], ArrowRight: [1, 0],+};++const reduceMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;++// The stage is a lit 3D scene, not an image, so the theme switch has to reach+// into it: a black floor punched into a light page reads as a broken asset.+const STAGE_THEMES = {+ dark: { fog: 0x0b0d11, floor: 0x161b21, sky: 0xdfe9ff, ground: 0x1b2a20, accent: 0x2fd35f, grid: 0x22302a, exposure: 1.05 },+ light: { fog: 0xeef1f5, floor: 0xdde3e9, sky: 0xffffff, ground: 0xbccfc2, accent: 0x14a544, grid: 0xc3d0c8, exposure: 1.0 },+};++function stageTheme() {+ return document.documentElement.getAttribute('data-theme') === 'light'+ ? STAGE_THEMES.light : STAGE_THEMES.dark;+}++const stage = document.getElementById('pill-stage');+const canvas = document.getElementById('pill-canvas');+const statusEl = document.getElementById('pill-status');+const progressEl = document.getElementById('pill-progress');+const hintEl = document.getElementById('pill-hint');+const toolbar = document.getElementById('pill-clips');+const joystickZone = document.getElementById('pill-joystick');++/** Swap the stage for the poster still and say why. */+function fallback(reason) {+ stage?.setAttribute('data-state', 'fallback');+ if (statusEl) {+ statusEl.innerHTML = '';+ const img = new Image();+ img.src = POSTER_URL;+ img.alt = 'The pump.fun pill mascot, rigged by three.ws';+ img.className = 'pill-poster';+ img.decoding = 'async';+ const note = document.createElement('p');+ note.className = 'pill-fallback-note';+ note.textContent = reason;+ statusEl.append(img, note);+ }+ toolbar?.setAttribute('hidden', '');+ hintEl?.setAttribute('hidden', '');+}++function hasWebGL() {+ try {+ const probe = document.createElement('canvas');+ return Boolean(probe.getContext('webgl2') || probe.getContext('webgl'));+ } catch {+ return false;+ }+}++/**+ * Soft round contact shadow, drawn once into a canvas texture.+ * Cheaper than a shadow map by an order of magnitude, and on a stage with one+ * character and a flat floor it is indistinguishable from one.+ */+function shadowTexture(THREE) {+ const size = 256;+ const c = document.createElement('canvas');+ c.width = c.height = size;+ const g = c.getContext('2d');+ const grad = g.createRadialGradient(size / 2, size / 2, 0, size / 2, size / 2, size / 2);+ grad.addColorStop(0, 'rgba(0,0,0,0.42)');+ grad.addColorStop(0.55, 'rgba(0,0,0,0.16)');+ grad.addColorStop(1, 'rgba(0,0,0,0)');+ g.fillStyle = grad;+ g.fillRect(0, 0, size, size);+ const tex = new THREE.CanvasTexture(c);+ tex.colorSpace = THREE.SRGBColorSpace;+ return tex;+}++async function boot() {+ if (!canvas || !stage) return;+ if (!hasWebGL()) {+ fallback('Your browser could not start WebGL, so here is the pill holding still.');+ return;+ }++ let THREE;+ let GLTFLoader;+ try {+ THREE = await import('three');+ ({ GLTFLoader } = await import('three/addons/loaders/GLTFLoader.js'));+ } catch (err) {+ log.warn('pill: three failed to load', err);+ fallback('The 3D runtime did not load. Reload the page to try again.');+ return;+ }++ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true, powerPreference: 'high-performance' });+ renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ renderer.toneMapping = THREE.ACESFilmicToneMapping;+ renderer.toneMappingExposure = 1.05;++ const scene = new THREE.Scene();+ scene.fog = new THREE.Fog(0x0b0d11, STAGE_RADIUS * 0.9, STAGE_RADIUS * 2.6);++ const ambient = new THREE.HemisphereLight(0xdfe9ff, 0x1b2a20, 1.9);+ scene.add(ambient);+ const key = new THREE.DirectionalLight(0xffffff, 2.1);+ key.position.set(4, 7, 5);+ scene.add(key);+ const rim = new THREE.DirectionalLight(0x8affc8, 0.9);+ rim.position.set(-5, 2.5, -4);+ scene.add(rim);++ // Floor: a dark disc with a green ring, matching the mascot rather than the+ // site's iris accent. The mascot is the accent on this page.+ const floor = new THREE.Mesh(+ new THREE.CircleGeometry(STAGE_RADIUS, 96),+ new THREE.MeshStandardMaterial({ color: 0x161b21, roughness: 0.96, metalness: 0 }),+ );+ floor.rotation.x = -Math.PI / 2;+ scene.add(floor);+ const ring = new THREE.Mesh(+ new THREE.RingGeometry(STAGE_RADIUS - 0.09, STAGE_RADIUS, 96),+ new THREE.MeshBasicMaterial({ color: 0x2fd35f, transparent: true, opacity: 0.35, side: THREE.DoubleSide }),+ );+ ring.rotation.x = -Math.PI / 2;+ ring.position.y = 0.002;+ scene.add(ring);+ const gridHelper = new THREE.PolarGridHelper(STAGE_RADIUS, 8, 6, 96);+ gridHelper.position.y = 0.001;+ gridHelper.material.vertexColors = false;+ gridHelper.material.transparent = true;+ gridHelper.material.opacity = 0.55;+ scene.add(gridHelper);++ function applyStageTheme() {+ const t = stageTheme();+ scene.fog.color.setHex(t.fog);+ floor.material.color.setHex(t.floor);+ ambient.color.setHex(t.sky);+ ambient.groundColor.setHex(t.ground);+ ring.material.color.setHex(t.accent);+ gridHelper.material.color.setHex(t.grid);+ renderer.toneMappingExposure = t.exposure;+ }+ applyStageTheme();+ const themeWatcher = new MutationObserver(applyStageTheme);+ themeWatcher.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });++ const shadow = new THREE.Mesh(+ new THREE.PlaneGeometry(2.2, 2.2),+ new THREE.MeshBasicMaterial({ map: shadowTexture(THREE), transparent: true, depthWrite: false }),+ );+ shadow.rotation.x = -Math.PI / 2;+ shadow.position.y = 0.004;+ scene.add(shadow);++ const camera = new THREE.PerspectiveCamera(38, 1, 0.1, 120);++ // ── Load ──────────────────────────────────────────────────────────────+ let gltf;+ try {+ gltf = await new GLTFLoader().loadAsync(MODEL_URL, (event) => {+ if (progressEl && event.total) {+ progressEl.style.setProperty('--pill-progress', `${Math.round((event.loaded / event.total) * 100)}%`);+ }+ });+ } catch (err) {+ log.warn('pill: model failed to load', err);+ fallback('The mascot could not be downloaded right now. Reload the page to try again.');+ renderer.dispose();+ return;+ }++ const rig = gltf.scene;+ const bounds = new THREE.Box3().setFromObject(rig);+ rig.position.y = -bounds.min.y; // stand it on the floor, not through it+ const height = bounds.max.y - bounds.min.y;++ const actor = new THREE.Group();+ actor.add(rig);+ scene.add(actor);++ const mixer = new THREE.AnimationMixer(rig);+ const clips = new Map();+ for (const clip of gltf.animations) clips.set(clip.name, mixer.clipAction(clip));+ if (!clips.size) {+ fallback('This build of the mascot shipped without its animations.');+ return;+ }+ for (const [name, action] of clips) {+ if (name === 'jump' || name === 'wave') {+ action.setLoop(THREE.LoopOnce, 1);+ action.clampWhenFinished = true;+ }+ }++ let current = null;+ function play(name, fade = 0.28) {+ const next = clips.get(name);+ if (!next || next === current) return;+ next.reset().setEffectiveWeight(1).fadeIn(fade).play();+ if (current) current.fadeOut(fade);+ current = next;+ toolbar?.querySelectorAll('[data-clip]').forEach((btn) => {+ btn.setAttribute('aria-pressed', String(btn.dataset.clip === name));+ });+ }+ play('idle', 0);++ // ── Input ─────────────────────────────────────────────────────────────+ const held = new Set();+ const stick = { x: 0, y: 0, force: 0 };+ let sprinting = false;+ // `oneShot` is the clip that owns the body: until it finishes (jump, wave),+ // or until the player moves (dance, and the locomotion previews the toolbar+ // fires). Without the second kind, clicking Walk plays one frame and the+ // next tick's "no input, so idle" overwrites it.+ let oneShot = null;+ let looping = false;++ function clearOneShot() {+ oneShot = null;+ looping = false;+ }++ mixer.addEventListener('finished', (event) => {+ if (oneShot && event.action === clips.get(oneShot)) clearOneShot();+ });++ function trigger(name) {+ if (!clips.has(name)) return;+ if (name === 'dance') {+ if (oneShot === 'dance') { clearOneShot(); play('idle'); return; }+ oneShot = 'dance';+ looping = true;+ play('dance');+ return;+ }+ if (name === 'jump') { jump(); return; }+ if (name === 'idle' || name === 'walk' || name === 'run') {+ oneShot = name;+ looping = true;+ play(name);+ return;+ }+ oneShot = name;+ looping = false;+ play(name, 0.18);+ }++ function jump() {+ if (oneShot === 'jump') return;+ // The hop lives in the clip's own Hips track, authored against the+ // mascot's proportions. Adding a physics arc on top of it lifted the+ // character twice as high as either intended and landed it a third of a+ // second before the animation finished.+ oneShot = 'jump';+ looping = false;+ play('jump', 0.1);+ }++ function onKeyDown(event) {+ if (event.metaKey || event.ctrlKey || event.altKey) return;+ const target = event.target;+ if (target instanceof HTMLElement && /^(INPUT|TEXTAREA|SELECT)$/.test(target.tagName)) return;+ if (event.code === 'ShiftLeft' || event.code === 'ShiftRight') { sprinting = true; return; }+ if (event.code === 'Space') { event.preventDefault(); jump(); return; }+ if (event.code === 'KeyE') { trigger('wave'); return; }+ if (event.code === 'KeyQ') { trigger('dance'); return; }+ if (!(event.code in KEY_AXES)) return;+ event.preventDefault();+ held.add(event.code);+ hintEl?.setAttribute('data-used', 'true');+ }+ function onKeyUp(event) {+ if (event.code === 'ShiftLeft' || event.code === 'ShiftRight') sprinting = false;+ held.delete(event.code);+ }+ window.addEventListener('keydown', onKeyDown);+ window.addEventListener('keyup', onKeyUp);+ window.addEventListener('blur', () => { held.clear(); sprinting = false; });++ toolbar?.addEventListener('click', (event) => {+ const btn = event.target instanceof Element ? event.target.closest('[data-clip]') : null;+ if (btn) trigger(btn.dataset.clip);+ });++ // Drag to orbit. Pointer events cover mouse, pen and touch with one path.+ const orbit = { yaw: 0.42, pitch: 0.17, distance: height * 2.3 };+ let dragging = null;+ canvas.addEventListener('pointerdown', (event) => {+ dragging = { id: event.pointerId, x: event.clientX, y: event.clientY };+ canvas.setPointerCapture(event.pointerId);+ });+ canvas.addEventListener('pointermove', (event) => {+ if (!dragging || dragging.id !== event.pointerId) return;+ orbit.yaw -= (event.clientX - dragging.x) * 0.006;+ orbit.pitch = Math.min(0.85, Math.max(-0.05, orbit.pitch + (event.clientY - dragging.y) * 0.004));+ dragging.x = event.clientX;+ dragging.y = event.clientY;+ });+ const endDrag = (event) => {+ if (dragging?.id === event.pointerId) dragging = null;+ };+ canvas.addEventListener('pointerup', endDrag);+ canvas.addEventListener('pointercancel', endDrag);+ canvas.addEventListener('wheel', (event) => {+ event.preventDefault();+ orbit.distance = Math.min(height * 4.5, Math.max(height * 1.35, orbit.distance + event.deltaY * 0.005));+ }, { passive: false });++ if (joystickZone && matchMedia('(pointer: coarse)').matches) {+ joystickZone.removeAttribute('hidden');+ try {+ const { default: nipplejs } = await import('nipplejs');+ const joystick = nipplejs.create({+ zone: joystickZone, mode: 'static', position: { left: '50%', top: '50%' },+ color: '#2fd35f', size: 92, restOpacity: 0.26,+ });+ joystick.on('move', (_event, data) => {+ const force = Math.min(1, data.force / 1.6);+ stick.force = force;+ stick.x = Math.cos(data.angle.radian) * force;+ stick.y = Math.sin(data.angle.radian) * force;+ hintEl?.setAttribute('data-used', 'true');+ });+ joystick.on('end', () => { stick.x = 0; stick.y = 0; stick.force = 0; });+ } catch (err) {+ log.warn('pill: joystick unavailable', err);+ joystickZone.setAttribute('hidden', '');+ }+ }++ // ── Frame loop ────────────────────────────────────────────────────────+ stage.setAttribute('data-state', 'ready');+ statusEl?.setAttribute('hidden', '');++ const forward = new THREE.Vector3();+ const right = new THREE.Vector3();+ const move = new THREE.Vector3();+ const camTarget = new THREE.Vector3();+ const camWanted = new THREE.Vector3();+ const hipsWorld = new THREE.Vector3();+ const hips = rig.getObjectByName('mixamorig:Hips') ?? null;+ const hipsRestY = hips ? hips.getWorldPosition(new THREE.Vector3()).y : 0;+ let heading = 0;++ function resize() {+ const rect = stage.getBoundingClientRect();+ const w = Math.max(1, Math.round(rect.width));+ const h = Math.max(1, Math.round(rect.height));+ renderer.setSize(w, h, false);+ camera.aspect = w / h;+ camera.updateProjectionMatrix();+ }+ const observer = new ResizeObserver(resize);+ observer.observe(stage);+ resize();++ let last = performance.now();+ let running = true;+ renderer.setAnimationLoop(() => {+ if (!running) return;+ const now = performance.now();+ const dt = Math.min(0.05, (now - last) / 1000);+ last = now;++ // Camera-relative input: W walks away from the camera, the way a+ // third-person camera sitting behind the character implies.+ forward.set(-Math.sin(orbit.yaw), 0, -Math.cos(orbit.yaw));+ right.set(-forward.z, 0, forward.x);+ move.set(0, 0, 0);+ for (const code of held) {+ const [x, z] = KEY_AXES[code];+ move.addScaledVector(right, x).addScaledVector(forward, z);+ }+ move.addScaledVector(right, stick.x).addScaledVector(forward, stick.y);+ const input = Math.min(1, move.length());+ if (input > 0.001) move.normalize();++ // Sprint is Shift on a keyboard and a hard push on a joystick; a plain+ // key press always walks, so the walk cycle is what most visitors see.+ const sprint = (sprinting || stick.force > 0.88) && input > 0.35;+ const speed = input * (sprint ? RUN_SPEED : WALK_SPEED);++ if (input > 0.05) {+ if (oneShot && looping) clearOneShot();+ const wanted = Math.atan2(move.x, move.z);+ let delta = ((wanted - heading + Math.PI) % (Math.PI * 2)) - Math.PI;+ if (delta < -Math.PI) delta += Math.PI * 2;+ heading += Math.max(-TURN_RATE * dt, Math.min(TURN_RATE * dt, delta));+ actor.position.addScaledVector(move, speed * dt);+ const radial = Math.hypot(actor.position.x, actor.position.z);+ if (radial > STAGE_RADIUS - 0.7) {+ const scale = (STAGE_RADIUS - 0.7) / radial;+ actor.position.x *= scale;+ actor.position.z *= scale;+ }+ }+ actor.rotation.y = heading;++ if (!oneShot) {+ const name = input > 0.05 ? (sprint ? 'run' : 'walk') : 'idle';+ play(name);+ const action = clips.get(name);+ if (action) {+ action.timeScale = name === 'idle' ? 1+ : Math.max(0.55, speed / (name === 'run' ? RUN_STRIDE_RATE : WALK_STRIDE_RATE));+ }+ }++ mixer.update(dt);++ // The shadow reads the hips off the skeleton rather than the actor, so it+ // shrinks under a jump that only the clip knows about.+ shadow.position.set(actor.position.x, 0.004, actor.position.z);+ const lift = hips ? Math.max(0, hips.getWorldPosition(hipsWorld).y - hipsRestY) : 0;+ shadow.scale.setScalar(1 / (1 + lift * 0.9));+ shadow.material.opacity = 1 / (1 + lift * 1.9);++ camTarget.set(actor.position.x, actor.position.y + height * 0.45, actor.position.z);+ camWanted.set(+ camTarget.x + Math.sin(orbit.yaw) * Math.cos(orbit.pitch) * orbit.distance,+ camTarget.y + Math.sin(orbit.pitch) * orbit.distance + height * 0.1,+ camTarget.z + Math.cos(orbit.yaw) * Math.cos(orbit.pitch) * orbit.distance,+ );+ camera.position.lerp(camWanted, reduceMotion ? 1 : Math.min(1, dt * 6));+ camera.lookAt(camTarget);++ renderer.render(scene, camera);+ });++ // Stop the loop when the stage scrolls away: a mascot idling in a canvas+ // nobody is looking at is a battery bug, not a feature.+ const visibility = new IntersectionObserver((entries) => {+ running = entries.some((entry) => entry.isIntersecting);+ if (running) last = performance.now();+ }, { threshold: 0.02 });+ visibility.observe(stage);+ document.addEventListener('visibilitychange', () => {+ if (document.hidden) running = false;+ else { running = true; last = performance.now(); }+ });+}++boot().catch((err) => {+ log.warn('pill: stage failed', err);+ fallback('The stage did not start. Reload the page to try again.');+});diff --git a/vercel.json b/vercel.jsonindex 4047b0055..6be05a257 100644--- a/vercel.json+++ b/vercel.json@@ -941,6 +941,10 @@"src": "/deploy-onchain/?","dest": "/deploy-onchain.html"},+ {+ "src": "/pill/?",+ "dest": "/pill.html"+ },{"src": "/portfolio/?","dest": "/portfolio.html"diff --git a/vite.config.js b/vite.config.jsindex fc4e8f41a..41009ef46 100644--- a/vite.config.js+++ b/vite.config.js@@ -641,6 +641,7 @@ const appConfig = {viability: resolve(__dirname, 'pages/viability.html'),deployments: resolve(__dirname, 'pages/deployments.html'),deployOnchain: resolve(__dirname, 'pages/deploy-onchain.html'),+ pill: resolve(__dirname, 'pages/pill.html'),portfolio: resolve(__dirname, 'pages/portfolio.html'),airdrops: resolve(__dirname, 'pages/airdrops.html'),launcher: resolve(__dirname, 'pages/launcher.html'),@@ -1319,6 +1320,8 @@ const appConfig = {'/deployments/': resolve(root, 'pages/deployments.html'),'/deploy-onchain': resolve(root, 'pages/deploy-onchain.html'),'/deploy-onchain/': resolve(root, 'pages/deploy-onchain.html'),+ '/pill': resolve(root, 'pages/pill.html'),+ '/pill/': resolve(root, 'pages/pill.html'),'/portfolio': resolve(root, 'pages/portfolio.html'),'/portfolio/': resolve(root, 'pages/portfolio.html'),'/airdrops': resolve(root, 'pages/airdrops.html'),