Video stills skip YouTube's gray placeholder; timeline back to teal dots; people rows fill
- A still that fails or comes back as YouTube's 120 x 90 "no thumbnail" image gives way to the next; with none left the player is a flat teal panel with the play button showing. - Timeline: solid teal dots, a solid teal rail and teal decade tags (still on their branch), one color throughout, until a vine or tree drawing replaces them. The leaf colors are gone. - People tiles fill each row with as many as fit (2 to 10), one fewer only when the last row would be a single tile, instead of evening rows out (8 where 6 fit had come out 4 and 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6506f65b1e
commit
57f8020542
11 changed files with 98 additions and 151 deletions
|
|
@ -53,9 +53,10 @@ import "./PeopleTiles.css";
|
|||
* lines of name (and two of title), so a row's cards are one
|
||||
* height. The list as a whole has the frame, not each tile.
|
||||
*
|
||||
* Rows are balanced (balancedColumns): as many tiles across as fit,
|
||||
* but never fewer than 2 or more than 10, and spread so the last
|
||||
* row isn't a lone tile. When 2 don't fit at full size they shrink.
|
||||
* Rows fill (balancedColumns): as many tiles across as fit, never
|
||||
* fewer than 2 or more than 10, one fewer when that would leave a
|
||||
* lone tile on the last row. When 2 don't fit at full size they
|
||||
* shrink.
|
||||
*
|
||||
* Details open in a panel right under the tile, over what follows
|
||||
* (flipped to end at the tile's right edge when it would run off
|
||||
|
|
@ -834,16 +835,16 @@ function Chevron() {
|
|||
/* ── Helpers ─────────────────────────────────────────────────── */
|
||||
|
||||
/* Tiles across a row: as many as fit, at least 2 and at most 10
|
||||
(never more than there are), then evened out so the rows come
|
||||
out as close to equal as they can: 5 tiles that fit 4 across go
|
||||
3 and 2, not 4 and 1. If one tile would still be left alone (3
|
||||
where only 2 fit), one more, narrower, column takes it. */
|
||||
(never more than there are). If that would leave one tile alone on
|
||||
the last row, one fewer across, so the last row has two: 7 that fit
|
||||
6 across go 5 and 2. With only 2 across, a third, narrower column
|
||||
takes the odd one instead (3 tiles on a phone go 3 across). */
|
||||
export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
|
||||
if (count <= 1) return 1;
|
||||
const fit = Math.floor((width + gap) / (tile + gap));
|
||||
const most = Math.min(count, 10, Math.max(2, fit));
|
||||
const cols = Math.ceil(count / Math.ceil(count / most));
|
||||
return count % cols === 1 && cols < Math.min(count, 10) ? cols + 1 : cols;
|
||||
const cols = Math.min(count, 10, Math.max(2, fit));
|
||||
if (count % cols !== 1) return cols;
|
||||
return cols > 2 ? cols - 1 : Math.min(count, 3);
|
||||
}
|
||||
|
||||
/* A string id is a people slug; a numeric or missing one is a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue