Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<name>-dark.png` shots and falls back to `<name>.png`.
Expand Down
Binary file added src/assets/shots/hero-loop.mp4
Binary file not shown.
Binary file added src/assets/shots/hero-loop.webm
Binary file not shown.
Binary file added src/assets/shots/hero-poster.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/shots/hero-poster.png
Binary file not shown.
Binary file modified src/assets/shots/hero.mp4
Binary file not shown.
Binary file added src/assets/shots/hero.webm
Binary file not shown.
45 changes: 31 additions & 14 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>('../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<string>('../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 =
Expand Down Expand Up @@ -70,18 +73,27 @@ const jsonLd = {
{RELEASED
? <a class="btn btn-primary btn-lg" href={DOWNLOAD_URL} data-goatcounter-click="download-windows"><Download aria-hidden="true" />Download for Windows</a>
: <a class="btn btn-primary btn-lg" href="#follow">Follow the build</a>}
{film
? <button class="btn btn-lg" type="button" data-film-open><Play aria-hidden="true" />Watch it build</button>
{film.length
? <button class="btn btn-lg" type="button" data-film-open><Play aria-hidden="true" />Watch the overview</button>
: <a class="btn btn-lg" href="#product">See how it works</a>}
</div>
<p class="fine">{hero.fine}{MAC_URL && <> · <a href={MAC_URL} data-goatcounter-click="download-mac">macOS test build</a></>}</p>
{RELEASED && <p class="fine">Needs the free CAD engine <a href={SOLIDCRAFT.url}>SolidCraft {SOLIDCRAFT.version}</a>.</p>}
</div>
</div>
<div class="stage">
<Shot name="clarify" full eager class="window" sizes="(min-width: 1360px) 1300px, (min-width: 760px) 94vw, 190vw"
alt="The PartBuddy window: parameters, a housing around a circuit board in the 3D view, and the assistant asking how the lid should hold" />
</div>
{loop.length && poster
? <div class="stage stage-loop">
<div class="window">
<video data-loop muted loop playsinline preload="none" poster={poster.src} width={posterSrc.width} height={posterSrc.height}
aria-label="PartBuddy in 40 seconds: an idea, a template, editable CAD, moving parts and the print check">
{loop.map((s) => <source src={s.src} type={s.type} />)}
</video>
</div>
</div>
: <div class="stage">
<Shot name="clarify" full eager class="window" sizes="(min-width: 1360px) 1300px, (min-width: 760px) 94vw, 190vw"
alt="The PartBuddy window: parameters, a housing around a circuit board in the 3D view, and the assistant asking how the lid should hold" />
</div>}
<div class="wrap works">
<p>Works with</p>
<ul class="logos">{worksWith.map((w) => <li class="logo"><Brand name={w} />{w}</li>)}</ul>
Expand Down Expand Up @@ -293,13 +305,18 @@ const jsonLd = {
</div>
</section>

{film && (
<dialog class="film" id="film" aria-label="A sensor housing designed in one chat: questions, step-by-step CAD build, print check and plate">
{film.length > 0 && (
<dialog class="film" id="film" aria-label="PartBuddy overview: input, questions, editable CAD, moving parts, print checks, export and models">
<form method="dialog"><button class="btn film-close" aria-label="Close"><X aria-hidden="true" /></button></form>
<video src={film} poster={poster?.src} controls muted playsinline preload="none" width={posterSrc?.width} height={posterSrc?.height}></video>
<video poster={poster?.src} controls muted playsinline preload="none" width={posterSrc?.width} height={posterSrc?.height}>
{film.map((s) => <source src={s.src} type={s.type} />)}
</video>
</dialog>
<script is:inline>
(() => {
// The hero loop only plays without a reduced-motion wish; the poster stays otherwise.
const l = document.querySelector('[data-loop]');
if (l && !matchMedia('(prefers-reduced-motion: reduce)').matches) { l.preload = 'auto'; l.play().catch(() => {}); }
const d = document.getElementById('film');
const v = d.querySelector('video');
document.querySelectorAll('[data-film-open]').forEach((b) => b.addEventListener('click', () => {
Expand Down
6 changes: 5 additions & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,15 @@ a.eyebrow:hover { color: var(--ink); border-color: rgb(255 255 255 / 0.25); }
-webkit-mask-image: linear-gradient(#000 62%, transparent 98%); mask-image: linear-gradient(#000 62%, transparent 98%);
}
.window::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgb(255 255 255 / 0.06), transparent 22%); pointer-events: none; }
.window img { width: 100%; height: auto; }
.window img, .window video { display: block; width: 100%; height: auto; }
.stage-loop .window { -webkit-mask-image: none; mask-image: none; }
.stage-loop + .works { margin-top: 32px; }
.film-btn { position: absolute; z-index: 2; left: 50%; top: 42%; translate: -50% -50%; backdrop-filter: blur(10px); background: rgb(8 9 11 / 0.6); }
@media (max-width: 760px) {
.stage { padding: 0 0 0 var(--gutter); overflow-x: clip; }
.window { width: 190%; border-radius: 12px 0 0 12px; }
.stage-loop { padding: 0 var(--gutter); }
.stage-loop .window { width: auto; border-radius: 12px; }
.film-btn { left: calc(50vw - var(--gutter)); }
}

Expand Down
Loading