Old Way New Way 1
The problem-to-turn beat as us versus them: the old way opens on its own muted, desaturated photo, a straight seam slides in to split the frame with the brand's way on a lit, natural photo, then the new way takes over about two thirds; plays mid-way through a sales video, VSL or video ad.
Use it in a prompt
Use the video/old-way-new-way 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/old-way-new-way.tsx. - Import it and pass your copy and images (Props tab):
import { OldWayNewWay } from "@/components/funneldna/video/old-way-new-way"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/old-way-new-way/component.tsx 312 lines
// When to use: The problem-to-turn beat as us versus them: the old way opens on its own muted, desaturated photo, a straight seam slides in to split the frame with the brand's way on a lit, natural photo, then the new way takes over about two thirds; plays mid-way through a sales video, VSL or video ad.
import * as React from "react"
import { useVideoConfig } from "remotion"
import { Check, X } from "lucide-react"
import concrete from "../fx/textures/concrete"
import {
EASE, HOLD, IN_OUT, KenBurns, SPRINGS, StageField, StageLight, StagePhoto, T, VideoStage, countText, display, ok, progress, springAt,
useFitText, useHeld, useStage, useWords,
type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 210, formats: ["landscape", "vertical"], poster: 204 } satisfies VideoMeta
export type OldWayNewWayProps = {
format?: VideoFormat
durationInFrames?: number
/** Name of the way the viewer is stuck with: two or three words. */
oldTitle?: string
/** Up to two short lines for the old way, three or four words each (any more are dropped); only differences the page states. */
oldRows?: string[]
/** The brand's own name for its way: two or three words. */
newTitle?: string
/** The matching lines for the new way, in the same order as oldRows (up to two, three or four words each); a number in a line counts up as it lands. */
newRows?: string[]
/** A word or phrase inside newTitle that gets one scale beat (100 → 106 → 100%) once the name has landed. */
newHighlight?: string
/** Frame the seam starts to slide in to the halves; default: just before the new way's name is spoken, else 32% into the scene. */
seamAt?: number
/** Frame the new way starts to take over (about 65% of the width, 63% of the height); default: after its last line, else 68% in. */
takeoverAt?: number
/** Voice timings for the scene, read in order: old title, old rows, new title, new rows. */
words?: Word[]
/** Photo behind the old way: shown desaturated and dimmed under its own even scrim. */
oldScene?: string
/** Photo behind the new way (pass slot("scene", …)): the same kind of place, finished and lit, in natural colour. */
newScene?: string
/** Old-way photo focal point (CSS object-position). */
focus?: string
/** New-way photo focal point (CSS object-position). */
newFocus?: string
}
/** Stage px per format. Each column is laid out once at its own width, then scaled and centred to fit its side of the seam. */
type Layout = {
/** Seam rest positions as a share of the long side: the halves, then the takeover (the old way keeps this share). */
half: number; take: number
/** Copy clearances: from the frame edge, from the seam, and inside the text-safe top and bottom. */
edge: number; seamPad: number; vPad: number
oldW: number; newW: number
titleMax: number; titleMin: number; titleH: number
/** Largest a scaled headline may draw (the display range for the format). */
headMax: number
/** Row type at layout size, and the smallest it may ever draw once the column is scaled. */
row: number; rowFloor: number; rowGap: number; titleGap: number
/** Largest scale a column may grow to when its side has room. */
cap: number
}
const LAYOUT: Record<"landscape" | "vertical", Layout> = {
// The old column is laid out at its docked width, so its rows stay 56px+ even at the takeover.
landscape: { half: 0.5, take: 0.35, edge: 104, seamPad: 72, vPad: 24, oldW: 560, newW: 768, titleMax: 124, titleMin: 92, titleH: 290, headMax: 130,
row: 64, rowFloor: 56, rowGap: 18, titleGap: 34, cap: 1.2 },
vertical: { half: 0.43, take: 0.37, edge: 84, seamPad: 44, vPad: 24, oldW: 912, newW: 912, titleMax: 120, titleMin: 88, titleH: 260, headMax: 150,
row: 54, rowFloor: 52, rowGap: 10, titleGap: 24, cap: 1 },
}
/** Frames the seam takes to slide in, and to push on for the takeover. */
const SEAM = 26
const TAKE = 28
/** The emphasis beat: frames up to the peak, frames back to rest, and the peak scale. */
const BEAT_UP = 6
const BEAT_DOWN = 8
const BEAT_PEAK = 0.06
/** A dark shadow colour from the theme's --shadow token at alpha `a` (never a light or theme-flipping token). */
const sh = (a: number) => `oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / ${a})`
/** White glyph on the solid status badge (component-scoped, overridable). */
const GLYPH = "var(--badge-glyph, #fff)"
type Box = { x0: number; x1: number; y0: number; y1: number }
type Placed = { s: number; cx: number; cy: number }
/** Problem → turn: the old way opens full frame; a seam slides in to two photo halves, then the brand's way takes over. */
export function OldWayNewWay({
format = "landscape",
durationInFrames = video.durationInFrames,
oldTitle = "The old way",
oldRows = [],
newTitle = "The new way",
newRows = [],
newHighlight,
seamAt,
takeoverAt,
words,
oldScene,
newScene,
focus,
newFocus,
}: OldWayNewWayProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { u, width, height, text, portrait } = useStage()
const L = portrait ? LAYOUT.vertical : LAYOUT.landscape
const end = durationInFrames - HOLD
const oldR = oldRows.slice(0, 2), newR = newRows.slice(0, 2)
const nO = oldR.length, nN = newR.length
// Timing: with voice words every title word and row lands on its spoken frame; without, the scene paces itself.
const segs = [oldTitle, ...oldR, newTitle, ...newR]
const timed = useWords(segs.join(" "), words, durationInFrames, { from: 2, span: 0.8 })
const voiced = !!words?.length
const offsets: number[] = []
segs.reduce((n, s) => { offsets.push(n); return n + split(s).length }, 0)
const spoken = (i: number, fallback: number) => (voiced && timed[i] ? timed[i].at : fallback)
const newIdx = offsets[nO + 1]
const paced = Math.round(durationInFrames * 0.32)
const seam0 = clamp(Math.round(seamAt ?? (voiced ? spoken(newIdx, paced + 12) - 12 : paced)), 24, end - SEAM - TAKE - 40)
const lastNew = nN ? spoken(offsets[nO + 1 + nN], 0) : 0
const take0 = clamp(Math.round(takeoverAt ?? (voiced && nN ? lastNew + 18 : durationInFrames * 0.68)), seam0 + SEAM + 8, end - TAKE - 8)
const oldTitleAt = (j: number) => clamp(spoken(offsets[0] + j, 2 + j * 3), 0, seam0)
const oldRowAt = (i: number) => clamp(spoken(offsets[1 + i], spread(nO, 22, seam0 - 14, i)), 6, seam0 - 6)
const newTitleAt = (j: number) => clamp(spoken(newIdx + j, seam0 + 20 + j * 4), seam0 + 8, end - 30)
const newRowAt = (i: number) => clamp(spoken(offsets[nO + 2 + i], spread(nN, seam0 + 38, take0 - 16, i)), seam0 + 24, end - 24)
// The seam: slides in from the far edge to the halves, then pushes on as the new way takes over.
const k1 = progress(f, seam0, seam0 + SEAM, IN_OUT)
const k2 = progress(f, take0, take0 + TAKE, IN_OUT)
const long = portrait ? height : width
const halfPos = long * L.half, takePos = long * L.take
const pos = long - (long - halfPos) * k1 - (halfPos - takePos) * k2
// The new copy waits in its halves position while the seam reveals it, then follows the takeover; it never squeezes mid-slide.
const newEdge = Math.min(pos, halfPos)
// Headlines measured in the theme's own face, each at its column's layout width.
const oldW = L.oldW * u, newW = L.newW * u
const oldHead = React.useRef<HTMLHeadingElement>(null), newHead = React.useRef<HTMLHeadingElement>(null)
const fit = { boxH: L.titleH * u, guess: L.titleMax * 0.9 * u, max: L.titleMax * u, min: L.titleMin * u, lines: [1, 2] }
const oldSize = useFitText(oldHead, oldTitle, { ...fit, boxW: oldW })
const newSize = useFitText(newHead, newTitle, { ...fit, boxW: newW })
const rowPx = L.row * u, badge = Math.round(L.row * 0.94) * u, gapX = L.row * 0.36 * u
const floor = L.rowFloor / L.row
// Each column's real height (rows keep their space from the first frame), measured once laid out; estimated until then.
const oldCol = React.useRef<HTMLDivElement>(null), newCol = React.useRef<HTMLDivElement>(null)
const [measured, setMeasured] = React.useState<{ o: number; n: number } | null>(null)
React.useLayoutEffect(() => {
const o = oldCol.current?.offsetHeight ?? 0, n = newCol.current?.offsetHeight ?? 0
if (!o || !n) return
setMeasured((m) => (m && Math.abs(m.o - o) < 0.5 && Math.abs(m.n - n) < 0.5 ? m : { o, n }))
})
const est = (title: string, size: number, rows: string[], w: number) => {
const textW = w - badge - gapX
return Math.min(2, lines(title, size, w, 0.6)) * size * 1.04 + (rows.length ? L.titleGap * u : 0)
+ rows.reduce((h, r, i) => h + (i ? L.rowGap * u : 0) + lines(r, rowPx, textW, 0.55) * rowPx * 1.2, 0)
}
const oldH = measured?.o ?? est(oldTitle, oldSize, oldR, oldW)
const newH = measured?.n ?? est(newTitle, newSize, newR, newW)
// Each side's copy box, inside the text-safe area and clear of the seam; the column scales to fit it and sits centred.
const top = text.top + L.vPad * u, bottom = height - text.bottom - L.vPad * u
const edge = L.edge * u, pad = L.seamPad * u
const oldBox: Box = portrait
? { x0: edge, x1: width - edge, y0: top, y1: Math.min(bottom, pos - pad) }
: { x0: edge, x1: Math.min(width - edge, pos - pad), y0: top, y1: bottom }
const newBox: Box = portrait
? { x0: edge, x1: width - edge, y0: newEdge + pad, y1: bottom }
: { x0: newEdge + pad, x1: width - edge, y0: top, y1: bottom }
const oldAt = place(oldBox, oldW, oldH, Math.min(L.cap, (L.headMax * u) / oldSize), floor)
const newAt = place(newBox, newW, newH, Math.min(L.cap, (L.headMax * u) / newSize), floor)
// The old way dims as it loses ground: by colour, never opacity, and its photo darkens under its own even scrim.
const oldInk = `color-mix(in oklch, ${T.bandInk} ${(100 - 8 * k1 - 8 * k2).toFixed(1)}%, ${T.band})`
const oldBadgeFill = `oklch(from var(--danger) min(l, ${(0.54 - 0.04 * k1 - 0.04 * k2).toFixed(3)}) calc(c * ${(1 - 0.25 * k1 - 0.3 * k2).toFixed(3)}) h)`
const newBadgeFill = "oklch(from var(--success) min(l, 0.54) c h)"
const oldDim = 0.6 + 0.09 * k1 + 0.09 * k2
const oldBright = 0.72 - 0.06 * k1 - 0.06 * k2
const reveal = portrait ? `inset(${pos.toFixed(2)}px 0 0 0)` : `inset(0 0 0 ${pos.toFixed(2)}px)`
const pop = (at: number, key: React.Key, w: string) => {
const s = springAt(f, at, fps, SPRINGS.pop)
return (
<span key={key} style={{ display: "inline-block", opacity: Math.min(1, s * 2.5), transform: `translateY(${(1 - s) * 24 * u}px) scale(${0.94 + 0.06 * s})` }}>
{w}
</span>
)
}
const oldParts: React.ReactNode[] = []
split(oldTitle).forEach((w, j, all) => {
oldParts.push(pop(oldTitleAt(j), "o" + j, w))
if (j < all.length - 1) oldParts.push(" ")
})
// Scale-beat: the key words of the new name pulse 100 → 106 → 100% once, after the whole name has landed, in the field ink.
const newWords = split(newTitle)
const hl = matchRange(newWords, newHighlight)
const beatAt = Math.min(end - BEAT_UP - BEAT_DOWN, newTitleAt(Math.max(0, newWords.length - 1)) + 6)
const beat = hl ? progress(f, beatAt, beatAt + BEAT_UP) - progress(f, beatAt + BEAT_UP, beatAt + BEAT_UP + BEAT_DOWN, IN_OUT) : 0
const newParts: React.ReactNode[] = []
newWords.forEach((w, j) => {
const word = pop(newTitleAt(j), "n" + j, w)
newParts.push(hl && j >= hl[0] && j < hl[1]
? <span key={"b" + j} style={{ display: "inline-block", transform: `scale(${(1 + BEAT_PEAK * beat).toFixed(4)})`, transformOrigin: "50% 70%" }}>{word}</span>
: word)
if (j < newWords.length - 1) newParts.push(" ")
})
const shared = { u, f, fps, row: rowPx, badge, gapX, titleGap: L.titleGap * u, rowGap: L.rowGap * u }
// The seam casts a close dark shadow onto the old side.
const edgeShadow = portrait
? `0 ${-2 * u}px ${3 * u}px ${sh(0.35)}, 0 ${-14 * u}px ${22 * u}px ${-6 * u}px ${sh(0.4)}`
: `${-2 * u}px 0 ${3 * u}px ${sh(0.35)}, ${-14 * u}px 0 ${22 * u}px ${-6 * u}px ${sh(0.4)}`
return (
<VideoStage format={format} tone="band">
{/* The old way: its own photo, desaturated, near locked off, darkening under an even band scrim as it docks. */}
<div aria-hidden style={{ position: "absolute", inset: 0, zIndex: 0, isolation: "isolate", overflow: "hidden" }}>
{oldScene
? <KenBurns src={oldScene} frame={f} dur={end} from={1} to={1.04} position={focus} style={{ filter: `grayscale(0.9) brightness(${oldBright.toFixed(3)})` }} />
: <StageField tone="band" texture={concrete} opacity={0.16} drift={0} frame={f} />}
<div style={{ position: "absolute", inset: 0, background: ok("--band", 0, Number(oldDim.toFixed(3))) }} />
</div>
<WayColumn {...shared} colRef={oldCol} headRef={oldHead} at={oldAt} w={oldW} h={oldH} size={oldSize} ink={oldInk} title={oldParts}
rows={oldR.map((r, i) => ({ text: r, at: oldRowAt(i) }))} weight={600} fill={oldBadgeFill} icon="x" />
{/* The new way: its own lit photo in natural colour, fixed to its final side and revealed by the seam's position. */}
<div style={{ position: "absolute", inset: 0, zIndex: 2, isolation: "isolate", background: T.band, clipPath: reveal }}>
<div aria-hidden style={{ position: "absolute", overflow: "hidden", isolation: "isolate", ...(portrait ? { left: 0, right: 0, top: takePos, bottom: 0 } : { top: 0, bottom: 0, left: takePos, right: 0 }) }}>
{newScene
? <StagePhoto src={newScene} frame={f} dur={end} push={[1.03, 1.1]} treatment="natural" side="full" tone="band" position={newFocus} slot={null} />
: <><StageField tone="band" texture={concrete} opacity={0.1} drift={6} frame={f} /><StageLight x="50%" strength={0.26} /></>}
</div>
<WayColumn {...shared} colRef={newCol} headRef={newHead} at={newAt} w={newW} h={newH} size={newSize} ink={T.bandInk} title={newParts}
rows={newR.map((r, i) => ({ text: countText(r, progress(f, newRowAt(i) + 2, newRowAt(i) + 24, EASE)), at: newRowAt(i) }))}
weight={700} fill={newBadgeFill} icon="check" />
</div>
{/* The seam itself: one straight accent rule riding the edge. */}
{k1 > 0 && (
<div aria-hidden style={{
position: "absolute", zIndex: 3, background: T.accentFill, boxShadow: edgeShadow,
...(portrait ? { left: 0, width, top: pos - 4 * u, height: 8 * u } : { top: 0, height, left: pos - 4 * u, width: 8 * u }),
}} />
)}
</VideoStage>
)
}
export default OldWayNewWay
/**
* One side's copy: the headline and up to two rows, laid out once at width `w`, scaled about its centre to fit its side.
* No halo behind it: legibility comes from the side's own scrimmed photo or lit field.
*/
function WayColumn({ colRef, headRef, at, w, h, size, ink, title, rows, weight, fill, icon, u, f, fps, row, badge, gapX, titleGap, rowGap }: {
colRef: React.Ref<HTMLDivElement>; headRef: React.Ref<HTMLHeadingElement>; at: Placed; w: number; h: number; size: number; ink: string
title: React.ReactNode; rows: { text: React.ReactNode; at: number }[]; weight: number; fill: string; icon: "x" | "check"
u: number; f: number; fps: number; row: number; badge: number; gapX: number; titleGap: number; rowGap: number
}) {
return (
<div ref={colRef} style={{
position: "absolute", zIndex: 1, left: at.cx - w / 2, top: at.cy - h / 2, width: w,
transform: `scale(${at.s.toFixed(4)})`, transformOrigin: "50% 50%", color: ink, textAlign: "center",
}}>
<h2 ref={headRef} style={{ ...display(size), margin: 0 }}>{title}</h2>
{rows.length > 0 && (
<div style={{ display: "flex", flexDirection: "column", alignItems: "flex-start", gap: rowGap, width: "fit-content", maxWidth: "100%", margin: `${titleGap}px auto 0`, textAlign: "left" }}>
{rows.map((r, i) => {
const s = springAt(f, r.at, fps, SPRINGS.firm), rise = progress(f, r.at + 2, r.at + 14)
return (
<div key={i} style={{ display: "flex", alignItems: "flex-start", gap: gapX }}>
<Badge size={badge} line={row * 1.2} fill={fill} s={s} u={u}>
{icon === "x" ? <X size={badge * 0.56} strokeWidth={3} color={GLYPH} /> : <Check size={badge * 0.56} strokeWidth={3} color={GLYPH} />}
</Badge>
<span style={{
fontSize: row, lineHeight: 1.2, fontWeight: weight, textWrap: "pretty", fontVariantNumeric: "tabular-nums",
opacity: rise, transform: `translateY(${(1 - rise) * 12 * u}px)`,
}}>{r.text}</span>
</div>
)
})}
</div>
)}
</div>
)
}
/** A solid status badge sized to its line: the status fill (kept dark enough for the white glyph), springing in. */
function Badge({ size, line, fill, s, u, children }: { size: number; line: number; fill: string; s: number; u: number; children: React.ReactNode }) {
return (
<div aria-hidden style={{
flex: "none", width: size, height: size, marginTop: Math.max(0, (line - size) / 2), borderRadius: "50%", background: fill,
display: "grid", placeItems: "center", opacity: Math.min(1, s * 1.6), transform: `scale(${0.6 + 0.4 * s})`,
boxShadow: `inset 0 ${1.5 * u}px 0 oklch(from ${fill} calc(l + 0.1) c h / 0.5), 0 ${2 * u}px ${3 * u}px ${sh(0.3)}`,
}}>{children}</div>
)
}
/** The scale (between `floor` and `cap`) and centre that fit a w × h column inside a box; `floor` keeps rows at their minimum size. */
function place(b: Box, w: number, h: number, cap: number, floor: number): Placed {
const s = clamp(Math.min((b.x1 - b.x0) / Math.max(1, w), (b.y1 - b.y0) / Math.max(1, h)), floor, Math.max(floor, cap))
return { s, cx: (b.x0 + b.x1) / 2, cy: (b.y0 + b.y1) / 2 }
}
const split = (s: string) => s.split(/\s+/).filter(Boolean)
const clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v))
const spread = (n: number, a: number, b: number, i: number) => (n <= 1 ? a : Math.round(a + ((b - a) * i) / (n - 1)))
/** Estimated wrapped line count for a string at a size inside a width (used until the column is measured). */
const lines = (s: string, px: number, w: number, k = 0.52) => Math.max(1, Math.ceil((s.length * k * px) / Math.max(1, w)))
const norm = (s: string) => s.toLowerCase().replace(/[^a-z0-9$%']/g, "")
function matchRange(list: string[], phrase?: string): [number, number] | null {
if (!phrase) return null
const p = split(phrase).map(norm)
if (!p.length) return null
for (let i = 0; i + p.length <= list.length; i++) if (p.every((x, k) => norm(list[i + k]) === x)) return [i, i + p.length]
return null
}
pieces/video/old-way-new-way/specimen.tsx 36 lines
import __studioImage29333534 from "../assets/6ecade6aeb8b4ca1.webp";
import __studioImage38ca50a7 from "../assets/96bb129629c4f4e7.webp";
import * as React from "react"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { OldWayNewWay, video, type OldWayNewWayProps } from "../old-way-new-way"
export const states = ["landscape", "vertical"]
/** Old way readable, the seam mid-slide, the halves with the new way's rows landed, the takeover mid-push, the final hold. */
export const keyframes = [14, 80, 146, 160, 205]
// Fictional sample: Hartline Builders, a remodelling contractor.
// The old way keeps the designed job-site still (the generic world the viewer is stuck in); the new way is the brand's
// own scene, so a brand that supplies a lifestyle photo shows its finished work there.
const jobSite = __studioImage38ca50a7
const finishedRoom = __studioImage29333534
export const sample: OldWayNewWayProps = {
oldTitle: "The low bid",
oldRows: ["Price changes mid-job", "Priced from the driveway"],
newTitle: "Fixed-Price Promise",
newRows: ["One price, in writing", "Every room walked first"],
newHighlight: "Fixed-Price",
oldScene: jobSite,
newScene: finishedRoom,
focus: "68% 50%",
newFocus: "50% 55%",
}
/** The sample business in its own colours and type; Original and every preset stay one click away. */
// forest-night · slab: a sturdy builder's face with real bold weights (no faux-bolded single-weight display face).
export const sampleBrand = { name: "Hartline Builders", theme: "dark", background: "#0f1f19", colors: ["#3ddc97", "#f4b860"], fonts: ["Roboto Slab", "Roboto"] }
export default function OldWayNewWaySpecimen({ state = "landscape" }: { state?: string }) {
return <VideoPreview component={OldWayNewWay} props={{ ...sample, newScene: slot("scene", finishedRoom) }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalOldWayNewWay |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalOldWayNewWay |
number |
Default video.durationInFrames
|
oldTitle OptionalOldWayNewWay |
string |
Default "The old way"
|
oldRows OptionalOldWayNewWay |
string[] |
Default []
|
newTitle OptionalOldWayNewWay |
string |
Default "The new way"
|
newRows OptionalOldWayNewWay |
string[] |
Default []
|
newHighlight OptionalOldWayNewWay |
string |
|
seamAt OptionalOldWayNewWay |
number |
|
takeoverAt OptionalOldWayNewWay |
number |
|
words OptionalOldWayNewWay |
Word[] |
|
oldScene OptionalOldWayNewWay |
string |
|
newScene OptionalOldWayNewWay |
string |
|
focus OptionalOldWayNewWay |
string |
|
newFocus OptionalOldWayNewWay |
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.
-
6ecade6aeb8b4ca1.webp
image/webp · 99 KB
-
96bb129629c4f4e7.webp
image/webp · 98.2 KB
-
f211b3080387e46d.webp
image/webp · 105 KB