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.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Home: the first screen's bottom row opens on the latest release
Adarsh7d0087ae9d3d
diff --git a/public/previews/home/image-4-480.avif b/public/previews/home/image-4-480.avifdeleted file mode 100644index 1a3b32e1..00000000Binary files a/public/previews/home/image-4-480.avif and /dev/null differdiff --git a/public/previews/home/image-4-768.avif b/public/previews/home/image-4-768.avifdeleted file mode 100644index 8ce05a72..00000000Binary files a/public/previews/home/image-4-768.avif and /dev/null differdiff --git a/scripts/gen-home-bento.mjs b/scripts/gen-home-bento.mjsindex c33ff852..87dc522b 100644--- a/scripts/gen-home-bento.mjs+++ b/scripts/gen-home-bento.mjs@@ -12,7 +12,6 @@* reel-sand-storm-<width>.avif the reel's first clip's first frame at each of its widths: the tile's poster* rotation-{640,1024,1536,2048}.{mp4,avif} the turning gown (the 3D tile) at four widths, and each one's first frame* reel-sand-storm-1024.jpg, rotation-1024.jpg the 1024 px clips' first frames, for a browser without AVIF- * image-4-{480,768}.avif the Image studio's example 4* voice-{room,quiet}-{480,768,1024}.avif Clean up voice's demo photos (public/samples/clean-voice/): the restaurant,* and the same photo softened around her, which the Audio tile shows once the* noise is off; voice-{room,quiet}-1024.jpg for a browser without AVIF@@ -215,8 +214,6 @@ const VOICE_WIDTHS = [480, 768, 1024];* its width, and a crop where it has one.*/const STILLS = [- { name: "image-4-480.avif", from: "/examples/image/4/out.jpg", width: 480 },- { name: "image-4-768.avif", from: "/examples/image/4/out.jpg", width: 768 },...VOICE.flatMap((v) => [...VOICE_WIDTHS.map((width) => ({ name: `${v.name}-${width}.avif`, from: v.from, width })),{ name: `${v.name}-${FALLBACK_WIDTH}.jpg`, from: v.from, width: FALLBACK_WIDTH },diff --git a/src/components/home/bento-islands.tsx b/src/components/home/bento-islands.tsxindex 9d4ca0ff..04bb2774 100644--- a/src/components/home/bento-islands.tsx+++ b/src/components/home/bento-islands.tsx@@ -4,16 +4,17 @@ import { Zap } from "lucide-react";import { useEffect, useRef, useState, useSyncExternalStore } from "react";import { useNavUi } from "@/components/nav/nav-ui";import { usePreviewPlayback, usePreviewsPaused } from "@/components/preset-preview";-import type { BentoPicture } from "@/lib/home-bento";+import type { BentoPicture, BentoSlide } from "@/lib/home-bento";import { REEL_STALL_MS, fadeDue, fadeOf, holdOf, nextInReel, reelProgress, reelSources, wipeFrame, type ReelClip, type ReelWipe } from "@/lib/home-reel";import { coverWidth, pickWidth, type Sized } from "@/lib/media-pick";import { releaseVideo } from "@/lib/media-release";import { browserPlaybackEnv } from "@/lib/preview-playback";+import { RELEASE_TITLES, releaseTitle } from "@/lib/release-day";import { s } from "./home-bento-classes";/** The first screen's few islands (home-bento.tsx): the switch that lets it move, the video tile's reel, the 3D tile's- * clip, the typing on the live tile and the numbers tile's launcher. Everything else on it is HTML from the server.+ * clip, the typing on the live tile, the release tile's pictures and title, and the numbers tile's launcher. Everything else on it is HTML from the server.*//** Whether the page has loaded (the first screen's animations wait for it) and whether it may move now (BentoMotion). */@@ -686,6 +687,71 @@ 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.+ */+export function BentoRelease({ slides, sizes, every, fade }: { slides: BentoSlide[]; sizes: string; every: number; fade: number }) {+ const play = usePlay();+ const [shown, setShown] = useState(0);+ const [prev, setPrev] = useState<number | null>(null);+ const [fetched, setFetched] = useState(false);+ if (play && !fetched) setFetched(true);+ const imgs = useRef<(HTMLImageElement | null)[]>([]);+ const at = useRef(0);+ useEffect(() => {+ if (!play || slides.length < 2) return;+ const t = window.setInterval(() => {+ const next = (at.current + 1) % slides.length;+ const img = imgs.current[next];+ // Not in yet: this one stays a turn longer.+ if (!img?.complete || !img.naturalWidth) return;+ setPrev(at.current);+ setShown(next);+ at.current = next;+ }, every);+ return () => clearInterval(t);+ }, [play, every, slides.length]);+ return (+ <span className={s.pic}>+ {slides.map((p, i) =>+ i === 0 || fetched ? (+ <picture key={p.fallback} className={s.releaseSlide} data-on={i === shown || undefined} data-prev={i === prev || undefined} style={{ "--fade": `${fade}ms`, "--o": p.position } as React.CSSProperties}>+ <source type="image/avif" srcSet={p.avif.map((a) => `${a.src} ${a.w}w`).join(", ")} sizes={sizes} />+ <img+ ref={(el) => {+ imgs.current[i] = el;+ }}+ src={p.fallback}+ alt=""+ width={p.width}+ height={p.height}+ fetchPriority="low"+ decoding="async"+ draggable={false}+ className={s.fill}+ style={{ objectPosition: p.position }}+ />+ </picture>+ ) : null,+ )}+ </span>+ );+}++const noSubscribe = () => () => {};++/**+ * The release tile's title: the later one in the HTML (Home is prerendered), "today" in the browser on the day the+ * model came out (src/lib/release-day.ts).+ */+export function ReleaseTitle({ released }: { released: string }) {+ return useSyncExternalStore(noSubscribe, () => releaseTitle(released, new Date()), () => RELEASE_TITLES.later);+}+/*** The numbers tile: a link to the Studios section, which opens every studio where it can (the launcher on a desktop,* the Studios sheet on a phone) instead. A modified click still follows the link.diff --git a/src/components/home/home-bento-classes.ts b/src/components/home/home-bento-classes.tsindex 49429d8d..1a919c5e 100644--- a/src/components/home/home-bento-classes.ts+++ b/src/components/home/home-bento-classes.ts@@ -3,6 +3,6 @@* stylesheet in this app is (next.config.ts runs each .css file through Tailwind as plain CSS), so the prefix keeps its* names to itself.*/-const NAMES = ["accent","aside","asideWords","audio","badge","bento","big","board","box","canvas","caret","clip","copy","corner","cta","edges","end","figures","fill","filmMark","foot","frame","genjutsu","grid","h1","head","image","kenburns","l2b","line1","line2","live","meta","node","nodeLabel","numbers","numbersFoot","numbersLine","out","pic","pill","progress","shade","step","three","tile","title","tsx","typed","video","voice","voiceBar","voiceChip","voiceCopy","voiceDot","voiceGo","voiceLink","voiceNear","voicePics","voicePlay","voiceQuiet","voiceSwitch","voiceUi","wipe","wipeAfter","wipeBefore"] as const;+const NAMES = ["accent","aside","asideWords","audio","badge","bento","big","board","box","canvas","caret","clip","copy","corner","cta","edges","end","figures","fill","filmMark","foot","frame","genjutsu","grid","h1","head","l2b","line1","line2","live","meta","newBadge","newDot","node","nodeLabel","numbers","numbersFoot","numbersLine","out","pic","pill","progress","release","releaseSlide","shade","step","three","tile","title","tsx","typed","video","voice","voiceBar","voiceChip","voiceCopy","voiceDot","voiceGo","voiceLink","voiceNear","voicePics","voicePlay","voiceQuiet","voiceSwitch","voiceUi","wipe","wipeAfter","wipeBefore"] as const;export const s = Object.fromEntries(NAMES.map((n) => [n, `hb-${n.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase())}`])) as Record<(typeof NAMES)[number], string>;diff --git a/src/components/home/home-bento.css b/src/components/home/home-bento.cssindex 0f16d7c7..4123fa87 100644--- a/src/components/home/home-bento.css+++ b/src/components/home/home-bento.css@@ -242,7 +242,7 @@/** 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 (image, 3D, audio, the numbers, canvas) each split it their own way.+ * (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.*/.hb-grid {@@ -253,7 +253,7 @@"video video""live live""genjutsu genjutsu"- "image three"+ "release three""audio audio""canvas canvas""numbers numbers";@@ -270,7 +270,7 @@.hb-genjutsu {aspect-ratio: 16 / 10;}- .hb-image,+ .hb-release,.hb-three {aspect-ratio: 1;}@@ -290,7 +290,7 @@grid-template-areas:"video video live""video video live"- "genjutsu genjutsu image"+ "genjutsu genjutsu release""three audio canvas""numbers numbers numbers";}@@ -303,14 +303,14 @@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"- "image image three three audio audio audio audio numbers numbers numbers canvas canvas canvas";+ "release release three three audio audio audio audio numbers numbers numbers canvas canvas canvas";}}.hb-video {grid-area: video;}-.hb-image {- grid-area: image;+.hb-release {+ grid-area: release;}.hb-audio {grid-area: audio;@@ -619,24 +619,143 @@transition-timing-function: cubic-bezier(0.6, 0, 0.4, 1);}-/* ---------------------------------------------------------------- image: a slow push in */+/* ---------------------------------------------------------------- release: the latest open model, new */-.hb-kenburns {- transform-origin: 50% 40%;+/*+ * The latest open model's pictures (BentoRelease in bento-islands.tsx), in a layer of their own under the tile's words:+ * the one shown on top, fading in over the one before it (held under it until the next turn), the rest unseen. Each+ * closes in slowly toward its own framing point (--o) while it shows and while the next fades in over it, so nothing+ * snaps back on screen. The tile's edge and a soft inner glow are the accent, and the badge's dot pulses: it reads as+ * new. All of it moves only while data-play is "1", freezes at "0", and without it the first picture rests whole.+ */+.hb-release > .hb-pic {+ isolation: isolate;+}+.hb-release-slide {+ position: absolute;+ inset: 0;+ display: block;+ opacity: 0;+}+.hb-release-slide[data-prev] {+ z-index: 1;+ opacity: 1;+}+.hb-release-slide[data-on] {+ z-index: 2;+ opacity: 1;+ transition: opacity var(--fade, 900ms) cubic-bezier(0.4, 0, 0.2, 1);}-.hb-bento[data-play] .hb-kenburns {- animation: bento-ken 16s ease-in-out infinite alternate;+.hb-release-slide .hb-fill {+ transform-origin: var(--o, 50% 40%);+}+.hb-bento[data-play] .hb-release-slide:is([data-on], [data-prev]) .hb-fill {+ animation: hb-release-ken 4.2s cubic-bezier(0.25, 0.1, 0.45, 1) both;animation-play-state: paused;}-.hb-bento[data-play="1"] .hb-kenburns {+.hb-bento[data-play="1"] .hb-release-slide:is([data-on], [data-prev]) .hb-fill {animation-play-state: running;}-@keyframes bento-ken {+@keyframes hb-release-ken {from {transform: scale(1);}to {- transform: scale(1.06);+ transform: scale(1.1);+ }+}++/* The edge in the accent, with a glow inside it; 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);+}+@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);+ }+}++/* "New · Day 0", as Genjutsu's "Swapped": an accent pill top left, with a white dot that pulses while the tile plays. */+.hb-new-badge {+ position: absolute;+ top: 10px;+ left: 10px;+ z-index: 1;+ display: inline-flex;+ align-items: center;+ gap: 6px;+ height: 24px;+ padding: 0 9px 0 8px;+ border-radius: 999px;+ background: color-mix(in oklch, var(--bento-accent) 82%, black);+ box-shadow: 0 0 16px var(--bento-glow);+ font-size: 10.5px;+ font-weight: 500;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ white-space: nowrap;+ pointer-events: none;+}+.hb-new-dot {+ flex: none;+ width: 6px;+ height: 6px;+ border-radius: 999px;+ background: #fff;+}+.hb-bento[data-play] .hb-new-dot {+ animation: hb-new-pulse 1.6s ease-out infinite;+ animation-play-state: paused;+}+.hb-bento[data-play="1"] .hb-new-dot {+ animation-play-state: running;+}+@keyframes hb-new-pulse {+ from {+ box-shadow: 0 0 0 0 rgb(255 255 255 / 70%);+ }+ to {+ box-shadow: 0 0 0 6px rgb(255 255 255 / 0%);+ }+}+@container (min-width: 220px) {+ .hb-new-badge {+ top: 14px;+ left: 14px;+ height: 26px;+ padding: 0 11px 0 10px;+ font-size: 11px;+ }+}++/*+ * The model's name over the title and "Try it now" under it, in every size of the tile (a small tile drops both+ * elsewhere): the name is what is new. The badge holds the top, so no corner arrow.+ */+.hb-release .hb-meta {+ display: block;+}+.hb-release .hb-cta {+ display: inline-flex;+}+.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. */+.hb-release .hb-shade {+ height: 78%;+}+@container (max-width: 199.98px) {+ .hb-release .hb-meta {+ letter-spacing: 0.04em;+ }+ .hb-release .hb-cta {+ margin-top: 5px;+ font-size: 12px;}}@@ -1562,7 +1681,8 @@ html:has([role="dialog"]) .hb-cue-float[data-shown] {.hb-frame {transition: none;}- .hb-bento .hb-kenburns,+ .hb-bento .hb-release-slide .hb-fill,+ .hb-bento .hb-new-dot,.hb-bento .hb-caret,.hb-bento .hb-edges path {animation: none !important;diff --git a/src/components/home/home-bento.tsx b/src/components/home/home-bento.tsxindex 7e601e96..77bce6fc 100644--- a/src/components/home/home-bento.tsx+++ b/src/components/home/home-bento.tsx@@ -1,6 +1,6 @@import { ArrowRight, ArrowUpRight, Play, Sparkles, Video } from "lucide-react";import { preload } from "react-dom";-import { BentoClip, BentoMotion, BentoReel, LiveTyping, NumbersLink } from "@/components/home/bento-islands";+import { BentoClip, BentoMotion, BentoReel, BentoRelease, LiveTyping, NumbersLink, ReleaseTitle } from "@/components/home/bento-islands";import { BentoVoice } from "@/components/home/bento-voice";import { PausePreviews, ScrollCue } from "@/components/home/home-islands";import { IntentLink } from "@/components/intent-link";@@ -23,6 +23,11 @@ const SIZES = {live: "(min-width: 1024px) 570px, (min-width: 768px) 630px, calc(100vw - 32px)",/** 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.+ */+ release: "(min-width: 1024px) 280px, (min-width: 768px) 400px, calc((100vw - 44px) * 0.9)",/*** 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.@@ -80,14 +85,17 @@ function Pic({);}-/** A tile's words: its kind and how much of it, its title, and where it opens (or, on a small tile, an arrow). */-function Copy({ tile, bigMeta }: { tile: BentoTile; bigMeta?: boolean }) {+/**+ * A tile's words: its kind and how much of it, its title (`title`: in place of the tile's own), and where it opens (or,+ * on a small tile, an arrow).+ */+function Copy({ tile, bigMeta, title }: { tile: BentoTile; bigMeta?: boolean; title?: React.ReactNode }) {return (<><span aria-hidden className={s.shade} /><span aria-hidden className={s.copy}>{tile.meta && <span className={cn(s.meta, bigMeta && s.big)}>{tile.meta}</span>}- <span className={s.title}>{tile.title}</span>+ <span className={s.title}>{title ?? tile.title}</span><span className={s.cta}>{tile.cta} <ArrowRight className="size-3.5" /></span>@@ -103,11 +111,11 @@ function Copy({ tile, bigMeta }: { tile: BentoTile; bigMeta?: boolean }) {* One tile: the whole of it is one link, named by its kind, title and where it goes. (The Audio tile holds a demo's* buttons, so only its words are its link: bento-voice.tsx.)*/-function Tile({ tile, area, children, bigMeta }: { tile: BentoTile; area: string; children?: React.ReactNode; bigMeta?: boolean }) {+function Tile({ tile, area, children, bigMeta, title }: { tile: BentoTile; area: string; children?: React.ReactNode; bigMeta?: boolean; title?: React.ReactNode }) {return (<IntentLink href={tile.href} aria-label={tile.label} data-tile={tile.key} className={cn(s.tile, area)}>{children}- <Copy tile={tile} bigMeta={bigMeta} />+ <Copy tile={tile} bigMeta={bigMeta} title={title} /></IntentLink>);}@@ -233,8 +241,16 @@ export function HomeBento({ bento }: { bento: Bento }) {<BentoReel id={bento.genjutsu.id} reel={bento.genjutsu.reel} wipes={bento.genjutsu.wipes} /></Tile>- <Tile tile={tiles.image} area={s.image}>- <Pic pic={bento.image} sizes={SIZES.square} className={s.kenburns} fetchPriority="low" />+ {/*+ 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}+ </span></Tile><Tile tile={tiles.threeD} area={s.three}>diff --git a/src/components/home/home-sections.tsx b/src/components/home/home-sections.tsxindex d0b8a03e..3b3b3fcf 100644--- a/src/components/home/home-sections.tsx+++ b/src/components/home/home-sections.tsx@@ -285,7 +285,7 @@ function ReleaseTile({ art, copy }: { art: ReleaseArt; copy?: boolean }) {/*** The newest open model, first under the first screen: what it is, two ways in, and a card of pictures it made, each a- * way to start from its prompt (HOME_RELEASE in home-showcase.ts; the next release swaps the data and the pictures).+ * way to start from its prompt (HOME_RELEASE in home-release.ts; the next release swaps the data and the pictures).*/export function ReleaseSection() {const r = HOME_RELEASE;diff --git a/src/lib/home-bento.generated.ts b/src/lib/home-bento.generated.tsindex 6da7715a..4eca2ffd 100644--- a/src/lib/home-bento.generated.ts+++ b/src/lib/home-bento.generated.ts@@ -33,8 +33,6 @@ export const HOME_BENTO_MEDIA: Record<string, string> = {"/previews/home/reel-sand-storm-1024.jpg": "cab53f24","/previews/home/rotation-1024.jpg": "61a2cbc9","/previews/home/genjutsu-couple-1024.jpg": "5b931a56",- "/previews/home/image-4-480.avif": "5a6d07a1",- "/previews/home/image-4-768.avif": "ef9d1b4d","/previews/home/voice-room-480.avif": "e6981604","/previews/home/voice-room-768.avif": "8c6ccbc8","/previews/home/voice-room-1024.avif": "a919de1e",diff --git a/src/lib/home-bento.ts b/src/lib/home-bento.tsindex 9124c7aa..c2abd046 100644--- a/src/lib/home-bento.ts+++ b/src/lib/home-bento.ts@@ -4,17 +4,19 @@* published file with its content version, so nothing here is typed in twice (tests/home-bento.test.ts).*/import "server-only";+import { createHash } from "node:crypto";import fs from "node:fs/promises";import path from "node:path";import { MODELS, isListed } from "@/lib/catalog";import { getTemplate } from "@/lib/catalog/canvas";import { runsOn } from "@/lib/catalog/engines";import type { ModelDef } from "@/lib/catalog/types";-import { EXAMPLE_MEDIA } from "@/lib/examples/media.generated";import { HOME_BENTO_GENJUTSU, HOME_BENTO_MEDIA, HOME_BENTO_REEL, HOME_BENTO_TINT } from "@/lib/home-bento.generated";+import { HOME_RELEASE, releaseArtSrc, releaseHref } from "@/lib/home-release";import type { ReelClip, ReelWipe } from "@/lib/home-reel";import type { Demo } from "@/lib/live/demo";import { presetCover } from "@/lib/preset-covers";+import { RELEASE_TITLES } from "@/lib/release-day";import { templateCover } from "@/lib/template-covers";/** The preset whose clip the 3D tile plays (no other card on Home plays it: tests/home-showcase.test.ts). */@@ -31,8 +33,11 @@ export const BENTO_REEL = HOME_BENTO_REEL.map((c) => c.id);export const BENTO_REEL_ID = "home-reel";/** The width of the JPEG copy of each clip's first frame, for a browser without AVIF. */export const BENTO_CLIP_FALLBACK = 1024;-/** The Image studio's example the image tile shows and opens with (src/lib/examples/plan.json). */-export const BENTO_IMAGE_EXAMPLE = { id: "image.4", out: "/examples/image/4/out.jpg" };+/**+ * The release tile: the latest open model's pictures (HOME_RELEASE.tile, from public/previews/release/), each shown for+ * `every` ms and faded into the next over `fade` ms, and the words of its badge.+ */+export const BENTO_RELEASE = { every: 3000, fade: 900, badge: "New · Day 0" } as const;/*** The Genjutsu tile: a reel of swaps shown as they happen (HOME_BENTO_GENJUTSU, made by scripts/gen-home-bento.mjs):* Genjutsu's own Group swap example first (a couple, both people swapped in one take; the studio's cover@@ -59,7 +64,7 @@ export const BENTO_LIVE_STEPS = ["s0", "s1", "s2", "s3"];/** Where each tile goes. Each label is the navigation's name for the place (or the app's own). */export const BENTO_HREFS = {video: "/cinema",- image: `/image?example=${BENTO_IMAGE_EXAMPLE.id}`,+ release: releaseHref("image"),audio: "/audio/clean",threeD: "/image-to-3d",genjutsu: "/genjutsu",@@ -145,11 +150,30 @@ function made(file: string): string {return `${file}?v=${v}`;}-/** A published example file with its version (src/lib/examples/media.generated.ts). */-function example(file: string): string {- const m = EXAMPLE_MEDIA[file];- if (!m) throw new Error(`Home's first screen names ${file}, which isn't a published example file`);- return `${file}?v=${m.v}`;+/** A published file under public/ with its content version (the first 8 hex of its SHA-256, as the covers' URLs). */+async function versioned(file: string): Promise<string> {+ const bytes = await fs.readFile(path.join(process.cwd(), "public", file)).catch(() => null);+ if (!bytes?.length) throw new Error(`Home's first screen names ${file}, which isn't a published file`);+ return `${file}?v=${createHash("sha256").update(bytes).digest("hex").slice(0, 8)}`;+}++/** A picture on the release tile: its copies, its original size and its framing in the tile. */+export interface BentoSlide extends BentoPicture {+ width: number;+ height: number;+ position: string;+}++/** The release tile's pictures, each in its 480 and 960 px AVIF and its 480 px WebP, at their content versions. */+async function releaseSlides(release = HOME_RELEASE): Promise<BentoSlide[]> {+ return Promise.all(+ release.tile.map(async ({ slug, position }) => {+ const art = release.art.find((a) => a.slug === slug);+ if (!art) throw new Error(`Home's release tile names ${slug}, which isn't one of the release's pictures`);+ const [a480, a960, fallback] = await Promise.all([versioned(releaseArtSrc(slug, 480, "avif")), versioned(releaseArtSrc(slug, 960, "avif")), versioned(releaseArtSrc(slug, 480, "webp"))]);+ return { avif: [{ src: a480, w: 480 }, { src: a960, w: 960 }], fallback, width: art.width, height: art.height, position };+ }),+ );}/** The phrase typed before each step of the Live edit session, in its own words: every `type` since the last step. */@@ -263,11 +287,21 @@ export async function homeBento(f: BentoFacts) {href: BENTO_HREFS[key],label: `${kind}: ${title}. ${cta}`,});+ // The latest release, by its own name: the model over the title, and the studio it opens on that model. The title+ // here is the one for after its first day (the page is built once; ReleaseTitle says "today" on the day itself).+ const release: BentoTile = {+ key: "release",+ meta: HOME_RELEASE.name,+ title: RELEASE_TITLES.later,+ cta: "Try it now",+ href: BENTO_HREFS.release,+ label: `${HOME_RELEASE.name}, new: try it now`,+ };return {facts: f,tiles: {video: tile("video", "Video", `${f.videoModels} video models · ${f.motions} camera moves`, "Films, ads and shorts", "Open Cinema Studio"),- image: tile("image", "Image", `Image · ${f.imageModels} models`, "Portraits and campaigns", "Open Image"),+ release,audio: tile("audio", "Audio", `Audio · ${f.soundTools} sound tools`, "Studio-clean voice", "Open Clean up voice"),threeD: tile("threeD", "3D", `3D · ${f.models3d} models`, "Spin it in 3D", "Open Image to 3D"),genjutsu: tile("genjutsu", "Genjutsu", "Genjutsu", "Swap anyone in a clip", "Open Genjutsu"),@@ -280,10 +314,7 @@ export async function homeBento(f: BentoFacts) {canvas: tile("canvas", "Canvas", "Canvas", "Chain any step, end to end", "Open Canvas"),},video: reel(),- image: {- avif: [480, 768].map((w) => ({ src: made(`/previews/home/image-4-${w}.avif`), w })),- fallback: example(BENTO_IMAGE_EXAMPLE.out),- } satisfies BentoPicture,+ release: { ...BENTO_RELEASE, released: HOME_RELEASE.released, slides: await releaseSlides() },threeD: moving(BENTO_CLIPS.threeD, BENTO_CLIP_FILES.threeD),genjutsu: genjutsu(),voice: { room: voicePic(BENTO_VOICE.room), quiet: voicePic(BENTO_VOICE.quiet) },diff --git a/src/lib/home-release.ts b/src/lib/home-release.tsnew file mode 100644index 00000000..874be23b--- /dev/null+++ b/src/lib/home-release.ts@@ -0,0 +1,75 @@+/**+ * The newest open model on Home: its section first under the first screen (home-sections.tsx: ReleaseSection) and its+ * tile in the first screen (home-bento.tsx). No server code in it, so the first screen's data can read it too.+ */++/** A picture in the latest release's card: its file stem, its original size, and the prompt it was made from. */+export interface ReleaseArt {+ slug: string;+ /** What it shows, for its link's name ("Make your own: …"). */+ label: string;+ width: number;+ height: number;+ prompt: string;+}++/**+ * The newest open model's section, first under Home's first screen (home-sections.tsx: ReleaseSection). The next release+ * swaps this object and the pictures in `dir` (`<slug>.480.avif`, `<slug>.960.avif` and `<slug>.480.webp` each). `art`+ * leads with people and fashion; the card shows it in two rows, alternately (the 1st, 3rd, 5th… on top). `tile`: the+ * ones the first screen's release tile fades through.+ */+export const HOME_RELEASE = {+ modelId: "oss-minimax-h3-image",+ name: "MiniMax H3 Image",+ vendor: "MiniMax",+ /** The day the model came out (UTC), as YYYY-MM-DD. */+ released: "2026-11-10",+ line: "MiniMax's new image model, on Fuobe the day it came out. Photoreal people and products, painting, illustration and exact lettering, up to 4096 × 4096.",+ dir: "/previews/release/h3-image",+ art: [+ { slug: "couture-dunes", label: "couture gown on desert dunes", width: 1792, height: 2368, prompt: "A haute couture editorial photograph of a striking fashion model with luminous dark skin and a sleek high bun, wearing a sculptural crimson silk gown whose long train sweeps across rippled golden sand dunes. Golden-hour sun low behind her, the fabric lifted by the wind into a dramatic arc, deep blue sky, long soft shadows on the dunes. Shot on medium format, 50mm, rich saturated color, luxury fashion campaign." },+ { slug: "gold-leaf-beauty", label: "gold leaf beauty close-up", width: 1792, height: 2368, prompt: "A high-end beauty close-up of a strikingly beautiful model with flawless warm skin, glossy nude lips and delicate gold leaf placed along her cheekbones and eyelids, her eyes looking softly into the lens. Clean studio light with a soft glow, a warm champagne backdrop, extreme detail in the lashes and skin texture, luxury cosmetics campaign." },+ { slug: "sky-cathedral", label: "cathedral city above the clouds", width: 2720, height: 1536, prompt: "A Romantic-era oil painting of a vast golden cathedral city floating above a sea of clouds at sunrise, waterfalls pouring from its edges into the mist, flocks of white birds circling the spires. Visible brushstrokes, luminous warm light against cool blue shadows, epic sense of scale, museum masterpiece in the style of nineteenth-century landscape painting." },+ { slug: "snow-leopard", label: "snow leopard in falling snow", width: 2368, height: 1792, prompt: "A wildlife photograph of a snow leopard resting on a rocky Himalayan ridge in gently falling snow, its pale eyes looking straight at the camera, thick spotted fur dusted with snowflakes. Soft overcast light, distant blue mountains fading in the mist, long telephoto lens, National Geographic cover quality." },+ { slug: "day-zero-poster", label: "risograph Day Zero poster", width: 1792, height: 2368, prompt: "A two-colour risograph art poster in fluorescent pink and deep blue with visible halftone dots, slight misregistration and grainy paper texture. A large halftone portrait of a beautiful woman in profile with flowing hair fills the centre, overprinted in pink over blue. Bold condensed letters across the top read \"DAY ZERO\". A small line at the bottom reads \"NEW MODELS, THE DAY THEY LAND\". Contemporary independent design studio poster, striking and collectible." },+ { slug: "cliff-villa", label: "villa over a sea cliff", width: 2720, height: 1536, prompt: "An architectural photograph of a minimalist concrete villa cantilevered over a sea cliff at dusk, floor-to-ceiling glass glowing with warm interior light, an infinity pool reflecting a lavender and peach sky, turquoise water far below breaking on dark rocks. Wide-angle, perfectly level verticals, calm and serene, award-winning architecture magazine cover." },+ { slug: "emerald-watch", label: "gold watch with a green dial", width: 2368, height: 1792, prompt: "A luxury product photograph of a slim gold wristwatch with a deep green sunburst dial resting on a polished block of black obsidian, tiny water droplets beading on the glass and stone. A single soft key light from above left, crisp reflections on the bezel, dark charcoal background with a faint emerald glow. Macro lens, razor-sharp detail, high-end jewellery advertising." },+ { slug: "rooftop-anime", label: "anime rooftop at dusk", width: 1536, height: 2720, prompt: "A cinematic anime illustration of an elegant woman in her late twenties with long silver hair, wearing a flowing midnight-blue long coat over a fitted white blouse, standing on a Tokyo rooftop garden at dusk as cherry blossom petals drift past, the city lights glowing below under a pink and violet sky. Confident calm expression, clean line art, soft cel shading, glowing rim light, richly detailed background art in the style of a feature animation film." },+ { slug: "ringed-planet", label: "ringed planet over an alien sea", width: 2720, height: 1536, prompt: "A cinematic science-fiction matte painting: an enormous ringed gas giant rising over a calm alien ocean at twilight, its rings casting a bright arc across the sky, a lone white sailboat on the mirror-still water, two small moons above the horizon. Teal and amber palette, soft atmospheric haze, photoreal detail, blockbuster film concept art." },+ { slug: "harbour-racer", label: "race car on a harbour road", width: 2720, height: 1536, prompt: "A cinematic automotive photograph of a sleek silver vintage-style race car with a long bonnet and round headlights, parked on a wet harbour road at night, yachts and city lights reflected in the black water behind it, warm streetlights glinting along its curves. Low angle, anamorphic look, shallow depth of field, luxury automotive campaign." },+ { slug: "clay-island", label: "clay island town", width: 2048, height: 2048, prompt: "A charming claymation-style miniature diorama of a tiny seaside town on a floating island: pastel houses, a red-and-white lighthouse, little boats in the harbour and fluffy cotton clouds around it. Soft studio lighting, tilt-shift depth of field, handmade plasticine texture with visible fingerprints, playful stop-motion film still." },+ { slug: "peony-watercolor", label: "peonies in watercolour", width: 1792, height: 2368, prompt: "A delicate botanical watercolor painting of blush pink peonies and soft green leaves with a ruby-throated hummingbird hovering beside the largest bloom. Loose translucent washes, fine ink details, gentle color blooms on textured cotton paper, plenty of white space, fine-art illustration." },+ { slug: "chocolate-dome", label: "chocolate dome dessert", width: 2048, height: 2048, prompt: "A fine-dining dessert plated on a matte black ceramic plate: a glossy dark chocolate dome with a single gold leaf, a quenelle of raspberry sorbet, scattered fresh raspberries and a thin swoosh of vanilla cream. Moody side light, shallow depth of field, a soft reflection on the table, Michelin-star restaurant food photography." },+ { slug: "japandi-room", label: "Japandi living room", width: 2368, height: 1792, prompt: "An interior design photograph of a serene Japandi living room in soft morning light: a low oak sofa with linen cushions, a hand-thrown ceramic vase with a single branch, paper lanterns, a shoji screen and a large window onto a misty bamboo garden. Warm neutral palette, clean lines, gentle shadows, architectural digest editorial." },+ ] satisfies ReleaseArt[],+ /**+ * The pictures the first screen's release tile fades through, in order (each one of `art`), and where each is framed+ * in the tile (its object-position; the slow zoom closes in on the same point). The first shows from the first paint.+ */+ tile: [+ { slug: "couture-dunes", position: "62% 42%" },+ { slug: "gold-leaf-beauty", position: "50% 40%" },+ { slug: "sky-cathedral", position: "50% 45%" },+ { slug: "day-zero-poster", position: "50% 0%" },+ { slug: "snow-leopard", position: "50% 45%" },+ { slug: "emerald-watch", position: "50% 55%" },+ ],+};++/**+ * A studio on the release's model, with a prompt filled in when one is given. The studio only prefills it: a run starts+ * when the person presses Generate (no `go` token here, src/lib/composer.ts START_PARAM).+ */+export const releaseHref = (studio: "image" | "edit", prompt?: string) =>+ `/${studio}?model=${HOME_RELEASE.modelId}${prompt ? `&prompt=${encodeURIComponent(prompt)}` : ""}`;++const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];+/** The release's pill: "Day-0 release · 10 Nov". */+export function releasePill(released = HOME_RELEASE.released) {+ const [, month, day] = released.split("-").map(Number);+ return `Day-0 release · ${day} ${MONTHS[month - 1]}`;+}++/** A release picture's file at a width (480 or 960) and format. */+export const releaseArtSrc = (slug: string, w: 480 | 960, ext: "avif" | "webp") => `${HOME_RELEASE.dir}/${slug}.${w}.${ext}`;diff --git a/src/lib/home-showcase.ts b/src/lib/home-showcase.tsindex 8b04814e..f4815510 100644--- a/src/lib/home-showcase.ts+++ b/src/lib/home-showcase.ts@@ -22,6 +22,9 @@ import { studioCoverCard, toPresetCard } from "@/lib/preset-card-data";import { PRESET_BEFORE_AFTER } from "@/lib/preset-before-after.generated";import { onPeak, thumbOf, type PresetCardData } from "@/lib/preset-cards";+// The latest release has a module of its own (Home's first screen reads it too); its names stay importable from here.+export { HOME_RELEASE, releaseArtSrc, releaseHref, releasePill, type ReleaseArt } from "@/lib/home-release";+/*** Captions and kinds for these presets' tiles elsewhere (a studio's row of examples reads them: studio-examples.ts), in* a line that fits a phone's tile (HOME_CAPTION_MAX.wall). Home itself opens on its first screen's grid (home-bento.ts).@@ -73,8 +76,7 @@ export const HOME_EFFECTS = [];/**- * Four rows, as the effects (HOME_EFFECTS). None repeats the first screen: its video tile plays One take, and its image- * tile is the gold sequins on the sea cliff (Glam's cover).+ * Four rows, as the effects (HOME_EFFECTS). None repeats the first screen: its video tile plays One take.*/export const HOME_MOTIONS = [{ id: "motion-dolly-in", caption: "A slow push in through the library" },@@ -185,64 +187,6 @@ export const HOME_BODY_DOUBLE = {line: "Every person in a photo or a clip becomes their double, clothes and hair included, with a full 3D body you can animate. Or go live with your camera, right in the browser.",};-/** A picture in the latest release's card: its file stem, its original size, and the prompt it was made from. */-export interface ReleaseArt {- slug: string;- /** What it shows, for its link's name ("Make your own: …"). */- label: string;- width: number;- height: number;- prompt: string;-}--/**- * The newest open model's section, first under Home's first screen (home-sections.tsx: ReleaseSection). The next release- * swaps this object and the pictures in `dir` (`<slug>.480.avif`, `<slug>.960.avif` and `<slug>.480.webp` each). `art`- * leads with people and fashion; the card shows it in two rows, alternately (the 1st, 3rd, 5th… on top).- */-export const HOME_RELEASE = {- modelId: "oss-minimax-h3-image",- name: "MiniMax H3 Image",- vendor: "MiniMax",- /** The day the model came out (UTC), as YYYY-MM-DD. */- released: "2026-11-10",- line: "MiniMax's new image model, on Fuobe the day it came out. Photoreal people and products, painting, illustration and exact lettering, up to 4096 × 4096.",- dir: "/previews/release/h3-image",- art: [- { slug: "couture-dunes", label: "couture gown on desert dunes", width: 1792, height: 2368, prompt: "A haute couture editorial photograph of a striking fashion model with luminous dark skin and a sleek high bun, wearing a sculptural crimson silk gown whose long train sweeps across rippled golden sand dunes. Golden-hour sun low behind her, the fabric lifted by the wind into a dramatic arc, deep blue sky, long soft shadows on the dunes. Shot on medium format, 50mm, rich saturated color, luxury fashion campaign." },- { slug: "gold-leaf-beauty", label: "gold leaf beauty close-up", width: 1792, height: 2368, prompt: "A high-end beauty close-up of a strikingly beautiful model with flawless warm skin, glossy nude lips and delicate gold leaf placed along her cheekbones and eyelids, her eyes looking softly into the lens. Clean studio light with a soft glow, a warm champagne backdrop, extreme detail in the lashes and skin texture, luxury cosmetics campaign." },- { slug: "sky-cathedral", label: "cathedral city above the clouds", width: 2720, height: 1536, prompt: "A Romantic-era oil painting of a vast golden cathedral city floating above a sea of clouds at sunrise, waterfalls pouring from its edges into the mist, flocks of white birds circling the spires. Visible brushstrokes, luminous warm light against cool blue shadows, epic sense of scale, museum masterpiece in the style of nineteenth-century landscape painting." },- { slug: "snow-leopard", label: "snow leopard in falling snow", width: 2368, height: 1792, prompt: "A wildlife photograph of a snow leopard resting on a rocky Himalayan ridge in gently falling snow, its pale eyes looking straight at the camera, thick spotted fur dusted with snowflakes. Soft overcast light, distant blue mountains fading in the mist, long telephoto lens, National Geographic cover quality." },- { slug: "day-zero-poster", label: "risograph Day Zero poster", width: 1792, height: 2368, prompt: "A two-colour risograph art poster in fluorescent pink and deep blue with visible halftone dots, slight misregistration and grainy paper texture. A large halftone portrait of a beautiful woman in profile with flowing hair fills the centre, overprinted in pink over blue. Bold condensed letters across the top read \"DAY ZERO\". A small line at the bottom reads \"NEW MODELS, THE DAY THEY LAND\". Contemporary independent design studio poster, striking and collectible." },- { slug: "cliff-villa", label: "villa over a sea cliff", width: 2720, height: 1536, prompt: "An architectural photograph of a minimalist concrete villa cantilevered over a sea cliff at dusk, floor-to-ceiling glass glowing with warm interior light, an infinity pool reflecting a lavender and peach sky, turquoise water far below breaking on dark rocks. Wide-angle, perfectly level verticals, calm and serene, award-winning architecture magazine cover." },- { slug: "emerald-watch", label: "gold watch with a green dial", width: 2368, height: 1792, prompt: "A luxury product photograph of a slim gold wristwatch with a deep green sunburst dial resting on a polished block of black obsidian, tiny water droplets beading on the glass and stone. A single soft key light from above left, crisp reflections on the bezel, dark charcoal background with a faint emerald glow. Macro lens, razor-sharp detail, high-end jewellery advertising." },- { slug: "rooftop-anime", label: "anime rooftop at dusk", width: 1536, height: 2720, prompt: "A cinematic anime illustration of an elegant woman in her late twenties with long silver hair, wearing a flowing midnight-blue long coat over a fitted white blouse, standing on a Tokyo rooftop garden at dusk as cherry blossom petals drift past, the city lights glowing below under a pink and violet sky. Confident calm expression, clean line art, soft cel shading, glowing rim light, richly detailed background art in the style of a feature animation film." },- { slug: "ringed-planet", label: "ringed planet over an alien sea", width: 2720, height: 1536, prompt: "A cinematic science-fiction matte painting: an enormous ringed gas giant rising over a calm alien ocean at twilight, its rings casting a bright arc across the sky, a lone white sailboat on the mirror-still water, two small moons above the horizon. Teal and amber palette, soft atmospheric haze, photoreal detail, blockbuster film concept art." },- { slug: "harbour-racer", label: "race car on a harbour road", width: 2720, height: 1536, prompt: "A cinematic automotive photograph of a sleek silver vintage-style race car with a long bonnet and round headlights, parked on a wet harbour road at night, yachts and city lights reflected in the black water behind it, warm streetlights glinting along its curves. Low angle, anamorphic look, shallow depth of field, luxury automotive campaign." },- { slug: "clay-island", label: "clay island town", width: 2048, height: 2048, prompt: "A charming claymation-style miniature diorama of a tiny seaside town on a floating island: pastel houses, a red-and-white lighthouse, little boats in the harbour and fluffy cotton clouds around it. Soft studio lighting, tilt-shift depth of field, handmade plasticine texture with visible fingerprints, playful stop-motion film still." },- { slug: "peony-watercolor", label: "peonies in watercolour", width: 1792, height: 2368, prompt: "A delicate botanical watercolor painting of blush pink peonies and soft green leaves with a ruby-throated hummingbird hovering beside the largest bloom. Loose translucent washes, fine ink details, gentle color blooms on textured cotton paper, plenty of white space, fine-art illustration." },- { slug: "chocolate-dome", label: "chocolate dome dessert", width: 2048, height: 2048, prompt: "A fine-dining dessert plated on a matte black ceramic plate: a glossy dark chocolate dome with a single gold leaf, a quenelle of raspberry sorbet, scattered fresh raspberries and a thin swoosh of vanilla cream. Moody side light, shallow depth of field, a soft reflection on the table, Michelin-star restaurant food photography." },- { slug: "japandi-room", label: "Japandi living room", width: 2368, height: 1792, prompt: "An interior design photograph of a serene Japandi living room in soft morning light: a low oak sofa with linen cushions, a hand-thrown ceramic vase with a single branch, paper lanterns, a shoji screen and a large window onto a misty bamboo garden. Warm neutral palette, clean lines, gentle shadows, architectural digest editorial." },- ] satisfies ReleaseArt[],-};--/**- * A studio on the release's model, with a prompt filled in when one is given. The studio only prefills it: a run starts- * when the person presses Generate (no `go` token here, src/lib/composer.ts START_PARAM).- */-export const releaseHref = (studio: "image" | "edit", prompt?: string) =>- `/${studio}?model=${HOME_RELEASE.modelId}${prompt ? `&prompt=${encodeURIComponent(prompt)}` : ""}`;--const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];-/** The release's pill: "Day-0 release · 10 Nov". */-export function releasePill(released = HOME_RELEASE.released) {- const [, month, day] = released.split("-").map(Number);- return `Day-0 release · ${day} ${MONTHS[month - 1]}`;-}--/** A release picture's file at a width (480 or 960) and format. */-export const releaseArtSrc = (slug: string, w: 480 | 960, ext: "avif" | "webp") => `${HOME_RELEASE.dir}/${slug}.${w}.${ext}`;-/** Assist's starter skills, as its empty chat lists them first (assist-view.tsx). */export const HOME_SKILLS = ["product-photoshoot", "ugc-video", "thumbnail-generation", "faceless-video", "short-film", "localization"];@@ -269,8 +213,8 @@ export const HOME_NEW_OPEN = [];/**- * The chips under the composer. Each fills it with a prompt that looks like a picture on this page (the gold sequins- * on the first screen, Relight under Apps); nothing runs until Start. Whoever runs the studio gets Assist's chip in+ * The chips under the composer. Each fills it with a prompt in the spirit of the pictures on this page (Relight under+ * Apps among them); nothing runs until Start. Whoever runs the studio gets Assist's chip in* place of the last (home-view.tsx): only the owner can use Assist.*/export const HOME_TRY = [diff --git a/src/lib/release-day.ts b/src/lib/release-day.tsnew file mode 100644index 00000000..4dd2ab03--- /dev/null+++ b/src/lib/release-day.ts@@ -0,0 +1,9 @@+/**+ * The release tile's title (home-bento.tsx), by the day: "today" only on the day the model came out (UTC), then a title+ * that stays true. Home is prerendered, so the page is built with the later title and the tile changes it in the+ * browser on the day itself (ReleaseTitle in bento-islands.tsx). No other code in this module: the browser loads it.+ */+export const RELEASE_TITLES = { today: "Live on Fuobe today", later: "Now on Fuobe" } as const;++/** The title for a release that came out on `released` (YYYY-MM-DD, UTC), as seen at `now`. */+export const releaseTitle = (released: string, now: Date) => (now.toISOString().slice(0, 10) === released ? RELEASE_TITLES.today : RELEASE_TITLES.later);diff --git a/tests/e2e/home-bento.mjs b/tests/e2e/home-bento.mjsindex cdaae180..4eb387c3 100644--- a/tests/e2e/home-bento.mjs+++ b/tests/e2e/home-bento.mjs@@ -99,7 +99,7 @@ const WIDTHS = [{ w: 1440, h: 900 },{ w: 1920, h: 1080 },];-const TILES = ["video", "live", "genjutsu", "image", "threeD", "audio", "numbers", "canvas"];+const TILES = ["video", "live", "genjutsu", "release", "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). */diff --git a/tests/home-bento.test.ts b/tests/home-bento.test.tsindex fcc54666..16e5d855 100644--- a/tests/home-bento.test.ts+++ b/tests/home-bento.test.ts@@ -31,9 +31,10 @@ vi.mock("next/navigation", () => ({useSearchParams: () => new URLSearchParams(),}));-const { BENTO_BOARD, BENTO_CLIPS, BENTO_CLIP_WIDTHS, BENTO_GENJUTSU, BENTO_GENJUTSU_WIDTHS, BENTO_HREFS, BENTO_IMAGE_EXAMPLE, BENTO_REEL, BENTO_REEL_ID, BENTO_VOICE, livePhrases, openModelsOf } =+const { BENTO_BOARD, BENTO_CLIPS, BENTO_CLIP_WIDTHS, BENTO_GENJUTSU, BENTO_GENJUTSU_WIDTHS, BENTO_HREFS, BENTO_REEL, BENTO_RELEASE, BENTO_REEL_ID, BENTO_VOICE, livePhrases, openModelsOf } =await import("@/lib/home-bento");-const { HOME_BEFORE_AFTER, HOME_EFFECTS, HOME_MOTIONS, HOME_REVEALS, HOME_STUDIOS, homeShowcase, navLabel } = await import("@/lib/home-showcase");+const { HOME_BEFORE_AFTER, HOME_EFFECTS, HOME_MOTIONS, HOME_RELEASE, HOME_REVEALS, HOME_STUDIOS, homeShowcase, navLabel, releaseArtSrc, releaseHref } = await import("@/lib/home-showcase");+const { RELEASE_TITLES } = await import("@/lib/release-day");const { HomeBento } = await import("@/components/home/home-bento");const { voiceButton } = await import("@/components/home/bento-voice");@@ -166,7 +167,7 @@ describe("Home's first screen", () => {});it("lists every picture at its real width", async () => {- const pictures: BentoPicture[] = [bento.video.poster, bento.threeD.poster, bento.image, bento.genjutsu.poster, bento.genjutsu.still, bento.voice.room, bento.voice.quiet, ...bento.live.frames];+ const pictures: BentoPicture[] = [bento.video.poster, bento.threeD.poster, ...bento.release.slides, bento.genjutsu.poster, bento.genjutsu.still, bento.voice.room, bento.voice.quiet, ...bento.live.frames];for (const p of pictures)for (const a of p.avif) {const m = await sharp(file(a.src)).metadata();@@ -218,16 +219,13 @@ describe("Home's first screen", () => {return HUB_MODES[hub as keyof typeof HUB_MODES].some((m) => m.id === mode) && fs.existsSync(path.join(root, "src", "app", "(studio)", hub, "[mode]", "page.tsx"));return fs.existsSync(path.join(root, "src", "app", "(studio)", seg, "page.tsx"));};- for (const href of [BENTO_HREFS.video, BENTO_HREFS.image, BENTO_HREFS.audio, BENTO_HREFS.threeD, BENTO_HREFS.genjutsu, BENTO_HREFS.live, BENTO_HREFS.canvas])+ for (const href of [BENTO_HREFS.video, BENTO_HREFS.release, BENTO_HREFS.audio, BENTO_HREFS.threeD, BENTO_HREFS.genjutsu, BENTO_HREFS.live, BENTO_HREFS.canvas])expect(route(href), href).toBe(true);- const plan = JSON.parse(fs.readFileSync(path.join(root, "src", "lib", "examples", "plan.json"), "utf8")) as { id: string; surface: string; output?: string }[];- expect(plan.find((r) => r.id === BENTO_IMAGE_EXAMPLE.id)).toMatchObject({ surface: "studio:image", output: BENTO_IMAGE_EXAMPLE.out });expect(BENTO_HREFS.numbers).toBe("#home-studios");expect(fs.readFileSync(path.join(root, "src", "components", "home", "home-sections.tsx"), "utf8")).toContain('id="home-studios"');// The words each link ends on are the place's own name.const t = bento.tiles;expect(t.video.cta).toBe(`Open ${navLabel("/cinema")}`);- expect(t.image.cta).toBe(`Open ${navLabel("/image")}`);// The Audio tile plays Clean up voice's demo, and opens that mode's own page.expect(BENTO_HREFS.audio).toBe("/audio/clean");expect(t.audio.cta).toBe(`Open ${HUB_MODES.audio.find((m) => m.id === "clean")!.label}`);@@ -241,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", "image", "threeD", "audio", "numbers", "canvas"]);- expect(tiles.map((a) => /data-tile="([^"]+)"/.exec(a)![1])).toEqual(["video", "live", "genjutsu", "image", "threeD", "numbers", "canvas"]);+ 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"]);const audioLink = links.find((a) => a.includes(`href="${BENTO_HREFS.audio}"`));expect(audioLink).toBeTruthy();expect(links).toHaveLength(8);@@ -251,7 +249,7 @@ describe("Home's first screen", () => {expect(label, a).toBeTruthy();expect(label!.length).toBeGreaterThan(10);}- const KINDS = { video: "Video", image: "Image", audio: "Audio", threeD: "3D", genjutsu: "Genjutsu", live: "Live edit", canvas: "Canvas" };+ const KINDS = { video: "Video", audio: "Audio", threeD: "3D", genjutsu: "Genjutsu", live: "Live edit", canvas: "Canvas" };for (const [key, kind] of Object.entries(KINDS)) {const t = bento.tiles[key as keyof typeof KINDS];expect(t.label).toBe(`${kind}: ${t.title}. ${t.cta}`);@@ -296,13 +294,19 @@ describe("Home's first screen", () => {for (const w of m.slice(1).filter(Boolean)) expect(w.replace(/\$\{[^}]+\}/g, "").replace(/3D/g, ""), w).not.toMatch(/\d/);});- it("reads plainly: no model or maker names, no status or prompt words", () => {- const visible = html+ it("reads plainly: no model or maker names but the release tile's own, no status or prompt words", () => {+ // The release tile names its model, by design (checked on its own below).+ const release = /<a [^>]*data-tile="release"[\s\S]*?<\/a>/.exec(html)![0];+ expect(release).toContain(`>${HOME_RELEASE.name}<`);+ const others = html.replace(release, "");+ const visible = others.replace(/<[^>]+>/g, " ").replace(/'|"|&/g, " ").replace(/\s+/g, " ");- const labels = [...html.matchAll(/aria-label="([^"]+)"/g)].map((m) => m[1]);- const texts = [visible.replace(/Rendered locally on ComfyUI, on one RTX 5090\.|Every preview on this page was rendered locally on ComfyUI, on one RTX 5090\./g, ""), ...labels];+ const labels = [...others.matchAll(/aria-label="([^"]+)"/g)].map((m) => m[1]);+ // The release tile's words without its model's name and the site's (its title: "Now on Fuobe"): plain too.+ const own = release.replace(/<[^>]+>/g, " ").replaceAll(HOME_RELEASE.name, " ").replace(/\bFuobe\b/g, " ").replace(/\s+/g, " ");+ const texts = [own, bento.tiles.release.label.replace(HOME_RELEASE.name, ""), visible.replace(/Rendered locally on ComfyUI, on one RTX 5090\.|Every preview on this page was rendered locally on ComfyUI, on one RTX 5090\./g, ""), ...labels];const WORDS = new Set(["Relight", "Runway", "Canvas", "Image", "Audio", "Video"]);const names = [...new Set(MODELS.flatMap((m) => [m.name, m.vendor]).filter((n): n is string => !!n && n.trim().length >= 3 && !WORDS.has(n)))];const status = /\b(unverified|not checked|todo|tbd|test|placeholder|demo|preview made with|gpu|comfy|lora|checkpoint)\b/i;@@ -399,4 +403,69 @@ describe("Home's first screen", () => {expect(photo.thumb).toMatch(/^\/previews\/home\/board-photo\.webp\?v=/);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", () => {+ const tile = /<a [^>]*data-tile="release"[\s\S]*?<\/a>/.exec(html)![0];+ const open = /^<a [^>]*>/.exec(tile)![0];+ const decode = (v: string) => v.replace(/&/g, "&");+ expect(BENTO_HREFS.release).toBe(releaseHref("image"));+ expect(decode(/href="([^"]+)"/.exec(open)![1])).toBe(`/image?model=${HOME_RELEASE.modelId}`);+ expect(/aria-label="([^"]+)"/.exec(open)![1]).toBe(`${HOME_RELEASE.name}, new: try it now`);+ expect(bento.tiles.release.label).toBe(`${HOME_RELEASE.name}, new: try it now`);+ // Its words: the badge, the model's name over the title (the later one in the HTML: the page is built once), the link's.+ const words = tile.replace(/<[^>]+>/g, "|").split("|").map((w) => w.trim()).filter(Boolean);+ expect(words).toEqual([BENTO_RELEASE.badge, HOME_RELEASE.name, RELEASE_TITLES.later, bento.tiles.release.cta]);+ expect(BENTO_RELEASE.badge).toBe("New · Day 0");+ expect(bento.tiles.release.cta).toBe("Try it now");+ // The tile it took the place of is gone, files and all (the folder test above holds the rest of previews/home).+ expect(Object.keys(bento.tiles)).not.toContain("image");+ expect(html).not.toMatch(/\/previews\/home\/image-4|Portraits and campaigns/);+ });++ it("fades through the release's own pictures, the first one in the HTML and the rest once it plays", () => {+ const r = bento.release;+ expect(r.released).toBe(HOME_RELEASE.released);+ expect([r.every, r.fade]).toEqual([BENTO_RELEASE.every, BENTO_RELEASE.fade]);+ expect(r.fade).toBeLessThan(r.every);+ expect(r.slides).toHaveLength(HOME_RELEASE.tile.length);+ for (const [i, { slug, position }] of HOME_RELEASE.tile.entries()) {+ const p = r.slides[i];+ const art = HOME_RELEASE.art.find((a) => a.slug === slug)!;+ // The release folder's own files (none copied into previews/home), each at its content version.+ expect(p.avif.map((a) => a.w)).toEqual([480, 960]);+ for (const [url, src] of [+ [p.avif[0].src, releaseArtSrc(slug, 480, "avif")],+ [p.avif[1].src, releaseArtSrc(slug, 960, "avif")],+ [p.fallback, releaseArtSrc(slug, 480, "webp")],+ ] as const)+ expect(url).toBe(`${src}?v=${contentVersion([file(src)])}`);+ expect([p.width, p.height]).toEqual([art.width, art.height]);+ expect(p.position).toBe(position);+ }+ const tile = /<a [^>]*data-tile="release"[\s\S]*?<\/a>/.exec(html)![0];+ // Only the first picture is in the HTML, shown, with nothing under it; decorative (the link names the tile).+ const imgs = [...tile.matchAll(/<img\b[^>]*>/g)].map((m) => m[0]);+ expect(imgs).toHaveLength(1);+ expect(imgs[0]).toContain('alt=""');+ expect(imgs[0]).toContain(`src="${r.slides[0].fallback}"`);+ expect(imgs[0]).not.toContain('loading="lazy"');+ 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);+ });++ it("moves the release tile only while the first screen plays, and never under reduced motion", () => {+ const css = fs.readFileSync(path.join(root, "src", "components", "home", "home-bento.css"), "utf8");+ // Its zoom and the badge's pulse run under data-play only ("1": running, "0": frozen); without it the first picture rests.+ for (const sel of [".hb-release-slide:is([data-on], [data-prev]) .hb-fill", ".hb-new-dot"]) {+ expect(css).toContain(`.hb-bento[data-play] ${sel} {`);+ expect(css).toContain(`.hb-bento[data-play="1"] ${sel} {`);+ }+ expect(css).not.toMatch(/^\.hb-release-slide[^{]*\{[^}]*animation:/m);+ // 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);+ });});diff --git a/tests/home-release.test.ts b/tests/home-release.test.tsindex a30026bf..80ec1e54 100644--- a/tests/home-release.test.ts+++ b/tests/home-release.test.ts@@ -6,9 +6,10 @@ import { renderToStaticMarkup } from "react-dom/server";import { describe, expect, it, vi } from "vitest";/*- * Home's latest-release section (HOME_RELEASE in src/lib/home-showcase.ts, ReleaseSection in home-sections.tsx): every+ * Home's latest-release section (HOME_RELEASE in src/lib/home-release.ts, ReleaseSection in home-sections.tsx): every* picture has its files in public/ and its prompt, and every tile opens the Image studio on the model with that prompt- * filled in, without starting a run.+ * filled in, without starting a run. The first screen's release tile (tests/home-bento.test.ts) fades through some of+ * them, and its title says "today" on the day the model came out only.*/vi.mock("next/cache", () => ({ cacheLife: () => {} }));@@ -21,6 +22,7 @@ vi.mock("next/navigation", () => ({const { ReleaseSection } = await import("@/components/home/home-sections");const { HOME_RELEASE, releaseArtSrc, releaseHref, releasePill } = await import("@/lib/home-showcase");const { START_PARAM } = await import("@/lib/composer");+const { RELEASE_TITLES, releaseTitle } = await import("@/lib/release-day");const root = process.cwd();const size = (url: string) => fs.statSync(path.join(root, "public", url), { throwIfNoEntry: false })?.size ?? 0;@@ -55,6 +57,26 @@ describe("Home's latest release", () => {for (const f of fs.readdirSync(dir)) expect(slugs, f).toContain(f.split(".")[0]);});+ it("picks the first screen's tile pictures from its own, people and fashion first", () => {+ const slugs = HOME_RELEASE.tile.map((t) => t.slug);+ expect(slugs).toHaveLength(6);+ expect(new Set(slugs).size).toBe(slugs.length);+ for (const t of HOME_RELEASE.tile) {+ expect(HOME_RELEASE.art.map((a) => a.slug), t.slug).toContain(t.slug);+ expect(t.position).toMatch(/^\d+% \d+%$/);+ }+ expect(slugs.slice(0, 2)).toEqual(HOME_RELEASE.art.slice(0, 2).map((a) => a.slug));+ });++ it("says \"today\" on the release tile on the day the model came out (UTC), and a title that stays true after", () => {+ expect(releaseTitle("2026-11-10", new Date("2026-11-10T00:00:00Z"))).toBe(RELEASE_TITLES.today);+ expect(releaseTitle("2026-11-10", new Date("2026-11-10T23:59:59Z"))).toBe(RELEASE_TITLES.today);+ expect(releaseTitle("2026-11-10", new Date("2026-11-11T00:00:00Z"))).toBe(RELEASE_TITLES.later);+ expect(releaseTitle("2026-11-10", new Date("2027-03-01T12:00:00Z"))).toBe(RELEASE_TITLES.later);+ expect(RELEASE_TITLES).toEqual({ today: "Live on Fuobe today", later: "Now on Fuobe" });+ expect(RELEASE_TITLES.later).not.toMatch(/today|new/i);+ });+it("opens the studios on the model, a tile with its prompt filled in and no run started", () => {const tile = new URL(releaseHref("image", HOME_RELEASE.art[0].prompt), "https://x.test");expect(tile.pathname).toBe("/image");