Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Home: the latest release leads the first screen, the video reel takes its place

Adarsha5716d3e44da
diff --git a/src/components/home/bento-islands.tsx b/src/components/home/bento-islands.tsx
index 04bb2774..d0d7f973 100644
--- a/src/components/home/bento-islands.tsx
+++ b/src/components/home/bento-islands.tsx
@@ -691,10 +691,11 @@ export function LiveTyping({ frames, phrases, sizes }: { frames: BentoPicture[];
* The release tile's pictures: each shows for `every` ms, closing in slowly (home-bento.css: hb-release-ken), then the
* next fades in over it in `fade` ms; after the last, the first again. Only while the first screen moves (BentoMotion:
* not paused, on screen, not under reduced motion), and it carries on where it stopped. The first picture is in the
- * HTML; the others are asked for once it first plays, and it waits on one that hasn't arrived. Decorative: the tile's
- * link names it.
+ * HTML; the others are asked for once it first plays, and it waits on one that hasn't arrived. `lead`: the tile is the
+ * first screen's biggest, so its first picture is asked for first and lands with the first paint. Decorative: the
+ * tile's link names it.
*/
-export function BentoRelease({ slides, sizes, every, fade }: { slides: BentoSlide[]; sizes: string; every: number; fade: number }) {
+export function BentoRelease({ slides, sizes, every, fade, lead }: { slides: BentoSlide[]; sizes: string; every: number; fade: number; lead?: boolean }) {
const play = usePlay();
const [shown, setShown] = useState(0);
const [prev, setPrev] = useState<number | null>(null);
@@ -729,8 +730,8 @@ export function BentoRelease({ slides, sizes, every, fade }: { slides: BentoSlid
alt=""
width={p.width}
height={p.height}
- fetchPriority="low"
- decoding="async"
+ fetchPriority={lead && i === 0 ? "high" : "low"}
+ decoding={lead && i === 0 ? "sync" : "async"}
draggable={false}
className={s.fill}
style={{ objectPosition: p.position }}
diff --git a/src/components/home/home-bento.css b/src/components/home/home-bento.css
index 4123fa87..1b77a165 100644
--- a/src/components/home/home-bento.css
+++ b/src/components/home/home-bento.css
@@ -240,26 +240,26 @@
/* ---------------------------------------------------------------- grid */
/*
- * The reel leads; Live edit, the highlight, and Genjutsu, whose swaps need room to be seen, are the next biggest, the
- * same size, right by it (right under it on a phone). From lg the grid is fourteen narrow columns, so the top two rows
- * (the reel, Live edit, Genjutsu) and the bottom row (the latest release, 3D, audio, the numbers, canvas) each split it their own way.
- * The audio tile, which holds a demo to play, takes four of the bottom row's columns.
+ * The latest release leads; Live edit, the highlight, and Genjutsu, whose swaps need room to be seen, are the next
+ * biggest, the same size, right by it (right under it on a phone). From lg the grid is fourteen narrow columns, so the
+ * top two rows (the latest release, Live edit, Genjutsu) and the bottom row (the video reel, 3D, audio, the numbers,
+ * canvas) each split it their own way. The audio tile, which holds a demo to play, takes four of the bottom row's columns.
*/
.hb-grid {
display: grid;
gap: var(--bento-gap);
grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-areas:
- "video video"
+ "release release"
"live live"
"genjutsu genjutsu"
- "release three"
+ "video three"
"audio audio"
"canvas canvas"
"numbers numbers";
}
@media (max-width: 767.98px) {
- .hb-video {
+ .hb-release {
aspect-ratio: 3 / 2;
}
/* Wide enough to show the whole portrait, short enough that the reel and it fit a phone's first screen. */
@@ -270,7 +270,7 @@
.hb-genjutsu {
aspect-ratio: 16 / 10;
}
- .hb-release,
+ .hb-video,
.hb-three {
aspect-ratio: 1;
}
@@ -288,9 +288,9 @@
/* Live edit one column two rows tall, Genjutsu two columns one row tall: the same size, each bigger than the rest. */
grid-template-rows: 230px 230px 230px 210px auto;
grid-template-areas:
- "video video live"
- "video video live"
- "genjutsu genjutsu release"
+ "release release live"
+ "release release live"
+ "genjutsu genjutsu video"
"three audio canvas"
"numbers numbers numbers";
}
@@ -301,9 +301,9 @@
grid-template-rows: repeat(3, minmax(0, 1fr));
height: clamp(var(--grid-min), calc(var(--content-h) - var(--bento-head) - var(--head-top) - 3.25rem), 760px);
grid-template-areas:
- "video video video video video video live live live live genjutsu genjutsu genjutsu genjutsu"
- "video video video video video video live live live live genjutsu genjutsu genjutsu genjutsu"
- "release release three three audio audio audio audio numbers numbers numbers canvas canvas canvas";
+ "release release release release release release live live live live genjutsu genjutsu genjutsu genjutsu"
+ "release release release release release release live live live live genjutsu genjutsu genjutsu genjutsu"
+ "video video three three audio audio audio audio numbers numbers numbers canvas canvas canvas";
}
}
.hb-video {
@@ -508,11 +508,11 @@
}
}
/*
- * The words keep the same inset in every tile, whatever its width, so tiles side by side (the reel, Live edit and
- * Genjutsu) set their titles and links on the same lines.
+ * The words keep the same inset in every tile, whatever its width, so tiles side by side (the latest release, Live edit
+ * and Genjutsu) set their titles and links on the same lines.
*/
@container (min-width: 460px) {
- .hb-video .hb-title {
+ .hb-release .hb-title {
font-size: 40px;
}
.hb-meta.hb-big {
@@ -522,7 +522,7 @@
}
}
@container (min-width: 540px) {
- .hb-video .hb-title {
+ .hb-release .hb-title {
font-size: 44px;
}
}
@@ -581,6 +581,17 @@
text-transform: uppercase;
pointer-events: none;
}
+/* A small tile (the bottom row, a phone's square): the badge on the corner arrow's line, a size down. */
+@container (max-width: 219.98px) {
+ .hb-badge {
+ top: 10px;
+ left: 10px;
+ gap: 6px;
+ height: 26px;
+ padding: 0 9px;
+ font-size: 10.5px;
+ }
+}
.hb-progress {
position: absolute;
inset: auto 0 0;
@@ -665,17 +676,17 @@
}
}
-/* The edge in the accent, with a glow inside it; brighter under the pointer. */
+/* The edge in the accent, with a glow inside it (wide enough to read on the lead tile); brighter under the pointer. */
.hb-release::before {
box-shadow:
inset 0 0 0 1px color-mix(in oklch, var(--bento-accent) 75%, transparent),
- inset 0 0 26px -6px var(--bento-glow);
+ inset 0 0 44px -10px var(--bento-glow);
}
@media (hover: hover) {
.hb-release:hover::before {
box-shadow:
inset 0 0 0 1px color-mix(in oklch, var(--bento-accent) 85%, white),
- inset 0 0 30px -4px color-mix(in oklch, var(--bento-accent) 45%, transparent);
+ inset 0 0 52px -8px color-mix(in oklch, var(--bento-accent) 45%, transparent);
}
}
@@ -731,6 +742,21 @@
font-size: 11px;
}
}
+/* The lead tile: the badge a size up, on the same inset as the words under it. */
+@container (min-width: 460px) {
+ .hb-new-badge {
+ top: 18px;
+ left: 18px;
+ gap: 8px;
+ height: 30px;
+ padding: 0 13px 0 12px;
+ font-size: 12px;
+ }
+ .hb-new-dot {
+ width: 7px;
+ height: 7px;
+ }
+}
/*
* The model's name over the title and "Try it now" under it, in every size of the tile (a small tile drops both
@@ -745,10 +771,22 @@
.hb-release .hb-corner {
display: none;
}
-/* Three lines of words on a small tile: the shade reaches higher, so the name reads over a bright picture. */
+/*
+ * Three lines of words on a narrow tile (a phone's row): the shade reaches higher, so the name reads over a bright
+ * picture. On the lead tile the words take a smaller share of its height, and the pictures show whole above them.
+ */
.hb-release .hb-shade {
height: 78%;
}
+@container (min-width: 460px) {
+ .hb-release .hb-shade {
+ height: 58%;
+ }
+ .hb-release .hb-cta {
+ margin-top: 12px;
+ font-size: 14px;
+ }
+}
@container (max-width: 199.98px) {
.hb-release .hb-meta {
letter-spacing: 0.04em;
diff --git a/src/components/home/home-bento.tsx b/src/components/home/home-bento.tsx
index 77bce6fc..7e1b1ef3 100644
--- a/src/components/home/home-bento.tsx
+++ b/src/components/home/home-bento.tsx
@@ -15,7 +15,12 @@ import "./home-bento.css";
* tile's width or, where the tile is the squarer shape, its height times 4/3, so the browser picks a copy that sharp.
*/
const SIZES = {
- video: "(min-width: 1024px) 572px, (min-width: 768px) 630px, calc(100vw - 32px)",
+ /**
+ * The video tile: two of the bottom row's fourteen columns from lg, a third of the grid tall (narrower than its 4:3
+ * clip, so its height times 4/3: up to 330 px), a column on a tablet, half the row on a phone (a square: its height
+ * times 4/3).
+ */
+ video: "(min-width: 1024px) 330px, (min-width: 768px) 320px, calc((100vw - 44px) * 0.667)",
/**
* The live tile: from lg a third of the grid wide and two rows tall (up to 570 px under cover on a 1920 x 1080
* screen), two rows tall on a tablet, the full row on a phone.
@@ -24,10 +29,11 @@ const SIZES = {
/** A 4:3 picture in a square tile on a phone (half the row): cropped at its sides, so 4/3 of the tile's width. */
square: "(min-width: 1024px) 274px, (min-width: 768px) 320px, calc((100vw - 44px) * 0.667)",
/**
- * The release tile: two of the bottom row's fourteen columns from lg, a column on a tablet, half the row on a phone. Its
- * pictures come portrait and landscape, so a landscape one under cover shows at about 16/9 of the tile's height.
+ * The release tile, the first screen's lead: from lg six of the top rows' fourteen columns and two rows tall, two
+ * columns and two rows on a tablet, the full row on a phone. Its pictures come portrait and landscape, so a landscape
+ * one under cover shows at about 16/9 of the tile's height (the 960 px copy from about 480 px of it on screen).
*/
- release: "(min-width: 1024px) 280px, (min-width: 768px) 400px, calc((100vw - 44px) * 0.9)",
+ release: "(min-width: 1024px) 860px, (min-width: 768px) 840px, calc(100vw - 32px)",
/**
* The Genjutsu tile: from lg as big as the live tile, two rows tall and squarer than its 4:3 clip (so its height
* times 4/3: up to 560 px on a 1920 x 1080 screen); two columns on a tablet; the full row on a phone.
@@ -185,14 +191,14 @@ function CanvasBoard({ board }: { board: Bento["canvas"] }) {
*/
export function HomeBento({ bento }: { bento: Bento }) {
const { tiles } = bento;
- // The video tile's still is the first screen's biggest picture: asked for from the head, before the body's HTML.
- const still = bento.video.poster;
- preload(still.avif.at(-1)!.src, {
+ // The release tile's first picture is the first screen's biggest: asked for from the head, before the body's HTML.
+ const lead = bento.release.slides[0];
+ preload(lead.avif.at(-1)!.src, {
as: "image",
type: "image/avif",
fetchPriority: "high",
- imageSrcSet: still.avif.map((a) => `${a.src} ${a.w}w`).join(", "),
- imageSizes: SIZES.video,
+ imageSrcSet: lead.avif.map((a) => `${a.src} ${a.w}w`).join(", "),
+ imageSizes: SIZES.release,
});
return (
<section id="home-bento" aria-labelledby="home-bento-title" className={s.bento}>
@@ -220,11 +226,15 @@ export function HomeBento({ bento }: { bento: Bento }) {
</div>
<div className={s.grid}>
- <Tile tile={tiles.video} area={s.video} bigMeta>
- <Pic pic={still} sizes={SIZES.video} fetchPriority="high" decoding="sync" position={bento.video.reel[0].position} />
- <BentoReel id={bento.video.id} reel={bento.video.reel} progress />
- <span aria-hidden className={s.badge}>
- <Video className="size-3.5" /> Video
+ {/*
+ The latest open model, new on Fuobe, leads the grid: its pictures fade one into the next as each closes in
+ slowly, under a badge saying it is new. Its name is over the title; the whole tile opens the Image studio on it.
+ */}
+ <Tile tile={tiles.release} area={s.release} bigMeta title={<ReleaseTitle released={bento.release.released} />}>
+ <BentoRelease slides={bento.release.slides} sizes={SIZES.release} every={bento.release.every} fade={bento.release.fade} lead />
+ <span aria-hidden className={s.newBadge}>
+ <span className={s.newDot} />
+ {bento.release.badge}
</span>
</Tile>
@@ -241,15 +251,12 @@ export function HomeBento({ bento }: { bento: Bento }) {
<BentoReel id={bento.genjutsu.id} reel={bento.genjutsu.reel} wipes={bento.genjutsu.wipes} />
</Tile>
- {/*
- The latest open model, new on Fuobe: its pictures fade one into the next as each closes in slowly, under a
- badge saying it is new. Its name is over the title; the whole tile opens the Image studio on it.
- */}
- <Tile tile={tiles.release} area={s.release} title={<ReleaseTitle released={bento.release.released} />}>
- <BentoRelease slides={bento.release.slides} sizes={SIZES.release} every={bento.release.every} fade={bento.release.fade} />
- <span aria-hidden className={s.newBadge}>
- <span className={s.newDot} />
- {bento.release.badge}
+ {/* The video reel, first in the bottom row: its still from the first paint, its clips once that is painted. */}
+ <Tile tile={tiles.video} area={s.video}>
+ <Pic pic={bento.video.poster} sizes={SIZES.video} fetchPriority="low" position={bento.video.reel[0].position} />
+ <BentoReel id={bento.video.id} reel={bento.video.reel} progress />
+ <span aria-hidden className={s.badge}>
+ <Video className="size-3.5" /> Video
</span>
</Tile>
diff --git a/tests/e2e/home-bento.mjs b/tests/e2e/home-bento.mjs
index 4eb387c3..cb8a937d 100644
--- a/tests/e2e/home-bento.mjs
+++ b/tests/e2e/home-bento.mjs
@@ -13,7 +13,7 @@
// 1. Every width (390, 768, 1024, 1280, 1440, 1920), light and dark, as a guest and as the owner: no sideways scroll,
// one h1, the headline in its own words ("Make anything:" on one line; the second line whole from 768, and on a
// phone two lines that break before "finished film,"), it rose into place once, and the first screen holds what it
-// should (a phone: the video tile and the live tile under it; from 1024: all eight). A picture of each (--shots), and a
+// should (a phone: the release tile and the live tile under it; from 1024: all eight). A picture of each (--shots), and a
// contact sheet of them all.
// 1b. Sharp at every width and pixel ratio (1x, 2x, 3x): every picture on the first screen is at least as wide as its
// box shows it (object-fit: cover, times the ratio), up to the widest copy there is, and so is each clip once it
@@ -47,8 +47,8 @@
// live words stay), and the tiles keep their stills.
// 5. Pause previews stops the reel and freezes every animation; pressed again, they go on.
// 6. Weight: what the page downloads before `load` (clips aside), at 390 and 1440, reported; the first screen's own
-// stills stay under 420 KB (the clips' posters are encoded close to their clips' first frames, and a 3x phone or a
-// 2x laptop gets the video tile's widest still). The clips are reported on their own.
+// stills stay under 420 KB (the clips' posters are encoded close to their clips' first frames, and the release
+// tile, the lead, shows its first picture's 960 px copy). The clips are reported on their own.
// 7. The composer: /?new=1 brings it into view with the focus; a plain visit stays at the top (no autofocus jump).
// 8. Every tile is a named link (the Audio tile: its words), and Tab reaches them in the grid's reading order (through
// the Audio tile's buttons) with a visible ring.
@@ -99,7 +99,7 @@ const WIDTHS = [
{ w: 1440, h: 900 },
{ w: 1920, h: 1080 },
];
-const TILES = ["video", "live", "genjutsu", "release", "threeD", "audio", "numbers", "canvas"];
+const TILES = ["release", "live", "genjutsu", "video", "threeD", "audio", "numbers", "canvas"];
/** The tiles that play a clip by themselves (the reel, the 3D clip, Genjutsu's swap): each only once it is on screen. */
const MOVING = ["video", "threeD", "genjutsu"];
/** The widest copy of a clip (scripts/gen-home-bento.mjs), where its element doesn't say (a reel clip's data-max). */
@@ -147,7 +147,7 @@ const layout = (page) =>
page.evaluate((tiles) => {
const box = (el) => {
const r = el.getBoundingClientRect();
- // Its title's size: the live tile, the highlight, is second only to the video tile.
+ // Its title's size: the live tile, the highlight, is second only to the release tile.
const title = el.querySelector("[class*=title]");
return { top: r.top, bottom: r.bottom, left: r.left, right: r.right, w: r.width, h: r.height, title: title ? parseFloat(getComputedStyle(title).fontSize) : 0 };
};
@@ -254,9 +254,9 @@ if (run("1"))
);
if (v.phone) {
const bottom = l.vh - 64;
- const first = ["video", "live"];
+ const first = ["release", "live"];
const out = first.filter((t) => l.tiles[t].top < 0 || l.tiles[t].bottom > bottom);
- check(`${tag}: the video tile and the live tile under it on the first screen`, out.length === 0, first.map((t) => `${t} ${Math.round(l.tiles[t].bottom)}`).join(", ") + ` ≤ ${bottom}`);
+ check(`${tag}: the release tile and the live tile under it on the first screen`, out.length === 0, first.map((t) => `${t} ${Math.round(l.tiles[t].bottom)}`).join(", ") + ` ≤ ${bottom}`);
check(`${tag}: every tile at least 44 px to tap`, TILES.every((t) => l.tiles[t].w >= 44 && l.tiles[t].h >= 44));
// Genjutsu right under the live tile, the full row wide, at 16:9 or taller.
const [lv, gj] = [l.tiles.live, l.tiles.genjutsu];
@@ -266,17 +266,17 @@ if (run("1"))
`live ${Math.round(lv.w)}x${Math.round(lv.h)} to ${Math.round(lv.bottom)}, genjutsu ${Math.round(gj.w)}x${Math.round(gj.h)} from ${Math.round(gj.top)}`,
);
}
- // The live tile, the highlight, and Genjutsu are the biggest after the video tile, the same size (the live tile
- // never the smaller), and their titles no smaller than any but the video's.
+ // The live tile, the highlight, and Genjutsu are the biggest after the release tile, the same size (the live tile
+ // never the smaller), and their titles no smaller than any but the release tile's.
const area = (t) => l.tiles[t].w * l.tiles[t].h;
- const rest = TILES.filter((t) => !["video", "live", "genjutsu", "numbers"].includes(t));
+ const rest = TILES.filter((t) => !["release", "live", "genjutsu", "numbers"].includes(t));
check(
- `${tag}: the live and Genjutsu tiles the same size, second only to the video tile`,
+ `${tag}: the live and Genjutsu tiles the same size, second only to the release tile`,
area("live") >= area("genjutsu") * 0.98 &&
area("genjutsu") >= area("live") * 0.85 &&
rest.every((t) => area("genjutsu") > area(t) && l.tiles.live.title >= l.tiles[t].title && l.tiles.genjutsu.title >= l.tiles[t].title) &&
- area("video") > area("live"),
- ["video", "live", "genjutsu", ...rest].map((t) => `${t} ${Math.round(l.tiles[t].w)}x${Math.round(l.tiles[t].h)}/${l.tiles[t].title}`).join(", "),
+ area("release") > area("live"),
+ ["release", "live", "genjutsu", ...rest].map((t) => `${t} ${Math.round(l.tiles[t].w)}x${Math.round(l.tiles[t].h)}/${l.tiles[t].title}`).join(", "),
);
if (v.w >= 1024) {
const out = TILES.filter((t) => l.tiles[t].bottom > l.vh || l.tiles[t].top < 0);
diff --git a/tests/home-bento.test.ts b/tests/home-bento.test.ts
index 16e5d855..bfa02331 100644
--- a/tests/home-bento.test.ts
+++ b/tests/home-bento.test.ts
@@ -239,8 +239,8 @@ describe("Home's first screen", () => {
const links = [...html.matchAll(/<a [^>]*>/g)].map((m) => m[0]);
const tiles = links.filter((a) => a.includes("data-tile="));
// Every tile is its link but the Audio tile, which holds the demo's buttons: its words are its link.
- expect([...html.matchAll(/<(?:a|div) [^>]*data-tile="([^"]+)"/g)].map((m) => m[1])).toEqual(["video", "live", "genjutsu", "release", "threeD", "audio", "numbers", "canvas"]);
- expect(tiles.map((a) => /data-tile="([^"]+)"/.exec(a)![1])).toEqual(["video", "live", "genjutsu", "release", "threeD", "numbers", "canvas"]);
+ expect([...html.matchAll(/<(?:a|div) [^>]*data-tile="([^"]+)"/g)].map((m) => m[1])).toEqual(["release", "live", "genjutsu", "video", "threeD", "audio", "numbers", "canvas"]);
+ expect(tiles.map((a) => /data-tile="([^"]+)"/.exec(a)![1])).toEqual(["release", "live", "genjutsu", "video", "threeD", "numbers", "canvas"]);
const audioLink = links.find((a) => a.includes(`href="${BENTO_HREFS.audio}"`));
expect(audioLink).toBeTruthy();
expect(links).toHaveLength(8);
@@ -404,7 +404,7 @@ describe("Home's first screen", () => {
expect(film.thumb).toMatch(/^\/previews\/home\/board-film\.webp\?v=/);
});
- it("shows the latest release in the bottom row: new, by its name, and one link to the Image studio on its model", () => {
+ it("leads with the latest release: new, by its name, and one link to the Image studio on its model", () => {
const tile = /<a [^>]*data-tile="release"[\s\S]*?<\/a>/.exec(html)![0];
const open = /^<a [^>]*>/.exec(tile)![0];
const decode = (v: string) => v.replace(/&amp;/g, "&");
@@ -449,6 +449,12 @@ describe("Home's first screen", () => {
expect(imgs[0]).toContain('alt=""');
expect(imgs[0]).toContain(`src="${r.slides[0].fallback}"`);
expect(imgs[0]).not.toContain('loading="lazy"');
+ // The first screen's biggest picture: asked for first, and decoded with the first paint.
+ expect(imgs[0]).toMatch(/fetchPriority="high"/i);
+ expect(imgs[0]).toContain('decoding="sync"');
+ // In its 480 and 960 px copies, the 960 wherever the tile shows it at more than 480 px.
+ expect(tile).toContain(`srcSet="${r.slides[0].avif[0].src} 480w, ${r.slides[0].avif[1].src} 960w"`);
+ expect(tile).toContain('sizes="(min-width: 1024px) 860px, (min-width: 768px) 840px, calc(100vw - 32px)"');
expect(tile).toContain('data-on="true"');
expect(tile).not.toContain("data-prev");
for (const p of r.slides.slice(1)) expect(tile).not.toContain(p.avif[0].src);
@@ -465,7 +471,29 @@ describe("Home's first screen", () => {
// Under reduced motion nothing moves, whatever data-play says.
const reduced = css.slice(css.lastIndexOf("@media (prefers-reduced-motion: reduce)"));
expect(reduced).toMatch(/\.hb-bento \.hb-release-slide \.hb-fill,[\s\S]*\.hb-bento \.hb-new-dot,[\s\S]*animation: none !important/);
- // It keeps the bottom row's place: the grid sets its box on every width.
- expect(css.match(/"release three"|"genjutsu genjutsu release"|"release release three three/g)).toHaveLength(3);
+ // It leads the grid on every width (a phone's first row, a tablet's two columns and two rows, from lg six columns
+ // and two rows), and the video reel takes the bottom row's first place it had (half a phone's row by 3D, a tablet's
+ // column by Genjutsu, from lg two columns): the grid sets both boxes.
+ expect(css.match(/"release release"\n\s*"live live"/g)).toHaveLength(1);
+ expect(css.match(/"video three"/g)).toHaveLength(1);
+ expect(css.match(/"release release live"\n\s*"release release live"\n\s*"genjutsu genjutsu video"/g)).toHaveLength(1);
+ expect(css.match(/("release release release release release release live live live live genjutsu genjutsu genjutsu genjutsu"\s*){2}"video video three three /g)).toHaveLength(1);
+ // The release tile's title at the lead's display size; the video tile's at the small tiles'.
+ expect(css).toMatch(/@container \(min-width: 540px\) \{\s*\.hb-release \.hb-title \{\s*font-size: 44px;/);
+ expect(css).not.toMatch(/\.hb-video \.hb-title/);
+ });
+
+ it("shows the video reel small: its still from the first paint, its clips once that is painted, and its link", () => {
+ const tile = /<a [^>]*data-tile="video"[\s\S]*?<\/a>/.exec(html)![0];
+ expect(/href="([^"]+)"/.exec(tile)![1]).toBe(BENTO_HREFS.video);
+ expect(/aria-label="([^"]+)"/.exec(tile)![1]).toBe(bento.tiles.video.label);
+ const imgs = [...tile.matchAll(/<img\b[^>]*>/g)].map((m) => m[0]);
+ expect(imgs).toHaveLength(1);
+ expect(imgs[0]).toContain(`src="${bento.video.poster.fallback}"`);
+ expect(imgs[0]).not.toContain('loading="lazy"');
+ // No clip in the HTML: the reel sets its source once the still is painted.
+ expect(tile).not.toMatch(/<video\b/);
+ expect(tile).toContain('sizes="(min-width: 1024px) 330px, (min-width: 768px) 320px, calc((100vw - 44px) * 0.667)"');
+ expect(tile).toContain(`>${bento.tiles.video.title}<`);
});
});