Product Hero Float 1
The offer's real product rises big into a spotlight and floats while the offer line slams in word by word and one fact fades in; the offer beat of a sales video, VSL or video ad.
Use it in a prompt
Use the video/product-hero-float video frame from the FunnelDNA library in my brand (landscape and vertical). Follow the video skill. Ask me for the script facts, voice and images you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/video/product-hero-float.tsx. - Import it and pass your copy and images (Props tab):
import { ProductHeroFloat } from "@/components/funneldna/video/product-hero-float"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/product-hero-float/component.tsx 256 lines
// When to use: The offer's real product rises big into a spotlight and floats while the offer line slams in word by word and one fact fades in; the offer beat of a sales video, VSL or video ad.
import * as React from "react"
import { useVideoConfig } from "remotion"
import noise from "../fx/textures/noise"
import {
HOLD, IN_OUT, ProductShot, Rise, SafeArea, SPRINGS, StageField, StageLight, StagePhoto, TONES, VideoStage, display, phraseRange, progress,
springAt, useFitText, useHeld, useStage, useWords,
type TimedWord, type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 210, formats: ["landscape", "vertical"], poster: 200 } satisfies VideoMeta
export type ProductHeroFloatProps = {
format?: VideoFormat
durationInFrames?: number
/** The real product as a transparent cut-out (pass slot("product", …)); never a mock-up. Shown exactly as supplied. */
image?: string
/** The offer line, as the page states it. */
headline?: string
/** The one offer fact under it (price, delivery, terms), word for word from the page. On phones it sets at 60px under the headline, or is left out when it would need more than two rows. */
fact?: string
/** The headline word or phrase that pulses once as it is said; defaults to its last word, "" turns it off. */
emphasis?: string
/** Voice timings for the headline (or the headline then the fact); without them the words set evenly. */
words?: Word[]
/** One slow light sweep across the product mid-scene. */
sweep?: boolean
/** Backdrop photo behind the stage (pass slot("scene", …)); keeps its own colour under a band scrim on the text side. Without one, the lit textured set. */
scene?: string
/**
* The share of the cut-out's square the product itself fills, across (w) and down (h), centred in it. In 9:16 the
* product is sized by these, not by its transparent margin, so it stands about 65% of the frame width.
*/
cutout?: { w: number; h: number }
}
// The sweep is a near-white light at 12%, drawn only inside the product's alpha; never behind text. Built from a token
// so it stays a light (not a dark streak) on light-ground brands too.
const LIGHT = "oklch(from var(--band-ink) 0.99 calc(c * 0.3) h / 0.12)"
// The product's float amplitude (stage px), shared by ProductShot and the sweep that rides on it.
const FLOAT = 6
// 9:16: the product's width as a share of the frame (the target, and the least it gives up to keep its foot in frame).
const BAG_WIDE = 0.65
const BAG_LEAST = 0.5
// 9:16: the least room left under the product's foot, the copy-to-product gap, the text edge, and the headline's
// target size over at most three rows.
const BAG_FOOT = 120
const BAG_GAP = 44
const V_EDGE = 60
const HEAD_V = 130
// The fact line: 56px beside the product; 60px set tight under the headline on phones (two rows at most, else left out).
const FACT_L = 56
const FACT_V = 60
const FACT_V_ROWS = 2
/** Offer: the product rises big into the light and floats, the line slams in word by word, one fact fades in. */
export function ProductHeroFloat({
format = "landscape",
durationInFrames = video.durationInFrames,
image = "",
headline = "",
fact = "",
emphasis,
words,
sweep = true,
scene = "",
cutout,
}: ProductHeroFloatProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { u, width, height, text, portrait } = useStage()
const live = durationInFrames - HOLD
const s = (n: number) => n * u
const ink = TONES.band.ink
const hasProduct = !!image
// Words: the headline sets word by word (5 frames apart unvoiced). When the voice also says the fact, the fact
// lands on its first spoken word; otherwise it follows the line.
const hw = headline.split(/\s+/).filter(Boolean)
const voiced = !!words?.length
const both = voiced && !!fact.trim() && words!.length !== hw.length
const timed = useWords(both ? `${headline} ${fact}` : headline, words, durationInFrames, {
from: 8, span: (8 + 5 * Math.max(1, hw.length - 1)) / durationInFrames,
})
const head: TimedWord[] = timed.slice(0, hw.length).map((x) => ({ ...x, at: Math.min(x.at, live - 12) }))
const headEnd = head.length ? head[head.length - 1].at : 0
const spokenFact = both ? timed[hw.length] : undefined
const factAt = Math.min(spokenFact ? Math.max(spokenFact.at, headEnd + 6) : headEnd + 14, live - 18)
// Scale-beat: the key word pulses 100 → 106 → 100% once, just as its slam settles.
const range: [number, number] | null = emphasis === undefined
? (head.length ? [head.length - 1, head.length] : null)
: phraseRange(head, emphasis)
const beatAt = range ? Math.min(head[range[1] - 1].at + 6, live - 12) : 0
const beat = range ? progress(f, beatAt, beatAt + 5, IN_OUT) - progress(f, beatAt + 5, beatAt + 11, IN_OUT) : 0
// One light sweep, mid-scene, after the fact has landed.
const sweepAt = Math.max(0, Math.min(Math.max(Math.round(live * 0.42), factAt + 12), live - 48))
const sweepX = progress(f, sweepAt, sweepAt + 40, IN_OUT)
// Camera drift as an orbit around the product: the backdrop slides 3% of the width, the light half as far, the
// product (with its floor shadow) a touch the other way. Type stays fixed.
const cam = progress(f, 0, live, IN_OUT)
const far = (0.015 - 0.03 * cam) * width
const lightX = far * 0.5
const near = (-0.004 + 0.008 * cam) * width
// Layout (stage px). Landscape: the product stands on the right at ~75% of the frame height, the copy in the column
// left of it. 9:16: the copy spans the title-safe width above the product.
const W = width / u, H = height / u
const box = { size: 810, left: 1040, top: 104 }
const col = portrait ? W - 2 * V_EDGE : hasProduct ? box.left - 10 - text.left / u : W - (text.left + text.right) / u
const areaTop = text.top / u
const areaBottom = H - text.bottom / u
const span = areaBottom - areaTop
// The fact: a support line beside the product; on phones part of the headline block at 60px, never fine print.
const factSize = portrait ? FACT_V : FACT_L
const factGap = portrait ? 24 : 44
const factEst = fact.trim() ? Math.max(1, Math.ceil((fact.length * 0.52 * factSize) / col)) : 0
const showFact = factEst > 0 && (!portrait || factEst <= FACT_V_ROWS)
const factH = showFact ? factGap + factEst * factSize * 1.2 : 0
const hasCopy = !!headline || showFact
// 9:16: the headline gets room for three rows at ~130px; the product (not its transparent square) stands ~65% of
// the frame width under the copy, giving up width (down to 50%) only to keep its foot inside the frame. The foot is
// an image, so it may run into the caption band; no text ever does.
const headRoom = Math.min(HEAD_V * 3 * 1.08 + 8, span - factH - 8)
const fill = { w: frac(cutout?.w, 0.62), h: frac(cutout?.h, 0.82) }
const bagGap = hasCopy ? BAG_GAP : 0
const copyEst = (headline ? headRoom : 0) + factH
const roomH = hasCopy ? H - BAG_FOOT - areaTop - copyEst - bagGap : span
const fitW = (roomH * fill.w) / fill.h
const bagW = W * Math.max(BAG_LEAST, Math.min(BAG_WIDE, fitW / W))
const bagBox = bagW / fill.w
const bagH = bagBox * fill.h
const tall = portrait && hasProduct
// Measured in the theme's own face: the line fills its box at 2–3 rows, whatever the display face.
const headRef = React.useRef<HTMLHeadingElement>(null)
const headBoxH = portrait ? headRoom : span - factH - 8
const size = useFitText(headRef, headline, {
boxW: s(col), boxH: s(Math.max(200, headBoxH)), guess: s(portrait ? 124 : 130),
max: s(portrait ? 140 : 170), min: s(90), lines: [2, 3],
})
const centred = portrait || !hasProduct
const lightAt = `${(((box.left + box.size / 2) / W) * 100).toFixed(1)}%`
// The sweep rides on ProductShot's own motion (its soft spring rise and float), so the masked light stays locked
// to the product's alpha on every frame.
const shotK = springAt(f, 0, fps, SPRINGS.soft)
const shotY = (1 - shotK) * s(70) + Math.sin((f / fps) * 1.25) * s(FLOAT) * Math.min(1, shotK) - s(FLOAT)
const mask = `url(${JSON.stringify(image)})`
const maskStyle: React.CSSProperties = {
WebkitMaskImage: mask, maskImage: mask, WebkitMaskSize: "contain", maskSize: "contain",
WebkitMaskPosition: "50% 100%", maskPosition: "50% 100%", WebkitMaskRepeat: "no-repeat", maskRepeat: "no-repeat",
}
/** The lit product as supplied (plain, no printed additions) and its one sweep, in a box of stage px. */
const shot = (b: { size: number; left: number; top: number }) => (
<>
<ProductShot src={image} frame={f} at={0} left={s(b.left)} top={s(b.top)} size={s(b.size)} float={FLOAT} />
{sweep && (
<div aria-hidden style={{
position: "absolute", left: s(b.left), top: s(b.top), width: s(b.size), height: s(b.size), overflow: "hidden",
opacity: Math.min(1, shotK * 1.5), transform: `translateY(${shotY}px)`, ...maskStyle,
}}>
<div style={{
position: "absolute", top: "-15%", bottom: "-15%", left: `${-40 + 150 * sweepX}%`, width: "34%",
transform: "skewX(-16deg)", background: `linear-gradient(90deg, transparent, ${LIGHT} 50%, transparent)`,
}} />
</div>
)}
</>
)
// Slam: each word arrives at 110% and settles inside 6 frames; drawn at full strength from its first frame.
const parts = head.flatMap((x, i) => {
const k = progress(f, x.at, x.at + 6)
const inBeat = !!range && i >= range[0] && i < range[1]
const scale = (1.1 - 0.1 * k) * (inBeat ? 1 + 0.06 * beat : 1)
const w = (
<span key={i} style={{ display: "inline-block", opacity: f >= x.at ? 1 : 0, transform: `scale(${scale})`, transformOrigin: "50% 62%" }}>
{x.w}
</span>
)
return i ? [" ", w] : [w]
})
// In 9:16 the copy paints above the product's transparent margin.
const lift: React.CSSProperties = tall ? { position: "relative", zIndex: 1 } : {}
const copy = (
<>
{headline && (
<h2 ref={headRef} style={{ ...display(size, { lineHeight: 1.04 }), margin: 0, maxWidth: s(col), color: ink, ...lift }}>
{parts}
</h2>
)}
{showFact && (
<Rise at={factAt} y={14} dur={14} style={{ marginTop: s(factGap), maxWidth: s(col), ...lift }}>
<p style={{
margin: 0, fontSize: s(factSize), fontWeight: portrait ? 700 : 600, lineHeight: 1.2, color: ink,
textWrap: portrait ? "balance" : "pretty", fontVariantNumeric: "tabular-nums",
}}>{fact}</p>
</Rise>
)}
</>
)
return (
<VideoStage format={format} tone="band">
{/* Bleeds 2% past each side so the drift never exposes a strip of bare band at the frame edge. */}
<div aria-hidden style={{ position: "absolute", top: 0, bottom: 0, left: -0.02 * width, right: -0.02 * width, transform: `translateX(${far}px)` }}>
{scene
? <StagePhoto src={scene} frame={f} dur={live} push={[1.05, 1.08]} treatment="natural" tone="band" side={portrait ? "top" : hasProduct ? "left" : "center"} />
: <StageField tone="band" texture={noise} opacity={0.14} drift={0} frame={f} />}
</div>
{hasProduct && (
<div aria-hidden style={{ position: "absolute", inset: 0, transform: `translateX(${lightX}px)` }}>
<StageLight x={portrait ? "50%" : lightAt} strength={0.26} floor={!portrait} />
</div>
)}
{tall ? (
// 9:16: the copy opens at the top of the safe area and the product stands big beneath it in one centred column.
<SafeArea inset={{ left: s(V_EDGE), right: s(V_EDGE), bottom: hasCopy ? 0 : text.bottom }}
style={{ justifyContent: hasCopy ? "flex-start" : "center", alignItems: "center", textAlign: "center" }}>
{copy}
<div aria-hidden style={{
position: "relative", flex: "none", width: s(bagW), height: s(bagH), marginTop: s(bagGap), transform: `translateX(${near}px)`,
}}>
{shot({ size: bagBox, left: -(bagBox - bagW) / 2, top: -(bagBox - bagH) / 2 })}
</div>
</SafeArea>
) : (
<>
{hasProduct && (
<div aria-hidden style={{ position: "absolute", inset: 0, transform: `translateX(${near}px)` }}>
{shot(box)}
</div>
)}
<SafeArea
inset={hasProduct ? { right: width - text.left - s(col) } : portrait ? { left: s(V_EDGE), right: s(V_EDGE) } : {}}
style={{ justifyContent: "center", alignItems: centred ? "center" : "flex-start", textAlign: centred ? "center" : "left" }}>
{copy}
</SafeArea>
</>
)}
</VideoStage>
)
}
/** A fill share in (0.2, 1], else the default. */
function frac(n: number | undefined, d: number) {
return typeof n === "number" && Number.isFinite(n) && n > 0.2 ? Math.min(1, n) : d
}
export default ProductHeroFloat
pieces/video/product-hero-float/specimen.tsx 30 lines
import __studioImage83e7c9b9 from "../assets/408a8774169d6324.webp";
import * as React from "react"
import tabletop from "../../fx/backdrops/tabletop"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { ProductHeroFloat, video, type ProductHeroFloatProps } from "../product-hero-float"
export const states = ["landscape", "vertical"]
/** First words readable, line set and fact landed, mid-sweep, final hold. */
export const keyframes = [20, 64, 103, 205]
// The designed product shot: a plain matte bag, shown as it is; the specimen swaps in the brand's product slot at render time.
const bag = __studioImage83e7c9b9
// Fictional sample: Kettle Row Coffee's roast-to-door offer (price and delivery terms stand in for the page's own).
export const sample: ProductHeroFloatProps = {
headline: "Roasted Monday. At your door Thursday.",
fact: "$18 a bag · free delivery over 2 bags",
emphasis: "Thursday.",
sweep: true,
image: bag,
scene: tabletop,
}
/** The sample business in its own colours and type (sample-brands.json: Kettle Row · rust-slate · warm-serif); Original and every preset stay one click away. */
export const sampleBrand = { name: "Kettle Row Coffee", theme: "dark", background: "#1e2328", colors: ["#e2733b", "#8fb8de"], fonts: ["Fraunces", "Nunito Sans"] }
export default function ProductHeroFloatSpecimen({ state = "landscape" }: { state?: string }) {
return <VideoPreview component={ProductHeroFloat} props={{ ...sample, image: slot("product", bag), scene: slot("scene", tabletop) }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalProductHeroFloat |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalProductHeroFloat |
number |
Default video.durationInFrames
|
image OptionalProductHeroFloat |
string |
Default ""
|
headline OptionalProductHeroFloat |
string |
Default ""
|
fact OptionalProductHeroFloat |
string |
Default ""
|
emphasis OptionalProductHeroFloat |
string |
|
words OptionalProductHeroFloat |
Word[] |
|
sweep OptionalProductHeroFloat |
boolean |
Default true
|
scene OptionalProductHeroFloat |
string |
Default ""
|
cutout OptionalProductHeroFloat |
{ w: number; h: number } |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
None listed in this pack.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
scene- A wide atmosphere photo behind or beside the copy.
-
408a8774169d6324.webp
image/webp · 23.8 KB
-
bec2a41897a3364d.webp
image/webp · 51.2 KB
-
e0015f5afe2d03e2.webp
image/webp · 29.5 KB