Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
workbenchthis machine
STOP is at least 56 px tall and red on touch, and the stopped banner spans the full width #141
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
quill/arm:quill/128-stop-is-at-least-56-px-tall-and-red-on-t → main 3 commits fork 1 thread · 1 unresolved
2 files
changed +24
−3
Software/so101/src/server.test.ts +21
| @@ -213,6 +213,27 @@ describe("viewer page", () => { | ||
| 213 | 213 | expect(page).toContain("Resume driving"); |
| 214 | 214 | expect(page.match(/>Stop</g)?.length).toBe(1); |
| 215 | 215 | }); |
| 216 | ||
| 217 | test("STOP is at least 56 px tall and red under a finger, and the stopped banner spans the full width", async () => { | |
| 218 | const page = await (await fetch(`${base}/`)).text(); | |
| 219 | const rule = (sel: string) => [...page.matchAll(new RegExp(`(?:^|[\\s}])${sel.replace(/[.#:]/g, "\\$&")} \\{([^}]*)\\}`, "g"))].map((m) => m[1]).join(";"); | |
| 220 | const px = Number(/min-height: (\d+)px/.exec(rule(".estop"))?.[1]); | |
| 221 | expect(px).toBeGreaterThanOrEqual(56); | |
| 222 | for (const sel of [".estop", ".estop:hover", ".estop:active"]) { | |
| 223 | const bg = /background: #([0-9a-f]{6})/.exec(rule(sel))?.[1]; | |
| 224 | expect(bg).toBeDefined(); | |
| 225 | const [r, g, b] = [0, 2, 4].map((i) => parseInt(bg!.slice(i, i + 2), 16)); | |
| 226 | expect(r).toBeGreaterThan(150); // red, not a grey or a dark pressed state | |
| 227 | expect(r).toBeGreaterThan(3 * Math.max(g!, b!)); | |
| 228 | } | |
| 229 | const stop = rule("#banner.stop"); | |
| 230 | expect(stop).toContain("position: fixed"); | |
| 231 | expect(stop).toMatch(/left: 0;/); | |
| 232 | expect(stop).toMatch(/right: 0;/); | |
| 233 | expect(stop).toContain("transform: none"); | |
| 234 | expect(stop).toContain("max-width: none"); | |
| 235 | expect(stop).toContain("width: auto"); | |
| 236 | }); | |
| 216 | 237 | }); |
| 217 | 238 | |
| 218 | 239 | describe("moves over HTTP", () => { |
Software/so101/src/viewer.html +3 −3
| @@ -61,7 +61,7 @@ | ||
| 61 | 61 | #stage { position: absolute; inset: 0; display: flex; gap: 2px; } |
| 62 | 62 | /* the emergency stop's held state, and the banner that says who pressed it */ |
| 63 | 63 | .estop:disabled { opacity: .5; cursor: not-allowed; } .estop.on { background: #7d1410; box-shadow: 0 0 0 3px var(); } |
| 64 | #banner.stop { display: block; border: 2px solid var(); background: rgba(80,10,8,.92); color: #fff; font-weight: 600; } | |
| 64 | #banner.stop { display: block; position: fixed; left: 0; right: 0; transform: none; width: auto; max-width: none; z-index: 8; border-radius: 0; border-width: 2px 0; border-style: solid; border-color: var(); padding: 10px calc(12px + var()) 10px calc(12px + var()); background: rgba(80,10,8,.92); color: #fff; font-weight: 600; } /* stopped: edge to edge, over the sheet, not a centred box */ | |
| 65 | 65 | #banner button { margin-left: 10px; min-height: 32px; padding: 2px 10px; } |
| 66 | 66 | .pane { flex: 1; min-width: 0; position: relative; background: #000; display: none; } |
| 67 | 67 | .pane.on { display: block; } |
| @@ -88,8 +88,8 @@ | ||
| 88 | 88 | #capLine { color: var(); font-size: 12px; } #capLine:empty { display: none; } |
| 89 | 89 | #driverLine.paused { color: var(); } |
| 90 | 90 | #turnActions { display: flex; gap: 6px; } #turnActions:empty { display: none; } |
| 91 | .estop { flex: none; min-width: 72px; min-height: 52px; border: 0; border-radius: 12px; background: #d1242f; color: #fff; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 0 0 3px rgba(209,36,47,.25), 0 2px 8px rgba(0,0,0,.35); } | |
| 92 | .estop:hover { background: #e5323d; } .estop:active { transform: scale(.97); } | |
| 91 | .estop { flex: none; min-width: 72px; min-height: 56px; border: 0; border-radius: 12px; background: #d1242f; color: #fff; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 0 0 3px rgba(209,36,47,.25), 0 2px 8px rgba(0,0,0,.35); } | |
| 92 | .estop:hover { background: #e5323d; } .estop:active { background: #b81d27; transform: scale(.97); } /* red under a finger too: a touch is hover then active */ | |
| 93 | 93 | #sheetToggle { flex: none; } |
| 94 | 94 | /* the turn ring: time left as a sweep around the seconds; the driver's name over the video for everyone */ |
| 95 | 95 | #ring { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var() var(, 0%), var() 0); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; } |
new above
offline
Specificity ties with .estop.on at line 63, and this rule comes later, so hover/active repaint the Stopped state. Add .estop.on:hover,.estop.on:active keeping #7d1410, or use :not(.on).