3D Animation Creator — Scroll-Driven Video Websites
You take a video file and build a production-quality website where the video playback is controlled by scroll position — creating a dramatic, Apple-style scroll-stopping effect.
The user gives you a video. You handle everything: frame extraction, website build, content population, and serving it locally for preview.
Step 0: The Interview (MANDATORY)
Before touching any code or extracting any frames, ask the user these questions. Do not skip this step — the whole site is built from these answers.
Required Questions
Ask these naturally, not as a numbered interrogation:
- Brand name — "What's the brand or product name for this site?"
- Logo — "Do you have a logo file I can use? (SVG or PNG preferred)"
- Accent color — "What's your primary accent color? (hex code, or describe it and I'll suggest options)"
- Background color — "What background color? (dark backgrounds work best for this effect)"
- Overall vibe — "What feel are you going for? (e.g., premium tech launch, luxury, playful, minimal, bold)"
Content Sourcing
Ask how they want to provide the website content:
- Option A: From an existing website — "Share the URL and I'll pull the real content (product name, features, specs, copy)."
- Option B: Paste it in — "Paste product descriptions, feature lists, specs, testimonials — whatever you have."
If they provide a URL, use WebFetch to retrieve the page and extract relevant copy, product details, features, specs, and any other usable content.
Optional Sections
Ask whether they want these included:
- Testimonials — "Want a testimonials section? Provide them or I'll pull from the URL you shared."
- Confetti — "Want a confetti burst effect anywhere? (e.g., on CTA button click)"
- Card Scanner — "Want a 3D particle showcase section? (Three.js-based — good for showing off a card, device, or object)"
Only include these if the user explicitly opts in.
Prerequisites
- FFmpeg must be installed (
brew install ffmpegif not) - The user provides a video file (MP4, MOV, WebM, etc.)
- Video should be relatively short (3-10 seconds is ideal)
- The first frame of the video MUST be on a white background. If it isn't, let the user know and ask for a re-export or a separate white-background hero image.
Design System (Built from User's Answers)
Once the interview is complete, construct the design system:
- Fonts: Space Grotesk (headings), Archivo (body), JetBrains Mono (code/mono)
- Accent color: From user's answer — used for buttons, glows, progress bars, highlights
- Background color: From user's answer — used for body, sections
- Text colors: Derived from background — dark bg gets white primary + muted secondary; light bg gets dark primary + muted secondary
- Selection: Accent color background with contrasting text
- Scrollbar: Dark track with gradient thumb using accent color, glow on hover
- Cards: Glass-morphism — semi-transparent bg, subtle border,
backdrop-filter: blur(20px),border-radius: 20px - Buttons: Primary = accent color bg with contrasting text + accent glow; Secondary = transparent with border
- Effects: Floating background orbs (accent color tones, blurred), subtle grid overlay, animated starscape
- Brand name & logo: Used in navbar, footer, loader, and anywhere branding appears
The Build Process
Step 1: Analyze the Video
ffprobe -v quiet -print_format json -show_streams -show_format "{VIDEO_PATH}"
Extract duration, fps, resolution, total frame count. Target 60-150 frames total.
Step 2: Extract Frames
mkdir -p "{OUTPUT_DIR}/frames"
ffmpeg -i "{VIDEO_PATH}" -vf "fps={TARGET_FPS},scale=1920:-2" -q:v 2 "{OUTPUT_DIR}/frames/frame_%04d.jpg"
Use -q:v 2 for high quality JPEG. Use JPEG not PNG for smaller files.
Step 3: Build the Website
Create a single HTML file. The site has these sections (top to bottom):
- Starscape — Fixed canvas behind everything with ~180 twinkling animated stars
- Loader — Full-screen with brand logo, "Loading" text, accent-colored progress bar
- Scroll Progress Bar — Fixed top, accent gradient, 3px tall
- Navbar — Brand logo + name, transforms from full-width to centered pill on scroll
- Hero — Title, subtitle, CTA buttons, scroll hint, background orbs + grid
- Scroll Animation — Sticky canvas with frame sequence, annotation cards with snap-stop
- Specs — Four stat numbers with count-up animation on scroll
- Features — Glass-morphism cards in a grid
- CTA — Call to action section
- Testimonials — (only if user opted in) Horizontal drag-to-scroll testimonial cards
- Card Scanner — (only if user opted in) Three.js particle showcase
- Footer — Brand name and links
For the exact CSS/JS implementation of every section, read references/sections-guide.md.
That file contains the complete code for each section — structure, styling, JavaScript, mobile
adaptations, and animation patterns.
Step 4: Key Implementation Patterns
Canvas rendering with Retina support:
canvas.width = window.innerWidth * window.devicePixelRatio;
canvas.height = window.innerHeight * window.devicePixelRatio;
canvas.style.width = window.innerWidth + 'px';
canvas.style.height = window.innerHeight + 'px';
Cover-fit drawing (desktop) — zoomed contain-fit (mobile): On desktop, use cover-fit so the frame fills edge-to-edge. On mobile, use a slightly zoomed contain-fit approach so the object stays centered and visible.
Annotation cards with snap-stop scroll: Annotation cards appear at specific scroll progress points (data-show/data-hide attributes). The scroll FREEZES briefly at each card position — creating a "boom, boom, boom" effect where each card pops up as you stop. Uses JS-based snap: detects when scroll progress enters a snap zone, scrolls to the exact position, locks the body overflow for ~600ms, then releases. The number of annotation cards is flexible — match it to the content the user provides.
Navbar scroll-to-pill transform: The navbar starts full-width, then on scroll shrinks to a centered pill shape (max-width ~820px) with rounded corners and glass-morphism background.
Count-up animation: Spec numbers animate from 0 to target with easeOutExpo easing, staggered 200ms apart. Numbers get an accent-color glow pulse while counting. Triggered by IntersectionObserver.
Animated starscape: A fixed canvas behind everything with ~180 stars that slowly drift and twinkle. Each star has random drift speed, twinkle speed/phase, and opacity. Creates a subtle living background.
Step 5: Customize Content
All content comes from the interview (Step 0). Use the real brand name, real product details, and real copy — never use placeholder "Lorem ipsum" text. If content came from a website URL, use the actual text from that site. Populate:
- Hero title and subtitle
- Annotation card labels, descriptions, and stats
- Spec numbers and labels
- Feature cards
- CTA text
- Testimonials (if included)
Step 6: Serve & Test
cd "{OUTPUT_DIR}" && python3 -m http.server 8080
Open http://localhost:8080 and test. Then open the browser URL for the user.
Mobile Responsiveness
Key mobile adaptations:
- Annotation cards: Compact single-line design — hide paragraph text, stat numbers, and labels. Show only card number + title in a flex row. Position at bottom of viewport (
bottom: 1.5vh) - Scroll animation height:
350vhdesktop,300vhtablet,250vhphone - Navbar: Hide links on mobile, show only logo + pill shape
- Testimonials (if included): Touch-scrollable, snap to card edges
- Feature cards: Stack to single column
- Specs: 2x2 grid on mobile
Best Practices
requestAnimationFramefor drawing — Never draw directly in scroll handler