diff --git a/README.md b/README.md index 46ee5f7..546680a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ private, optional); `SITE_REPO_TOKEN` in the app repository. - **Screenshots:** `pnpm site:shots` in the app repository renders them at 1440 × 900 @2x into `src/assets/shots/`. `scripts/crop-shots.mjs` cuts each one to the region in `src/data/crops.ts` before every build. Missing files render as marked placeholders. -- **Build film:** `hero.mp4` + `hero-poster.png` open in a dialog from the hero button "Watch it build". +- **Hero films:** `hero-loop.webm`/`.mp4` (40 s, silent) plays in the hero stage, `hero.webm`/`.mp4` (the 2:04 overview) opens in a dialog from "Watch the overview"; `hero-poster.jpg` is the poster of both. Source: `renders/marketing/hero-app` in the app repo. - **Lighthouse on this server:** run Chrome with `--disable-gpu`. Without a GPU, headless Chrome waits up to 350 ms for its software GPU process, which shows up as about 1.5 s of blocking time. - **Dark only:** the site uses the `-dark.png` shots and falls back to `.png`. diff --git a/src/assets/shots/hero-loop.mp4 b/src/assets/shots/hero-loop.mp4 new file mode 100644 index 0000000..98732c1 Binary files /dev/null and b/src/assets/shots/hero-loop.mp4 differ diff --git a/src/assets/shots/hero-loop.webm b/src/assets/shots/hero-loop.webm new file mode 100644 index 0000000..a911e7e Binary files /dev/null and b/src/assets/shots/hero-loop.webm differ diff --git a/src/assets/shots/hero-poster.jpg b/src/assets/shots/hero-poster.jpg new file mode 100644 index 0000000..89a4559 Binary files /dev/null and b/src/assets/shots/hero-poster.jpg differ diff --git a/src/assets/shots/hero-poster.png b/src/assets/shots/hero-poster.png deleted file mode 100644 index f05542a..0000000 Binary files a/src/assets/shots/hero-poster.png and /dev/null differ diff --git a/src/assets/shots/hero.mp4 b/src/assets/shots/hero.mp4 index 2e08b83..76357d2 100644 Binary files a/src/assets/shots/hero.mp4 and b/src/assets/shots/hero.mp4 differ diff --git a/src/assets/shots/hero.webm b/src/assets/shots/hero.webm new file mode 100644 index 0000000..df32516 Binary files /dev/null and b/src/assets/shots/hero.webm differ diff --git a/src/pages/index.astro b/src/pages/index.astro index 181f5c3..b7e9577 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -13,12 +13,15 @@ const privacyIcons = [FolderLock, Cpu, EyeOff]; const markIcon = { yes: Check, no: X, part: Minus }; const markLabel = { yes: 'Yes', no: 'No', part: 'Partly' }; -// The produced build film (src/assets/shots/hero.mp4 + hero-poster.png) opens in a dialog. -const videos = import.meta.glob('../assets/shots/hero.mp4', { eager: true, query: '?url', import: 'default' }); -const posters = import.meta.glob<{ default: ImageMetadata }>('../assets/shots/hero-poster.png', { eager: true }); -const film = Object.values(videos)[0]; +// The produced films in src/assets/shots: hero-loop.{webm,mp4} plays silently in the hero stage, +// hero.{webm,mp4} (the whole overview) opens in a dialog; hero-poster.jpg stands in for both. +const videos = import.meta.glob('../assets/shots/hero{,-loop}.{webm,mp4}', { eager: true, query: '?url', import: 'default' }); +const video = (name: string) => Object.entries(videos).filter(([p]) => p.split('/').pop()!.startsWith(name + '.')).map(([p, src]) => ({ src, type: 'video/' + p.split('.').pop() })).sort((a) => (a.type === 'video/webm' ? -1 : 1)); +const posters = import.meta.glob<{ default: ImageMetadata }>('../assets/shots/hero-poster.jpg', { eager: true }); +const film = video('hero'); +const loop = video('hero-loop'); const posterSrc = Object.values(posters)[0]?.default; -const poster = posterSrc && (await getImage({ src: posterSrc, width: Math.min(1100, posterSrc.width), format: 'webp', quality: 70 })); +const poster = posterSrc && (await getImage({ src: posterSrc, width: Math.min(1300, posterSrc.width), format: 'webp', quality: 72 })); const title = 'PartBuddy · Parts that fit. First print.'; const description = @@ -70,18 +73,27 @@ const jsonLd = { {RELEASED ? : Follow the build} - {film - ? + {film.length + ? : See how it works}

{hero.fine}{MAC_URL && <> · macOS test build}

{RELEASED &&

Needs the free CAD engine SolidCraft {SOLIDCRAFT.version}.

} -
- -
+ {loop.length && poster + ?
+
+ +
+
+ :
+ +
}

Works with

    {worksWith.map((w) => )}
@@ -293,13 +305,18 @@ const jsonLd = {
- {film && ( - + {film.length > 0 && ( +
- +