Skip to content

Commit f044784

Browse files
committed
Present task videos in three rows and animate alignment pipelines
1 parent 6fc414c commit f044784

13 files changed

Lines changed: 147 additions & 95 deletions

‎public/EgoHumanoid-V2/app.js‎

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -63,53 +63,10 @@ function selectTab(group, task, focus = false) {
6363
if (selected && focus) tab.focus({ preventScroll: true });
6464
});
6565
$(`#${group}-panel`).setAttribute("aria-labelledby", `${group}-tab-${task}`);
66-
if (group === "demo") renderDemo();
6766
if (group === "ik") renderIK();
6867
announce(`${tasks[task].name} selected.`);
6968
}
7069

71-
function renderDemo() {
72-
const task = tasks[state.demo];
73-
state.view = "external";
74-
$("#task-heading").textContent = task.name;
75-
$("#task-score").replaceChildren(document.createTextNode(task.score), Object.assign(document.createElement("span"), { textContent: "%" }));
76-
$("#view-toggle").hidden = !task.ego;
77-
$("#view-original").hidden = state.demo !== "curtain";
78-
$("#curtain-edit-note").hidden = state.demo !== "curtain";
79-
updateViewControls();
80-
setClip($("#human-video"), `human-${state.demo}`, `Human demonstration: ${task.name}`);
81-
setClip($("#robot-video"), `deployment-${state.demo}`, `Robot execution: ${task.name}`);
82-
}
83-
84-
function updateViewControls() {
85-
const label = state.view === "ego" ? "Show external view" : "Show egocentric view";
86-
$("#view-toggle").setAttribute("aria-label", label);
87-
$("#view-toggle").setAttribute("title", label);
88-
$("#view-toggle").setAttribute("aria-pressed", String(state.view === "ego"));
89-
$("#view-original").setAttribute("aria-pressed", String(state.view === "original"));
90-
$("#view-original").textContent = state.view === "original" ? "Chair removed" : "Original";
91-
}
92-
93-
function changeView(view) {
94-
if (state.view === view) return;
95-
const video = $("#robot-video");
96-
const restoreTime = state.demo === "curtain" ? video.currentTime : 0;
97-
const restorePlayback = state.demo === "curtain" && !video.paused;
98-
state.view = view;
99-
updateViewControls();
100-
const clip = view === "original" ? "deployment-curtain-original" : `${view === "ego" ? "ego" : "deployment"}-${state.demo}`;
101-
const label = view === "original" ? "Original recording" : view === "ego" ? "Egocentric" : state.demo === "curtain" ? "Chair-removed visualization" : "External";
102-
setClip(video, clip, `${label}: ${tasks[state.demo].name}`);
103-
if (restoreTime || restorePlayback) {
104-
video.addEventListener("loadedmetadata", () => {
105-
if (video.dataset.src !== `assets/videos/${clip}.mp4`) return;
106-
video.currentTime = Math.min(restoreTime, video.duration);
107-
if (restorePlayback) video.play().catch(() => {});
108-
}, { once: true });
109-
}
110-
announce(`${label} selected.`);
111-
}
112-
11370
function renderIK() {
11471
const foot = state.ik === "drawer";
11572
$("#ik-desc-a").textContent = foot ? "Leg IK; SONIC on remaining joints." : "Arm and waist IK; SONIC legs.";
@@ -136,13 +93,6 @@ $$('[role="tablist"]').forEach((tablist) => {
13693
});
13794
});
13895

139-
$("#view-toggle").addEventListener("click", () => changeView(state.view === "ego" ? "external" : "ego"));
140-
$("#view-original").addEventListener("click", () => changeView(state.view === "original" ? "external" : "original"));
141-
$("#robot-video").addEventListener("ratechange", (event) => {
142-
$("#playback-speed").textContent = `${Number(event.currentTarget.playbackRate.toFixed(2))}×`;
143-
});
144-
$$('[data-hero-task]').forEach((link) => link.addEventListener("click", () => selectTab("demo", link.dataset.heroTask)));
145-
14696
function bindGroupPlayback(button, videos, playLabel, pauseLabel) {
14797
function updateLabel() {
14898
const playing = videos.some((video) => !video.paused && !video.ended);
@@ -167,7 +117,6 @@ function bindGroupPlayback(button, videos, playLabel, pauseLabel) {
167117
});
168118
}
169119

170-
bindGroupPlayback($("#play-pair"), [$("#human-video"), $("#robot-video")], "Play both", "Pause both");
171120
bindGroupPlayback($("#play-ik"), ["a", "b", "c"].map((variant) => $(`#ik-video-${variant}`)), "Play all three", "Pause all three");
172121

173122
const videoLoader = new IntersectionObserver((entries) => {
-886 Bytes
Loading
56.9 KB
Loading
66.1 KB
Loading
55.1 KB
Loading
48.3 KB
Loading
1.86 MB
Binary file not shown.
401 KB
Binary file not shown.
1.26 MB
Binary file not shown.
889 KB
Binary file not shown.

0 commit comments

Comments
 (0)