Problem Montage 1
Three moments of the problem play in turn, each still on a slow push or pull in its own colours with one short phrase whose pain word is set heavier and pulses once as the still dims; the problem beat of a sales video, VSL or video ad, right after the hook.
Use it in a prompt
Use the video/problem-montage 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/problem-montage.tsx. - Import it and pass your copy and images (Props tab):
import { ProblemMontage } from "@/components/funneldna/video/problem-montage"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/problem-montage/component.tsx 218 lines
// When to use: Three moments of the problem play in turn, each still on a slow push or pull in its own colours with one short phrase whose pain word is set heavier and pulses once as the still dims; the problem beat of a sales video, VSL or video ad, right after the hook.
import * as React from "react"
import { useVideoConfig } from "remotion"
import noise from "../fx/textures/noise"
import type { BackdropTreatment } from "../fx/fx"
import {
HOLD, IN_OUT, SPRINGS, StageField, StagePhoto, TONES, VideoStage, XFADE, display, phraseRange, progress, springAt, timeWords,
useFitText, useHeld, useStage,
type TimedWord, type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 300, formats: ["landscape", "vertical"], poster: 272 } satisfies VideoMeta
export type ProblemMontageItem = {
/** The still for this moment (pass slot("item-1", …), slot("item-2", …), …). An illustration of the situation, never a customer. */
image?: string
/** One short phrase, five words or fewer, in the viewer's words. */
phrase: string
/** The pain word or phrase inside `phrase`: set one weight heavier in the field ink, it pulses once as the still dims behind it. */
pain?: string
/** Focal point of the still (CSS object-position); the 9:16 crop centres on it. */
focus?: string
}
export type ProblemMontageProps = {
format?: VideoFormat
durationInFrames?: number
/** The moments, in order (three is the design; up to six play). */
items?: ProblemMontageItem[]
/** Seconds per still, scaled to the scene's length; without them the stills follow `words`, else split the scene evenly. */
beats?: number[]
/** Voice timings for all the phrases read in order; each phrase lands on its spoken words. */
words?: Word[]
/** The field and scrim tone: band (the dark end of the palette, default) or surface. */
tone?: "band" | "surface"
/** How the stills take the theme: natural (their own colours, scrimmed on the text side only; default) or duotone (mapped to the tokens). */
treatment?: BackdropTreatment
}
/** Dim-others: the still dips behind its pain word for a beat, then returns to its natural colour. */
const DIM = { up: 6, hold: 12, down: 16, depth: 0.42 } as const
/** Shortest moment, in frames. */
const MIN_MOMENT = 30
/** Stage px the bottom row keeps above the caption band in 16:9 (covers the word rise and descenders). */
const CLEAR = 44
/** Stage px each word rises as it lands. */
const RISE = 24
/** Scale-beat on the pain word: frames up and back down, its delay after the word lands, and its peak scale. */
const BEAT = { up: 4, down: 8, lag: 4, peak: 0.06 } as const
/** Share of the phrase box the fit measures against, so the heavier pain word never wraps past the fitted rows. */
const FIT_SLACK = 0.96
/** The pain word sets one weight step above the display weight (capped at 900); the colour stays the field ink. */
const PAIN_WEIGHT = "min(900, calc(var(--display-weight, 800) + 100))"
/**
* 9:16 phrase scrim: a soft radial in the field tone behind the centred phrase block, so every phrase holds 4.5:1 over
* bright parts of the stills. A flat plateau at `alpha` out to `plateau`% of the ellipse (it spans the full width and the
* fitted phrase rows), feathering to clear by its edge; `pad` (stage px) extends it above and below the phrase box. The
* still stays in its natural colour outside it.
*/
const SCRIM = { alpha: 0.82, plateau: 72, pad: 260, spread: 2.2 } as const
type Moment = { start: number; end: number; words: TimedWord[]; pain: [number, number] | null; dimAt: number }
/** Problem montage: full-bleed stills in turn, a slow push or pull each, one big phrase per still on the text side. */
export function ProblemMontage({
format = "landscape",
durationInFrames = video.durationInFrames,
items = [],
beats,
words,
tone = "band",
treatment = "natural",
}: ProblemMontageProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { u, width, height, text, portrait } = useStage()
const list = items.slice(0, 6)
const plan = React.useMemo(() => planMoments(items.slice(0, 6), beats, words, durationInFrames, fps), [items, beats, words, durationInFrames, fps])
const n = plan.length
const last = durationInFrames - HOLD
const colors = TONES[tone]
const field = tone === "band" ? "--band" : "--surface"
// The moment on screen now, and its dim-others beat.
let cur = 0
plan.forEach((m, i) => { if (f >= m.start) cur = i })
const m = plan[cur]
const dimEnd = m ? m.dimAt + DIM.up + DIM.hold : 0
const dim = m ? DIM.depth * (progress(f, m.dimAt, m.dimAt + DIM.up) - progress(f, dimEnd, dimEnd + DIM.down, IN_OUT)) : 0
// 16:9: the phrase box fills the left of the safe area, text anchored to its foot just above the caption band.
// 9:16: the phrase box is the whole safe area (platform UI above, caption box below), the phrase centred in it.
const phraseTop = text.top
const phraseBottom = portrait ? text.bottom : text.bottom + CLEAR * u
const boxW = portrait ? width - text.left - text.right : 1020 * u
const boxH = Math.max(1, height - phraseTop - phraseBottom)
// Every phrase shares one size, fitted to the longest in the theme's own face.
const longest = list.reduce((a, it) => ((it.phrase ?? "").length > a.length ? it.phrase : a), "")
const fit = React.useRef<HTMLDivElement>(null)
const size = useFitText(fit, longest, {
boxW: boxW * FIT_SLACK, boxH: portrait ? boxH * 0.72 : boxH, guess: (portrait ? 150 : 150) * u, max: (portrait ? 160 : 176) * u,
min: (portrait ? 112 : 96) * u, lines: portrait ? [2, 3, 4] : [2, 3],
})
const scrimColor = `oklch(from var(${field}) l c h / ${SCRIM.alpha})`
return (
<VideoStage format={format} tone={tone}>
{n === 0 && <StageField tone={tone} texture={noise} opacity={tone === "band" ? 0.14 : 0.08} frame={f} />}
{plan.map((x, i) => {
const it = list[i]
const next = plan[i + 1]
const shown = i === 0 ? 1 : progress(f, x.start, x.start + XFADE, IN_OUT)
const covered = !!next && f >= next.start + XFADE
const span = Math.max(1, (next ? next.start + XFADE : last) - x.start)
return (
<div key={i} aria-hidden style={{ position: "absolute", inset: 0, overflow: "hidden", background: colors.bg, opacity: covered ? 0 : shown }}>
{it.image
? <StagePhoto src={it.image} frame={Math.max(0, f - x.start)} dur={span} push={i % 2 ? [1.1, 1.02] : [1.02, 1.1]} treatment={treatment}
tone={tone} side={portrait ? "center" : "left"} position={it.focus} slot={null} />
: <StageField tone={tone} texture={noise} opacity={tone === "band" ? 0.14 : 0.08} frame={Math.max(0, f - x.start)} />}
</div>
)
})}
{dim > 0.001 && <div aria-hidden style={{ position: "absolute", inset: 0, background: `oklch(from var(${field}) l c h / ${dim.toFixed(3)})` }} />}
{portrait && n > 0 && (
<div aria-hidden style={{
position: "absolute", pointerEvents: "none",
left: -width * ((SCRIM.spread - 1) / 2), width: width * SCRIM.spread,
top: phraseTop - SCRIM.pad * u, height: boxH + 2 * SCRIM.pad * u,
background: `radial-gradient(ellipse 50% 50% at 50% 50%, ${scrimColor} 0%, ${scrimColor} ${SCRIM.plateau}%, transparent 100%)`,
}} />
)}
<div ref={fit} style={{ position: "absolute", left: text.left, width: boxW, top: phraseTop, bottom: phraseBottom, ...display(size), color: colors.ink }}>
{plan.map((x, i) => {
const next = plan[i + 1]
const away = next ? progress(f, next.start - 8, next.start, IN_OUT) : 0
if (f < x.start || away >= 1) return null
// The pain word pulses once the whole pain phrase has landed, and always settles before the final hold.
const painLanded = x.pain ? x.words[x.pain[1] - 1].at : 0
const beatAt = Math.min(Math.max(x.dimAt, painLanded) + BEAT.lag, last - BEAT.up - BEAT.down)
const beat = progress(f, beatAt, beatAt + BEAT.up) - progress(f, beatAt + BEAT.up, beatAt + BEAT.up + BEAT.down, IN_OUT)
return (
<div key={i} style={{
position: "absolute", inset: 0, display: "flex", flexDirection: "column", justifyContent: portrait ? "center" : "flex-end",
opacity: 1 - away, transform: `translateY(${-away * 18 * u}px)`,
}}>
<p style={{ ...display(size, { lineHeight: 1.04 }), margin: 0, textAlign: "left" }}>
{x.words.map((w, j) => {
const s = springAt(f, w.at, fps, SPRINGS.firm)
const hot = !!x.pain && j >= x.pain[0] && j < x.pain[1]
const lift = `translateY(${Math.max(0, 1 - s) * RISE * u}px)`
return (
<React.Fragment key={j}>
{j > 0 && " "}
<span style={{
display: "inline-block", opacity: Math.min(1, s * 2.5),
transform: hot ? `${lift} scale(${1 + BEAT.peak * Math.max(0, beat)})` : lift,
transformOrigin: "50% 70%",
...(hot ? { fontWeight: PAIN_WEIGHT as unknown as number, color: colors.ink } : null),
}}>
{w.w}
</span>
</React.Fragment>
)
})}
</p>
</div>
)
})}
</div>
</VideoStage>
)
}
export default ProblemMontage
/** Each moment's frames, its words on screen (voiced or evenly paced) and the frame its dim-others beat starts. */
function planMoments(items: ProblemMontageItem[], beats: number[] | undefined, words: Word[] | undefined, dur: number, fps: number): Moment[] {
const n = items.length
if (!n) return []
const last = dur - HOLD
const lists = items.map((it) => (it.phrase ?? "").split(/\s+/).filter(Boolean))
const voiced = words?.length ? timeWords(lists.flat().join(" "), words, dur, fps) : null
const firsts: number[] = []
let k = 0
lists.forEach((l) => { firsts.push(voiced?.[k]?.at ?? 0); k += l.length })
let starts: number[]
if (beats?.length) {
const w = items.map((_, i) => Math.max(0.1, beats[i] ?? beats[beats.length - 1]))
const sum = w.reduce((a, b) => a + b, 0)
let acc = 0
starts = w.map((x) => { const s = Math.round((acc / sum) * dur); acc += x; return s })
} else if (voiced) {
// Picture leads voice: each still arrives a few frames before its phrase is spoken.
starts = firsts.map((at, i) => (i === 0 ? 0 : at - 6))
} else {
starts = items.map((_, i) => Math.round((i * dur) / n))
}
starts[0] = 0
for (let i = 1; i < n; i++) starts[i] = Math.min(Math.max(starts[i], starts[i - 1] + MIN_MOMENT), last - MIN_MOMENT * (n - i))
let off = 0
return items.map((it, i) => {
const start = starts[i], end = i < n - 1 ? starts[i + 1] : last
const l = lists[i]
const ws: TimedWord[] = voiced
? voiced.slice(off, off + l.length).map((x, j) => ({ ...x, i: j, at: Math.max(x.at, start + 2) }))
: timeWords(l.join(" "), undefined, end - start, fps, 3, 0.35).map((x, j) => ({ ...x, i: j, at: x.at + start, end: x.end + start }))
off += l.length
const pain = phraseRange(ws, it.pain)
const landed = ws.length ? (pain ? ws[pain[0]].at : ws[ws.length - 1].at + 4) : start + 20
// The dim beat always returns before the next still (or the final hold).
const latest = (i < n - 1 ? end - 8 : last) - (DIM.up + DIM.hold + DIM.down)
return { start, end, words: ws, pain, dimAt: Math.max(start, Math.min(landed, latest)) }
})
}
pieces/video/problem-montage/specimen.tsx 45 lines
import __studioImage344e0be5 from "../assets/c87f3aaa58b390bb.webp";
import __studioImage76086ef0 from "../assets/c63956c5d5d6215f.webp";
import __studioImage2f2e59a9 from "../assets/3528bafe345cefb0.webp";
import * as React from "react"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { ProblemMontage, video, type ProblemMontageProps } from "../problem-montage"
export const states = ["landscape", "vertical"]
/** First readable phrase, mid still 1, the 1→2 crossfade, mid still 2, mid still 3, final hold. */
export const keyframes = [18, 70, 108, 175, 272, 299]
// Fictional sample: Halfmoon Press, publisher of a sleep book for shift workers. The stills illustrate the situation only.
export const sample: ProblemMontageProps = {
items: [
{
image: __studioImage344e0be5,
phrase: "The drive home. Blinding sun.",
pain: "Blinding",
focus: "58% 50%",
},
{
image: __studioImage76086ef0,
phrase: "Then the street gets loud.",
pain: "loud.",
focus: "50% 60%",
},
{
image: __studioImage2f2e59a9,
phrase: "Phone buzzing at 2 p.m.",
pain: "2 p.m.",
focus: "35% 55%",
},
],
}
const SLOTS = ["item-1", "item-2", "item-3"] as const
/** The sample business in its own colours and type (sample-palettes.md: rust-slate · epilogue); Original and every preset stay one click away. */
export const sampleBrand = { name: "Halfmoon Press", theme: "dark", background: "#1e2328", colors: ["#e2733b", "#8fb8de"], fonts: ["Epilogue", "Hanken Grotesk"] }
export default function ProblemMontageSpecimen({ state = "landscape" }: { state?: string }) {
const items = (sample.items ?? []).map((it, i) => ({ ...it, image: it.image ? slot(SLOTS[i % SLOTS.length], it.image) : undefined }))
return <VideoPreview component={ProblemMontage} props={{ ...sample, items }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalProblemMontage |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalProblemMontage |
number |
Default video.durationInFrames
|
items OptionalProblemMontage |
ProblemMontageItem[] |
Default []
|
beats OptionalProblemMontage |
number[] |
|
words OptionalProblemMontage |
Word[] |
|
tone OptionalProblemMontage |
"band" | "surface" |
Default "band"
|
treatment OptionalProblemMontage |
BackdropTreatment |
Default "natural"
|
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.
--display-weight- Headlines: weight, letter case and tracking.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
3528bafe345cefb0.webp
image/webp · 31.2 KB
-
bec2a41897a3364d.webp
image/webp · 51.2 KB
-
c63956c5d5d6215f.webp
image/webp · 166 KB
-
c87f3aaa58b390bb.webp
image/webp · 36.9 KB