From ecd9ec77aa5799c3e59b23b36eb1d633477a825e Mon Sep 17 00:00:00 2001 From: Steve Westhoek Date: Mon, 28 Sep 2026 22:58:46 +0100 Subject: [PATCH 1/9] fix: keep cinematic opening frame visible --- .../funnels/ScrollVideoBackground.tsx | 8 +++-- .../cinematic-marketing-experience.spec.ts | 35 +++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/components/funnels/ScrollVideoBackground.tsx b/src/components/funnels/ScrollVideoBackground.tsx index 1cbbc19..2815a70 100644 --- a/src/components/funnels/ScrollVideoBackground.tsx +++ b/src/components/funnels/ScrollVideoBackground.tsx @@ -9,6 +9,7 @@ const BOOTSTRAP_SPRITE_URL = '/funnels/cinematic-bootstrap.jpg' const BOOTSTRAP_FRAME_COUNT = 24 const BOOTSTRAP_COLUMNS = 6 const BOOTSTRAP_ROWS = 4 +const FIRST_FRAME_TIME_SECONDS = 0.04 type ScrollVideoBackgroundProps = { containerRef?: RefObject @@ -74,13 +75,14 @@ export function ScrollVideoBackground({ containerRef, className = '', onProgress const image = new Image() image.decoding = 'async' image.fetchPriority = 'high' - image.src = BOOTSTRAP_SPRITE_URL image.onload = () => { bootstrapImageRef.current = image setBootstrapReady(true) } + image.src = BOOTSTRAP_SPRITE_URL return () => { image.onload = null + image.onerror = null bootstrapImageRef.current = null } }, []) @@ -175,7 +177,7 @@ export function ScrollVideoBackground({ containerRef, className = '', onProgress for (const index of buildExtractionOrder(count)) { if (cancelled) break - const time = (index / Math.max(1, count - 1)) * Math.max(0, duration - 0.05) + const time = Math.max(FIRST_FRAME_TIME_SECONDS, (index / Math.max(1, count - 1)) * Math.max(0, duration - 0.05)) await seekTo(time) if (cancelled) break ctx.drawImage(source, 0, 0, width, height) @@ -282,5 +284,5 @@ export function ScrollVideoBackground({ containerRef, className = '', onProgress }, [bootstrapReady, cacheReady, videoReady]) const canvasVisible = bootstrapReady || cacheReady - return <>