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.

6.9 KB
Raw Blame
<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title data-i18n="demos_404.meta_title">three.ws — 404</title>
		<meta name="robots" content="noindex" />
		<link rel="stylesheet" href="/fonts/fonts.css" />
		<style>
			:root { color-scheme: dark; }
			*, *::before, *::after { box-sizing: border-box; }
			html, body { height: 100%; margin: 0; background: #050505; color: #eee; font: 15px/1.5 'Inter', -apple-system, system-ui, sans-serif; overflow: hidden; }

			#avatar-canvas {
				position: fixed; inset: 0;
				width: 100vw; height: 100vh;
				pointer-events: none; z-index: 999;
			}

			.nav {
				position: fixed; top: 0; left: 0; right: 0; z-index: 20;
				display: flex; align-items: center; gap: 16px; padding: 14px 28px;
				background: rgba(4,5,13,0.55); backdrop-filter: blur(14px);
				border-bottom: 1px solid rgba(255,255,255,0.04);
			}
			.nav .brand { font: 700 15px/1 'Space Grotesk','Inter',sans-serif; color:#fff; text-decoration:none; display:flex; align-items:center; gap:7px; }
			.brand-dot { width:8px; height:8px; border-radius:50%; background:linear-gradient(135deg,#3dc1ff,#aacc00); box-shadow:0 0 10px rgba(61, 193, 255,0.6); }
			.nav a.link { color:#555870; text-decoration:none; font-size:13px; margin-left:auto; }
			.nav a.link:hover { color:#3dc1ff; }

			.stage {
				min-height: 100vh;
				display: flex; flex-direction: column; align-items: center; justify-content: center;
				gap: 28px; padding: 100px 24px 60px;
				text-align: center;
			}
			.eyebrow {
				display: inline-flex; align-items: center; gap: 9px;
				font-size: 11px; font-weight: 600;
				letter-spacing: 0.17em; text-transform: uppercase;
				color: #3dc1ff;
				font-family: 'Space Grotesk', 'Inter', sans-serif;
			}
			.eyebrow-dot {
				width: 7px; height: 7px; border-radius: 50%;
				background: #3dc1ff; box-shadow: 0 0 8px rgba(61, 193, 255,0.7);
				animation: blink 2.2s ease-in-out infinite;
			}
			@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

			.bignum {
				font-family: 'Space Grotesk', 'Inter', sans-serif;
				font-weight: 800; letter-spacing: -0.06em;
				font-size: clamp(140px, 28vw, 320px);
				line-height: 0.85;
				margin: 0;
				color: #fff;
				/* JS drives --agent-shadow as the avatar lands on the digits */
				text-shadow: var(--agent-shadow, none);
				transition: text-shadow 90ms linear;
				user-select: none;
			}
			.bignum em { color: #3dc1ff; font-style: normal; }

			.line {
				font-family: 'Space Grotesk', 'Inter', sans-serif;
				font-size: clamp(20px, 2.4vw, 28px); font-weight: 700;
				margin: 0; color: #fff; letter-spacing: -0.015em;
			}
			.sub { color: #6b6e88; max-width: 44ch; margin: 0; font-size: 15px; }

			.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
			.btn {
				display: inline-flex; align-items: center; gap: 10px;
				padding: 14px 26px; border: none; border-radius: 12px;
				font: 700 14.5px/1 'Inter', inherit; cursor: pointer; text-decoration: none;
				user-select: none;
				transform-origin: bottom center;
				will-change: transform;
			}
			.btn-primary {
				background: linear-gradient(160deg, #5ad1ff, #2cb0ef);
				color: #0b0b0b;
				box-shadow: 0 7px 0 0 #005a8a, 0 9px 24px rgba(61, 193, 255,0.25);
			}
			.btn-primary:hover { filter: brightness(1.07); }
			.btn-ghost {
				background: rgba(255,255,255,0.05); color: #bbb;
				border: 1.5px solid rgba(255,255,255,0.1);
				box-shadow: 0 4px 0 0 rgba(255,255,255,0.04);
			}
			.btn-ghost:hover { color: #fff; border-color: rgba(61, 193, 255,0.4); }

			.hint {
				position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
				z-index: 15; color: #4a4d63; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
			}
		</style>
		<!-- Resolve the bare @three-ws/agent-ui specifier without a bundler (this
		     file is served verbatim from public/). esm.sh ships the package's ESM
		     build and resolves its peer deps (three, etc.) transitively. -->
		<script type="importmap">
			{ "imports": { "@three-ws/agent-ui": "https://esm.sh/@three-ws/[email protected]" } }
		</script>
	</head>
	<body>
		<div class="nav">
			<a href="/" class="brand">
				<img src="/three.svg" width="20" height="20" alt="" />
				<span class="brand-dot"></span>
				three.ws
			</a>
			<a href="/demos/" class="link" data-i18n="demos_404.lab">← lab</a>
		</div>

		<div class="stage">
			<div class="eyebrow"><span class="eyebrow-dot"></span><span data-i18n="demos_404.lost_in_3d">Lost in 3D</span></div>
			<h1 class="bignum" id="bignum"><span id="four-a">4</span><em id="zero">0</em><span id="four-b">4</span></h1>
			<p class="line" id="lost-line" data-i18n="demos_404.your_agent_took_a_wrong_turn">Your agent took a wrong turn.</p>
			<p class="sub" data-i18n="demos_404.this_page_does_not_exist_on_three">This page does not exist on three.ws — but she landed here, looked around, and seems pretty confused. Send her home.</p>
			<div class="actions">
				<a href="/" class="btn btn-primary" id="home-btn" data-i18n-html="demos_404.take_her_home">
					<span>Take her home</span>
					<span>→</span>
				</a>
				<a href="/demos/" class="btn btn-ghost" id="lab-btn" data-i18n-html="demos_404.back_to_lab">
					<span>Back to lab</span>
				</a>
			</div>
		</div>

		<canvas id="avatar-canvas"></canvas>

		<script type="module">
			import { createAgentUI } from '@three-ws/agent-ui';

			const zero    = document.getElementById('zero');
			const homeBtn = document.getElementById('home-btn');
			const labBtn  = document.getElementById('lab-btn');

			const agent = await createAgentUI({
				canvas: document.getElementById('avatar-canvas'),
				clips: ['idle', 'walk', 'falling'],
			});

			// Proximity shadow tracks the avatar's screen Y vs. the "0" baseline.
			// The CSS picks it up via `text-shadow: var(--agent-shadow, none)`.
			agent.fx.proximityShadow(document.getElementById('bignum'));

			// Drop from above the viewport onto the "0", fire dust + pulse on land.
			await agent.fallOnto(zero, {
				duration: 1.4,
				landingOffsetPx: 90,
				tumble: 0.25,
				onLand: () => {
					agent.fx.dust(zero);
					agent.fx.impactPulse(zero);
				},
			});

			// Confused look-around loop: gentle yaw oscillation while idle on the digit.
			agent.play('idle', { loop: true });
			const t0 = performance.now();
			(function lookAround() {
				if (agent._runningOff) return;
				const t = (performance.now() - t0) / 1000;
				agent.avatar.rotation.y = Math.sin(t * 1.25) * 0.35;
				requestAnimationFrame(lookAround);
			})();

			// Each link runs the avatar off-screen before navigating.
			agent.interceptNavigation(homeBtn, { direction: 'right', delay: 1100 });
			agent.interceptNavigation(labBtn,  { direction: 'left',  delay: 1100 });
		</script>
		<script src="/brand.js" defer></script>
	<!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
	<script type="module" src="/i18n.js"></script>
</body>
</html>