Testimonial Card 1
A customer's verbatim words set huge and centred, the result swiped, then their portrait chip, name and town under it; the proof beat of a sales video, VSL or video ad.
Use it in a prompt
Use the video/testimonial-card video frame from the FunnelDNA library in my brand (landscape and vertical and square). 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/testimonial-card.tsx. - Import it and pass your copy and images (Props tab):
import { TestimonialCard } from "@/components/funneldna/video/testimonial-card"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/testimonial-card/component.tsx 264 lines
// When to use: A customer's verbatim words set huge and centred, the result swiped, then their portrait chip, name and town under it; the proof beat of a sales video, VSL or video ad.
import * as React from "react"
import { Star } from "lucide-react"
import { Img, OffthreadVideo, Sequence, useVideoConfig } from "remotion"
import noise from "../fx/textures/noise"
import { Scrim } from "../fx/fx"
import {
EASE, HOLD, IN_OUT, MarkerSwipe, SPRINGS, StageField, StagePhoto, T, TONES, VideoStage, display, ok, phraseRange, progress, springAt, swipePart, tween,
useFitText, useHeld, useStage, useWords,
type StageTone, type TimedWord, type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 210, formats: ["landscape", "vertical", "square"], poster: 200 } satisfies VideoMeta
export type TestimonialCardProps = {
format?: VideoFormat
/** Scene length, 5–9 s. With a clip: the clip's length plus the 12-frame hold. */
durationInFrames?: number
/** The customer's words, verbatim and used with their permission. The frame renders nothing without it. */
quote?: string
/** The phrase inside `quote` that gets the one marker swipe (usually the result). */
highlight?: string
/** Who said it, set bold beside (landscape) or under (vertical, square) the portrait chip. */
name?: string
/** Their town, business or role, plain under the name. */
role?: string
/** Their real portrait (pass slot("item-1", …)), shown as a rounded-square chip beside or above the name. */
portrait?: string
/** Portrait focal point inside the chip (CSS object-position); the default suits a head-and-shoulders shot. */
focus?: string
/** A supplied testimonial clip, played in the chip in place of the still. Pass `portrait` too: it takes over for the final hold. */
video?: string
/** Play the clip's own sound; muted by default. */
audio?: boolean
/** Their real star rating out of 5; the stars render only when it is given. */
rating?: number
/** Accessible label for the stars; {rating} is replaced by the number shown. */
ratingLabel?: string
/** Voice timings for `quote` (the clip's audio or the voiceover); without them the phrases land on an even beat. */
words?: Word[]
/** The field: surface (the bright end, default) or band (the dark end of the palette). */
tone?: Exclude<StageTone, "card">
/** Scene photo behind the quote (pass slot("scene", …)): natural colour, a slow push, scrimmed behind the words only. */
scene?: string
/** Scene photo focal point (CSS object-position). */
sceneFocus?: string
}
/**
* The type and spacing scale per format (stage px at the native canvas). Landscape sets the credit as a row beside the
* chip; vertical and square stack the chip above a centred credit, so every centred line is centred on the column.
* Square is its own composition: a tighter mark, a 120px chip and a 4-row quote box that fills the 1:1 safe area.
*/
const SCALE = {
landscape: { mark: 200, chip: 160, name: 60, role: 48, star: 48, quoteGap: 28, creditGap: 48, chipGap: 32, guess: 120, max: 128, lines: [2, 3, 4] },
vertical: { mark: 170, chip: 160, name: 56, role: 48, star: 48, quoteGap: 28, creditGap: 48, chipGap: 24, guess: 100, max: 116, lines: [3, 4, 5] },
square: { mark: 150, chip: 120, name: 50, role: 40, star: 40, quoteGap: 22, creditGap: 36, chipGap: 20, guess: 92, max: 108, lines: [2, 3, 4] },
} as const
/** Proof: the quote mark draws on, the words set phrase by phrase big and centred, one swipe on the result, then the portrait chip and who said it. */
export function TestimonialCard({
format = "landscape",
durationInFrames = video.durationInFrames,
quote = "",
highlight,
name = "",
role = "",
portrait = "",
focus = "50% 30%",
video: clip = "",
audio = false,
rating,
ratingLabel = "Rated {rating} out of 5",
words,
tone = "surface",
scene = "",
sceneFocus,
}: TestimonialCardProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { u, width, height, text, format: fmt } = useStage()
const stacked = fmt !== "landscape"
const sc = SCALE[fmt]
const line = quote.trim()
const voiced = !!words?.length
const timed = useWords(line, words, durationInFrames, { from: 6, span: 0.42 })
const end = durationInFrames - HOLD
const colors = TONES[tone]
// Phrase by phrase: a phrase lands on its first spoken word, or on an even beat without voice timings.
const group = phraseOf(timed, voiced)
const first: number[] = []
group.forEach((p, i) => { if (first[p] === undefined) first[p] = i })
const step = first.length > 1 ? Math.min(30, Math.max(8, (Math.min(durationInFrames * 0.42, end - 60) - 6) / (first.length - 1))) : 0
const phraseAt = first.map((i, p) => (voiced ? Math.min(timed[i].at, end - 44) : Math.round(6 + p * step)))
const shownAt = timed.map((_, i) => phraseAt[group[i]] + 2 * (i - first[group[i]]))
const lastShown = shownAt.length ? Math.max(...shownAt) : 0
// One swipe behind the result once it has landed (and been said), then who said it; everything settles before the hold.
const range = phraseRange(timed, highlight)
const swipeAt = range ? Math.min(Math.max(shownAt[range[1] - 1] + 12, voiced ? timed[range[1] - 1].at + 2 : 0), end - 30) : -1
const swipe = range ? progress(f, swipeAt, swipeAt + 8, (t) => t) : 0
const stars = typeof rating === "number" && rating > 0 ? Math.round(Math.min(5, rating)) : 0
const creditAt = Math.min(Math.max(lastShown + 16, range ? swipeAt + 8 : 0), end - 40)
const nameAt = creditAt + (stars ? 16 : 8)
const roleAt = nameAt + (name ? 5 : 0)
// One centred column in the text-safe area: the quote mark, the quote (fitted to what is left), the credit.
const media = !!(portrait || clip)
const areaH = height - text.top - text.bottom
const colW = stacked ? width - text.left - text.right : Math.min(1560 * u, width - text.left - text.right)
const markSize = sc.mark * u
const markRoom = markSize * 0.46
// 9:16: the platform UI owns the top 250px. The column starts below it by the mark's ascent overhang (its glyph box
// rises past its 1.0 line box), its -0.06em lift and the drift's growth, so no glyph crosses the band on any frame.
const guard = fmt === "vertical" ? Math.ceil(markSize * 0.22 + areaH * 0.0075 + 8 * u) : 0
const colTop = text.top + guard, colH = areaH - guard
const chip = media ? sc.chip * u : 0
const chipGap = sc.chipGap * u
// Phone type scale: the credit stays large (48px on 16:9 and 9:16, 40px in the tighter 1:1), never near the 28px floor.
const nameSize = sc.name * u, roleSize = sc.role * u, starSize = sc.star * u
const textH = (stars ? starSize + 14 * u : 0) + (name ? nameSize * 1.15 : 0) + (role ? roleSize * 1.25 + (name ? 6 * u : 0) : 0)
const hasCredit = !!(stars || name || role || media)
const hasText = !!(stars || name || role)
const creditH = stacked ? chip + (media && hasText ? chipGap : 0) + textH : Math.max(chip, textH)
const creditGap = sc.creditGap * u, quoteGap = sc.quoteGap * u
const boxH = colH - markRoom - quoteGap - (hasCredit ? creditH + creditGap : 0)
const quoteRef = React.useRef<HTMLQuoteElement>(null)
const size = useFitText(quoteRef, line, {
boxW: colW, boxH, guess: sc.guess * u, max: sc.max * u, min: 72 * u, lines: [...sc.lines],
})
if (!line) return null
const draw = progress(f, 2, 18, IN_OUT)
const drift = tween(f, [0, end], [1, 1.015], IN_OUT)
const still = clip ? progress(f, end - 10, end, IN_OUT) : 1
const markInk = tone === "band" ? T.accentFill : T.accent
const rise = (at: number): React.CSSProperties => {
const k = progress(f, at, at + 14, EASE)
return { opacity: Math.min(1, k * 1.6), transform: `translateY(${(1 - k) * 24 * u}px)` }
}
const chipIn = springAt(f, creditAt, fps, SPRINGS.pop)
// Dark, close drop shadows read straight from the --shadow token (dark recipe as the fallback).
const contactShade = "oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35)"
const ambientShade = "oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.3)"
const cover: React.CSSProperties = { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", objectPosition: focus }
// Without a photo the field gets depth: a quiet in-hue edge tint under the drifting texture.
const edgeTone = tone === "band" ? ok("--band", -0.07) : "color-mix(in oklch, var(--ink) 8%, var(--surface))"
// The credit text is centred on the column when stacked (or without a chip), left-aligned beside the chip in landscape.
const centredCredit = stacked || !media
const parts: React.ReactNode[] = []
timed.forEach((x, i) => {
const k = progress(f, shownAt[i], shownAt[i] + 16, EASE)
const w = (
<span key={i} style={{ display: "inline-block", opacity: Math.min(1, k * 1.6), transform: `translateY(${(1 - k) * 30 * u}px)` }}>{x.w}</span>
)
const m = range && i >= range[0] && i < range[1] ? i - range[0] : -1
parts.push(m < 0 ? w : <MarkerSwipe key={"m" + i} p={swipePart(swipe, m, range![1] - range![0])}>{w}</MarkerSwipe>)
if (i < timed.length - 1) parts.push(" ")
})
return (
<VideoStage format={format} tone={tone}>
{scene ? (
<>
<StagePhoto src={scene} frame={f} dur={end} push={fmt === "square" ? [1.03, 1.09] : [1.02, 1.08]} treatment="natural" side="center" tone={tone} position={sceneFocus} />
<div aria-hidden style={{ position: "absolute", inset: 0, zIndex: 0, isolation: "isolate", pointerEvents: "none" }}>
<Scrim side="center" tone={tone} strength={0.45} />
</div>
</>
) : (
<>
<div aria-hidden style={{ position: "absolute", inset: 0, zIndex: 0, background: `radial-gradient(120% 90% at 50% 46%, transparent 42%, ${edgeTone} 100%)` }} />
<StageField tone={tone} texture={noise} opacity={tone === "band" ? 0.14 : 0.1} frame={f} />
</>
)}
<figure style={{
position: "absolute", zIndex: 1, margin: 0, boxSizing: "border-box", left: (width - colW) / 2, top: colTop, width: colW, height: colH,
display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", textAlign: "center",
transform: `scale(${drift})`, transformOrigin: "50% 50%",
}}>
<div aria-hidden style={{ alignSelf: "stretch", height: markRoom, marginBottom: quoteGap, overflow: "visible" }}>
<span style={{
...display(markSize, { lineHeight: 1, letterSpacing: 0, textTransform: "none" }), display: "block", marginTop: "-0.06em", textAlign: "center",
color: markInk, clipPath: `inset(0 ${(1 - draw) * 100}% 0 0)`, opacity: Math.min(1, draw * 3),
}}>“</span>
</div>
<blockquote ref={quoteRef} style={{ ...display(size, { lineHeight: 1.06 }), margin: 0, color: colors.ink, maxWidth: colW, textAlign: "center" }}>{parts}</blockquote>
{hasCredit && (
<figcaption style={{
marginTop: creditGap, marginInline: "auto", alignSelf: "center", boxSizing: "border-box", maxWidth: colW,
display: "flex", flexDirection: stacked ? "column" : "row", alignItems: "center", justifyContent: "center", gap: chipGap,
textAlign: centredCredit ? "center" : "left",
}}>
{media && (
<div style={{
flex: "none", width: chip, height: chip, opacity: Math.min(1, chipIn * 1.6),
transform: `translateY(${(1 - chipIn) * 20 * u}px) scale(${0.86 + 0.14 * chipIn})`,
filter: `drop-shadow(0 ${2 * u}px ${3 * u}px ${contactShade}) drop-shadow(0 ${12 * u}px ${16 * u}px ${ambientShade})`,
}}>
<div style={{
position: "relative", width: "100%", height: "100%", overflow: "hidden", borderRadius: `calc(${T.radius} * ${2 * u})`,
background: `color-mix(in oklch, ${colors.ink} 8%, ${colors.bg})`,
}}>
{clip && (
<Sequence durationInFrames={Math.max(1, end)}>
<OffthreadVideo src={clip} muted={!audio} style={{ ...cover, opacity: portrait ? 1 : 1 - still }} />
</Sequence>
)}
{portrait && <Img src={portrait} alt={name} style={{ ...cover, opacity: clip ? still : 1 }} />}
</div>
</div>
)}
{hasText && (
<div style={{
display: "flex", flexDirection: "column", alignItems: centredCredit ? "center" : "flex-start", textAlign: centredCredit ? "center" : "left",
marginInline: centredCredit ? "auto" : undefined,
minWidth: 0, maxWidth: stacked ? colW : colW - chip - (media ? chipGap : 0), textWrap: "pretty",
}}>
{stars > 0 && (
<div role="img" aria-label={ratingLabel.replace("{rating}", String(stars))} style={{ display: "flex", justifyContent: centredCredit ? "center" : "flex-start", gap: 8 * u, height: starSize, marginBottom: 14 * u }}>
{[0, 1, 2, 3, 4].map((i) => {
const s = springAt(f, creditAt + 6 + i * 3, fps, SPRINGS.pop)
const c = i < stars ? T.accentFill : `color-mix(in oklch, ${colors.ink} 18%, ${colors.bg})`
return (
<span key={i} style={{ display: "inline-flex", opacity: Math.min(1, s * 2), transform: `scale(${0.6 + 0.4 * s})` }}>
<Star aria-hidden size={starSize} strokeWidth={2} strokeLinejoin="round" color={c} fill={c} />
</span>
)
})}
</div>
)}
{name && <div style={{ ...rise(nameAt), fontSize: nameSize, fontWeight: 800, lineHeight: 1.15, color: colors.ink }}>{name}</div>}
{role && <div style={{ ...rise(roleAt), marginTop: name ? 6 * u : 0, fontSize: roleSize, fontWeight: 500, lineHeight: 1.25, color: colors.muted }}>{role}</div>}
</div>
)}
</figcaption>
)}
</figure>
</VideoStage>
)
}
export default TestimonialCard
/** Words that open a new phrase, and short words a phrase never ends on (so "was up by" carries on to "Friday."). */
const OPENS = new Set(["and", "but", "so", "because", "then", "when", "until", "while", "or", "yet"])
const SMALL = new Set(["a", "an", "the", "to", "of", "and", "or", "but", "by", "for", "in", "on", "at", "with", "from", "my", "your", "our", "their", "his", "her", "its", "was", "is", "are", "were", "i", "we", "you", "it"])
const bare = (w: string) => w.toLowerCase().replace(/[^a-z']/g, "")
/** The phrase index of each word: a break at punctuation, before a joining word, after three words (never on a short word), or on a spoken pause. */
function phraseOf(timed: TimedWord[], voiced: boolean) {
const out: number[] = []
let p = 0, n = 0
timed.forEach((x, i) => {
const prev = timed[i - 1]
if (prev && (/[,.;:!?—–][”’"')]?$/.test(prev.w) || (n >= 2 && OPENS.has(bare(x.w))) || (n >= 3 && !SMALL.has(bare(prev.w))) || n >= 6 ||
(voiced && n >= 2 && x.at - prev.end > 7))) { p++; n = 0 }
out.push(p)
n++
})
return out
}
pieces/video/testimonial-card/specimen.tsx 32 lines
import __studioImage7474be13 from "../assets/56920fed40cda2fb.webp";
import * as React from "react"
import nature from "../../fx/backdrops/nature"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { TestimonialCard, video, type TestimonialCardProps } from "../testimonial-card"
export const states = ["landscape", "vertical", "square"]
/** First phrase readable, quote swiped with the chip and credit landed, final hold. */
export const keyframes = [18, 150, 205]
// Fictional sample: Larchway Fencing, a local fence builder; Jo Farrant of Millbrook is an invented customer.
const portraitShot = __studioImage7474be13
export const sample: TestimonialCardProps = {
quote: "They quoted Tuesday and the fence was up by Friday.",
highlight: "up by Friday.",
name: "Jo Farrant",
role: "Millbrook",
rating: 5,
tone: "band",
// The designed still (fx "Nature"), in its own colours under a centred scrim; the brand's scene slot replaces it.
scene: nature,
sceneFocus: "50% 60%",
}
/** The sample business in its own colours and type (sample-palettes.md: olive-ochre · warm-serif); Original and every preset stay one click away. */
export const sampleBrand = { name: "Larchway Fencing", theme: "light", background: "#f7f8f2", colors: ["#556b1f", "#c7922c"], fonts: ["Fraunces", "Nunito Sans"] }
export default function TestimonialCardSpecimen({ state = "landscape" }: { state?: string }) {
return <VideoPreview component={TestimonialCard} props={{ ...sample, scene: slot("scene", nature), portrait: slot("item-1", portraitShot) }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalTestimonialCard |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalTestimonialCard |
number |
Default video.durationInFrames
|
quote OptionalTestimonialCard |
string |
Default ""
|
highlight OptionalTestimonialCard |
string |
|
name OptionalTestimonialCard |
string |
Default ""
|
role OptionalTestimonialCard |
string |
Default ""
|
portrait OptionalTestimonialCard |
string |
Default ""
|
focus OptionalTestimonialCard |
string |
Default "50% 30%"
|
video OptionalTestimonialCard |
string |
Default ""
|
audio OptionalTestimonialCard |
boolean |
Default false
|
rating OptionalTestimonialCard |
number |
|
ratingLabel OptionalTestimonialCard |
string |
Default "Rated {rating} out of 5"
|
words OptionalTestimonialCard |
Word[] |
|
tone OptionalTestimonialCard |
Exclude<StageTone, "card"> |
Default "surface"
|
scene OptionalTestimonialCard |
string |
Default ""
|
sceneFocus OptionalTestimonialCard |
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.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
scene- A wide atmosphere photo behind or beside the copy.
-
56920fed40cda2fb.webp
image/webp · 53.7 KB
-
8276864f4b8e6ac1.webp
image/webp · 47 KB
-
bec2a41897a3364d.webp
image/webp · 51.2 KB