From 4f117387316e6e2f6abbe65ff808cc09ac234335 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Tue, 2 Jun 2026 10:25:14 -0400 Subject: [PATCH] =?UTF-8?q?zebra-spaces:=20spotlight=20model=20=E2=80=94?= =?UTF-8?q?=20one=20tile=20big=20in=20middle,=20click=20thumbnail=20to=20s?= =?UTF-8?q?wap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per fox: every camera and screen tile becomes clickable. One tile at a time sits in the middle 'spotlight' slot at full size; all others render as thumbnails in the cameras column (with screens stacked under the cameras group). Clicking any thumbnail promotes it to the spotlight and demotes the previous spotlight tile back to its kind's thumb container. Thumbnails hide the fullscreen button (the tile-click is now the action) and shrink to ~22vh letterbox. Implementation: - DOM: replaced #screens with #spotlight (middle); added #screens-thumbs to cameras-col (under #cameras); cameras-thumbs h2 appears when at least one thumbnail screen exists. - TILE_KINDS now points at thumb containers only; spotlight is shared across kinds via a single global 'spotlight = {kind, pubHex}' var. - renderVideoTile: first tile auto-promotes to spotlight; subsequent tiles go to their kind's thumb container. Tile click handler calls setSpotlight; fullscreen + tap-to-play buttons stopPropagation so they don't trigger the swap. - removeVideoTile: if the removed tile was the spotlight, pickNext- Spotlight() promotes a screen (preferred) or camera. Otherwise just updates container visibility. - updateContainerVisibility: hides sec-spotlight when nothing spotlit, hides sec-cameras when no tiles at all, hides screens-thumbs h2 when no thumbnail screens are present. - CSS: .tile-thumb shrinks video (22vh max) + meta fontsize; spotlight cameras use object-fit:contain so the whole face frame is visible. --- web/zebra-spaces.html | 177 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 146 insertions(+), 31 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index a3fb8b2..504efd3 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -209,10 +209,34 @@ * sinks for the WebRTC track, no UI required */ audio { display: none; } - /* screen-share tiles render in the LEFT (timeline) column at full width. - * When sec-screens is shown the game tabs + iframe are hidden so the - * screen owns the column. */ - #screens { display: grid; grid-template-columns: 1fr; gap: 0.75rem; } + /* spotlight: the active tile (camera OR screen) renders full-width + * in the middle column. All other tiles render as thumbnails inside + * the cameras-col. Clicking a thumbnail promotes it to the spotlight + * and demotes the current one back to the column. */ + #spotlight { display: grid; grid-template-columns: 1fr; gap: 0; } + #screens-thumbs { display: grid; grid-template-columns: 1fr; gap: 0.45rem; margin-top: 0.5rem; } + .screens-thumbs-h2 { margin-top: 0.5rem; } + .screens-thumbs-h2.hidden { display: none; } + /* a thumbnail tile is the same DOM as a spotlight tile but with a + * thumb modifier class; clicking it triggers a spotlight swap */ + .tile-thumb { cursor: pointer; } + .tile-thumb:hover { outline: 1px solid #888; } + /* spotlight sizing — a camera in the spotlight uses contain so the + * whole frame is visible (not cropped like the thumb cover) */ + #spotlight > .camera-tile video { + aspect-ratio: 16 / 9; + object-fit: contain; + max-height: 92vh; + } + /* thumb sizing for either kind: small, cropped 16:9 */ + .tile-thumb > video { + width: 100%; height: auto; + aspect-ratio: 16 / 9; object-fit: cover; + max-height: 22vh; + } + .tile-thumb > .screen-meta { + font-size: 0.6rem; padding: 0.15rem 0.3rem; + } /* tile chrome (border + bg + meta) defaults to light-theme palette so * the screen-share blends with a white page. Dark-theme overrides * further down restore the black tile chrome for the night palette. */ @@ -239,9 +263,9 @@ font-family: monospace; font-size: 1rem; user-select: none; } .screen-tile.needs-tap .tap-play { display: grid; } - /* sec-screens visible → push everything else in the timeline column down or hide */ - .timeline:has(> #sec-screens:not(.hidden)) > .game-tabs, - .timeline:has(> #sec-screens:not(.hidden)) > #game-frame { display: none; } + /* spotlight active → hide the game iframe so the spotlight tile owns the column */ + .timeline:has(> #sec-spotlight:not(.hidden)) > .game-tabs, + .timeline:has(> #sec-spotlight:not(.hidden)) > #game-frame { display: none; } /* camera tiles live in the LEFT column now — single column, stacked * vertically. Each tile keeps a 16:9 letterbox so faces don't squash. */ @@ -463,15 +487,16 @@ try {
- -