Spaces:
Sleeping
Sleeping
deploy rater (Docker/FastAPI): registration + completeness gate + /api/submit → dataset
Browse files- static/index.html +9 -17
- static/mobile.html +2 -2
static/index.html
CHANGED
|
@@ -236,9 +236,6 @@
|
|
| 236 |
.q-card .likert button.selected[data-score="4"] { background: var(--score-4); }
|
| 237 |
.q-card .likert button.selected[data-score="5"] { background: var(--score-5); }
|
| 238 |
|
| 239 |
-
/* Long prompts: cap their height; prompt scrolls inside its own box. */
|
| 240 |
-
.left-pane .prompt-box { max-height: 7em; overflow-y: auto; }
|
| 241 |
-
|
| 242 |
/* ---------- footer / nav ---------- */
|
| 243 |
footer.bottom { position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
|
| 244 |
background: var(--panel); border-top: 1px solid var(--border);
|
|
@@ -2006,13 +2003,10 @@ function renderCaseHeader(c) {
|
|
| 2006 |
}
|
| 2007 |
|
| 2008 |
function renderVideoControls(c) {
|
| 2009 |
-
//
|
| 2010 |
-
//
|
| 2011 |
-
//
|
| 2012 |
const ctl = el("div", { class: "video-controls" });
|
| 2013 |
-
ctl.appendChild(el("button", {
|
| 2014 |
-
class: "ctl-btn", onclick: playActive,
|
| 2015 |
-
}, t("play_all")));
|
| 2016 |
ctl.appendChild(el("button", {
|
| 2017 |
class: "ctl-btn", onclick: pauseAll,
|
| 2018 |
}, t("pause")));
|
|
@@ -2050,7 +2044,6 @@ function activeVideo() {
|
|
| 2050 |
// The only video that's NOT inside a .hidden tile is the active one.
|
| 2051 |
return document.querySelector(".video-tile:not(.hidden) video[data-slot]");
|
| 2052 |
}
|
| 2053 |
-
function playActive() { const v = activeVideo(); if (v) { try { v.play(); } catch(e){} } }
|
| 2054 |
function restartActive() {
|
| 2055 |
const v = activeVideo();
|
| 2056 |
if (v) { v.currentTime = 0; try { v.play(); } catch(e){} }
|
|
@@ -2071,7 +2064,6 @@ function rowSlotOrder(caseId, qKey, slotCount) {
|
|
| 2071 |
function allVideos() {
|
| 2072 |
return Array.from(document.querySelectorAll("video[data-slot]"));
|
| 2073 |
}
|
| 2074 |
-
function playAll() { allVideos().forEach(v => { try { v.play(); } catch(e){} }); }
|
| 2075 |
function pauseAll() { allVideos().forEach(v => v.pause()); }
|
| 2076 |
function restartAll() {
|
| 2077 |
allVideos().forEach(v => { v.currentTime = 0; try { v.play(); } catch(e){} });
|
|
@@ -2090,11 +2082,11 @@ function toggleMute(btn) {
|
|
| 2090 |
btn.textContent = MUTED ? "🔇 Muted" : "🔊 Sound";
|
| 2091 |
}
|
| 2092 |
function setSpeed(rate) { allVideos().forEach(v => v.playbackRate = rate); }
|
| 2093 |
-
|
| 2094 |
-
|
| 2095 |
-
|
| 2096 |
-
|
| 2097 |
-
if (
|
| 2098 |
}
|
| 2099 |
|
| 2100 |
/* =========================================================================
|
|
@@ -2394,7 +2386,7 @@ document.addEventListener("keydown", e => {
|
|
| 2394 |
switch (e.key) {
|
| 2395 |
case "ArrowLeft": case "k": e.preventDefault(); step(-1); break;
|
| 2396 |
case "ArrowRight": case "j": e.preventDefault(); step(1); break;
|
| 2397 |
-
case " ": e.preventDefault();
|
| 2398 |
case "r": case "R": e.preventDefault(); restartAll(); break;
|
| 2399 |
case "l": case "L":
|
| 2400 |
e.preventDefault();
|
|
|
|
| 236 |
.q-card .likert button.selected[data-score="4"] { background: var(--score-4); }
|
| 237 |
.q-card .likert button.selected[data-score="5"] { background: var(--score-5); }
|
| 238 |
|
|
|
|
|
|
|
|
|
|
| 239 |
/* ---------- footer / nav ---------- */
|
| 240 |
footer.bottom { position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
|
| 241 |
background: var(--panel); border-top: 1px solid var(--border);
|
|
|
|
| 2003 |
}
|
| 2004 |
|
| 2005 |
function renderVideoControls(c) {
|
| 2006 |
+
// The active <video> already exposes the browser's native play/pause UI,
|
| 2007 |
+
// so there's no separate "Play" button here. Pause / Restart stay because
|
| 2008 |
+
// they act globally / sync-style.
|
| 2009 |
const ctl = el("div", { class: "video-controls" });
|
|
|
|
|
|
|
|
|
|
| 2010 |
ctl.appendChild(el("button", {
|
| 2011 |
class: "ctl-btn", onclick: pauseAll,
|
| 2012 |
}, t("pause")));
|
|
|
|
| 2044 |
// The only video that's NOT inside a .hidden tile is the active one.
|
| 2045 |
return document.querySelector(".video-tile:not(.hidden) video[data-slot]");
|
| 2046 |
}
|
|
|
|
| 2047 |
function restartActive() {
|
| 2048 |
const v = activeVideo();
|
| 2049 |
if (v) { v.currentTime = 0; try { v.play(); } catch(e){} }
|
|
|
|
| 2064 |
function allVideos() {
|
| 2065 |
return Array.from(document.querySelectorAll("video[data-slot]"));
|
| 2066 |
}
|
|
|
|
| 2067 |
function pauseAll() { allVideos().forEach(v => v.pause()); }
|
| 2068 |
function restartAll() {
|
| 2069 |
allVideos().forEach(v => { v.currentTime = 0; try { v.play(); } catch(e){} });
|
|
|
|
| 2082 |
btn.textContent = MUTED ? "🔇 Muted" : "🔊 Sound";
|
| 2083 |
}
|
| 2084 |
function setSpeed(rate) { allVideos().forEach(v => v.playbackRate = rate); }
|
| 2085 |
+
// Space-bar shortcut: play/pause whichever video is on the active tab.
|
| 2086 |
+
function toggleActive() {
|
| 2087 |
+
const v = activeVideo();
|
| 2088 |
+
if (!v) return;
|
| 2089 |
+
if (v.paused) { try { v.play(); } catch(e){} } else { v.pause(); }
|
| 2090 |
}
|
| 2091 |
|
| 2092 |
/* =========================================================================
|
|
|
|
| 2386 |
switch (e.key) {
|
| 2387 |
case "ArrowLeft": case "k": e.preventDefault(); step(-1); break;
|
| 2388 |
case "ArrowRight": case "j": e.preventDefault(); step(1); break;
|
| 2389 |
+
case " ": e.preventDefault(); toggleActive(); break;
|
| 2390 |
case "r": case "R": e.preventDefault(); restartAll(); break;
|
| 2391 |
case "l": case "L":
|
| 2392 |
e.preventDefault();
|
static/mobile.html
CHANGED
|
@@ -1038,7 +1038,8 @@ function renderVideoControls(){
|
|
| 1038 |
b.textContent = label; b.onclick = fn; if (id) b.id = id;
|
| 1039 |
return b;
|
| 1040 |
};
|
| 1041 |
-
|
|
|
|
| 1042 |
wrap.appendChild(mkBtn(t("pause"), pauseAll));
|
| 1043 |
wrap.appendChild(mkBtn(t("restart"), restartAll));
|
| 1044 |
const loop = mkBtn(t("loop"), () => toggleLoop(loop));
|
|
@@ -1135,7 +1136,6 @@ function closeDrawer(){
|
|
| 1135 |
|
| 1136 |
/* ----- Video controls ----- */
|
| 1137 |
function allVideos(){ return Array.from(document.querySelectorAll("video[data-slot]")); }
|
| 1138 |
-
function playAll(){ allVideos().forEach(v=>{ try{ v.play(); }catch(e){} }); }
|
| 1139 |
function pauseAll(){ allVideos().forEach(v=>v.pause()); }
|
| 1140 |
function restartAll(){ allVideos().forEach(v=>{ v.currentTime=0; try{ v.play(); }catch(e){} }); }
|
| 1141 |
let LOOPING=false;
|
|
|
|
| 1038 |
b.textContent = label; b.onclick = fn; if (id) b.id = id;
|
| 1039 |
return b;
|
| 1040 |
};
|
| 1041 |
+
// Play button removed — the native <video controls> on the active tab
|
| 1042 |
+
// provides play/pause already.
|
| 1043 |
wrap.appendChild(mkBtn(t("pause"), pauseAll));
|
| 1044 |
wrap.appendChild(mkBtn(t("restart"), restartAll));
|
| 1045 |
const loop = mkBtn(t("loop"), () => toggleLoop(loop));
|
|
|
|
| 1136 |
|
| 1137 |
/* ----- Video controls ----- */
|
| 1138 |
function allVideos(){ return Array.from(document.querySelectorAll("video[data-slot]")); }
|
|
|
|
| 1139 |
function pauseAll(){ allVideos().forEach(v=>v.pause()); }
|
| 1140 |
function restartAll(){ allVideos().forEach(v=>{ v.currentTime=0; try{ v.play(); }catch(e){} }); }
|
| 1141 |
let LOOPING=false;
|