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.

fix(animations): hide the clip transport until there is something to play

nirholas898a07f58f2f
diff --git a/pages/animations.html b/pages/animations.html
index 483de7480..e33a9ca0e 100644
--- a/pages/animations.html
+++ b/pages/animations.html
@@ -839,7 +839,7 @@
<span data-i18n="animations.couldn_t_load_this_clip_s_preview">⚠️ Couldn't load this clip's preview.</span>
<span data-i18n="animations.you_can_still_open_it_in_the">You can still open it in the Studio.</span>
</div>
- <div class="ag-modal-transport" aria-label="Playback controls">
+ <div class="ag-modal-transport" data-role="modal-transport" aria-label="Playback controls">
<button data-role="modal-play" aria-label="Pause" data-i18n-attr="aria-label:animations.pause_arialabel"></button>
<input type="range" class="ag-modal-scrub" data-role="modal-scrub" min="0" max="1000" value="0" step="1" aria-label="Scrub timeline" />
<span class="ag-modal-time" data-role="modal-time"></span>
diff --git a/src/animations-gallery.js b/src/animations-gallery.js
index 13bfdf274..cd00bf968 100644
--- a/src/animations-gallery.js
+++ b/src/animations-gallery.js
@@ -81,6 +81,7 @@ const els = {
modalPrev: $('modal-prev'),
modalNext: $('modal-next'),
modalError: $('modal-error'),
+ modalTransport: $('modal-transport'),
};
// URL params are user-editable, so every one is validated against the values the
@@ -576,6 +577,10 @@ function openModal(index) {
els.modalStudio.href = `/pose?anim=${encodeURIComponent(clip.id)}`;
els.modalError.hidden = true;
els.modalSpinner.hidden = false;
+ // Nothing is playing yet, so the transport would be a row of controls that
+ // do nothing. It comes back the moment the clip is on the stage, and stays
+ // away entirely if the preview fails.
+ els.modalTransport.hidden = true;
els.modalPrev.disabled = index <= 0;
els.modalNext.disabled = index >= state.filtered.length - 1;
@@ -613,6 +618,7 @@ function openModal(index) {
})
.then(() => {
els.modalSpinner.hidden = true;
+ els.modalTransport.hidden = false;
live.refit();
})
.catch(() => {
@@ -801,7 +807,7 @@ document.addEventListener('keydown', (e) => {
else if (onSlider) return;
else if (e.key === 'ArrowLeft') stepModal(-1);
else if (e.key === 'ArrowRight') stepModal(1);
- else if (e.key === ' ' && tag !== 'BUTTON' && tag !== 'A') {
+ else if (e.key === ' ' && tag !== 'BUTTON' && tag !== 'A' && !els.modalTransport.hidden) {
e.preventDefault();
els.modalPlay.click();
}