Mechanism Steps 1
How it works: the mechanism's name lands as a fitted headline over a full-bleed scene photo under a dark scrim, then three or four big numbered steps arrive in turn in one centred column on their spoken cue, the current one at full strength and earlier ones stepping back; the mechanism beat of a sales video, VSL, demo or webinar trailer.
Use it in a prompt
Use the video/mechanism-steps 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/mechanism-steps.tsx. - Import it and pass your copy and images (Props tab):
import { MechanismSteps } from "@/components/funneldna/video/mechanism-steps"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/mechanism-steps/component.tsx 234 lines
// When to use: How it works: the mechanism's name lands as a fitted headline over a full-bleed scene photo under a dark scrim, then three or four big numbered steps arrive in turn in one centred column on their spoken cue, the current one at full strength and earlier ones stepping back; the mechanism beat of a sales video, VSL, demo or webinar trailer.
import * as React from "react"
import { continueRender, delayRender, useVideoConfig } from "remotion"
import concrete from "../fx/textures/concrete"
import {
HOLD, IN_OUT, Rise, RollDigit, SafeArea, SPRINGS, StageField, StagePhoto, T, VideoStage, display, progress, springAt, useFitText, useHeld, useStage, useWords,
type TimedWord, type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 480, formats: ["landscape", "vertical"], poster: 470 } satisfies VideoMeta
/** Retired: steps no longer draw icons. Kept so older storyboards and imports still type-check. */
export type MechanismStepIcon = string
export type MechanismStep = {
/** The step as a short headline ("Walk the room"). Its first word is the voice cue. */
title: string
/** Retired: no longer drawn (the step is its headline alone). */
icon?: MechanismStepIcon
/** Retired: no longer drawn (the step is its headline alone). */
line?: string
}
export type MechanismStepsProps = {
format?: VideoFormat
durationInFrames?: number
/** The mechanism's name, fitted as the headline above the steps. */
title?: string
/** Three or four steps of the real process, in order (the first four with a title render). */
steps?: MechanismStep[]
/** Retired: every format now centres the steps in one column under the name. */
layout?: "column" | "row"
/** Voice timings for the scene; each step lands on the first word of its title. Without them the steps take an even beat. */
words?: Word[]
/** Scene photo (pass slot("scene", …)): full bleed in its own colours with a slow push, under a dark band scrim in every theme. Without it a lit, textured band set. */
scene?: string
/** Photo focal point (CSS object-position). */
focus?: string
}
/** Mechanism: the name lands, then each numbered step arrives in turn in a centred column (its numeral rolls in and beats, its title springs up); earlier steps step back toward the band; all return to full strength for the hold. */
export function MechanismSteps({
format = "landscape",
durationInFrames = video.durationInFrames,
title = "",
steps = [],
words,
scene,
focus,
}: MechanismStepsProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { text, u, width, height, format: stageFormat } = useStage()
const stacked = stageFormat !== "landscape"
const G = stacked ? GEOMETRY.stacked : GEOMETRY.landscape
const list = steps.filter((x) => x && typeof x.title === "string" && x.title.trim()).slice(0, 4)
const n = list.length
const hasHead = !!title.trim()
// Timing: steps on their spoken cue (or an even beat); every step returns to full strength before the hold.
const timed = useWords(words?.map((x) => x.w).join(" ") ?? "", words, durationInFrames)
const starts = schedule(list, timed, durationInFrames, !!words?.length)
const back = progress(f, durationInFrames - HOLD - 22, durationInFrames - HOLD - 8, IN_OUT)
// The text column in stage px, centred on the frame: inside the title-safe edges and above the caption band.
const top = stacked ? text.top / u : LANDSCAPE_TOP
const availH = height / u - text.bottom / u - top
const fullW = (width - text.left - text.right) / u
const colW = Math.min(G.colW, fullW)
// The name: measured in the theme's own face and fitted to the full column width it is drawn at.
const head = React.useRef<HTMLHeadingElement>(null)
const headPx = useFitText(head, title, {
boxW: colW * u, boxH: G.head.boxH * u, guess: G.head.max * 0.85 * u, max: G.head.max * u, min: G.head.min * u, lines: G.head.lines,
})
// The steps: the longest title is fitted beside its numeral (one row in landscape, up to two in 9:16) and every step takes its size.
const stepRef = React.useRef<HTMLHeadingElement>(null)
const longest = list.reduce((a, x) => (x.title.length > a.length ? x.title : a), "")
const numBox = G.step.max * (NUM_W + NUM_GAP)
const ts = useFitText(stepRef, longest, {
boxW: (colW - numBox) * u, boxH: (Math.max(...G.step.lines) * G.step.max * STEP_LH + 1) * u, guess: G.step.max * 0.9 * u,
max: G.step.max * u, min: G.step.min * u, lines: G.step.lines,
})
// The block's real height, read from the rendered type after the fonts load (and whenever the theme swaps faces).
// If a wide face still overruns, the block scales as one piece so it always ends above the caption band.
const block = React.useRef<HTMLDivElement>(null)
const [measured, setMeasured] = React.useState(0)
const [hold] = React.useState(() => (typeof document !== "undefined" ? delayRender("mechanism-steps fit") : null))
const [ready, setReady] = React.useState(false)
const released = React.useRef(false)
const remeasure = React.useCallback(() => {
const h = block.current?.offsetHeight ?? 0
setMeasured((m) => (Math.abs(m - h) > 0.5 ? h : m))
}, [])
const release = React.useCallback(() => {
if (hold !== null && !released.current) { released.current = true; continueRender(hold) }
}, [hold])
React.useLayoutEffect(remeasure)
React.useEffect(() => {
if (typeof document === "undefined" || !document.fonts) { remeasure(); setReady(true); return }
let live = true
document.fonts.ready.then(() => { if (live) { remeasure(); setReady(true) } }, release)
document.fonts.addEventListener?.("loadingdone", remeasure)
return () => { live = false; document.fonts.removeEventListener?.("loadingdone", remeasure) }
}, [remeasure, release])
// Released after the render that carries the post-font measurement has committed.
React.useEffect(() => { if (ready) release() }, [ready, release])
React.useEffect(() => release, [release])
const fitScale = measured > 0 ? Math.min(1, (availH * u * FIT_MARGIN) / measured) : 1
// Every word is set in the band-ink colour on the band scrim (the pair every theme fits). Earlier steps step back toward
// the band by colour, never opacity, and still clear 4.5:1 over the veiled photo.
const ink = (p: number) => (p >= 100 ? T.bandInk : `color-mix(in oklch, ${T.bandInk} ${Math.round(DIM + ((100 - DIM) * p) / 100)}%, ${T.band})`)
const rows = list.map((step, i) => {
const a = starts[i], next = starts[i + 1] as number | undefined
const dim = next === undefined ? 0 : progress(f, next, next + 10, IN_OUT)
const p = Math.round((1 - dim * (1 - back)) * 100)
const label = String(i + 1).padStart(2, "0"), prev = String(i).padStart(2, "0")
const roll = progress(f, a, a + 14, (x) => x)
// Scale-beat: the numeral pulses 100 → 106 → 100% once as the step is said.
const beat = 1 + 0.06 * (progress(f, a + 6, a + 12, IN_OUT) - progress(f, a + 12, a + 20, IN_OUT))
const land = springAt(f, a + 4, fps, SPRINGS.firm)
return (
<React.Fragment key={i}>
<div style={{
...display(ts, { lineHeight: STEP_LH }), display: "flex", alignItems: "flex-end", height: ts * STEP_LH, color: ink(p),
fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap", opacity: progress(f, a - 2, a + 4),
transform: `scale(${beat.toFixed(4)})`, transformOrigin: "0% 60%",
}}>
{[...label].map((c, j) => c === prev[j]
? <span key={j} style={{ display: "inline-block", minWidth: "0.64em", textAlign: "center", lineHeight: 1.12 }}>{c}</span>
: <RollDigit key={j} from={prev[j]} to={c} r={roll} />)}
</div>
<h3 ref={i === 0 ? stepRef : undefined} style={{
...display(ts, { lineHeight: STEP_LH }), margin: 0, minWidth: 0, color: ink(p),
opacity: Math.min(1, land * 2), transform: `translateY(${((1 - land) * 28 * u).toFixed(2)}px)`,
}}>{step.title}</h3>
</React.Fragment>
)
})
// The dark scrim over the full-bleed photo: the band colour, even across the text column and easing a little toward the
// frame edges where no text sits, so the photo keeps its own colour and the column reads in every theme.
const veil = (p: number) => `color-mix(in oklch, ${T.band} ${p}%, transparent)`
const veilBg = stacked
? `linear-gradient(180deg, ${veil(VEIL_EDGE)} 0%, ${veil(VEIL)} 12%, ${veil(VEIL)} 70%, ${veil(VEIL_EDGE)} 100%)`
: `linear-gradient(90deg, ${veil(VEIL_EDGE)} 0%, ${veil(VEIL)} 10%, ${veil(VEIL)} 90%, ${veil(VEIL_EDGE)} 100%)`
return (
<VideoStage format={format} tone="band">
{scene ? (
<>
<StagePhoto src={scene} frame={f} dur={durationInFrames - HOLD} push={[1.03, 1.09]} treatment="natural" tone="band"
side="center" position={focus} />
<div aria-hidden style={{ position: "absolute", inset: 0, zIndex: 0, pointerEvents: "none", background: veilBg }} />
</>
) : <StageField tone="band" texture={concrete} opacity={0.12} drift={8} frame={f} />}
<SafeArea inset={{ top: top * u }} style={{ justifyContent: "center", alignItems: "center" }}>
<div ref={block} style={{
width: colW * u, flex: "none", transformOrigin: "50% 50%",
transform: fitScale < 1 ? `scale(${fitScale.toFixed(4)})` : undefined,
}}>
{hasHead && (
<Rise at={3} y={28} dur={12}>
<h2 ref={head} style={{ ...display(headPx, { lineHeight: 1.04 }), margin: 0, color: T.bandInk, textAlign: "center" }}>{title}</h2>
</Rise>
)}
{n > 0 && (
<div style={{
display: "grid", gridTemplateColumns: `${(ts * NUM_W).toFixed(2)}px auto`, columnGap: ts * NUM_GAP, rowGap: G.rowGap * u,
alignItems: "start", width: "fit-content", maxWidth: colW * u, margin: `${hasHead ? G.headGap * u : 0}px auto 0`,
}}>{rows}</div>
)}
</div>
</SafeArea>
</VideoStage>
)
}
export default MechanismSteps
type Geometry = {
/** The centred column's widest span (stage px); the safe width caps it. */
colW: number
/** The name: fitted size range (stage px), row counts and the box height it may take. */
head: { max: number; min: number; lines: number[]; boxH: number }
/** The step headlines: fitted size range (stage px) and the rows the longest may wrap to. */
step: { max: number; min: number; lines: number[] }
/** Name to steps, and step to step (stage px). */
headGap: number
rowGap: number
}
/** Base sizes in stage px (1080 short side) per composition: steps ~110px in landscape, ~100px in 9:16, the name fitted above. */
const GEOMETRY: Record<"landscape" | "stacked", Geometry> = {
landscape: { colW: 1500, head: { max: 132, min: 96, lines: [1, 2], boxH: 270 }, step: { max: 112, min: 84, lines: [1] }, headGap: 56, rowGap: 20 },
stacked: { colW: 1000, head: { max: 132, min: 96, lines: [1, 2, 3], boxH: 300 }, step: { max: 104, min: 76, lines: [1, 2] }, headGap: 72, rowGap: 30 },
}
/** Landscape text top in stage px (the kit's title-safe edge is 48). */
const LANDSCAPE_TOP = 72
/** The measured block fills at most 96% of its area, a 4% safety margin above the caption band. */
const FIT_MARGIN = 0.96
/** Numeral column width and its gap to the title, in ems of the step size (two rolling digits need 1.28em). */
const NUM_W = 1.34
const NUM_GAP = 0.22
/** Step headline line box, matched to the rolling digit's window so numeral and title share a baseline. */
const STEP_LH = 1.12
/** Band scrim strength (percent) across the text column, and at the frame edges where no text sits. */
const VEIL = 54
const VEIL_EDGE = 30
/** Share of band-ink (percent) kept by a step that has stepped back; the rest is the band. */
const DIM = 76
const norm = (x: string) => x.toLowerCase().replace(/[^a-z0-9$%']/g, "")
/** Start frame of each step: on the first word of its title when voiced (searched in order), else an even beat; the last step keeps a short active span. */
function schedule(list: MechanismStep[], timed: TimedWord[], dur: number, voiced: boolean) {
const n = list.length, end = dur - HOLD - 22, first = 26
const span = n > 1 ? Math.max(36, (end - 50 - first) / (n - 1)) : 0
const even = list.map((_, i) => Math.round(first + i * span))
if (!voiced) return even
let pos = 0, prev = 0
return list.map((step, i) => {
const key = norm(step.title.split(/\s+/)[0] ?? "")
const idx = key ? timed.findIndex((x, j) => j >= pos && norm(x.w) === key) : -1
let at = even[i]
if (idx >= 0) { pos = idx + 1; at = timed[idx].at - 6 }
at = Math.max(at, i ? prev + 36 : 18)
at = Math.min(at, end - 40 - (n - 1 - i) * 36)
prev = at
return at
})
}
pieces/video/mechanism-steps/specimen.tsx 30 lines
import * as React from "react"
import workshop from "../../fx/backdrops/workshop"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { MechanismSteps, video, type MechanismStepsProps } from "../mechanism-steps"
export const states = ["landscape", "vertical"]
/** Headline readable, each step landed and current (01, 02, 03, 04), final hold with every step back at full strength. */
export const keyframes = [16, 66, 189, 313, 436, 479]
// Fictional sample: Hartline Builders, a remodelling contractor, walking through its real four-step process.
export const sample: MechanismStepsProps = {
title: "The Hartline Build Plan",
steps: [
{ title: "Walk the room" },
{ title: "Written plan in a week" },
{ title: "One fixed price" },
{ title: "One crew" },
],
// The designed still (fx "Workshop"), full bleed in its own colours under a dark band scrim; the specimen swaps in the brand's scene slot at render time.
scene: workshop,
focus: "72% 55%",
}
/** The sample business in its own colours and type (sample-brands.json); Original and every preset stay one click away. */
export const sampleBrand = {"name":"Hartline Builders","theme":"dark","background":"#0f1f19","colors":["#3ddc97","#f4b860"],"fonts":["DM Serif Display","DM Sans"]}
export default function MechanismStepsSpecimen({ state = "landscape" }: { state?: string }) {
return <VideoPreview component={MechanismSteps} props={{ ...sample, scene: slot("scene", workshop) }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalMechanismSteps |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalMechanismSteps |
number |
Default video.durationInFrames
|
title OptionalMechanismSteps |
string |
Default ""
|
steps OptionalMechanismSteps |
MechanismStep[] |
Default []
|
layout OptionalMechanismSteps |
"column" | "row" |
|
words OptionalMechanismSteps |
Word[] |
|
scene OptionalMechanismSteps |
string |
|
focus OptionalMechanismSteps |
string |
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.
scene- A wide atmosphere photo behind or beside the copy.
-
c8cba8e5f188490f.webp
image/webp · 35.9 KB
-
f211b3080387e46d.webp
image/webp · 105 KB