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.

feat: add showcase link to navigation and footer; enhance AR button functionality and styling

nirholasd3353224e04c
diff --git a/index.html b/index.html
index a3df60626..76da6d31f 100644
--- a/index.html
+++ b/index.html
@@ -770,6 +770,7 @@
<a href="/app">Viewer</a>
<a href="/create">Create</a>
<a href="/discover">Discover</a>
+ <a href="/showcase">Showcase</a>
<a href="/features">Features</a>
<a href="/widgets">Widgets</a>
<a href="/studio">Studio</a>
@@ -1211,6 +1212,7 @@
<a href="/widgets">Widgets</a>
<a href="/features">Features</a>
<a href="/discover">Discover</a>
+ <a href="/showcase">Showcase</a>
<a href="/docs/widgets">Docs</a>
<a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>
<a href="/legal/privacy">Privacy</a>
diff --git a/public/login.html b/public/login.html
index e75cc464c..30dd1534b 100644
--- a/public/login.html
+++ b/public/login.html
@@ -160,6 +160,11 @@
color: #444;
margin: 0 0 10px;
font-weight: 500;
+ text-decoration: none;
+ display: inline-block;
+ }
+ .brand:hover {
+ color: #888;
}
.divider {
display: flex;
@@ -213,6 +218,70 @@
}
.chain-panel { display: none; }
.chain-panel.active { display: block; }
+
+ /* ── Interactions ── */
+ @keyframes card-in {
+ from { opacity: 0; transform: translateY(14px) scale(0.985); }
+ to { opacity: 1; transform: translateY(0) scale(1); }
+ }
+ .card {
+ animation: card-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
+ }
+ input {
+ transition: border-color 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
+ }
+ input:focus {
+ border-color: rgba(255, 255, 255, 0.45);
+ box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
+ background: #080808;
+ }
+ label {
+ transition: color 0.1s ease;
+ }
+ label.lit {
+ color: #bbb;
+ }
+ #submit {
+ position: relative;
+ overflow: hidden;
+ transition: background 0.1s ease, transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s;
+ }
+ #submit:active:not(:disabled) {
+ transform: scale(0.965);
+ }
+ #submit::after {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: linear-gradient(100deg, transparent 20%, rgba(0, 0, 0, 0.08) 50%, transparent 80%);
+ transform: translateX(-150%);
+ }
+ #submit:hover:not(:disabled)::after {
+ transform: translateX(150%);
+ transition: transform 0.55s ease;
+ }
+ .chain-tab {
+ transition: background 0.1s ease, color 0.1s ease, transform 0.08s cubic-bezier(0.34, 1.56, 0.64, 1);
+ }
+ .chain-tab:active {
+ transform: scale(0.93);
+ }
+ .wallet-hint-btn {
+ transition: border-color 0.1s ease, color 0.1s ease, transform 0.08s cubic-bezier(0.34, 1.56, 0.64, 1);
+ }
+ .wallet-hint-btn:active {
+ transform: scale(0.91);
+ }
+ @keyframes err-shake {
+ 0%, 100% { transform: translateX(0); }
+ 20% { transform: translateX(-6px); }
+ 40% { transform: translateX(5px); }
+ 65% { transform: translateX(-3px); }
+ 85% { transform: translateX(2px); }
+ }
+ .err.shaking {
+ animation: err-shake 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97);
+ }
</style>
</head>
<body>
@@ -236,7 +305,7 @@
></model-viewer>
</div>
<form class="card" id="f">
- <p class="brand">three.ws</p>
+ <a href="/" class="brand">three.ws</a>
<h1>Welcome back</h1>
<p class="sub">Sign in to manage your avatars.</p>
<label for="email">Email or username</label>
@@ -383,10 +452,21 @@
} catch (e) {
err.textContent = e.message;
err.style.display = 'block';
+ err.classList.remove('shaking');
+ void err.offsetWidth;
+ err.classList.add('shaking');
btn.disabled = false;
btn.textContent = 'Sign in';
}
});
</script>
+ <script>
+ document.querySelectorAll('#f input').forEach((input) => {
+ const label = document.querySelector(`label[for="${input.id}"]`);
+ if (!label) return;
+ input.addEventListener('focus', () => label.classList.add('lit'));
+ input.addEventListener('blur', () => label.classList.remove('lit'));
+ });
+ </script>
</body>
</html>
diff --git a/public/register.html b/public/register.html
index cce4a3396..a6fdc26b0 100644
--- a/public/register.html
+++ b/public/register.html
@@ -5,6 +5,11 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Create account · three.ws</title>
<link rel="icon" href="/favicon.ico" />
+ <link rel="stylesheet" href="/wallet-connect.css" />
+ <script
+ type="module"
+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"
+ ></script>
<style>
:root {
color-scheme: dark;
@@ -25,10 +30,36 @@
color: #eee;
margin: 0;
min-height: 100vh;
- display: grid;
- place-items: center;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
padding: 24px;
}
+ .agent-avatar {
+ position: relative;
+ width: 160px;
+ height: 160px;
+ pointer-events: none;
+ }
+ .agent-avatar model-viewer {
+ width: 100%;
+ height: 100%;
+ --poster-color: transparent;
+ background: transparent;
+ }
+ .agent-avatar::after {
+ content: '';
+ position: absolute;
+ left: 50%;
+ bottom: -2px;
+ width: 90px;
+ height: 10px;
+ background: radial-gradient(ellipse, rgba(106, 92, 255, 0.35), transparent 70%);
+ transform: translateX(-50%);
+ filter: blur(4px);
+ }
a {
color: #9a8cff;
}
@@ -50,6 +81,24 @@
color: #888;
margin: 0 0 24px;
font-size: 14px;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ flex-wrap: wrap;
+ }
+ .badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-size: 11px;
+ font-weight: 600;
+ padding: 2px 8px;
+ border-radius: 20px;
+ background: rgba(106, 92, 255, 0.15);
+ border: 1px solid rgba(106, 92, 255, 0.3);
+ color: #a899ff;
+ letter-spacing: 0.02em;
+ white-space: nowrap;
}
label {
display: block;
@@ -65,6 +114,7 @@
border-radius: 9px;
color: #eee;
font-size: 15px;
+ transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
outline: none;
@@ -76,7 +126,26 @@
color: #666;
margin-top: 4px;
}
- button {
+ .strength-bar {
+ height: 3px;
+ border-radius: 2px;
+ background: #2a2a36;
+ margin-top: 6px;
+ overflow: hidden;
+ }
+ .strength-fill {
+ height: 100%;
+ width: 0%;
+ border-radius: 2px;
+ transition: width 0.2s, background 0.2s;
+ }
+ .strength-label {
+ font-size: 11px;
+ margin-top: 3px;
+ color: #555;
+ transition: color 0.2s;
+ }
+ button[type="submit"] {
width: 100%;
margin-top: 20px;
padding: 12px 16px;
@@ -87,8 +156,17 @@
font-weight: 600;
font-size: 15px;
cursor: pointer;
+ transition: filter 0.15s, transform 0.1s;
+ }
+ button[type="submit"]:hover:not(:disabled) {
+ filter: brightness(1.12);
+ transform: translateY(-1px);
}
- button:disabled {
+ button[type="submit"]:active:not(:disabled) {
+ transform: translateY(0);
+ filter: brightness(0.95);
+ }
+ button[type="submit"]:disabled {
opacity: 0.6;
cursor: default;
}
@@ -108,20 +186,114 @@
font-size: 13px;
color: #888;
}
+ .legal {
+ margin-top: 10px;
+ text-align: center;
+ font-size: 11px;
+ color: #555;
+ }
.brand {
font-size: 12px;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--accent);
margin: 0 0 8px;
+ text-decoration: none;
+ display: inline-block;
+ }
+ .brand:hover {
+ color: #9a8cff;
+ }
+ .divider {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ margin: 22px 0 4px;
+ color: #555;
+ font-size: 12px;
+ text-transform: uppercase;
+ letter-spacing: 0.08em;
+ }
+ .divider::before,
+ .divider::after {
+ content: '';
+ flex: 1;
+ height: 1px;
+ background: #2a2a36;
}
+ .chain-tabs {
+ display: flex;
+ gap: 4px;
+ background: #0f0f17;
+ border: 1px solid #2a2a36;
+ border-radius: 10px;
+ padding: 3px;
+ margin-bottom: 4px;
+ }
+ .chain-tab {
+ flex: 1;
+ padding: 7px 10px;
+ border: none;
+ border-radius: 7px;
+ background: transparent;
+ color: #888;
+ font-size: 13px;
+ font-weight: 500;
+ cursor: pointer;
+ transition: background 0.15s, color 0.15s;
+ margin-top: 0;
+ width: auto;
+ }
+ .chain-tab.active {
+ background: #1e1e2e;
+ color: #eee;
+ border: 1px solid #2a2a36;
+ }
+ .chain-tab:hover:not(.active) {
+ color: #bbb;
+ }
+ .chain-panel { display: none; }
+ .chain-panel.active { display: block; }
+ .wallet-hint-btn {
+ width: auto;
+ margin-top: 0;
+ padding: 4px 10px;
+ background: transparent;
+ border: 1px solid #2a2a36;
+ border-radius: 6px;
+ color: #666;
+ font-size: 11px;
+ font-weight: 400;
+ cursor: pointer;
+ }
+ .wallet-hint-btn:hover { border-color: #6a5cff; color: #9a8cff; }
+ .wallet-hint-btn.active { border-color: #6a5cff; color: #9a8cff; background: rgba(106,92,255,0.08); }
</style>
</head>
<body>
+ <div class="agent-avatar" aria-hidden="true">
+ <model-viewer
+ id="register-avatar"
+ src="/avatars/cz.glb"
+ alt=""
+ autoplay
+ animation-name="IdleV4.2(maya_head)"
+ disable-zoom
+ interaction-prompt="none"
+ shadow-intensity="0.6"
+ shadow-softness="1"
+ exposure="1.05"
+ tone-mapping="aces"
+ environment-image="neutral"
+ camera-orbit="0deg 88deg 4.8m"
+ field-of-view="32deg"
+ loading="eager"
+ ></model-viewer>
+ </div>
<form class="card" id="f">
- <p class="brand">three.ws</p>
+ <a href="/" class="brand">three.ws</a>
<h1>Create account</h1>
- <p class="sub">Pick a username and password — no email needed.</p>
+ <p class="sub">Get started free. <span class="badge">✓ No email needed</span></p>
<label for="username">Username</label>
<input
id="username"
@@ -145,15 +317,102 @@
maxlength="200"
aria-describedby="password-hint err"
/>
- <p class="hint" id="password-hint">Minimum 10 characters</p>
+ <div class="strength-bar"><div class="strength-fill" id="strength-fill"></div></div>
+ <p class="strength-label" id="strength-label">Minimum 10 characters</p>
<button id="submit" type="submit">Create account</button>
<div class="err" id="err" role="alert" aria-live="polite"></div>
+ <div class="divider">or connect wallet</div>
+ <div class="chain-tabs" role="tablist" aria-label="Wallet chain">
+ <button type="button" class="chain-tab active" data-chain="evm" role="tab" aria-selected="true" aria-controls="evm-panel">EVM</button>
+ <button type="button" class="chain-tab" data-chain="solana" role="tab" aria-selected="false" aria-controls="solana-panel">Solana</button>
+ </div>
+ <div id="evm-panel" class="chain-panel active" role="tabpanel">
+ <div id="wallet-mount"></div>
+ </div>
+ <div id="solana-panel" class="chain-panel" role="tabpanel">
+ <div id="solana-wallet-mount"></div>
+ <div class="chain-hints" id="solana-hints" style="margin-top:8px;font-size:12px;color:#555;display:flex;gap:8px;justify-content:center;">
+ <button type="button" class="wallet-hint-btn" data-wallet="phantom">Phantom</button>
+ <button type="button" class="wallet-hint-btn" data-wallet="backpack">Backpack</button>
+ <button type="button" class="wallet-hint-btn" data-wallet="solflare">Solflare</button>
+ </div>
+ </div>
<p class="foot">Already have an account? <a href="/login">Sign in</a></p>
+ <p class="legal">By creating an account you agree to our <a href="/legal/tos">Terms of Service</a> and <a href="/legal/privacy">Privacy Policy</a>.</p>
</form>
+
+ <script type="module" src="/wallet-login.js"></script>
+
<script>
+ // Avatar mouse tracking
+ (function () {
+ const viewer = document.getElementById('register-avatar');
+ if (!viewer) return;
+ const BASE_AZ = 0, BASE_POL = 88, AZ_RANGE = 30, POL_RANGE = 14;
+ let targetAz = BASE_AZ, targetPol = BASE_POL;
+ let curAz = BASE_AZ, curPol = BASE_POL;
+ let nod = 0;
+ const lerp = (a, b, t) => a + (b - a) * t;
+ function tick() {
+ curAz = lerp(curAz, targetAz, 0.1);
+ curPol = lerp(curPol, targetPol + nod, 0.18);
+ nod *= 0.85;
+ viewer.setAttribute('camera-orbit', `${curAz}deg ${curPol}deg 4.8m`);
+ requestAnimationFrame(tick);
+ }
+ requestAnimationFrame(tick);
+ window.addEventListener('mousemove', (e) => {
+ const nx = e.clientX / window.innerWidth - 0.5;
+ const ny = e.clientY / window.innerHeight - 0.5;
+ targetAz = BASE_AZ - nx * AZ_RANGE * 2;
+ targetPol = BASE_POL + ny * POL_RANGE * 2;
+ }, { passive: true });
+ document.querySelectorAll('#f input').forEach((el) => {
+ el.addEventListener('keydown', (e) => {
+ if (e.key.length === 1 || e.key === 'Backspace') {
+ nod = (nod >= 0 ? -1 : 1) * 4;
+ }
+ });
+ });
+ })();
+
+ // Password strength indicator
+ (function () {
+ const pw = document.getElementById('password');
+ const fill = document.getElementById('strength-fill');
+ const label = document.getElementById('strength-label');
+ const levels = [
+ { color: '#ff5c5c', text: 'Too short' },
+ { color: '#ff9a3c', text: 'Weak' },
+ { color: '#f0c040', text: 'Fair' },
+ { color: '#7ddf7d', text: 'Strong' },
+ { color: '#4fc66a', text: 'Very strong' },
+ ];
+ function score(v) {
+ if (v.length < 10) return 0;
+ let s = 1;
+ if (v.length >= 14) s++;
+ if (/[A-Z]/.test(v) && /[a-z]/.test(v)) s++;
+ if (/[0-9]/.test(v)) s++;
+ if (/[^A-Za-z0-9]/.test(v)) s++;
+ return Math.min(s, 4);
+ }
+ pw.addEventListener('input', () => {
+ const v = pw.value;
+ if (!v) { fill.style.width = '0%'; label.textContent = 'Minimum 10 characters'; label.style.color = '#555'; return; }
+ const s = score(v);
+ const pct = [15, 35, 55, 75, 100][s];
+ const lvl = levels[s];
+ fill.style.width = pct + '%';
+ fill.style.background = lvl.color;
+ label.textContent = lvl.text;
+ label.style.color = lvl.color;
+ });
+ })();
+
+ // Registration form submit
const params = new URLSearchParams(location.search);
- const next =
- params.get('next') || sessionStorage.getItem('login_redirect') || '/create';
+ const next = params.get('next') || sessionStorage.getItem('login_redirect') || '/create';
sessionStorage.removeItem('login_redirect');
const form = document.getElementById('f');
const err = document.getElementById('err');
@@ -176,13 +435,8 @@
const data = await res.json();
if (!res.ok) throw new Error(data.error_description || 'Registration failed');
try {
- localStorage.setItem(
- '3dagent:auth-hint',
- JSON.stringify({ authed: true, ts: Date.now() }),
- );
- } catch {
- /* ignore */
- }
+ localStorage.setItem('3dagent:auth-hint', JSON.stringify({ authed: true, ts: Date.now() }));
+ } catch { /* ignore */ }
location.href = next;
} catch (e) {
err.textContent = e.message;
diff --git a/public/wallet/connect-button.js b/public/wallet/connect-button.js
index 4e264252c..153063278 100644
--- a/public/wallet/connect-button.js
+++ b/public/wallet/connect-button.js
@@ -228,6 +228,9 @@ export function createConnectWalletButton(mountEl, opts = {}) {
btn.setAttribute('data-state', s);
btn.disabled = ASYNC_STATES.has(s) || s === STATES.SUCCESS;
btn.setAttribute('aria-busy', ASYNC_STATES.has(s) ? 'true' : 'false');
+ btn.title = s === STATES.IDLE
+ ? 'Your wallet will prompt twice — once to connect, once to sign'
+ : '';
if (s === STATES.CONNECTED || s === STATES.WRONG_CHAIN) {
const addr = detail.address || '';
diff --git a/sims-demo/example/Map.jsx b/sims-demo/example/Map.jsx
index 913cb642e..f5c5c2f87 100644
--- a/sims-demo/example/Map.jsx
+++ b/sims-demo/example/Map.jsx
@@ -19,7 +19,6 @@ export default function Map(props) {
const mapMeshRef = useRef(null);
// Load map model
const bakeInnModel = useGLTF("./fantasy_game_inn.glb");
- const su7Model = useGLTF("./SU7.glb");
// useEffect(()=>{
// console.log(mapMeshRef.current.geometry.boundsTree);
diff --git a/sims-demo/example/SimsExperience.jsx b/sims-demo/example/SimsExperience.jsx
index 99cdd6f7e..5cf38dc62 100644
--- a/sims-demo/example/SimsExperience.jsx
+++ b/sims-demo/example/SimsExperience.jsx
@@ -13,6 +13,9 @@ import BVHEcctrl, {
import Lights from "./Lights";
import AgentCharacterModel from "./AgentCharacterModel";
import CozyTavernMap from "./CozyTavernMap";
+import LargeFloorMap from "./LargeFloorMap";
+import HintzeHall from "./HintzeHall";
+import InstancedMap from "./InstancedMap";
const keyboardMap = [
{ name: "forward", keys: ["ArrowUp", "KeyW"] },
@@ -23,13 +26,22 @@ const keyboardMap = [
{ name: "run", keys: ["Shift"] },
];
-export default function SimsExperience() {
+const MAP_CONFIG = {
+ cozy_tavern: { component: CozyTavernMap, props: { position: [0, -3, 0] }, env: "apartment" },
+ large_floor: { component: LargeFloorMap, props: {}, env: "city" },
+ hintze_hall: { component: HintzeHall, props: { position: [0, -1, 0] }, env: "warehouse" },
+ fantasy_inn: { component: InstancedMap, props: { position: [0, -1, 0] }, env: "forest" },
+};
+
+export default function SimsExperience({ mapName = "cozy_tavern" }) {
const camControlRef = useRef(null);
const ecctrlRef = useRef(null);
const colliderMeshesArray = useEcctrlStore(
(state) => state.colliderMeshesArray
);
+ const { component: MapComponent, props: mapProps, env } = MAP_CONFIG[mapName] ?? MAP_CONFIG.cozy_tavern;
+
useFrame(() => {
if (camControlRef.current && ecctrlRef.current?.group) {
const p = ecctrlRef.current.group.position;
@@ -50,7 +62,7 @@ export default function SimsExperience() {
makeDefault
/>
<Lights />
- <Environment preset="apartment" environmentIntensity={0.6} />
+ <Environment preset={env} environmentIntensity={0.6} />
<KeyboardControls map={keyboardMap}>
<BVHEcctrl
@@ -64,7 +76,7 @@ export default function SimsExperience() {
</KeyboardControls>
<StaticCollider>
- <CozyTavernMap position={[0, -3, 0]} />
+ <MapComponent {...mapProps} />
</StaticCollider>
</>
);
diff --git a/sims-demo/example/index.jsx b/sims-demo/example/index.jsx
index 37cb0b888..cec283203 100644
--- a/sims-demo/example/index.jsx
+++ b/sims-demo/example/index.jsx
@@ -9,47 +9,67 @@ import ChatPanel from "./ChatPanel";
const root = ReactDOM.createRoot(document.querySelector("#root"));
-const JoystickControls = () => {
+const MAPS = [
+ { id: "cozy_tavern", label: "Cozy Tavern" },
+ { id: "large_floor", label: "Large Floor" },
+ { id: "hintze_hall", label: "Hintze Hall" },
+ { id: "fantasy_inn", label: "Fantasy Inn" },
+];
+
+const App = () => {
const [isTouchScreen, setIsTouchScreen] = useState(false);
+ const [mapName, setMapName] = useState("cozy_tavern");
+
useEffect(() => {
if ("ontouchstart" in window || navigator.maxTouchPoints > 0) {
setIsTouchScreen(true);
}
}, []);
+
return (
<>
{isTouchScreen && (
<>
<Joystick />
- <VirtualButton
- id="run"
- label="RUN"
- buttonWrapperStyle={{ right: "100px", bottom: "40px" }}
- />
- <VirtualButton
- id="jump"
- label="JUMP"
- buttonWrapperStyle={{ right: "40px", bottom: "100px" }}
- />
+ <VirtualButton id="run" label="RUN" buttonWrapperStyle={{ right: "100px", bottom: "40px" }} />
+ <VirtualButton id="jump" label="JUMP" buttonWrapperStyle={{ right: "40px", bottom: "100px" }} />
</>
)}
+ <div style={{
+ position: "fixed", top: 16, left: "50%", transform: "translateX(-50%)",
+ display: "flex", gap: 8, zIndex: 100,
+ }}>
+ {MAPS.map((m) => (
+ <button
+ key={m.id}
+ onClick={() => setMapName(m.id)}
+ style={{
+ padding: "6px 14px",
+ borderRadius: 8,
+ border: "none",
+ cursor: "pointer",
+ fontWeight: 600,
+ fontSize: 13,
+ background: mapName === m.id ? "#fff" : "rgba(255,255,255,0.25)",
+ color: mapName === m.id ? "#111" : "#fff",
+ backdropFilter: "blur(6px)",
+ transition: "background 0.15s",
+ }}
+ >
+ {m.label}
+ </button>
+ ))}
+ </div>
+ <ChatPanel />
+ <Canvas shadows camera={{ fov: 65, near: 0.1, far: 1000, position: [0, 2, 5] }}>
+ <Suspense fallback={null}>
+ <Bvh firstHitOnly>
+ <SimsExperience key={mapName} mapName={mapName} />
+ </Bvh>
+ </Suspense>
+ </Canvas>
</>
);
};
-root.render(
- <>
- <JoystickControls />
- <ChatPanel />
- <Canvas
- shadows
- camera={{ fov: 65, near: 0.1, far: 1000, position: [0, 2, 5] }}
- >
- <Suspense fallback={null}>
- <Bvh firstHitOnly>
- <SimsExperience />
- </Bvh>
- </Suspense>
- </Canvas>
- </>
-);
+root.render(<App />);
diff --git a/src/app.js b/src/app.js
index f07a28e22..d78a75010 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1158,6 +1158,12 @@ class App {
// Configure external animations (Mixamo-style) for skinned models
this._configureAnimations(viewer);
+ // Update AR button target (GLB URL only; no USDZ companion in this project)
+ if (viewer.setARTarget) {
+ const glbUrl = typeof rootFile === 'string' ? fileURL : null;
+ viewer.setARTarget(glbUrl);
+ }
+
if (!this.options.kiosk) {
this.validator.validate(fileURL, rootPath, fileMap, gltf);
}
diff --git a/src/components/footer.jsx b/src/components/footer.jsx
index 74fa33d2a..464294c0b 100644
--- a/src/components/footer.jsx
+++ b/src/components/footer.jsx
@@ -21,6 +21,30 @@ export function Footer() {
|
</span>
+ <a class="item" href="/showcase">
+ showcase
+ </a>
+
+ <span class="separator" aria-hidden="true">
+ |
+ </span>
+
+ <a class="item" href="/validation/">
+ validation
+ </a>
+
+ <span class="separator" aria-hidden="true">
+ |
+ </span>
+
+ <a class="item" href="/reputation/">
+ reputation
+ </a>
+
+ <span class="separator" aria-hidden="true">
+ |
+ </span>
+
<a class="item" target="_blank" href="https://github.com/nirholas/3d-agent/issues/new">
help & feedback
</a>
diff --git a/src/viewer.js b/src/viewer.js
index 085c0e444..dc3f76539 100644
--- a/src/viewer.js
+++ b/src/viewer.js
@@ -24,6 +24,9 @@ import { GUI } from 'dat.gui';
import { environments } from './environments.js';
import { createModelInfo } from './model-info.js';
+import { canUseQuickLook, openQuickLook } from './ar/quick-look.js';
+import { canUseSceneViewer, openSceneViewer } from './ar/scene-viewer.js';
+import { WebXRSession } from './ar/webxr.js';
import { buildAnnotations, renderAnnotationCanvas } from './annotations.js';
import {
DEFAULT_CAMERA,
@@ -439,6 +442,51 @@ export class Viewer {
takeScreenshot(this);
}
+ /**
+ * Update the AR button visibility and target URLs after a model loads.
+ * @param {string|null} glbUrl — absolute or relative URL to the GLB (for Android/WebXR)
+ * @param {string|null} usdzUrl — absolute or relative URL to a USDZ (for iOS Quick Look)
+ */
+ async setARTarget(glbUrl, usdzUrl = null) {
+ this._arGlbUrl = glbUrl;
+ this._arUsdzUrl = usdzUrl;
+
+ if (!this._arBtn) return;
+
+ const hasGlb = !!glbUrl;
+ const hasUsdz = !!usdzUrl;
+
+ const iosOk = hasUsdz && canUseQuickLook();
+ const androidOk = hasGlb && canUseSceneViewer();
+ const webxrOk = hasGlb && (await WebXRSession.isSupported());
+
+ this._arBtn.hidden = !(iosOk || androidOk || webxrOk);
+ }
+
+ async _launchAR() {
+ if (canUseQuickLook() && this._arUsdzUrl) {
+ openQuickLook(this._arUsdzUrl);
+ } else if (canUseSceneViewer() && this._arGlbUrl) {
+ openSceneViewer(this._arGlbUrl);
+ } else if (this._arGlbUrl) {
+ // Desktop WebXR
+ if (this._xrSession) {
+ await this._xrSession.end();
+ this._xrSession = null;
+ this._arBtn.classList.remove('ar-btn--active');
+ return;
+ }
+ this._xrSession = new WebXRSession(this, {
+ onEnd: () => {
+ this._xrSession = null;
+ this._arBtn.classList.remove('ar-btn--active');
+ },
+ });
+ await this._xrSession.start();
+ this._arBtn.classList.add('ar-btn--active');
+ }
+ }
+
resize() {
const { clientHeight, clientWidth } = this.el;
if (clientWidth === 0 || clientHeight === 0) return;
@@ -1010,6 +1058,29 @@ export class Viewer {
this.el.appendChild(toggle);
this._guiToggle = toggle;
+ // AR button — hidden until setARTarget() is called with a supported URL
+ const arBtn = document.createElement('button');
+ arBtn.className = 'ar-btn';
+ arBtn.setAttribute('title', 'View in AR');
+ arBtn.setAttribute('aria-label', 'View in AR');
+ arBtn.innerHTML =
+ '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' +
+ '<path d="M1 6l5-3 5 3v5l-5 3-5-3z"></path>' +
+ '<path d="M11 3l5 3v5l-5-3z"></path>' +
+ '<path d="M1 11l5 3 5-3"></path>' +
+ '<path d="M6 9v5"></path>' +
+ '<path d="M16 6v5l5 3v-5z"></path>' +
+ '<path d="M11 8l5 3"></path>' +
+ '</svg>' +
+ '<span class="ar-btn__label">AR</span>';
+ arBtn.hidden = true;
+ arBtn.addEventListener('click', () => this._launchAR());
+ this.el.appendChild(arBtn);
+ this._arBtn = arBtn;
+ this._arGlbUrl = null;
+ this._arUsdzUrl = null;
+ this._xrSession = null;
+
if (isMobile) {
gui.close();
} else {
diff --git a/style.css b/style.css
index 7f143ccf5..393b8bfce 100644
--- a/style.css
+++ b/style.css
@@ -356,6 +356,49 @@ header h1 .wordmark-dot {
font-size: 11px;
}
+/* AR button — sits below the Controls toggle, same corner */
+.ar-btn {
+ position: absolute;
+ top: calc(var(--space-sm) + 38px);
+ right: var(--space-sm);
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 6px 10px;
+ background: rgba(18, 18, 26, 0.85);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: var(--radius-md);
+ color: rgba(255, 255, 255, 0.6);
+ font-family: var(--font-body);
+ font-size: var(--text-xs);
+ font-weight: 500;
+ letter-spacing: 0.02em;
+ cursor: pointer;
+ backdrop-filter: blur(12px);
+ -webkit-backdrop-filter: blur(12px);
+ transition:
+ color 0.18s,
+ background 0.18s,
+ border-color 0.18s;
+ z-index: 30;
+}
+
+.ar-btn:hover {
+ color: #fff;
+ background: rgba(28, 28, 38, 0.9);
+ border-color: rgba(255, 255, 255, 0.18);
+}
+
+.ar-btn--active {
+ color: #fff;
+ background: var(--accent-soft);
+ border-color: rgba(139, 92, 246, 0.45);
+}
+
+.ar-btn__label {
+ font-size: 11px;
+}
+
.dg li.gui-stats:not(.folder) {
height: auto;
}