Skip to content

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.

Club, forge, animation manager, player page, and changelog updates

nirholasc87209bcb924
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c3cb8b688..aa2ab364b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Build structures, snap blocks, and share your coin world creation** — The /play building layer now ships a full structures system: blocks snap to a 1.5m grid and rotation locks to quarter-turns so pieces always line up. A structures toolbar above the block hotbar gives you one-click composite pieces — Wall (4×3), Floor (4×4), Stairs (4-step), and Doorway — that stamp a whole shape at once with a live rotatable footprint preview. Large builds stay smooth because every block type is drawn as a single instanced mesh regardless of how many you place. The share button captures an offscreen screenshot of your build, lets you name it, copy a deep link, download the image, or publish it to this coin's featured builds — a new per-world gallery (with loading skeleton, empty, and error states) that links every shared creation back into the world so others can drop straight in. (`/play`) `[feature, improvement]`
- **Buy a skill, get an on-chain NFT receipt in your wallet** — When you purchase an agent's skill, you now receive a real NFT minted straight to your Solana wallet as proof of ownership and a perpetual license to use that skill. Each agent has its own verified on-chain collection, so the skills you buy from an agent group together in your wallet and on explorers like Solscan and Phantom — with the agent's name and avatar. The NFT is minted only after your payment is confirmed on-chain to the creator, it's tied to the wallet linked to your account so it can never be sent to a stranger, and asking again never mints a duplicate. Your purchased skills now show their NFT mint address. (`/marketplace`) `[feature]`
- **Change a placed agent's outfit from your dashboard — everyone nearby sees it** — Your IRL Agents dashboard now has a real outfit editor. Open Change outfit on any agent you've placed and a live 3D preview loads with wardrobe controls for the exact layers that avatar has — recolour its hair, skin, and clothing, strip back to the base body and dress it up again, or stack on hats, glasses, and earrings. Because your agents are public, the new look is baked into the agent itself and pushed to its real-world pin, so every person who walks up to that spot sees the updated outfit in their camera — not just you. Save when you're happy; the avatar is re-rendered for real before it confirms, the previous look stays untouched if anything fails, and nearby viewers refresh to the new outfit within seconds. Run a seasonal look, brand your agents as staff for an event, or just keep them fresh — all without walking back to where you pinned them. (`/dashboard/irl-placements`) `[feature]`
+- **Choose who dances — avatar selector in the Pole Club** — Every pole card now has an Avatar dropdown so you can pick which 3D avatar dances on each pole. Choose from each dancer's signature look, a set of built-in rigs, or any public avatar from the gallery — the dancer swaps to the new model live, right on stage, with no reload. Your picks are remembered per pole on your next visit. The picker locks for the few seconds a dancer is mid-routine so a swap never interrupts a paid performance, and any model the animation library can't drive falls back to the default rig automatically. (`/club`) `[feature]`
- **Clearer pricing on every agent's skills in the marketplace** — An agent's detail page now reads cleanly when its skills carry a price. Each skill shows a badge at a glance — green 'Free', a yellow price for paid skills, or an indigo 'Owned' once you've bought it — and when a paid skill offers a free trial or a timed access pass, those now appear as proper buttons styled to match the Purchase button, with hover, focus, and press states. The price badge and action buttons are grouped together on the right of each row instead of spreading out, so a skill with several options stays tidy and easy to scan. (`/marketplace`) `[improvement]`
- **Coin world builds now have ownership, caps, and anti-grief protection** — Every block and prop placed in a coin world is now server-enforced with a full permission model. Only the player who placed a piece can break it; the coin's creator can remove any piece as a moderation tool, or sweep a radius or the entire world with a single action. A per-player block cap (1,200 blocks) prevents any single builder from monopolising the budget; a per-column density limit stops walls from caging the plaza; and protected zones around the spawn point and the coin totem can never be buried or fenced in. All rejections — wrong owner, over cap, protected zone, rate-limited, out of bounds — are surfaced to the builder immediately with a clear message. The build HUD now shows how many of your personal 1,200 blocks you've used, and coin creators see a "Creator" moderation panel with the clear-area tool. (`/play`) `[feature, improvement]`
- **Connect your Solana wallet right from the app header** — The main app now has a Connect Wallet button in the top bar — the first step toward buying an agent's paid skills. Click it and your Solana wallet (Phantom, or the built-in wallet on Solana Mobile / Seeker) prompts you to connect; once you do, the button shows your address shortened to something like '7xKq…9fPa' with a green tick so you can see at a glance that you're connected. If you've connected before, it reconnects silently on load, and if you don't have a wallet yet it points you to Phantom. No wallet, no signature, and nothing on-chain happens just from connecting — it only lets the platform know which wallet to use when you choose to pay. (`/app`) `[feature]`
@@ -33,6 +34,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Every agent now has a dedicated wallet hub** — Each 3D agent's self-custodied Solana wallet now has one home: a tabbed Agent Wallet hub — Balance, Deposit, Trade, Snipe, Pay, and Withdraw — reachable from the agent's profile and right after you create one. The Balance tab is live now, showing the real on-chain SOL balance with a USD estimate and recent activity, refreshing on its own and degrading gracefully if the network is briefly unreachable. Behind the scenes every agent is guaranteed a wallet: older agents that predated automatic wallets are backfilled, and the agent API now reports whether each agent's wallet is ready. The remaining tabs are wired up across the next releases. `[feature]`
- **Everyone at a location now sees your IRL agent in the same real spot** — three.ws/irl agents now line up across phones. A placed agent renders from its own saved compass bearing and ground height instead of whichever way your phone happens to face, so two people standing in the same place see it standing in the same place, facing the same way. To keep it steady, your own GPS position is now smoothed so anchored agents stop drifting and swimming as your location jitters, and noisy fixes are ignored. Every agent now sits inside a ground ring whose size reflects the real GPS accuracy — honest about the fact that phone GPS is roughly 5–15 metres, and wider (and amber) when the signal is poor — so it never pretends to be pinpoint-perfect. And if an agent landed a little off, its owner can fine-tune it: long-press your own agent (or tap Calibrate position on its card) and drag to nudge it a few centimetres, twist with two fingers to rotate it, or step its floor height up and down. Saving the nudge updates the spot for everyone nearby. Only the owner can calibrate an agent, nudges are capped to small corrections so this can never be used to drag someone's agent across the map, and a failed save keeps your change on screen with a one-tap retry. (`/irl`) `[feature, improvement]`
- **Filter the marketplace by Free or Paid** — The marketplace now has working Free / Paid filters. "Paid" surfaces every agent that charges in any way — a one-time price to own it or per-call pricing on its skills — and "Free" shows the rest. Filtering happens on the server, so the result count and "load more" stay accurate no matter how many pages deep you browse, and your choice is saved in the URL so you can bookmark or share a filtered view. (`/marketplace`) `[feature, improvement]`
+- **Forge resilience: HuggingFace fallback now covers text→3D; club-payout log noise reduced** — When the NVIDIA NIM free lane returns a 5xx and the Replicate TRELLIS lane is also unavailable, the forge now falls through to the HuggingFace Spaces fallback for text→3D requests (using the FLUX-synthesized intermediate image) instead of returning a 429 to the user. Previously this fallback only fired for image uploads. Club-payout cron warnings for dancers with no registered wallet are now emitted at most once per 24 hours instead of every 5-minute tick. `[fix, infra]`
- **Game-Ready export in Forge — one click to engine-ready GLB + FBX** — Any model you generate or upload in Forge can now be turned into a clean, engine-ready asset in one click. Pick Quad retopology (field-aligned QuadriFlow edge loops that rig and animate well) or Tri low-poly (silhouette-preserving, with the texture re-baked), set a poly budget with 5k / 15k / 50k presets, and export a textured GLB plus an FBX for Unity and Unreal together. You see the before→after poly count (e.g. 28,400 → 5,012) and can flip on a live wireframe to inspect the new topology right in the viewer. Files are served from our own CDN. (`/forge`) `[feature]`
- **iPhone now world-locks your IRL agent — it holds its real spot as you pan and walk** — iPhone Safari has no AR mode, so a placed agent used to drift with the camera. On three.ws/irl it now stays anchored to its real-world spot using the compass and GPS: pan your phone and the agent holds its real bearing instead of following the view, and walk toward it and it grows and keeps its place. Tapping Pin here saves the full placement — facing, ground height, and how good your GPS fix was — so iPhone placements match the AR-anchored version other phones see. If you pin before your location is ready, it waits for the first fix and pins precisely instead of dropping at a default spot. Permission states are designed and recoverable too: if motion or location access is off you get a clear card with the exact iOS Settings path and a Try again button, and if your phone can't read an absolute compass heading you're warned that others may see the agent rotated. (`/irl`) `[improvement]`
- **IRL agents now materialize as you walk up to them** — On three.ws/irl, a 3D agent placed further away first appears as a glowing beacon to keep things light. Previously it stayed a beacon even after you walked right up to it; now it upgrades to the full 3D avatar the moment you come within range, so approaching an agent in real life actually reveals it. Distance to each nearby agent is also recalculated live as you move instead of being frozen at the moment you arrived. Long AR sessions are smoother too: agents that leave the area now fully release their 3D model from memory instead of quietly accumulating, which keeps the camera view fast when you're somewhere busy with lots of agents coming and going. (`/irl`) `[fix, improvement]`
@@ -61,6 +63,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Move your IRL agents on a real map — drag the pin from anywhere** — Your IRL Agents dashboard now has a live map. Open Move on map on any placed agent and you get an OpenStreetMap view with a draggable pin for each agent you've placed: drag the highlighted one to a new spot, or tap another to switch to it. As you drag, the new location is named for you (the nearest town or city) and a Save bar appears so nothing changes until you confirm — and if a save ever fails, the pin snaps back to where it was. A compass dial lets you re-aim which way the agent faces, in degrees or by dragging the needle, and a Remove from map button takes a pin down. You can relocate an agent across the city — or across the world — without walking back to it. The map loads only when you open it, works on a phone, and if it can't load it falls back to a simple latitude/longitude form so you can still move the pin. (`/dashboard/irl-placements`) `[feature]`
- **My Cosmetics — owned-item wardrobe with cross-world equip persistence** — A new 'My Fits' wardrobe panel in the /play HUD lists every cosmetic you own (free items + premium unlocks), grouped by slot. Click any item to equip it — the change is validated server-side, written to your account, reflected instantly on your avatar, and visible to other players in the room. Equipped looks persist across sessions and carry automatically into every world (/play and /walk). Purchasing a cosmetic from the shop now equips it durably too, not just as a temporary preview. (`/play`) `[feature]`
- **Nearby agents on IRL now update live — no reload** — Open three.ws/irl and the agents other people have placed around you now update in real time. When anyone nearby drops a new agent, moves one, changes its outfit, or takes one down, you see it appear, shift, or vanish on your screen within about a second — no refresh, no waiting for the next scan. It works both ways: pin an agent and everyone standing near you sees it pop in too, and walk into a new area and the live view follows you to the agents there. A small status pill next to the nearby count shows whether you're getting live updates; if the realtime connection can't be reached — some networks block it — IRL automatically falls back to refreshing every few seconds and the pill reads 'Polling', still fully working, just a touch slower. (`/irl`) `[feature, improvement]`
+- **Never lose your way in — a minimap on the walk to the Pole Club** — The walk-in to the Pole Club now has a live minimap in the top-right corner. It shows a top-down radar of the room you're in, your avatar as an arrow that points the way you're facing, and a pulsing line to the door you're headed for — so you always know which way the exit is. It re-fits to each room as you move from the alley to the gallery to the clubhouse, and the door marker turns green once you're in range to enter. (`/club`) `[feature]`
- **Pay an IRL agent for its services — and open its full profile — right from the card** — When you tap an agent on three.ws/irl, its card now does real things. View profile opens that agent's full page so you can see who you just met. If the agent offers paid services, each one shows its price and a Use button: tap it, approve the payment in your wallet, and you pay in USDC on the spot — the standard x402 flow, capped at the price shown so a misconfigured service can never overcharge you. The response you paid for appears right inside the card instead of vanishing into a toast. Every state is handled: no wallet, a cancelled signature, or a service error each show a clear message and leave the button ready to try again, and each service button works on its own so paying for one never freezes the others. Completed encounters quietly notify the agent's owner, receipt and all. (`/irl`) `[feature]`
- **Place your IRL agent on the real floor with AR anchoring** — On AR-capable phones (Android Chrome), three.ws/irl now lets you point at your actual floor through a placement ring and tap to set your agent on that exact spot. It binds to a real-world anchor, so it stays put as you walk around it instead of sliding with the camera or jittering with GPS — the world-locked placement you'd expect from a top AR app. Each placement is saved as a pin, capturing the floor height, facing, and how good your GPS fix was, so it reloads near the same place and nearby people can see it. If you tap to anchor before your location is ready, it holds the spot and saves it the instant your first GPS fix lands instead of losing the placement. iPhone, which doesn't support this AR mode, keeps the existing compass-based Pin here flow and simply doesn't show the floor button. (`/irl`) `[feature]`
- **Placed objects in coin worlds now survive restarts** — Props, signs, and decorations placed in a coin's 3D world now persist across room disposal and server restarts. Leave a coin world and come back tomorrow — the build your community placed is still there, exactly where it was left. Durable objects are saved to Postgres + R2 via a debounced write-through that batches rapid edits into a single round-trip; transient objects like thrown balls and effects are intentionally excluded. The world correctly shows its saved state the moment the first player enters, before any new pieces are placed. (`/play`) `[feature]`
diff --git a/api/_lib/club/sweep.js b/api/_lib/club/sweep.js
index 916112ad8..f2d8f63ce 100644
--- a/api/_lib/club/sweep.js
+++ b/api/_lib/club/sweep.js
@@ -125,7 +125,16 @@ export async function runClubPayoutSweep({ send = sendClubPayout } = {}) {
const stuckHours = Number.isFinite(oldestMs) ? (Date.now() - oldestMs) / 3_600_000 : 0;
const msg = `[club-payouts] no ${network} wallet for dancer ${group.dancer} — skipping ${tipIds.length} tips`;
if (stuckHours >= 24) {
- console.warn(`${msg} (oldest unpaid ${Math.round(stuckHours)}h ago — register a payout wallet)`);
+ // Warn at most once per 24-hour period — this cron runs every 5 minutes so
+ // without the gate the same message would log ~288 times a day per dancer.
+ // Detect boundary crossing: floor(stuckHours/24) increments exactly once
+ // each day regardless of cron jitter.
+ const CRON_INTERVAL_H = 5 / 60;
+ const dayNow = Math.floor(stuckHours / 24);
+ const dayPrior = Math.floor((stuckHours - CRON_INTERVAL_H) / 24);
+ if (dayNow > dayPrior) {
+ console.warn(`${msg} (oldest unpaid ${Math.round(stuckHours)}h ago — register a payout wallet)`);
+ }
} else {
console.info(msg);
}
diff --git a/api/forge.js b/api/forge.js
index 3e4a84d25..9ce865630 100644
--- a/api/forge.js
+++ b/api/forge.js
@@ -817,22 +817,31 @@ async function startJob(req, res) {
params: reconstructParams,
});
} catch (submitErr) {
- // Image→3D free fallback chain: when the standing platform TRELLIS lane
- // (Replicate) is over-quota or unreachable, a photo upload must never
- // dead-end — the text→3D fallback (free NVIDIA NIM, in the outer catch)
- // can't take photos, so image mode would otherwise have no escape. Scoped
- // to the default trellis lane: an explicitly chosen Hunyuan3D / BYOK
- // backend that fails surfaces its own error. Provenance reports the lane
- // that actually ran so the downgrade stays visible.
+ // Free fallback chain when the default TRELLIS lane (Replicate) is
+ // over-quota or unreachable. Covers two modes:
+ // • image→3D: user photos can't fall to the text NIM lane (it's
+ // text-only), so we need a reconstruct-capable fallback here.
+ // • text→3D via NVIDIA fallback: NIM failed first (nvidiaTried=true),
+ // TRELLIS was the second attempt; we already have a synthesized
+ // referenceImageUrl from textToImage(), so the same reconstruct
+ // fallbacks apply. Without this branch the outer catch re-checks
+ // nvidiaTried=true and skips NIM, leaving the user with a 429.
+ // Scoped to the default trellis backend only — an explicitly chosen
+ // Hunyuan3D / BYOK backend that fails surfaces its own error. Provenance
+ // always reports the lane that actually ran so any downgrade is visible.
const upstreamGone =
- isImageMode && backendId === 'trellis' && isUpstreamUnavailable(submitErr);
+ backendId === 'trellis' &&
+ isUpstreamUnavailable(submitErr) &&
+ (isImageMode || referenceImageUrl != null);
if (!upstreamGone) throw submitErr;
+ const mode3d = isImageMode ? 'image→3D' : 'text→3D (via synthesized image)';
+
// Fallback #1 — self-hosted Hunyuan3D Cloud Run worker, when wired.
const hunyuanUrl = process.env.GCP_HUNYUAN3D_URL;
if (hunyuanUrl && process.env.GCP_RECONSTRUCTION_KEY) {
console.warn(
- `[forge] platform TRELLIS lane unavailable (${submitErr?.providerStatus || submitErr?.code}); degrading image→3D to self-hosted Hunyuan3D`,
+ `[forge] platform TRELLIS lane unavailable (${submitErr?.providerStatus || submitErr?.code}); degrading ${mode3d} to self-hosted Hunyuan3D`,
);
backendId = 'hunyuan3d';
provider = createGcpProvider({ reconstructUrl: hunyuanUrl });
@@ -849,8 +858,9 @@ async function startJob(req, res) {
// Fallback #2 — free Hugging Face Spaces image→3D (gated on HF_TOKEN).
// It blocks and writes its own status:'done' response; if it does, the
// request is complete. Otherwise fall through to surface the real error.
+ // For text mode, views=[referenceImageUrl] (the FLUX-synthesized image).
console.warn(
- `[forge] platform TRELLIS lane unavailable (${submitErr?.providerStatus || submitErr?.code}); trying free HuggingFace image→3D lane`,
+ `[forge] platform TRELLIS lane unavailable (${submitErr?.providerStatus || submitErr?.code}); trying free HuggingFace ${mode3d} lane`,
);
if (await runHfImageLane({ req, res, ip, imageUrls: views, prompt, aspect, tier, path })) {
return;
diff --git a/data/changelog.json b/data/changelog.json
index 060e03d4b..3308c68d2 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,33 @@
{
"$comment": "Curated changelog entries for three.ws \u2014 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-06-17",
+ "title": "Never lose your way in — a minimap on the walk to the Pole Club",
+ "summary": "The walk-in to the Pole Club now has a live minimap in the top-right corner. It shows a top-down radar of the room you're in, your avatar as an arrow that points the way you're facing, and a pulsing line to the door you're headed for — so you always know which way the exit is. It re-fits to each room as you move from the alley to the gallery to the clubhouse, and the door marker turns green once you're in range to enter.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/club"
+ },
+ {
+ "date": "2026-06-17",
+ "title": "Choose who dances — avatar selector in the Pole Club",
+ "summary": "Every pole card now has an Avatar dropdown so you can pick which 3D avatar dances on each pole. Choose from each dancer's signature look, a set of built-in rigs, or any public avatar from the gallery — the dancer swaps to the new model live, right on stage, with no reload. Your picks are remembered per pole on your next visit. The picker locks for the few seconds a dancer is mid-routine so a swap never interrupts a paid performance, and any model the animation library can't drive falls back to the default rig automatically.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/club"
+ },
+ {
+ "date": "2026-06-17",
+ "title": "Forge resilience: HuggingFace fallback now covers text→3D; club-payout log noise reduced",
+ "summary": "When the NVIDIA NIM free lane returns a 5xx and the Replicate TRELLIS lane is also unavailable, the forge now falls through to the HuggingFace Spaces fallback for text→3D requests (using the FLUX-synthesized intermediate image) instead of returning a 429 to the user. Previously this fallback only fired for image uploads. Club-payout cron warnings for dancers with no registered wallet are now emitted at most once per 24 hours instead of every 5-minute tick.",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-06-17",
"title": "Emote wheel — all 70 animations at your fingertips",
diff --git a/pages/club.html b/pages/club.html
index fab7794c5..67f234254 100644
--- a/pages/club.html
+++ b/pages/club.html
@@ -642,36 +642,32 @@
justify-content: center;
text-align: center;
padding: 24px;
- background:
- radial-gradient(120% 90% at 50% 18%, rgba(255, 59, 214, 0.14), transparent 55%),
- radial-gradient(110% 80% at 50% 100%, rgba(74, 214, 255, 0.1), transparent 60%),
- #050308;
+ background: #080808;
opacity: 1;
transition: opacity 0.7s ease;
}
.club-loader.is-done { opacity: 0; pointer-events: none; }
- .club-loader-inner { max-width: 460px; width: 100%; }
+ .club-loader-inner { max-width: 420px; width: 100%; }
.club-loader-kicker {
- font-size: 11px;
- font-weight: 600;
- letter-spacing: 0.42em;
+ font-size: 10.5px;
+ font-weight: 500;
+ letter-spacing: 0.38em;
text-transform: uppercase;
- color: var(--accent-2, #4ad6ff);
- opacity: 0.85;
- margin-bottom: 14px;
+ color: rgba(255, 255, 255, 0.38);
+ margin-bottom: 20px;
}
.club-loader-title {
margin: 0;
- font-size: clamp(40px, 11vw, 76px);
+ font-size: clamp(52px, 13vw, 88px);
font-weight: 800;
- line-height: 0.96;
- letter-spacing: -0.02em;
+ line-height: 0.92;
+ letter-spacing: -0.03em;
color: #fff;
- text-shadow: 0 0 28px rgba(255, 59, 214, 0.55);
+ text-shadow: none;
}
.club-loader-title span {
display: block;
- background: linear-gradient(92deg, #ff3bd6, #ff8a3b 60%, #4ad6ff);
+ background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.42) 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
@@ -679,31 +675,33 @@
text-shadow: none;
}
.club-loader-tagline {
- margin: 16px auto 28px;
- max-width: 360px;
- font-size: 14px;
- line-height: 1.5;
- color: var(--text-2, #c2a8d8);
+ margin: 20px auto 32px;
+ max-width: 340px;
+ font-size: 13.5px;
+ line-height: 1.55;
+ color: rgba(255, 255, 255, 0.38);
+ letter-spacing: 0.01em;
}
.club-loader-track {
- height: 4px;
+ height: 1px;
border-radius: 999px;
- background: rgba(255, 255, 255, 0.08);
+ background: rgba(255, 255, 255, 0.1);
overflow: hidden;
}
.club-loader-bar {
height: 100%;
width: 4%;
border-radius: 999px;
- background: linear-gradient(90deg, #ff3bd6, #4ad6ff);
- box-shadow: 0 0 16px rgba(255, 59, 214, 0.8);
+ background: rgba(255, 255, 255, 0.85);
+ box-shadow: none;
transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.club-loader-status {
- margin-top: 14px;
- font-size: 12px;
- letter-spacing: 0.04em;
- color: var(--text-3, #7c5d92);
+ margin-top: 16px;
+ font-size: 11px;
+ letter-spacing: 0.06em;
+ color: rgba(255, 255, 255, 0.22);
+ text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
.club-loader, .club-loader-bar { transition: none; }
@@ -782,6 +780,59 @@
.club-journey { transition: opacity 0.6s ease; }
}
+ /* Minimap — top-down radar of the room you're in: your avatar, the
+ way you're facing, and a pulsing line to the door you're headed
+ for. Drawn each frame by src/club-entrance.js. */
+ .club-minimap {
+ position: fixed;
+ top: 70px;
+ right: 18px;
+ z-index: 9445;
+ width: 156px;
+ padding: 9px 9px 7px;
+ border-radius: 14px;
+ background: rgba(8, 5, 12, 0.6);
+ border: 1px solid rgba(255, 59, 214, 0.18);
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ box-shadow: 0 10px 34px -14px rgba(0, 0, 0, 0.85);
+ pointer-events: none;
+ opacity: 0;
+ transform: translateY(-10px);
+ transition: opacity 0.6s ease, transform 0.6s ease;
+ }
+ .club-minimap.is-visible { opacity: 1; transform: translateY(0); }
+ .club-minimap-head {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ margin: 0 2px 6px;
+ }
+ .club-minimap-label {
+ font: 600 11px/1 'Inter', system-ui, sans-serif;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: #fff;
+ }
+ .club-minimap-tag {
+ font: 600 9px/1 'Inter', system-ui, sans-serif;
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ color: var(--text-3, #7c5d92);
+ }
+ .club-minimap-canvas {
+ display: block;
+ width: 138px;
+ height: 110px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.03);
+ }
+ @media (max-width: 560px) {
+ .club-minimap { top: 58px; right: 12px; width: 120px; padding: 7px 7px 5px; }
+ .club-minimap-canvas { width: 106px; height: 84px; }
+ .club-minimap-tag { display: none; }
+ }
+
.club-controls-hint {
position: fixed;
left: 50%;
@@ -1592,6 +1643,13 @@
<li class="club-journey-step" data-step="3"><span class="cj-dot"></span><span class="cj-label">Stage</span></li>
</ol>
</nav>
+ <div id="club-minimap" class="club-minimap" aria-hidden="true">
+ <div class="club-minimap-head">
+ <span id="club-minimap-label" class="club-minimap-label">Alley</span>
+ <span class="club-minimap-tag">You · Door</span>
+ </div>
+ <canvas id="club-minimap-canvas" class="club-minimap-canvas"></canvas>
+ </div>
<div id="club-controls-hint" class="club-controls-hint" role="status" aria-live="polite"></div>
<button id="club-door-prompt" type="button" class="club-door-prompt" aria-label="Enter the club">
Enter the club <kbd>E</kbd>
diff --git a/pages/home.html b/pages/home.html
index 9da947510..d981b9104 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -999,21 +999,7 @@
@media (max-width: 480px) { .foot-inner { flex-direction: column; align-items: flex-start; } .foot-ca { width: 100%; justify-content: flex-start; } }
/* ── HERO LOADING ───────────────────────────────────────── */
- .hero-stage-shimmer {
- position: absolute; inset: 0; z-index: 1;
- display: flex; align-items: center; justify-content: center;
- transition: opacity 0.6s ease;
- }
- .hero-stage-shimmer.hidden { opacity: 0; pointer-events: none; }
- .hero-stage-shimmer::before {
- content: ""; width: 120px; height: 120px; border-radius: 50%;
- background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
- animation: hero-pulse 2.4s ease-in-out infinite;
- }
- @keyframes hero-pulse {
- 0%, 100% { transform: scale(1); opacity: 0.5; }
- 50% { transform: scale(1.3); opacity: 1; }
- }
+ .hero-stage agent-3d .skeleton { display: none !important; }
.hero-stage agent-3d {
position: absolute; inset: 0; display: block; width: 100%; height: 100%;
opacity: 0; transition: opacity 0.8s cubic-bezier(.2,.7,.3,1);
@@ -1064,7 +1050,6 @@
@media (prefers-reduced-motion: reduce) {
.reveal, .hero-text > * { opacity: 1 !important; transform: none !important; transition: none !important; }
.hero-stage agent-3d { opacity: 1 !important; transition: none !important; }
- .hero-stage-shimmer { display: none !important; }
}
/* ── HERO ANIMATION CHIPS ────────────────────────────────── */
@@ -2475,7 +2460,6 @@
</div>
</div>
<div class="hero-stage" id="hero-stage">
- <div class="hero-stage-shimmer" id="hero-shimmer"></div>
<div class="hero-stage-inner" id="hero-stage-inner"></div>
<div class="hero-chips-wrap" id="hero-chips-wrap">
<div class="hero-chips-label">
@@ -4931,32 +4915,28 @@
return el;
}
async function bootHeroAvatar() {
- const heroInner = document.getElementById('hero-stage-inner');
- const shimmer = document.getElementById('hero-shimmer');
+ const heroInner = document.getElementById(‘hero-stage-inner’);
try {
const r = await fetch(`${location.origin}/api/avatars/${AVATAR_ID}`);
- if (!r.ok) throw new Error('HTTP ' + r.status);
+ if (!r.ok) throw new Error(‘HTTP ‘ + r.status);
const d = await r.json();
const glb = devProxyGlb(d.avatar?.model_url || d.avatar?.url);
- if (!glb) throw new Error('no model url');
+ if (!glb) throw new Error(‘no model url’);
if (heroInner) {
- heroInner.innerHTML = '';
+ heroInner.innerHTML = ‘’;
const heroEl = spawnAgent(glb);
heroInner.appendChild(heroEl);
initHeroWalk(heroEl);
initHeroChips(heroEl);
}
} catch (e) {
- console.warn('[home] avatar boot failed', e);
- // Designed fallback — never leave the hero shimmering forever on a network failure.
- if (shimmer) shimmer.classList.add('hidden');
+ console.warn(‘[home] avatar boot failed’, e);
if (heroInner) {
- heroInner.innerHTML = '<div class="hero-stage-fallback" role="status">'
- + '<p>The live preview couldn’t load right now.</p>'
- + '<button type="button" class="btn btn--sm" id="hero-retry">Retry</button></div>';
- heroInner.querySelector('#hero-retry')?.addEventListener('click', () => {
- if (shimmer) shimmer.classList.remove('hidden');
- heroInner.innerHTML = '';
+ heroInner.innerHTML = ‘<div class="hero-stage-fallback" role="status">’
+ + ‘<p>The live preview couldn’t load right now.</p>’
+ + ‘<button type="button" class="btn btn--sm" id="hero-retry">Retry</button></div>’;
+ heroInner.querySelector(‘#hero-retry’)?.addEventListener(‘click’, () => {
+ heroInner.innerHTML = ‘’;
bootHeroAvatar();
});
}
@@ -5787,15 +5767,11 @@
// ── Hero agent loaded state ─────────────────────────────────────
{
const heroStage = document.getElementById('hero-stage');
- const shimmer = document.getElementById('hero-shimmer');
if (heroStage) {
const checkLoaded = () => {
const agentEl = heroStage.querySelector('agent-3d');
if (!agentEl) return;
- const markLoaded = () => {
- agentEl.classList.add('loaded');
- if (shimmer) shimmer.classList.add('hidden');
- };
+ const markLoaded = () => { agentEl.classList.add('loaded'); };
agentEl.addEventListener('agent:ready', markLoaded, { once: true });
if (agentEl._viewer) markLoaded();
};
diff --git a/player.html b/player.html
new file mode 100644
index 000000000..f0e318433
--- /dev/null
+++ b/player.html
@@ -0,0 +1,465 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<title>Club · T.Pain</title>
+<style>
+*{box-sizing:border-box;margin:0;padding:0}
+html,body{height:100%;overflow:hidden}
+
+body{
+ font-family:system-ui,sans-serif;
+ display:flex;align-items:center;justify-content:center;
+ height:100vh;
+ background:#06060f;
+ transition:background 1.6s ease;
+}
+body.inside{background:#160328}
+
+/* ── neon glow overlay, only inside ── */
+.bg-glow{
+ position:fixed;inset:0;pointer-events:none;
+ opacity:0;transition:opacity 1.6s ease;
+ background:
+ radial-gradient(ellipse 70% 50% at 50% 110%,rgba(185,0,255,.35),transparent),
+ radial-gradient(ellipse 50% 70% at 15% 60%,rgba(0,200,255,.1),transparent),
+ radial-gradient(ellipse 50% 70% at 85% 60%,rgba(255,0,150,.1),transparent);
+}
+body.inside .bg-glow{opacity:1}
+
+/* brick-wall texture: only outside */
+.wall{
+ position:fixed;inset:0;pointer-events:none;
+ background:
+ repeating-linear-gradient(0deg,transparent,transparent 28px,rgba(255,255,255,.015) 28px,rgba(255,255,255,.015) 29px),
+ repeating-linear-gradient(90deg,transparent,transparent 58px,rgba(255,255,255,.01) 58px,rgba(255,255,255,.01) 59px);
+ transition:opacity 1.6s;
+}
+body.inside .wall{opacity:0}
+
+/* floating particles: only inside */
+.particles{position:fixed;inset:0;pointer-events:none;overflow:hidden}
+.p{position:absolute;width:3px;height:3px;border-radius:50%;opacity:0;transition:opacity 1.6s;animation:pfloat 5s ease-in-out infinite}
+body.inside .p{opacity:.7}
+.p:nth-child(1){left:12%;top:18%;background:#ff3cac;animation-delay:0s}
+.p:nth-child(2){left:88%;top:30%;background:#00d4ff;animation-delay:.8s}
+.p:nth-child(3){left:48%;top:12%;background:#ff6600;animation-delay:1.5s}
+.p:nth-child(4){left:72%;top:65%;background:#ff3cac;animation-delay:2.2s}
+.p:nth-child(5){left:22%;top:72%;background:#00d4ff;animation-delay:3s}
+.p:nth-child(6){left:60%;top:85%;background:#b84fff;animation-delay:1.1s}
+@keyframes pfloat{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-22px) scale(1.6)}}
+
+/* ── center column ── */
+.ui{
+ position:relative;z-index:10;
+ display:flex;flex-direction:column;align-items:center;gap:0;
+ padding:32px 24px;
+}
+
+/* sign */
+.sign{
+ font-size:10px;letter-spacing:.35em;text-transform:uppercase;
+ color:#ff3cac;
+ text-shadow:0 0 0 transparent;
+ transition:opacity 1.6s,text-shadow 1.6s;
+ opacity:.15;margin-bottom:4px;
+}
+body.inside .sign{
+ opacity:1;
+ text-shadow:0 0 14px #ff3cac,0 0 40px #ff3cac60;
+}
+
+/* location label */
+.where{
+ font-size:24px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
+ transition:color 1.6s,text-shadow 1.6s;
+ color:#222233;margin-bottom:20px;
+}
+body.inside .where{
+ color:#fff;
+ text-shadow:0 0 24px rgba(185,0,255,.7);
+}
+
+/* ── visualizer ── */
+canvas{
+ width:320px;height:68px;
+ border-radius:4px;display:block;
+ margin-bottom:20px;
+}
+
+/* ── play button ── */
+.play-btn{
+ width:60px;height:60px;border-radius:50%;border:none;cursor:pointer;
+ font-size:22px;line-height:1;
+ display:flex;align-items:center;justify-content:center;
+ transition:background 1.6s,box-shadow .2s,transform .1s;
+ background:#111122;color:#333355;
+ box-shadow:0 0 0 2px #1e1e33;
+ margin-bottom:18px;
+}
+body.inside .play-btn{
+ background:linear-gradient(135deg,#b84fff,#7c3aed);
+ color:#fff;
+ box-shadow:0 0 24px rgba(184,79,255,.5);
+}
+.play-btn:hover{transform:scale(1.06)}
+.play-btn.playing{animation:pulse 1.8s ease infinite}
+@keyframes pulse{
+ 0%,100%{box-shadow:0 0 24px rgba(184,79,255,.4)}
+ 50%{box-shadow:0 0 44px rgba(184,79,255,.75)}
+}
+
+/* ── DOOR ── */
+.door-wrap{
+ position:relative;
+ perspective:900px;
+ margin-bottom:6px;
+}
+
+.door-frame{
+ width:130px;height:195px;
+ border:3px solid #1c1c2c;
+ position:relative;overflow:hidden;
+ transition:border-color 1.6s,box-shadow 1.6s;
+ box-shadow:
+ 0 0 0 5px #08080f,
+ inset 0 0 30px rgba(0,0,0,.9),
+ /* light seeping around the door from inside */
+ 0 0 6px 2px rgba(185,0,255,.25),
+ 0 0 1px 0 rgba(185,0,255,.4);
+}
+body.inside .door-frame{
+ border-color:#3a1a5a;
+ box-shadow:
+ 0 0 0 5px #160328,
+ inset 0 0 20px rgba(0,0,0,.5),
+ 0 0 30px rgba(185,0,255,.45);
+}
+
+/* club interior glimpsed through open door */
+.door-inside{
+ position:absolute;inset:0;
+ background:radial-gradient(ellipse at 50% 90%,#3a0060 0%,#1a002e 55%,#080012 100%);
+ overflow:hidden;
+}
+.lasers{position:absolute;inset:0}
+.laser{
+ position:absolute;bottom:0;
+ width:2px;height:75%;
+ opacity:.55;
+}
+.laser:nth-child(1){left:28%;background:linear-gradient(to top,#ff00cc,transparent);animation:la 3.2s ease-in-out infinite}
+.laser:nth-child(2){left:50%;background:linear-gradient(to top,#00ccff,transparent);animation:lb 3.8s ease-in-out infinite .5s}
+.laser:nth-child(3){left:72%;background:linear-gradient(to top,#ff6600,transparent);animation:lc 4.1s ease-in-out infinite 1s}
+@keyframes la{0%,100%{transform:rotate(-18deg)}50%{transform:rotate(-4deg)}}
+@keyframes lb{0%,100%{transform:rotate(0deg)}50%{transform:rotate(16deg)}}
+@keyframes lc{0%,100%{transform:rotate(18deg)}50%{transform:rotate(4deg)}}
+.floor{
+ position:absolute;bottom:0;width:100%;height:38%;
+ background:
+ linear-gradient(to top,rgba(0,0,0,.85),transparent),
+ repeating-linear-gradient(90deg,rgba(255,255,255,.04) 0,rgba(255,255,255,.04) 1px,transparent 1px,transparent 18px),
+ repeating-linear-gradient(0deg,rgba(255,255,255,.04) 0,rgba(255,255,255,.04) 1px,transparent 1px,transparent 18px);
+}
+
+/* the door panel swings on its left hinge */
+.door-panel{
+ position:absolute;inset:0;
+ background:linear-gradient(160deg,#1e1e30 0%,#121220 70%,#0d0d1a 100%);
+ transform-origin:left center;
+ transform:perspective(900px) rotateY(0deg);
+ transition:transform 1s cubic-bezier(.25,.46,.45,.94);
+ will-change:transform;
+}
+.door-panel.open{transform:perspective(900px) rotateY(-76deg)}
+
+/* door panels (decorative insets) */
+.door-panel::before,.door-panel::after{
+ content:'';position:absolute;
+ left:10px;right:10px;
+ border:1px solid #1a1a28;
+}
+.door-panel::before{top:10px;height:44%}
+.door-panel::after{bottom:10px;height:38%}
+
+/* handle */
+.handle{
+ position:absolute;right:14px;top:50%;transform:translateY(-50%);
+ width:8px;height:28px;
+ background:linear-gradient(to bottom,#4a4a6a,#2a2a40,#4a4a6a);
+ border-radius:4px;
+ box-shadow:0 1px 4px rgba(0,0,0,.8);
+}
+
+/* door label */
+.door-label{
+ position:absolute;bottom:-30px;left:50%;transform:translateX(-50%);
+ font-size:11px;letter-spacing:.1em;text-transform:uppercase;
+ color:#333355;white-space:nowrap;
+ cursor:pointer;
+ transition:color .2s;
+ user-select:none;
+}
+.door-label:hover{color:#b84fff}
+
+/* status */
+.status{
+ font-size:10px;letter-spacing:.1em;text-transform:uppercase;
+ transition:color 1.6s;color:#1a1a2a;
+ margin-top:36px;
+}
+body.inside .status{color:#7744aa}
+
+/* mobile */
+@media(max-width:440px){
+ .door-frame{width:104px;height:156px}
+ canvas{width:260px}
+ .where{font-size:20px}
+}
+</style>
+</head>
+<body>
+
+<div class="bg-glow"></div>
+<div class="wall"></div>
+<div class="particles">
+ <div class="p"></div><div class="p"></div><div class="p"></div>
+ <div class="p"></div><div class="p"></div><div class="p"></div>
+</div>
+
+<div class="ui">
+ <div class="sign">Club Three</div>
+ <div class="where" id="where">Outside</div>
+
+ <canvas id="viz"></canvas>
+ <button class="play-btn" id="playBtn" aria-label="Play">▶</button>
+
+ <div class="door-wrap">
+ <div class="door-frame" id="doorFrame">
+ <div class="door-inside">
+ <div class="lasers">
+ <div class="laser"></div>
+ <div class="laser"></div>
+ <div class="laser"></div>
+ </div>
+ <div class="floor"></div>
+ </div>
+ <div class="door-panel" id="doorPanel">
+ <div class="handle"></div>
+ </div>
+ </div>
+ <div class="door-label" id="doorLabel" role="button" tabindex="0">Enter the club →</div>
+ </div>
+
+ <div class="status" id="status">tap play to start</div>
+</div>
+
+<script>
+(function () {
+ 'use strict';
+
+ // ── audio state ────────────────────────────────────────────────────────────
+ var ctx, sourceNode, bassFilter, lowPassFilter;
+ var dryGain, outdoorConv, indoorConv, outdoorWet, indoorWet, masterGain, analyser;
+ var animId, playing = false, audioBuffer = null, startTime = 0, pauseOffset = 0;
+ var isInside = false;
+
+ // outside: heavy bass (wall frequencies), brutal lowpass, huge wet outdoor reverb, quieter
+ // inside: full spectrum, tight room reverb, full volume
+ var P = {
+ out: { lowpass: 420, lowpassQ: 1.2, bass: 22, dry: 0.22, oWet: 0.88, iWet: 0.0, master: 0.72 },
+ in: { lowpass: 17000, lowpassQ: 0.5, bass: 9, dry: 0.60, oWet: 0.0, iWet: 0.30, master: 1.0 }
+ };
+
+ // Synthetic impulse response.
+ // outdoor: long (5s), sparse echoes bouncing off building — sounds like outdoor reverb
+ // indoor: short (1.5s), dense — tight club room
+ function buildIR(audioCtx, duration, decay, density) {
+ var rate = audioCtx.sampleRate;
+ var len = Math.floor(rate * duration);
+ var buf = audioCtx.createBuffer(2, len, rate);
+ for (var c = 0; c < 2; c++) {
+ var ch = buf.getChannelData(c);
+ for (var i = 0; i < len; i++) {
+ var r = (density >= 1) ? (Math.random() * 2 - 1)
+ : (Math.random() < density ? (Math.random() * 2 - 1) : 0);
+ ch[i] = r * Math.pow(1 - i / len, decay);
+ }
+ }
+ return buf;
+ }
+
+ function initAudio() {
+ if (ctx) return Promise.resolve();
+ ctx = new (window.AudioContext || window.webkitAudioContext)();
+
+ bassFilter = ctx.createBiquadFilter();
+ bassFilter.type = 'lowshelf';
+ bassFilter.frequency.value = 90;
+ bassFilter.gain.value = P.out.bass;
+
+ lowPassFilter = ctx.createBiquadFilter();
+ lowPassFilter.type = 'lowpass';
+ lowPassFilter.frequency.value = P.out.lowpass;
+ lowPassFilter.Q.value = P.out.lowpassQ;
+
+ dryGain = ctx.createGain();
+ dryGain.gain.value = P.out.dry;
+
+ outdoorConv = ctx.createConvolver();
+ outdoorConv.buffer = buildIR(ctx, 5.0, 1.0, 0.32); // sparse, slow decay
+ outdoorWet = ctx.createGain();
+ outdoorWet.gain.value = P.out.oWet;
+
+ indoorConv = ctx.createConvolver();
+ indoorConv.buffer = buildIR(ctx, 1.5, 2.8, 1.0); // dense, fast decay
+ indoorWet = ctx.createGain();
+ indoorWet.gain.value = P.out.iWet;
+
+ masterGain = ctx.createGain();
+ masterGain.gain.value = P.out.master;
+
+ analyser = ctx.createAnalyser();
+ analyser.fftSize = 256;
+
+ // graph: source → bass → lowpass → dry ──────────────────┐
+ // → outdoorConv → outdoorWet ┼→ master → analyser → dest
+ // → indoorConv → indoorWet ─┘
+ dryGain.connect(masterGain);
+ outdoorConv.connect(outdoorWet); outdoorWet.connect(masterGain);
+ indoorConv.connect(indoorWet); indoorWet.connect(masterGain);
+ masterGain.connect(analyser);
+ analyser.connect(ctx.destination);
+
+ setStatus('loading…');
+ return fetch('im-in-love-wit-a-stripper-fast.mp3')
+ .then(function (r) { if (!r.ok) throw new Error(r.status); return r.arrayBuffer(); })
+ .then(function (ab) { return ctx.decodeAudioData(ab); })
+ .then(function (buf) { audioBuffer = buf; setStatus('tap play to start'); })
+ .catch(function (e) { setStatus('load error: ' + e.message); });
+ }
+
+ function startPlayback() {
+ if (sourceNode) { try { sourceNode.disconnect(); } catch (_) {} }
+ sourceNode = ctx.createBufferSource();
+ sourceNode.buffer = audioBuffer;
+ sourceNode.connect(bassFilter);
+ bassFilter.connect(lowPassFilter);
+ lowPassFilter.connect(dryGain);
+ lowPassFilter.connect(outdoorConv);
+ lowPassFilter.connect(indoorConv);
+ sourceNode.start(0, pauseOffset);
+ startTime = ctx.currentTime - pauseOffset;
+ sourceNode.onended = function () {
+ if (!playing) return;
+ playing = false; pauseOffset = 0;
+ playBtn.textContent = '▶';
+ playBtn.classList.remove('playing');
+ setStatus('finished');
+ cancelAnimationFrame(animId);
+ };
+ }
+
+ // smooth all parameters over ~tc seconds
+ function transitionAudio(inside) {
+ if (!ctx) return;
+ var p = inside ? P.in : P.out;
+ var t = ctx.currentTime, tc = 0.9;
+ bassFilter.gain.setTargetAtTime(p.bass, t, tc);
+ lowPassFilter.frequency.setTargetAtTime(p.lowpass, t, tc);
+ lowPassFilter.Q.setTargetAtTime(p.lowpassQ, t, tc);
+ dryGain.gain.setTargetAtTime(p.dry, t, tc);
+ outdoorWet.gain.setTargetAtTime(p.oWet, t, tc);
+ indoorWet.gain.setTargetAtTime(p.iWet, t, tc);
+ masterGain.gain.setTargetAtTime(p.master, t, tc);
+ }
+
+ // ── visualizer ────────────────────────────────────────────────────────────
+ var canvas = document.getElementById('viz');
+ var canCtx = canvas.getContext('2d');
+ var vizMode = 0; // 0=outside 1=inside, interpolates
+
+ function drawViz() {
+ animId = requestAnimationFrame(drawViz);
+ // smoothly interpolate vizMode toward target
+ var target = isInside ? 1 : 0;
+ vizMode += (target - vizMode) * 0.03;
+
+ var W = canvas.width = canvas.offsetWidth;
+ var H = canvas.height = canvas.offsetHeight;
+ var data = new Uint8Array(analyser.frequencyBinCount);
+ analyser.getByteFrequencyData(data);
+ canCtx.clearRect(0, 0, W, H);
+
+ // outside: only low ~25% of bins; inside: all bins — lerp the count
+ var maxBins = data.length;
+ var binCount = Math.round(maxBins * (0.22 + vizMode * 0.78));
+ var barW = (W / binCount) - 1;
+
+ for (var i = 0; i < binCount; i++) {
+ var v = data[i] / 255;
+ var h = v * H;
+ if (h < 1) continue;
+ var t = i / binCount;
+ // outside: desaturated cool blue-grey; inside: vivid purple→pink
+ var sat = Math.round(20 + vizMode * 65);
+ var hue = Math.round(220 + vizMode * (t * 80));
+ var lgt = Math.round(30 + v * 35);
+ var alpha = 0.5 + v * 0.5;
+ canCtx.fillStyle = 'hsla(' + hue + ',' + sat + '%,' + lgt + '%,' + alpha + ')';
+ canCtx.fillRect(i * (barW + 1), H - h, barW, h);
+ }
+ }
+
+ // ── scene toggle ──────────────────────────────────────────────────────────
+ var playBtn = document.getElementById('playBtn');
+ var doorPanel = document.getElementById('doorPanel');
+ var doorLabel = document.getElementById('doorLabel');
+ var where = document.getElementById('where');
+ function setStatus(t) { document.getElementById('status').textContent = t; }
+
+ function toggleScene() {
+ isInside = !isInside;
+ document.body.classList.toggle('inside', isInside);
+ doorPanel.classList.toggle('open', isInside);
+ where.textContent = isInside ? 'Inside' : 'Outside';
+ doorLabel.textContent = isInside ? '← Step outside' : 'Enter the club →';
+ if (playing) setStatus(isInside ? 'inside the club' : 'outside the club');
+ transitionAudio(isInside);
+ }
+
+ doorLabel.addEventListener('click', toggleScene);
+ doorLabel.addEventListener('keydown', function (e) {
+ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggleScene(); }
+ });
+ // clicking the door frame (anywhere on the door) also toggles
+ document.getElementById('doorFrame').addEventListener('click', toggleScene);
+
+ // ── play / pause ──────────────────────────────────────────────────────────
+ playBtn.addEventListener('click', function () {
+ initAudio().then(function () {
+ if (!audioBuffer) return;
+ if (ctx.state === 'suspended') ctx.resume();
+ if (playing) {
+ pauseOffset = ctx.currentTime - startTime;
+ sourceNode.stop();
+ playing = false;
+ playBtn.textContent = '▶';
+ playBtn.classList.remove('playing');
+ setStatus('paused');
+ cancelAnimationFrame(animId);
+ } else {
+ startPlayback();
+ playing = true;
+ playBtn.textContent = '⏸';
+ playBtn.classList.add('playing');
+ setStatus(isInside ? 'inside the club' : 'outside the club');
+ drawViz();
+ }
+ });
+ });
+})();
+</script>
+</body>
+</html>
diff --git a/public/changelog.json b/public/changelog.json
index 29888d158..167d5bab9 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T19:29:05.313Z",
+ "generated_at": "2026-06-17T20:21:48.884Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -149,6 +149,16 @@
"feature"
]
},
+ {
+ "date": "2026-06-17",
+ "type": "update",
+ "title": "Choose who dances — avatar selector in the Pole Club",
+ "summary": "Every pole card now has an Avatar dropdown so you can pick which 3D avatar dances on each pole. Choose from each dancer's signature look, a set of built-in rigs, or any public avatar from the gallery — the dancer swaps to the new model live, right on stage, with no reload. Your picks are remembered per pole on your next visit. The picker locks for the few seconds a dancer is mid-routine so a swap never interrupts a paid performance, and any model the animation library can't drive falls back to the default rig automatically.",
+ "link": "/club",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-17",
"type": "update",
@@ -283,6 +293,17 @@
"improvement"
]
},
+ {
+ "date": "2026-06-17",
+ "type": "update",
+ "title": "Forge resilience: HuggingFace fallback now covers text→3D; club-payout log noise reduced",
+ "summary": "When the NVIDIA NIM free lane returns a 5xx and the Replicate TRELLIS lane is also unavailable, the forge now falls through to the HuggingFace Spaces fallback for text→3D requests (using the FLUX-synthesized intermediate image) instead of returning a 429 to the user. Previously this fallback only fired for image uploads. Club-payout cron warnings for dancers with no registered wallet are now emitted at most once per 24 hours instead of every 5-minute tick.",
+ "link": null,
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-06-17",
"type": "update",
@@ -574,6 +595,16 @@
"improvement"
]
},
+ {
+ "date": "2026-06-17",
+ "type": "update",
+ "title": "Never lose your way in — a minimap on the walk to the Pole Club",
+ "summary": "The walk-in to the Pole Club now has a live minimap in the top-right corner. It shows a top-down radar of the room you're in, your avatar as an arrow that points the way you're facing, and a pulsing line to the door you're headed for — so you always know which way the exit is. It re-fits to each room as you move from the alley to the gallery to the clubhouse, and the door marker turns green once you're in range to enter.",
+ "link": "/club",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-17",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 85602464d..c66f193a6 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -118,6 +118,14 @@
<category>feature</category>
<description>Your IRL Agents dashboard now has a real outfit editor. Open Change outfit on any agent you've placed and a live 3D preview loads with wardrobe controls for the exact layers that avatar has — recolour its hair, skin, and clothing, strip back to the base body and dress it up again, or stack on hats, glasses, and earrings. Because your agents are public, the new look is baked into the agent itself and pushed to its real-world pin, so every person who walks up to that spot sees the updated outfit in their camera — not just you. Save when you're happy; the avatar is re-rendered for real before it confirms, the previous look stays untouched if anything fails, and nearby viewers refresh to the new outfit within seconds. Run a seasonal look, brand your agents as staff for an event, or just keep them fresh — all without walking back to where you pinned them.</description>
</item>
+ <item>
+ <title>Choose who dances — avatar selector in the Pole Club</title>
+ <link>https://three.ws/club</link>
+ <guid isPermaLink="false">2026-06-17:Choose who dances — avatar selector in the Pole Club</guid>
+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Every pole card now has an Avatar dropdown so you can pick which 3D avatar dances on each pole. Choose from each dancer's signature look, a set of built-in rigs, or any public avatar from the gallery — the dancer swaps to the new model live, right on stage, with no reload. Your picks are remembered per pole on your next visit. The picker locks for the few seconds a dancer is mid-routine so a swap never interrupts a paid performance, and any model the animation library can't drive falls back to the default rig automatically.</description>
+ </item>
<item>
<title>Clearer pricing on every agent's skills in the marketplace</title>
<link>https://three.ws/marketplace</link>
@@ -222,6 +230,14 @@
<category>feature</category>
<description>The marketplace now has working Free / Paid filters. &quot;Paid&quot; surfaces every agent that charges in any way — a one-time price to own it or per-call pricing on its skills — and &quot;Free&quot; shows the rest. Filtering happens on the server, so the result count and &quot;load more&quot; stay accurate no matter how many pages deep you browse, and your choice is saved in the URL so you can bookmark or share a filtered view.</description>
</item>
+ <item>
+ <title>Forge resilience: HuggingFace fallback now covers text→3D; club-payout log noise reduced</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-17:Forge resilience: HuggingFace fallback now covers text→3D; club-payout log noise reduced</guid>
+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>When the NVIDIA NIM free lane returns a 5xx and the Replicate TRELLIS lane is also unavailable, the forge now falls through to the HuggingFace Spaces fallback for text→3D requests (using the FLUX-synthesized intermediate image) instead of returning a 429 to the user. Previously this fallback only fired for image uploads. Club-payout cron warnings for dancers with no registered wallet are now emitted at most once per 24 hours instead of every 5-minute tick.</description>
+ </item>
<item>
<title>Game-Ready export in Forge — one click to engine-ready GLB + FBX</title>
<link>https://three.ws/forge</link>
@@ -446,6 +462,14 @@
<category>feature</category>
<description>Open three.ws/irl and the agents other people have placed around you now update in real time. When anyone nearby drops a new agent, moves one, changes its outfit, or takes one down, you see it appear, shift, or vanish on your screen within about a second — no refresh, no waiting for the next scan. It works both ways: pin an agent and everyone standing near you sees it pop in too, and walk into a new area and the live view follows you to the agents there. A small status pill next to the nearby count shows whether you're getting live updates; if the realtime connection can't be reached — some networks block it — IRL automatically falls back to refreshing every few seconds and the pill reads 'Polling', still fully working, just a touch slower.</description>
</item>
+ <item>
+ <title>Never lose your way in — a minimap on the walk to the Pole Club</title>
+ <link>https://three.ws/club</link>
+ <guid isPermaLink="false">2026-06-17:Never lose your way in — a minimap on the walk to the Pole Club</guid>
+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The walk-in to the Pole Club now has a live minimap in the top-right corner. It shows a top-down radar of the room you're in, your avatar as an arrow that points the way you're facing, and a pulsing line to the door you're headed for — so you always know which way the exit is. It re-fits to each room as you move from the alley to the gallery to the clubhouse, and the door marker turns green once you're in range to enter.</description>
+ </item>
<item>
<title>Pay an IRL agent for its services — and open its full profile — right from the card</title>
<link>https://three.ws/irl</link>
diff --git a/public/features.json b/public/features.json
index 2b3e5b505..43f65b4a2 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T19:29:05.294Z",
+ "generated_at": "2026-06-17T20:21:48.872Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/animation-manager.js b/src/animation-manager.js
index 8f22b8288..788793ca5 100644
--- a/src/animation-manager.js
+++ b/src/animation-manager.js
@@ -365,6 +365,25 @@ export class AnimationManager {
return this._registerParsedClip(name, clip, opts);
}
+ /**
+ * Register a clip from already-fetched JSON — skips all network I/O.
+ * Useful for callers that pre-fetch clip data alongside other parallel loads
+ * so animations are ready before the first render frame.
+ * @param {string} name
+ * @param {object} clipJson Raw AnimationClip JSON (same shape as the files in /animations/clips/)
+ * @param {{ loop?: boolean }} [opts]
+ */
+ injectClip(name, clipJson, opts = {}) {
+ if (!clipJson || this.clips.has(name)) return;
+ try {
+ const clip = AnimationClip.parse(clipJson);
+ clip.name = name;
+ this._registerParsedClip(name, clip, opts);
+ } catch (err) {
+ log.warn(`[AnimationManager] injectClip "${name}" parse error:`, err.message);
+ }
+ }
+
/** @private Shared finalization for both load paths. */
_registerParsedClip(name, clip, opts) {
this.clips.set(name, clip);
@@ -429,19 +448,23 @@ export class AnimationManager {
* Play a named clip immediately (hard cut, no crossfade).
* Lazily loads if not yet in memory.
* @param {string} name
+ * @returns {Promise<boolean>} true if the clip started playing, false if unavailable or rejected
*/
async play(name) {
const ready = await this.ensureLoaded(name);
if (!ready) {
if (this._failed.has(name) || this._animationDefs.some((d) => d.name === name))
log.warn(`[AnimationManager] "${name}" unavailable`);
- return;
+ return false;
}
+ // Re-check after async load so concurrent play() calls don't all reset
+ // the action's timeline back to 0 once the clip finally resolves.
+ if (name === this.currentName) return true;
const action = this.actions.get(name);
- if (!action) return;
+ if (!action) return false;
// Reject a retarget that would lie the avatar on its back; fall back to the
// authored bind pose rather than play a fallen clip.
- if (!this._guardAgainstFallenPose(name, action)) return;
+ if (!this._guardAgainstFallenPose(name, action)) return false;
if (this.currentAction && this.currentAction !== action) {
this.currentAction.fadeOut(0.01);
@@ -450,6 +473,7 @@ export class AnimationManager {
this.currentAction = action;
this.currentName = name;
try { this.onChange?.(name); } catch (e) { log.warn('[AnimationManager] onChange threw:', e); }
+ return true;
}
/**
@@ -532,6 +556,11 @@ export class AnimationManager {
log.warn(`[AnimationManager] "${name}" unavailable`);
return;
}
+ // Re-check after the async load: stepAvatar calls crossfadeTo every frame,
+ // so many calls queue up while the clip is fetching. The first one to resume
+ // sets currentName; all subsequent ones must exit here or they'll all try to
+ // crossfade the action to itself, zeroing out its weight and causing T-pose.
+ if (name === this.currentName) return;
const next = this.actions.get(name);
if (!next) return;
// Reject a fallen-pose retarget: keep the current clip (or the authored
@@ -540,7 +569,7 @@ export class AnimationManager {
if (!this._guardAgainstFallenPose(name, next)) return;
next.reset().play();
- if (this.currentAction) {
+ if (this.currentAction && this.currentAction !== next) {
this.currentAction.crossFadeTo(next, duration, true);
} else {
next.fadeIn(duration);
diff --git a/src/club-entrance.js b/src/club-entrance.js
index 08fc74f33..913873be1 100644
--- a/src/club-entrance.js
+++ b/src/club-entrance.js
@@ -63,6 +63,7 @@ const AVATAR_URL = '/avatars/default.glb';
const MANIFEST_URL = '/animations/manifest.json';
const PASS_KEY = 'club:pass:v1';
const MOVE_CLIPS = new Set(['idle', 'walk']);
+const VENUE_NAMES = ['Alley', 'Gallery', 'Clubhouse']; // index-aligned with SEQUENCE, for the minimap label
const ROOM_HEIGHT = 7.0; // environments normalised to this Y so the avatar reads human
const AVATAR_HEIGHT = 1.75;
@@ -209,10 +210,14 @@ async function start(canvasEl) {
// Land in the alley + the avatar first; prefetch the rest so each place is
// ready the moment you walk into it. The loader bar tracks real bytes.
- const [firstGltf, avatarGltf, manifest] = await Promise.all([
+ // Clip JSON is fetched in the same parallel batch so idle is guaranteed
+ // ready before the first render frame — no T-pose on entry.
+ const [firstGltf, avatarGltf, manifest, idleClipJson, walkClipJson] = await Promise.all([
loader.loadAsync(SEQUENCE[0].url, (e) => setLoaderProgress('alley', e)),
loader.loadAsync(AVATAR_URL, (e) => setLoaderProgress('avatar', e)),
fetch(MANIFEST_URL, { cache: 'force-cache' }).then((r) => (r.ok ? r.json() : [])).catch(() => []),
+ fetch('/animations/clips/idle.json', { cache: 'force-cache' }).then((r) => r.ok ? r.json() : null).catch(() => null),
+ fetch('/animations/clips/walk.json', { cache: 'force-cache' }).then((r) => r.ok ? r.json() : null).catch(() => null),
]);
const loaded = SEQUENCE.map(() => null); // index-aligned gltf cache
loaded[0] = firstGltf;
@@ -256,8 +261,13 @@ async function start(canvasEl) {
const anim = new AnimationManager();
anim.attach(avatar);
- anim.setAnimationDefs((Array.isArray(manifest) ? manifest : []).filter((d) => MOVE_CLIPS.has(d.name)));
- anim.play('idle').catch(() => {});
+ const moveDefs = (Array.isArray(manifest) ? manifest : []).filter((d) => MOVE_CLIPS.has(d.name));
+ anim.setAnimationDefs(moveDefs);
+ // Inject the pre-fetched clip data directly — no second network round-trip,
+ // animations are bound before the first render frame so there's no T-pose.
+ anim.injectClip('idle', idleClipJson, { loop: true });
+ anim.injectClip('walk', walkClipJson, { loop: true });
+ await anim.play('idle');
// ── Door marker — a neon frame at the end of the alley you walk up to ────
const doorMarker = buildDoorMarker();
@@ -265,6 +275,9 @@ async function start(canvasEl) {
const doorGlow = new PointLight(0xff4fd8, 0, 9, 1.6);
scene.add(doorGlow);
+ // Top-down radar so you always know which way the exit is.
+ const minimap = buildMinimap();
+
// ── Camera + controller state ────────────────────────────────────────────
let camYaw = Math.atan2(path.dir.x, path.dir.z); // start looking down the alley toward the door
let camPitch = 0.12;
@@ -280,13 +293,15 @@ async function start(canvasEl) {
placeSpawn();
- // Cast straight down from above to the floor at (x, z). Starts at mid-room so
- // it clears ceilings/awnings and returns the walkable surface height.
+ // Cast straight down from waist height to find the walkable floor.
+ // Starting from ROOM_HEIGHT * 0.6 wrongly hit sculpture tops / arch geometry
+ // in rooms like the gallery; starting from y=1.2 samples only floor-level
+ // surfaces (floor is always near y=0 after mountEnvironment normalises).
function sampleFloor(x, z) {
- groundRay.set(new Vector3(x, ROOM_HEIGHT * 0.6, z), DOWN);
- groundRay.far = ROOM_HEIGHT;
+ groundRay.set(new Vector3(x, 1.2, z), DOWN);
+ groundRay.far = 1.5; // covers y ∈ [−0.3, 1.2] — the floor band
const hit = groundRay.intersectObject(env.root, true)[0];
- return hit ? hit.point.y : 0;
+ return hit ? Math.max(0, hit.point.y) : 0;
}
function placeSpawn() {
@@ -301,6 +316,7 @@ async function start(canvasEl) {
camYaw = Math.atan2(path.dir.x, path.dir.z);
updateCamera(1);
setJourneyStep(venueIndex);
+ minimap.setVenue(env.box, path.door, VENUE_NAMES[venueIndex] || 'Venue');
}
// ── Input ──────────────────────────────────────────────────────────────
@@ -387,6 +403,7 @@ async function start(canvasEl) {
showHint(true);
showJoystick(isTouch);
showJourney(true);
+ showMinimap(true);
setJourneyStep(venueIndex);
// Hint + prompt copy track where you are in the journey: the alley door takes
@@ -419,6 +436,7 @@ async function start(canvasEl) {
showPrompt(false);
showHint(false);
showJoystick(false);
+ showMinimap(false);
if (currentCover) {
// Hand off to the cover-charge card; we resume on admit (onPaid).
window.dispatchEvent(new CustomEvent('club:enter-door'));
@@ -445,6 +463,7 @@ async function start(canvasEl) {
inputEnabled = true;
showHint(true);
showJoystick(isTouch);
+ showMinimap(true);
});
// ── State + render loop ──────────────────────────────────────────────────
@@ -476,6 +495,7 @@ async function start(canvasEl) {
anim.update(dt);
updateCamera(dt);
approachAudio.update(dt);
+ if (phase === 'walk') minimap.update(rig.position, rig.rotation.y, nearDoor, now / 1000, prefersReducedMotion);
// Key light + proximity prompt follow the avatar in the alley.
key.position.set(rig.position.x, 5, rig.position.z + 1);
@@ -528,6 +548,7 @@ async function start(canvasEl) {
nearDoor = false;
showHint(true);
showJoystick(isTouch);
+ showMinimap(true);
}
break;
}
@@ -597,7 +618,7 @@ async function start(canvasEl) {
paid = true;
currentCover = false;
approachAudio.handOff(); // the anthem (src/club.js) takes the night from here
- showPrompt(false); showHint(false); showJoystick(false);
+ showPrompt(false); showHint(false); showJoystick(false); showMinimap(false);
advance();
}
onAdmit = onPaid;
@@ -608,6 +629,7 @@ async function start(canvasEl) {
composer.setSize(window.innerWidth, window.innerHeight);
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
+ minimap.resize();
}
window.addEventListener('resize', onResize);
@@ -623,7 +645,7 @@ async function start(canvasEl) {
composer.dispose();
renderer.dispose();
try { canvasEl.remove(); } catch {}
- showHint(false); showJoystick(false); showPrompt(false); showJourney(false);
+ showHint(false); showJoystick(false); showPrompt(false); showJourney(false); showMinimap(false);
}
}
@@ -632,6 +654,7 @@ function showPrompt(v) { toggle('club-door-prompt', v); }
function showHint(v) { toggle('club-controls-hint', v); }
function showJoystick(v) { toggle('club-joystick', v); }
function showJourney(v) { toggle('club-journey', v); }
+function showMinimap(v) { toggle('club-minimap', v); }
function toggle(id, v) {
const el = document.getElementById(id);
if (el) el.classList.toggle('is-visible', !!v);
@@ -769,6 +792,110 @@ function buildDoorMarker() {
};
}
+// Top-down radar drawn on a 2D canvas: the room footprint, your avatar (an arrow
+// that points where you're facing), and a pulsing dashed line to the door you're
+// walking toward — so you always know which way the exit is. Pure 2D context, no
+// extra WebGL; setVenue() re-fits the view to each room, update() redraws a frame.
+function buildMinimap() {
+ const cv = document.getElementById('club-minimap-canvas');
+ const labelEl = document.getElementById('club-minimap-label');
+ if (!cv) return { setVenue() {}, update() {}, resize() {} };
+ const ctx = cv.getContext('2d');
+
+ let cssW = 0, cssH = 0, dpr = 1;
+ function resize() {
+ const r = cv.getBoundingClientRect();
+ cssW = r.width || cv.clientWidth || 138;
+ cssH = r.height || cv.clientHeight || 110;
+ dpr = Math.min(window.devicePixelRatio || 1, 2);
+ cv.width = Math.round(cssW * dpr);
+ cv.height = Math.round(cssH * dpr);
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
+ }
+ resize();
+
+ const PAD = 14;
+ let bounds = null; // { minX, maxX, minZ, maxZ }
+ let door = null; // { x, z }
+
+ // World (x, z) → minimap pixel (x, y), aspect-preserving so the room reads true.
+ function project(x, z) {
+ if (!bounds) return { x: cssW / 2, y: cssH / 2 };
+ const bw = (bounds.maxX - bounds.minX) || 1;
+ const bh = (bounds.maxZ - bounds.minZ) || 1;
+ const scale = Math.min((cssW - PAD * 2) / bw, (cssH - PAD * 2) / bh);
+ const ox = (cssW - bw * scale) / 2;
+ const oy = (cssH - bh * scale) / 2;
+ return { x: ox + (x - bounds.minX) * scale, y: oy + (z - bounds.minZ) * scale, scale };
+ }
+
+ function setVenue(box, doorPos, name) {
+ bounds = { minX: box.min.x, maxX: box.max.x, minZ: box.min.z, maxZ: box.max.z };
+ door = { x: doorPos.x, z: doorPos.z };
+ if (labelEl && name) labelEl.textContent = name;
+ }
+
+ function update(pos, yaw, near, t, reduced) {
+ ctx.clearRect(0, 0, cssW, cssH);
+ if (!bounds || !door) return;
+
+ // Room footprint.
+ const a = project(bounds.minX, bounds.minZ);
+ const b = project(bounds.maxX, bounds.maxZ);
+ ctx.fillStyle = 'rgba(255, 59, 214, 0.06)';
+ ctx.strokeStyle = 'rgba(255, 59, 214, 0.28)';
+ ctx.lineWidth = 1;
+ ctx.beginPath();
+ ctx.rect(a.x, a.y, b.x - a.x, b.y - a.y);
+ ctx.fill();
+ ctx.stroke();
+
+ const me = project(pos.x, pos.z);
+ const dr = project(door.x, door.z);
+
+ // Pulsing dashed guide line from you to the door — the "go this way" cue.
+ ctx.save();
+ ctx.setLineDash([5, 5]);
+ ctx.lineDashOffset = reduced ? 0 : -(t * 14) % 10;
+ ctx.strokeStyle = near ? 'rgba(120, 255, 180, 0.85)' : 'rgba(255, 79, 216, 0.7)';
+ ctx.lineWidth = 1.5;
+ ctx.beginPath();
+ ctx.moveTo(me.x, me.y);
+ ctx.lineTo(dr.x, dr.y);
+ ctx.stroke();
+ ctx.restore();
+
+ // Door marker — glowing diamond.
+ const pulse = reduced ? 0 : (Math.sin(t * 2.4) + 1) * 0.5;
+ ctx.save();
+ ctx.translate(dr.x, dr.y);
+ ctx.rotate(Math.PI / 4);
+ ctx.fillStyle = near ? '#78ffb4' : '#ff4fd8';
+ ctx.shadowColor = ctx.fillStyle;
+ ctx.shadowBlur = 6 + pulse * 6;
+ const s = 4.5;
+ ctx.fillRect(-s, -s, s * 2, s * 2);
+ ctx.restore();
+
+ // Avatar arrow — points the way you're facing (world heading = sin/cos yaw).
+ ctx.save();
+ ctx.translate(me.x, me.y);
+ ctx.rotate(Math.atan2(Math.cos(yaw), Math.sin(yaw)));
+ ctx.fillStyle = '#ffffff';
+ ctx.shadowColor = 'rgba(255, 255, 255, 0.9)';
+ ctx.shadowBlur = 5;
+ ctx.beginPath();
+ ctx.moveTo(7, 0);
+ ctx.lineTo(-4, 4.5);
+ ctx.lineTo(-4, -4.5);
+ ctx.closePath();
+ ctx.fill();
+ ctx.restore();
+ }
+
+ return { setVenue, update, resize };
+}
+
function scaleToHeight(obj, h) {
const b = new Box3().setFromObject(obj);
const cur = b.max.y - b.min.y || 1;
diff --git a/src/club.js b/src/club.js
index b9bb07f45..ec13cca1f 100644
--- a/src/club.js
+++ b/src/club.js
@@ -76,8 +76,9 @@ const VENUE_HDRI_URL = '/club/venue/club-hdri.hdr';
// paid routine would crossfade to a no-op and leave the dancer frozen.
const REQUIRED_CLIPS = new Set([
'idle', 'dance', 'rumba', 'silly', 'thriller', 'capoeira', 'walk',
+ 'av-walk-feminine',
]);
-const WALK_CLIP = 'walk';
+const WALK_CLIP = 'av-walk-feminine';
// Guaranteed-present clip every dancer can drive. Used as the failsafe routine
// when a ticket's requested clips can't be loaded on the chosen rig, so a paid
// tip always yields a real performance (Hard rule 9: ship a working fallback).
@@ -715,8 +716,62 @@ class PoleStation {
this.skinned = root;
this.anim.setAnimationDefs(animationDefs);
- // Lazy-load — first clip request fetches its JSON on demand.
- this.anim.play('idle');
+ // Await idle so we can detect if the fallen-pose guard rejects the
+ // retarget — in which case swap to the fallback rig rather than leave
+ // the dancer frozen in her bind pose.
+ this.anim.play('idle').then((ok) => {
+ if (ok || !fallback || fallback === template) return;
+ log.warn(`[club] dancer ${this.id} idle retarget rejected — falling back to default avatar`);
+ this.anim.detach();
+ this.rig.remove(root);
+ const fbRoot = this._buildAvatarRoot(fallback);
+ this.rig.add(fbRoot);
+ this.anim.attach(fbRoot);
+ this.skinned = fbRoot;
+ this.anim.setAnimationDefs(animationDefs);
+ this.anim.play('idle').catch(() => {});
+ }).catch(() => {});
+ // Pre-load the walk clip so the first tip's walk starts immediately
+ // without a network round-trip mid-performance.
+ this.anim.ensureLoaded(WALK_CLIP).catch(() => {});
+ }
+
+ /**
+ * Hot-swap this dancer's avatar to a different rig at runtime. Tears down
+ * the current mixer + rig, then re-attaches the chosen template through the
+ * same drivable-rig verification path used at boot (attachAvatar), so an
+ * un-retargetable pick falls back to the default rather than freezing.
+ *
+ * The cloned root shares geometry/materials with `template`
+ * (SkeletonUtils.clone), so we only unparent the old root — disposing it
+ * would corrupt the shared template other stations may reuse.
+ *
+ * @param {import('three').Object3D} template
+ * @param {import('three').Object3D} [fallback]
+ */
+ swapAvatar(template, fallback = null) {
+ // Cancel any in-flight performance: drop to idle, resolve pending
+ // render-clock sleepers so a running playSequence unblocks and exits
+ // (its isCancelled sees performing === false), and re-home the rig.
+ this.performing = false;
+ this.walkPhase = 'idle';
+ while (this._sleepers.length) this._sleepers.pop().resolve();
+ this.activeTicket = null;
+
+ this.anim?.detach();
+ if (this.skinned) {
+ this.rig.remove(this.skinned);
+ this.skinned = null;
+ }
+
+ this.rig.position.copy(this.homePos);
+ this.rig.rotation.y = this.layout.yaw;
+ this._phaseTarget = this.homePos;
+ this._spotTarget = this.spotIdleIntensity;
+ this._accentTarget = 0.4;
+ updatePoleCardStatus(this.id, 'idle');
+
+ this.attachAvatar(template, animationDefs, fallback);
}
get backstagePos() {
@@ -1167,8 +1222,12 @@ async function bootstrap() {
const tpl = avatarGltfs[i].scene;
tpl.traverse((n) => { if (n.isMesh) n.castShadow = true; });
avatarTemplates.set(url, tpl);
+ // Seed the swap cache so picking a rig we already loaded this boot is
+ // instant (no second network fetch).
+ avatarTemplateCache.set(url, Promise.resolve(tpl));
});
const fallbackTemplate = avatarTemplates.get(AVATAR_URL);
+ fallbackTemplateRef = fallbackTemplate;
const poleTemplate = poleGltf.scene;
const stageTemplate = stageGltf.scene;
@@ -1191,6 +1250,11 @@ async function bootstrap() {
if (typeof window !== 'undefined') window.__clubParticles = particles;
}
+ // Build the per-pole avatar selector (dancer looks + bundled rigs + public
+ // gallery) and restore any look the visitor picked previously. Side-effect
+ // only — doesn't block the stage being ready.
+ initAvatarSelector(dancerUrls);
+
// Backfill history + open the SSE channel so this tab sees other tabs'
// tips. Both run side-effect-only and don't block the stage being ready.
loadInitialTips();
@@ -1460,6 +1524,11 @@ function updatePoleCardStatus(poleId, status) {
if (progressEl) {
progressEl.style.display = status === 'performing' ? '' : 'none';
}
+ // Lock the avatar picker mid-routine so a swap can't interrupt a paid
+ // performance; it re-enables the moment she returns to idle. Skip while the
+ // dropdown is still loading its options (kept disabled until populated).
+ const avatarSel = cardEl.querySelector('.club-avatar-select');
+ if (avatarSel && avatarSel.value) avatarSel.disabled = status === 'performing';
}
function flashPoleCard(poleId) {
@@ -1471,6 +1540,145 @@ function flashPoleCard(poleId) {
cardEl.addEventListener('animationend', () => cardEl.classList.remove('is-flash'), { once: true });
}
+// ── Avatar selector ──────────────────────────────────────────────────────
+// Each pole card carries an "Avatar" dropdown so a visitor can choose which
+// 3D avatar dances on that pole. The catalog is built at boot from three
+// sources, deduped by URL: each dancer's own curated look, a set of bundled
+// known-good humanoid rigs (guaranteed to load offline — Hard rule 9), and
+// public avatars from the gallery (/api/explore). Picks hot-swap the rig live
+// and persist per-pole to localStorage. Any rig the clip library can't
+// retarget falls back to the default in attachAvatar, so a pick never freezes
+// a dancer.
+const BUNDLED_AVATARS = [
+ { key: 'bundled-michelle', name: 'Michelle', url: '/avatars/michelle.glb' },
+ { key: 'bundled-studio', name: 'Studio', url: '/avatars/readyplayerme.glb' },
+ { key: 'bundled-realistic', name: 'Realistic', url: '/avatars/realistic-female.glb' },
+ { key: 'bundled-mannequin', name: 'Mannequin', url: '/avatars/mannequin.glb' },
+ { key: 'bundled-classic', name: 'Classic', url: AVATAR_URL },
+];
+const GALLERY_URL = '/api/explore?source=avatar&category=avatar&only3d=1&limit=24';
+const POLE_AVATARS_KEY = 'club:poleAvatars';
+
+// key → { key, name, url }. Insertion order drives the dropdown order.
+const avatarCatalog = new Map();
+// url → Promise<Object3D>, so a re-pick (or two poles sharing a look) loads once.
+const avatarTemplateCache = new Map();
+let fallbackTemplateRef = null;
+
+function registerAvatar(entry) {
+ if (!entry?.key || !entry?.url || avatarCatalog.has(entry.key)) return;
+ avatarCatalog.set(entry.key, { key: entry.key, name: entry.name || 'Avatar', url: entry.url });
+}
+
+function escapeText(value) {
+ return String(value ?? '').replace(/[<>&"]/g, '');
+}
+
+const savedPoleAvatars = (() => {
+ try { return JSON.parse(localStorage.getItem(POLE_AVATARS_KEY) || '{}') || {}; }
+ catch { return {}; }
+})();
+function savePoleAvatar(poleId, key) {
+ savedPoleAvatars[poleId] = key;
+ try { localStorage.setItem(POLE_AVATARS_KEY, JSON.stringify(savedPoleAvatars)); } catch {}
+}
+// The default look for a pole is that pole's own dancer; persisted only when
+// the visitor picks something else.
+function defaultAvatarKey(poleId) { return `dancer-${poleId}`; }
+
+function loadAvatarTemplate(url) {
+ if (avatarTemplateCache.has(url)) return avatarTemplateCache.get(url);
+ const p = gltfLoader(renderer).loadAsync(url).then((gltf) => {
+ gltf.scene.traverse((n) => { if (n.isMesh) n.castShadow = true; });
+ return gltf.scene;
+ });
+ avatarTemplateCache.set(url, p);
+ return p;
+}
+
+// Pull public avatars from the gallery. Never throws — a failed fetch just
+// leaves the dropdown with the dancer + bundled looks.
+async function loadGalleryAvatars() {
+ try {
+ const res = await fetch(GALLERY_URL, { headers: { accept: 'application/json' } });
+ if (!res.ok) return;
+ const data = await res.json();
+ const items = Array.isArray(data?.items) ? data.items : [];
+ for (const it of items) {
+ if (!it?.glbUrl || it.has3d === false || it.kind !== 'avatar') continue;
+ registerAvatar({ key: `gallery-${it.avatarId}`, name: it.name || 'Avatar', url: it.glbUrl });
+ }
+ } catch (err) {
+ log.warn('[club] gallery avatar fetch failed', err);
+ }
+}
+
+// Fill every pole's avatar dropdown from the catalog, selecting the persisted
+// (or default) choice. Idempotent — safe to call again once the gallery lands.
+function populateAvatarSelects() {
+ const entries = [...avatarCatalog.values()];
+ if (!entries.length) return;
+ for (const pole of POLES) {
+ const select = poleCardEls.get(pole.id)?.querySelector('.club-avatar-select');
+ if (!select) continue;
+ const saved = savedPoleAvatars[pole.id];
+ const current = saved && avatarCatalog.has(saved) ? saved : defaultAvatarKey(pole.id);
+ select.innerHTML = entries
+ .map((en) => `<option value="${escapeText(en.key)}"${en.key === current ? ' selected' : ''}>${escapeText(en.name)}</option>`)
+ .join('');
+ select.disabled = false;
+ }
+}
+
+async function swapPoleAvatar(poleId, key) {
+ const station = stations.find((s) => s.id === poleId);
+ const entry = avatarCatalog.get(key);
+ if (!station || !entry) return;
+ const select = poleCardEls.get(poleId)?.querySelector('.club-avatar-select');
+ if (select) select.disabled = true;
+ const dancerName = DANCER_META[parseInt(poleId, 10) - 1]?.name || `Dancer ${poleId}`;
+ try {
+ const template = await loadAvatarTemplate(entry.url);
+ station.swapAvatar(template, fallbackTemplateRef || template);
+ savePoleAvatar(poleId, key);
+ setStatus(`${dancerName} now wearing ${entry.name}.`, { kind: 'ok' });
+ } catch (err) {
+ log.warn(`[club] avatar swap failed for pole ${poleId}`, err);
+ setStatus("Couldn't load that avatar — keeping the current look.", { kind: 'error' });
+ // Roll the dropdown back to whatever the station is actually wearing.
+ if (select) {
+ const fallbackKey = savedPoleAvatars[poleId] && avatarCatalog.has(savedPoleAvatars[poleId])
+ ? savedPoleAvatars[poleId]
+ : defaultAvatarKey(poleId);
+ select.value = fallbackKey;
+ }
+ } finally {
+ if (select) select.disabled = station.performing;
+ }
+}
+
+// Build the catalog and restore persisted picks. Called from bootstrap once
+// the dancers' own avatar URLs are resolved and their boot templates cached.
+async function initAvatarSelector(dancerUrls) {
+ DANCER_META.forEach((m, i) => registerAvatar({
+ key: defaultAvatarKey(String(i + 1)),
+ name: m.name,
+ url: dancerUrls[i] || AVATAR_URL,
+ }));
+ for (const a of BUNDLED_AVATARS) registerAvatar(a);
+ await loadGalleryAvatars();
+ populateAvatarSelects();
+
+ // Re-apply any look the visitor chose on a previous visit. The boot path
+ // already attached each pole's own dancer, so we only swap the overrides.
+ for (const pole of POLES) {
+ const key = savedPoleAvatars[pole.id];
+ if (key && avatarCatalog.has(key) && key !== defaultAvatarKey(pole.id)) {
+ swapPoleAvatar(pole.id, key);
+ }
+ }
+}
+
function renderPoles() {
if (!polesPanel) return;
polesPanel.innerHTML = '';
@@ -1501,6 +1709,13 @@ function renderPoles() {
<div class="club-pole-progress" style="display:none" role="progressbar" aria-label="Performance progress" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
<div class="club-pole-progress-bar" style="width:0%"></div>
</div>
+ <label class="club-pole-style">
+ <span class="sr-only">Avatar for ${meta.name}</span>
+ Avatar
+ <select data-pole="${pole.id}" class="club-pole-select club-avatar-select" aria-label="Avatar for pole ${pole.id}" disabled>
+ <option value="">Loading avatars…</option>
+ </select>
+ </label>
<label class="club-pole-style">
<span class="sr-only">Dance style for ${meta.name}</span>
Style
@@ -1540,6 +1755,13 @@ function renderPoles() {
if (layout) clubCam.setVip(layout);
}
});
+
+ // Avatar dropdown → hot-swap the chosen rig onto that pole's dancer.
+ polesPanel.addEventListener('change', (e) => {
+ const select = e.target.closest('.club-avatar-select');
+ if (!select || !select.value) return;
+ swapPoleAvatar(select.dataset.pole, select.value);
+ });
}
// ── Pointer + pinch handling ─────────────────────────────────────────────