Spaces:
Sleeping
Sleeping
deploy rater (Docker/FastAPI): registration + completeness gate + /api/submit → dataset
Browse files- static/index.html +42 -28
static/index.html
CHANGED
|
@@ -103,7 +103,16 @@
|
|
| 103 |
.sidebar-rail:hover { color: var(--fg); border-color: var(--border-strong); }
|
| 104 |
body:not(.sidebar-expanded) .sidebar-rail { display: block; }
|
| 105 |
|
| 106 |
-
section.detail
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
/* ---------- instructions panel ---------- */
|
| 109 |
.instructions { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
|
|
@@ -140,30 +149,30 @@
|
|
| 140 |
border: 1px solid var(--border); display: block; }
|
| 141 |
|
| 142 |
/* ---------- two-pane case layout ---------- */
|
| 143 |
-
.case-pane-wrap {
|
| 144 |
-
|
|
|
|
|
|
|
| 145 |
@media (max-width: 900px) {
|
| 146 |
.case-pane-wrap { grid-template-columns: 1fr; }
|
| 147 |
}
|
| 148 |
-
/* Left pane
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
.left-pane { position: sticky; top: 0; align-self: start;
|
| 153 |
-
display: flex; flex-direction: column; gap: 8px;
|
| 154 |
padding-top: 4px; padding-bottom: 8px;
|
| 155 |
-
height:
|
| 156 |
-
min-height: 0; }
|
| 157 |
.left-pane > .video-panel, .left-pane > .video-controls,
|
| 158 |
.left-pane > .case-meta { flex: 0 0 auto; }
|
| 159 |
.left-pane > .prompt-box { flex: 1 1 auto; min-height: 5em;
|
| 160 |
max-height: none; overflow-y: auto; }
|
| 161 |
-
/* Right pane
|
| 162 |
-
→ 3-4
|
| 163 |
-
columns. */
|
| 164 |
-
.right-pane { min-width: 0;
|
| 165 |
-
|
| 166 |
-
align-content: start;
|
|
|
|
| 167 |
.right-pane > .dim-header { grid-column: 1 / -1; }
|
| 168 |
|
| 169 |
/* ---------- video tabs + single active video ---------- */
|
|
@@ -177,8 +186,11 @@
|
|
| 177 |
border-color: var(--accent); font-weight: 700; }
|
| 178 |
.video-tile { display: flex; flex-direction: column; gap: 6px; }
|
| 179 |
.video-tile.hidden { display: none; }
|
|
|
|
|
|
|
| 180 |
.video-frame { position: relative; background: #000; border: 1px solid var(--border);
|
| 181 |
-
border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9;
|
|
|
|
| 182 |
.video-frame video { width: 100%; height: 100%; display: block; background: #000; }
|
| 183 |
.video-frame .empty-state { position: absolute; inset: 0; display: flex;
|
| 184 |
flex-direction: column; align-items: center; justify-content: center;
|
|
@@ -1711,8 +1723,9 @@ function renderDetail() {
|
|
| 1711 |
wrap.appendChild(renderRightPane(c));
|
| 1712 |
detail.appendChild(wrap);
|
| 1713 |
bindAutoCollapseInstructions();
|
| 1714 |
-
detail.
|
| 1715 |
-
|
|
|
|
| 1716 |
|
| 1717 |
// Update sidebar active row + footer
|
| 1718 |
document.querySelectorAll(".case-row").forEach((row, i) => {
|
|
@@ -1915,23 +1928,24 @@ function observeStickyTop(node) {
|
|
| 1915 |
}
|
| 1916 |
|
| 1917 |
// Once per case visit: auto-collapse the instructions panel as soon as the
|
| 1918 |
-
// user scrolls past
|
| 1919 |
-
//
|
| 1920 |
-
//
|
| 1921 |
function bindAutoCollapseInstructions() {
|
| 1922 |
const detail = document.getElementById("detail");
|
| 1923 |
-
|
| 1924 |
-
|
|
|
|
| 1925 |
let closed = false;
|
| 1926 |
-
|
| 1927 |
if (closed) return;
|
| 1928 |
-
if (
|
| 1929 |
const ins = detail.querySelector("details.instructions[open]");
|
| 1930 |
if (ins) { ins.removeAttribute("open"); closed = true; }
|
| 1931 |
}
|
| 1932 |
}, { passive: true });
|
| 1933 |
// Reset the once-per-case flag whenever a new case is rendered.
|
| 1934 |
-
|
| 1935 |
}
|
| 1936 |
|
| 1937 |
function renderInstructions(forceOpen) {
|
|
|
|
| 103 |
.sidebar-rail:hover { color: var(--fg); border-color: var(--border-strong); }
|
| 104 |
body:not(.sidebar-expanded) .sidebar-rail { display: block; }
|
| 105 |
|
| 106 |
+
/* section.detail becomes a non-scrolling flex column: instructions panel at
|
| 107 |
+
the top (also non-scrolling), then the two-pane wrap that fills the rest.
|
| 108 |
+
Inside the wrap the LEFT pane is fixed-position-like (it doesn't move,
|
| 109 |
+
since the parent has no scroll), and only the RIGHT pane has its own
|
| 110 |
+
overflow-y: auto. Net effect: scrolling rating cards on the right while
|
| 111 |
+
prompt + video + instructions remain pinned. */
|
| 112 |
+
section.detail { flex: 1; overflow: hidden; padding: 14px 24px 80px;
|
| 113 |
+
min-width: 0; min-height: 0;
|
| 114 |
+
display: flex; flex-direction: column; gap: 10px; }
|
| 115 |
+
section.detail > .instructions { flex: 0 0 auto; margin-bottom: 0; }
|
| 116 |
|
| 117 |
/* ---------- instructions panel ---------- */
|
| 118 |
.instructions { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
|
|
|
|
| 149 |
border: 1px solid var(--border); display: block; }
|
| 150 |
|
| 151 |
/* ---------- two-pane case layout ---------- */
|
| 152 |
+
.case-pane-wrap { flex: 1 1 auto; min-height: 0;
|
| 153 |
+
display: grid; gap: 18px;
|
| 154 |
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* 50 / 50 */
|
| 155 |
+
align-items: stretch; }
|
| 156 |
@media (max-width: 900px) {
|
| 157 |
.case-pane-wrap { grid-template-columns: 1fr; }
|
| 158 |
}
|
| 159 |
+
/* Left pane fills its grid cell vertically. Doesn't scroll the page; if
|
| 160 |
+
its own content exceeds the cell height, the prompt-box scrolls
|
| 161 |
+
internally. */
|
| 162 |
+
.left-pane { display: flex; flex-direction: column; gap: 8px;
|
|
|
|
|
|
|
| 163 |
padding-top: 4px; padding-bottom: 8px;
|
| 164 |
+
min-height: 0; max-height: 100%; }
|
|
|
|
| 165 |
.left-pane > .video-panel, .left-pane > .video-controls,
|
| 166 |
.left-pane > .case-meta { flex: 0 0 auto; }
|
| 167 |
.left-pane > .prompt-box { flex: 1 1 auto; min-height: 5em;
|
| 168 |
max-height: none; overflow-y: auto; }
|
| 169 |
+
/* Right pane is the only scroll surface on this page. Grid of question
|
| 170 |
+
cards, ~210 px min → 3-4 per row at typical desktop widths. Dim
|
| 171 |
+
headers span all columns. */
|
| 172 |
+
.right-pane { min-width: 0; min-height: 0; max-height: 100%;
|
| 173 |
+
overflow-y: auto; padding-right: 4px;
|
| 174 |
+
display: grid; gap: 10px; align-content: start;
|
| 175 |
+
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
|
| 176 |
.right-pane > .dim-header { grid-column: 1 / -1; }
|
| 177 |
|
| 178 |
/* ---------- video tabs + single active video ---------- */
|
|
|
|
| 186 |
border-color: var(--accent); font-weight: 700; }
|
| 187 |
.video-tile { display: flex; flex-direction: column; gap: 6px; }
|
| 188 |
.video-tile.hidden { display: none; }
|
| 189 |
+
/* aspect-ratio gives a 16:9 box; max-height caps it on tall/wide left panes
|
| 190 |
+
so the prompt still has plenty of room below. */
|
| 191 |
.video-frame { position: relative; background: #000; border: 1px solid var(--border);
|
| 192 |
+
border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9;
|
| 193 |
+
max-height: 42vh; }
|
| 194 |
.video-frame video { width: 100%; height: 100%; display: block; background: #000; }
|
| 195 |
.video-frame .empty-state { position: absolute; inset: 0; display: flex;
|
| 196 |
flex-direction: column; align-items: center; justify-content: center;
|
|
|
|
| 1723 |
wrap.appendChild(renderRightPane(c));
|
| 1724 |
detail.appendChild(wrap);
|
| 1725 |
bindAutoCollapseInstructions();
|
| 1726 |
+
const right = detail.querySelector(".right-pane");
|
| 1727 |
+
right?.__resetAutoCollapse?.();
|
| 1728 |
+
if (right) right.scrollTop = 0;
|
| 1729 |
|
| 1730 |
// Update sidebar active row + footer
|
| 1731 |
document.querySelectorAll(".case-row").forEach((row, i) => {
|
|
|
|
| 1928 |
}
|
| 1929 |
|
| 1930 |
// Once per case visit: auto-collapse the instructions panel as soon as the
|
| 1931 |
+
// user scrolls past the top of the right pane. Keeps the rubric out of the
|
| 1932 |
+
// way once they start scoring. We listen on the right pane because
|
| 1933 |
+
// section.detail is no longer the scroll container (only .right-pane is).
|
| 1934 |
function bindAutoCollapseInstructions() {
|
| 1935 |
const detail = document.getElementById("detail");
|
| 1936 |
+
const right = detail?.querySelector(".right-pane");
|
| 1937 |
+
if (!right || right.__autoCollapseBound) return;
|
| 1938 |
+
right.__autoCollapseBound = true;
|
| 1939 |
let closed = false;
|
| 1940 |
+
right.addEventListener("scroll", () => {
|
| 1941 |
if (closed) return;
|
| 1942 |
+
if (right.scrollTop > 80) {
|
| 1943 |
const ins = detail.querySelector("details.instructions[open]");
|
| 1944 |
if (ins) { ins.removeAttribute("open"); closed = true; }
|
| 1945 |
}
|
| 1946 |
}, { passive: true });
|
| 1947 |
// Reset the once-per-case flag whenever a new case is rendered.
|
| 1948 |
+
right.__resetAutoCollapse = () => { closed = false; right.scrollTop = 0; };
|
| 1949 |
}
|
| 1950 |
|
| 1951 |
function renderInstructions(forceOpen) {
|