/previz: password protect, add PDF export of the crowd previz
Deploy / deploy (push) Successful in 1m5s

- nginx basic auth on /previz/ (login file lives on the server, mounted
  from docker/auth/, see DEPLOY.md step 8); private, no-store so
  Cloudflare never caches it
- Print styles for previz pages: dark, A4 landscape, one section a page;
  videos print as poster frames with a link
- scripts/previz-pdf.mjs (npm run previz:pdf) prints the page to
  public/previz/crowd/crowd-previz.pdf via Edge/Chrome DevTools
- "PDF" download link on the page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
twotalesanimation
2026-10-17 06:21:25 +02:00
parent 35b263ba31
commit 22bc903041
11 changed files with 200 additions and 26 deletions
+41 -23
View File
@@ -162,17 +162,25 @@ const setTips: Tip[] = [
function PreviewVideo({ src, poster, label }: { src?: string; poster?: string; label: string }) {
if (src) {
return (
<video
src={src}
poster={poster}
className="aspect-[2.39/1] w-full bg-black object-cover"
controls
autoPlay
muted
loop
playsInline
preload="metadata"
/>
<div>
<video
src={src}
poster={poster}
className="aspect-[2.39/1] w-full bg-black object-cover print:hidden"
controls
autoPlay
muted
loop
playsInline
preload="metadata"
/>
{/* Paper/PDF: the poster frame and a pointer to the moving version */}
{/* eslint-disable-next-line @next/next/no-img-element */}
{poster && <img src={poster} alt={label} className="hidden aspect-[2.39/1] w-full object-cover print:block" />}
<p className="mt-2 hidden font-mono text-[10px] tracking-[0.2em] text-muted uppercase print:block">
▶ Video: {site.url.replace(/^https?:\/\//, "")}/previz/crowd/
</p>
</div>
);
}
return (
@@ -186,9 +194,9 @@ function PreviewVideo({ src, poster, label }: { src?: string; poster?: string; l
);
}
function TipGrid({ tips }: { tips: Tip[] }) {
function TipGrid({ tips, className = "" }: { tips: Tip[]; className?: string }) {
return (
<ol className="mt-10 grid gap-px border border-line bg-line md:grid-cols-2">
<ol className={`mt-10 grid gap-px border border-line bg-line md:grid-cols-2 ${className}`}>
{tips.map((c, i) => (
<li key={c.title} className="flex gap-4 bg-ink p-5 md:p-6">
<span className="font-mono text-xs text-accent">{String(i + 1).padStart(2, "0")}</span>
@@ -224,10 +232,20 @@ function Step({
export default function CrowdPrevizPage() {
return (
<main className="grain min-h-dvh bg-ink pb-24">
<main className="previz grain min-h-dvh bg-ink pb-24">
{/* Print/PDF: landscape A4, edge to edge. Inline so it beats the global @page rule. */}
<style>{"@page { size: A4 landscape; margin: 0; }"}</style>
<header className="mx-auto flex max-w-6xl items-center gap-3 px-4 pt-6 md:px-8">
<Fox className="h-6 w-6 text-accent" />
<span className="font-mono text-[11px] tracking-[0.25em] text-muted uppercase">{site.name} · Previz</span>
{/* Regenerate with `npm run previz:pdf` after editing this page */}
<a
href={`${dir}/crowd-previz.pdf`}
download
className="-my-2 ml-auto py-2 font-mono text-[11px] tracking-[0.2em] text-accent uppercase hover:text-fg print:hidden"
>
PDF ↓
</a>
</header>
<section className="mx-auto max-w-6xl px-4 pt-16 md:px-8 md:pt-24">
@@ -254,7 +272,7 @@ export default function CrowdPrevizPage() {
</dl>
</section>
<section className="mx-auto mt-20 max-w-6xl px-4 md:mt-28 md:px-8">
<section className="mx-auto mt-20 max-w-6xl px-4 md:mt-28 md:px-8 print:!mt-0 print:break-before-page">
<figure>
<div className="relative">
{/* eslint-disable-next-line @next/next/no-img-element */}
@@ -282,7 +300,7 @@ export default function CrowdPrevizPage() {
</section>
<div className="mx-auto mt-24 max-w-6xl space-y-24 px-4 md:mt-32 md:space-y-32 md:px-8">
<section className="space-y-10">
<section className="space-y-10 print:!mt-0 print:break-before-page">
<Step index="01" label="Hero shot" title="One drone move, real crowd at the stage">
<p>
The drone starts behind the audience and flies forward toward the truck stage. Height and camera tilt stay
@@ -297,7 +315,7 @@ export default function CrowdPrevizPage() {
<PreviewVideo src={videos.hero} poster={videos.heroPoster} label="Hero shot previz coming soon" />
</section>
<section className="space-y-10">
<section className="space-y-10 print:!mt-0 print:break-before-page">
<Step index="02" label="Crowd plates" title="Same spot, same angle, new arrangement">
<p>
After the hero shot, the drone flies to a single marked position and holds still. No camera movement. The
@@ -326,7 +344,7 @@ export default function CrowdPrevizPage() {
</p>
</section>
<section className="space-y-10">
<section className="space-y-10 print:!mt-0 print:break-before-page">
<Step index="03" label="Composite" title="Plates placed into the moving shot">
<p>
We track the hero drone move in 3D, then place each plate as a flat layer on the ground behind the real
@@ -340,7 +358,7 @@ export default function CrowdPrevizPage() {
<PreviewVideo src={videos.final} poster={videos.finalPoster} label="Final comp proof of concept coming soon" />
</section>
<section>
<section className="print:!mt-0 print:break-before-page">
<SectionLabel index="04">Shot list</SectionLabel>
<h2 className="font-display text-3xl leading-none font-thin uppercase md:text-5xl">Six shots, two setups</h2>
<p className="mt-6 max-w-3xl text-lg leading-relaxed font-light text-muted md:text-xl">
@@ -351,7 +369,7 @@ export default function CrowdPrevizPage() {
</div>
</section>
<section>
<section className="print:!mt-0 print:break-before-page">
<SectionLabel index="05">Crowd direction</SectionLabel>
<h2 className="font-display text-3xl leading-none font-thin uppercase md:text-5xl">Briefing the extras</h2>
<p className="mt-6 max-w-3xl text-lg leading-relaxed font-light text-muted md:text-xl">
@@ -385,16 +403,16 @@ export default function CrowdPrevizPage() {
the comp, so that&apos;s where arms need to stay down.
</figcaption>
</figure>
<TipGrid tips={crowdTips} />
<TipGrid tips={crowdTips} className="print:break-before-page" />
</section>
<section>
<section className="print:!mt-0 print:break-before-page">
<SectionLabel index="06">Camera</SectionLabel>
<h2 className="font-display text-3xl leading-none font-thin uppercase md:text-5xl">Notes for DOP and drone op</h2>
<TipGrid tips={cameraTips} />
</section>
<section>
<section className="print:!mt-0 print:break-before-page">
<SectionLabel index="07">On set</SectionLabel>
<h2 className="font-display text-3xl leading-none font-thin uppercase md:text-5xl">Production and VFX</h2>
<TipGrid tips={setTips} />