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: enhance avatar display and update animation for improved user experience

nirholas1bc5b6fc83a5
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index 1611103b6..e81a1300a 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -2454,44 +2454,9 @@
<!-- Inline avatar pinned right under the latest response -->
{#if (effectiveAgentId || $talkingHeadEnabled) && agentVisible}
<li
- class="avatar-inline mx-auto mt-2 select-none list-none"
+ class="avatar-inline mx-auto mt-2 flex flex-col items-center gap-2 select-none list-none"
class:avatar-walking={generating || tokensFlowing}
- style="position: relative;"
>
- <!-- Bubble floats above the avatar's head -->
- {#if thinkingMessage}
- <div
- class="thought-bubble avatar-head-bubble"
- class:thought-bubble-collapsed={!thoughtBubbleActive}
- role="status"
- aria-live="polite"
- >
- <div class="thought-bubble-header">
- <span class="thought-bubble-dot" class:idle={!thoughtBubbleActive} />
- <span class="thought-bubble-label">
- {thoughtBubbleActive ? 'Thinking' : 'Thought'} for {thoughtBubbleSeconds}s
- </span>
- </div>
- {#if thoughtBubbleActive}
- <div class="thought-bubble-body" bind:this={thoughtBubbleEl}>
- {#if thoughtBubbleText}
- {thoughtBubbleText}
- {:else}
- <span class="thought-bubble-placeholder">Reasoning…</span>
- {/if}
- </div>
- {/if}
- <span class="thought-bubble-tail thought-bubble-tail-1" />
- <span class="thought-bubble-tail thought-bubble-tail-2" />
- </div>
- {:else if generating && convo.messages[convo.messages.length - 1]?.role === 'assistant' && convo.messages[convo.messages.length - 1]?.content}
- <div class="chat-bubble avatar-head-bubble" role="status" aria-live="polite">
- <p class="chat-bubble-text">{convo.messages[convo.messages.length - 1].content}</p>
- <span class="thought-bubble-tail thought-bubble-tail-1" />
- <span class="thought-bubble-tail thought-bubble-tail-2" />
- </div>
- {/if}
-
{#if effectiveAgentId}
<!-- svelte-ignore custom-element-no-implicit-ns -->
<agent-3d
@@ -2731,15 +2696,15 @@
transform-origin: bottom center;
}
.avatar-walking {
- animation: avatar-walk-across 6s ease-in-out infinite;
+ animation: avatar-walk-bob 720ms ease-in-out infinite;
transform-origin: bottom center;
}
- @keyframes avatar-walk-across {
- 0% { transform: translateX(-140px) scaleX(1); }
- 49% { transform: translateX(140px) scaleX(1); }
- 50% { transform: translateX(140px) scaleX(-1); }
- 99% { transform: translateX(-140px) scaleX(-1); }
- 100% { transform: translateX(-140px) scaleX(1); }
+ @keyframes avatar-walk-bob {
+ 0% { transform: translateY(0) rotate(-1.2deg); }
+ 25% { transform: translateY(-6px) rotate(0deg); }
+ 50% { transform: translateY(0) rotate(1.2deg); }
+ 75% { transform: translateY(-6px) rotate(0deg); }
+ 100% { transform: translateY(0) rotate(-1.2deg); }
}
@media (prefers-reduced-motion: reduce) {
.avatar-walking { animation: none; }
@@ -2758,40 +2723,6 @@
100% { transform: translateY(0) rotate(0); opacity: 1; }
}
- .avatar-head-bubble {
- position: absolute;
- top: 0;
- left: 50%;
- transform: translateX(-50%);
- z-index: 10;
- margin-bottom: 0;
- }
-
- .chat-bubble {
- position: relative;
- width: 280px;
- max-width: calc(100vw - 48px);
- margin-bottom: 14px;
- padding: 10px 14px 12px;
- border-radius: 18px;
- background: #ffffff;
- border: 1px solid #E5E3DC;
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
- animation: thought-bubble-pop 220ms ease-out;
- }
- .chat-bubble-text {
- font-family: 'Inter', system-ui, sans-serif;
- font-size: 13px;
- line-height: 1.5;
- color: #1A1A1A;
- margin: 0;
- max-height: 120px;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 5;
- -webkit-box-orient: vertical;
- }
-
.thought-bubble {
position: relative;
width: 280px;
diff --git a/chat/src/Message.svelte b/chat/src/Message.svelte
index bb5f5ab67..8c4674b12 100644
--- a/chat/src/Message.svelte
+++ b/chat/src/Message.svelte
@@ -196,7 +196,20 @@
? 'border border-teal-200 bg-teal-100 pb-px'
: ''}"
>
- {#if false}
+ {#if message.role === 'assistant' && hasLogo && isLatestAssistant}
+ <span class="w-full h-full overflow-hidden inline-block shrink-0 rounded-[inherit]">
+ <!-- svelte-ignore custom-element-no-implicit-ns -->
+ <agent-3d
+ src="/avatars/cz.glb"
+ mode="inline"
+ width="220"
+ height="220"
+ background="transparent"
+ kiosk
+ name-plate="off"
+ style="width:100%;height:100%;display:block;"
+ ></agent-3d>
+ </span>
{:else}
<span class="m-auto">
{#if message.role === 'system'}