Bonus Cards Fan 1
The offer's bonuses deal out of a closed stack into a frame-filling spread of illustrated cards (a fanned row in 16:9, a three-card cascade in 9:16), each landing on the word that names it, then one headline totals them; the bonus beat of a sales video, VSL or video ad.
Use it in a prompt
Use the video/bonus-cards-fan 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/bonus-cards-fan.tsx. - Import it and pass your copy and images (Props tab):
import { BonusCardsFan } from "@/components/funneldna/video/bonus-cards-fan"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/bonus-cards-fan/component.tsx 360 lines
// When to use: The offer's bonuses deal out of a closed stack into a frame-filling spread of illustrated cards (a fanned row in 16:9, a three-card cascade in 9:16), each landing on the word that names it, then one headline totals them; the bonus beat of a sales video, VSL or video ad.
import * as React from "react"
import { Img, useVideoConfig } from "remotion"
import noise from "../fx/textures/noise"
import gift from "../fx/spots/gift"
import { Spot, type BackdropTreatment } from "../fx/fx"
import {
CountUp, HOLD, IN_OUT, Rise, SPRINGS, StageField, StageLight, StagePhoto, T, TONES, VideoStage, cue, display, progress, springAt,
useFitText, useHeld, useStage, useWords,
type SpringConfig, type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 240, formats: ["landscape", "vertical"], poster: 220 } satisfies VideoMeta
export type BonusCard = {
/** The bonus's name, as the page lists it. */
name: string
/** The bonus shown as an object: an fx Spot illustration (import book from "../fx/spots/book"), tinted from the tokens. Default: the gift spot. */
spot?: string
/** The bonus's own art (pass slot("item-n", …)): a cover or cut-out, shown whole in place of the spot. */
image?: string
/** Its stated value, exactly as the page states it ("$49"). Leave empty when the page states none. */
value?: string
}
export type BonusCardsFanProps = {
format?: VideoFormat
durationInFrames?: number
/** The real bonuses, in the order they are named. Cards without a name do not render. */
bonuses?: BonusCard[]
/** The page's stated total value. Without it the total is summed only when every bonus has a value in one currency. */
total?: string
/** The total line. Placeholders: {count} (the number as a word) and {total} (the value, counted up). */
totalLine?: string
/** The total line for a single bonus. */
totalLineOne?: string
/** Number words for {count}, from one upward; past the list the digits show. */
countWords?: string[]
/** How a card states its value. Placeholder: {value}. */
valueLabel?: string
/** One short closing line under the total (one-line punch: "Included."); without a total it becomes the key line. In 9:16 it shows only when it fits at full size. */
close?: string
/** Voice timings for the scene; each card deals on the first word of its name, the total line on its first word. */
words?: Word[]
/** The field: band (default; a tinted or dark stage the white cards stand out on) or surface (the bright end). */
tone?: "surface" | "band"
/** Scene photo behind the cards (pass slot("scene", …)); keeps its own colour under a scrim behind the total line. Without one the lit stage set shows. */
scene?: string
/** How the photo takes the theme: natural (its own colours under the tone's scrim) or duotone (mapped to the tokens). */
treatment?: BackdropTreatment
/** Photo focal point (CSS object-position). */
focus?: string
}
const COUNT_WORDS = ["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve"]
/** The deal: a quick slide with one small overshoot, landed in about 11 frames. */
const DEAL: SpringConfig = { damping: 17, stiffness: 200, mass: 0.8 }
/** The total line arrives at 106% and settles to 100% inside 6 frames. */
const SLAM = 1.06
/**
* Card designs in stage px. Every card is one white surface: the illustration stands straight on it, the words under
* (16:9) or beside it (9:16). Landscape: tall cards fanned in a shallow arc; the settled fan starts `top` below the
* 96px title margin. Vertical: three wide cards at 90% of the safe width in a cascade that never overlaps once dealt;
* names 60px and values 48px, never under the 44px phone floor.
*/
const LAND = { w: 500, rot: 3.5, arc: 26, maxH: 600, top: 16, pad: 24, gap: 18, name: 56, val: 44, valGap: 6, padB: 26 } as const
const VERT = { share: 0.9, step: 20, rot: 1, gap: 18, edge: 20, pad: 26, spot: 136, inner: 26, name: 60, val: 48, valGap: 4, floor: 44, fit: 0.74 } as const
/** The closing line under the total. */
const SUP = 52
const SHADOW = "var(--shadow, oklch(0.22 0.03 260))"
/** Offer · bonuses: the closed stack deals its cards out one by one, the spread settles, the total line slams in and counts. */
export function BonusCardsFan({
format = "landscape",
durationInFrames = video.durationInFrames,
bonuses = [],
total = "",
totalLine = "{count} bonuses, {total} value",
totalLineOne = "{count} bonus, {total} value",
countWords = COUNT_WORDS,
valueLabel = "{value} value",
close = "",
words,
tone = "band",
scene = "",
treatment = "natural",
focus,
}: BonusCardsFanProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { u, width, height, text, portrait } = useStage()
const s = (x: number) => x * u
const live = durationInFrames - HOLD
// Copy: the total shows only when it is stated or every bonus states a value.
const cards = bonuses.filter((b) => b.name?.trim())
const n = cards.length
const sum = n ? total.trim() || sumValues(cards.map((b) => b.value)) : ""
const count = countWords[n - 1] ?? String(n)
const keyTpl = sum ? (n === 1 ? totalLineOne : totalLine) : ""
const keyText = keyTpl ? keyTpl.split("{count}").join(count).split("{total}").join(sum).trim() : close.trim()
const support = keyTpl ? close.trim() : ""
// The text-safe column: the cards above, the total line under them. Every word on a card stays inside it.
const colL = text.left / u, colW = (width - text.left - text.right) / u
const top = text.top / u, bottom = (height - text.bottom) / u, avail = bottom - top
const keyMax = portrait ? 110 : 120
const keyW = colW / SLAM
const keyRows = keyText ? Math.min(portrait ? 3 : 2, Math.max(1, Math.ceil((keyText.length * 0.5 * keyMax) / keyW))) : 0
const keyIdeal = keyRows ? keyRows * keyMax * 1.08 + 8 : 0
const keyMin = keyRows ? keyRows * (portrait ? 90 : 84) * 1.08 + 8 : 0
const supGap = portrait ? 18 : 10
const supRaw = support ? supGap + SUP * 1.2 * (support.length * 0.55 * SUP > colW ? 2 : 1) : 0
const lineGap = n && keyText ? (portrait ? 32 : 24) : 0
const anyVal = cards.some((b) => b.value?.trim())
const longestAt = cards.reduce((best, b, i) => (b.name.trim().length > cards[best].name.trim().length ? i : best), 0)
const longest = n ? cards[longestAt].name.trim().length : 0
const mid = (n - 1) / 2
// 9:16: the longest name is measured in the theme's own face; it takes one row at 60px when it fits, else two.
const wV = colW * VERT.share
const textWv = wV - 2 * VERT.pad - VERT.spot - VERT.inner
const nameRef = React.useRef<HTMLDivElement>(null)
const nameFit = useFitText(nameRef, n ? cards[longestAt].name.trim() : "", {
boxW: textWv * 0.97 * u, boxH: 400 * u, guess: VERT.name * u, max: VERT.name * u, min: 30 * u, lines: [1],
})
const linesV = nameFit >= VERT.name * u - 0.5 ? 1 : 2
const wordsV = linesV * VERT.name * 1.06 + (anyVal ? VERT.valGap + VERT.val * 1.15 : 0)
const cardV = Math.max(VERT.spot, wordsV) + 2 * VERT.pad
const bodyV = n ? n * cardV + (n - 1) * VERT.gap : 0
const roomV = (sh: number) => avail - lineGap - sh - keyMin - 2 * VERT.edge
// On phones the closing line shows only when the cards keep their full size with it; it is never shrunk.
const showSup = !!support && (!portrait || !n || roomV(supRaw) >= bodyV)
const supH = showSup ? supRaw : 0
// 16:9: the fan takes the height the total line leaves; cards scale together only when the row cannot hold them.
const sinL = Math.sin((LAND.rot * Math.PI) / 180)
const spanL = n < 2 ? LAND.w : n === 2 ? 2 * LAND.w + 40 : n * LAND.w - 2 * (n - 1)
const cl = n ? Math.max(0.4, Math.min(1, (colW * 0.98 - 2 * LAND.maxH * sinL) / spanL)) : 1
const fanL = n ? Math.max(0, avail - lineGap - keyIdeal - supH) : 0
const cWl = LAND.w * cl
const linesL = Math.min(2, Math.max(1, Math.ceil((longest * 0.55 * LAND.name) / (LAND.w - 2 * LAND.pad))))
const textL = (LAND.gap + linesL * LAND.name * 1.08 + (anyVal ? LAND.valGap + LAND.val * 1.15 : 0) + LAND.padB) * cl
const arcY = n > 2 ? LAND.arc * cl : n === 2 ? 10 * cl : 0
const roomL = fanL - LAND.top - arcY - (cWl * sinL) / 2 - 12
const cHl = Math.max((LAND.pad + 140) * cl + textL, Math.min(LAND.maxH * cl, roomL))
const cy0 = LAND.top + Math.max(0, (roomL - cHl) / 2) + cHl / 2
const artL = Math.min((cWl - 2 * LAND.pad * cl) * 0.8, (cHl - LAND.pad * cl - textL) * 0.9)
// 9:16: the cascade and the total centred together in the safe area; more than three cards scale down to the floor.
const cv = n ? Math.max(VERT.fit, Math.min(1, roomV(supH) / bodyV)) : 1
const fanV = n ? bodyV * cv + 2 * VERT.edge : 0
const keyV = keyText ? Math.max(0, Math.min(keyIdeal, avail - fanV - lineGap - supH)) : 0
const topV = top + Math.max(0, (avail - fanV - lineGap - keyV - supH) / 2)
const c = portrait ? cv : cl
const cW = portrait ? wV * cv : cWl
const cH = portrait ? cardV * cv : cHl
const fanTop = portrait ? topV : top
const fanH = portrait ? fanV : fanL
const keyBoxH = portrait ? keyV : keyIdeal
const lineH = keyBoxH + supH
const lineTop = portrait ? topV + fanV + lineGap : n ? bottom - lineH : top + (avail - lineH) / 2
const stepY = (cardV + VERT.gap) * cv
const midY = VERT.edge + cH / 2 + mid * stepY
const stepC = n > 1 ? Math.min(VERT.step, 60 / (n - 1)) : 0
const stepX = n < 2 ? 0 : n === 2 ? cW + 40 * cl : cW - 2 * cl
const sz = (x: number) => x * c * u
// Words on a card never go under 28px, and never under 44px on phones.
const txt = (x: number) => Math.max((portrait ? VERT.floor : 28) * u, sz(x))
/** A card's settled place (stage px inside the card box); `spread` opens the spread a little before it settles. */
const slotAt = (i: number, spread: number) => {
const m = n > 1 ? (i - mid) / mid : 0
if (portrait) return { x: colW / 2 + (i - mid) * stepC, y: midY + (i - mid) * stepY * spread, r: -m * VERT.rot, m }
return { x: colW / 2 + (i - mid) * stepX * spread, y: cy0 + arcY * m * m * spread, r: m * LAND.rot, m }
}
// The closed stack sits in the middle of the spread; cards deal out of it to their places.
const stackY = portrait ? midY : cy0 + arcY * 0.3
// Schedule: the default fits 8 s (first card landed by frame ~15, all out by ~70); other lengths stretch or
// compress it, and voice cues move each beat to its word.
const timed = useWords(words?.map((w) => w.w).join(" ") ?? "", words, durationInFrames)
const voiced = !!words?.length
const k = Math.max(0.55, Math.min(1.6, live / 228))
const at = (x: number) => Math.round(x * k)
const gapOut = n > 1 ? Math.min(at(28), (at(62) - at(4)) / (n - 1)) : 0
const outAt: number[] = []
cards.forEach((b, i) => {
const said = cue(timed, voiced ? b.name : undefined, Math.round(at(4) + i * gapOut))
outAt.push(Math.min(Math.max(said, i ? outAt[i - 1] + 8 : 3), live - 96 - (n - 1 - i) * 8))
})
const lastOut = n ? outAt[n - 1] : 0
const settleAt = Math.min(lastOut + at(16), live - 76)
const settleEnd = settleAt + 18
const ready = n ? settleEnd + 4 : 6
const slamAt = Math.min(Math.max(ready, cue(timed, voiced ? keyText : undefined, ready)), live - 40)
const countAt = slamAt + 6
const countDur = Math.max(10, Math.min(at(26), live - 18 - countAt))
const beatBase = keyTpl ? countAt + countDur : slamAt + at(24)
const beatAt = Math.min(Math.max(beatBase, voiced && keyTpl ? cue(timed, sum, -1) : -1), live - 12)
const closeAt = Math.min(Math.max(countAt + countDur + 4, voiced && showSup ? cue(timed, support, -1) : -1), live - 16)
// The slam is the only thing that moves for its six frames: the field, the camera and the art pause under it.
const tt = !keyText || f < slamAt ? f : f < slamAt + 6 ? slamAt : f - 6
const outP = outAt.map((a) => springAt(f, a, fps, DEAL))
const settle = n ? progress(f, settleAt, settleEnd, IN_OUT) : 1
const sp = 1 + (portrait ? 0.02 : 0.035) * (1 - settle)
const cam = 1 + 0.015 * progress(tt, 0, live, (t) => t)
const artPush = 1 + 0.05 * progress(tt, 0, live, (t) => t)
// Already mid-spring at frame 0, so the closed stack reads from the first frames.
const enter = springAt(f, -4, fps, SPRINGS.firm)
const slam = f < slamAt ? SLAM : SLAM - (SLAM - 1) * progress(f, slamAt, slamAt + 6)
const beat = 1 + 0.06 * Math.sin(Math.PI * progress(f, beatAt, beatAt + 10, IN_OUT))
const radius = `calc(${T.cardRadius} * ${(1.8 * u).toFixed(4)})`
// One hard, close shadow per card: a crisp contact layer and a short ambient layer on the theme's shadow colour.
const shadow = `var(--card-shadow, 0 ${s(2)}px ${s(3)}px oklch(from ${SHADOW} l c h / 0.3), 0 ${s(16)}px ${s(26)}px ${s(-12)}px oklch(from ${SHADOW} l c h / 0.42))`
const artShadow = `drop-shadow(0 ${s(2)}px ${s(3)}px oklch(from ${SHADOW} l c h / 0.35)) drop-shadow(0 ${s(10)}px ${s(14)}px oklch(from ${SHADOW} l c h / 0.3))`
const ink = TONES[tone].ink
// The counted total takes the accent only on the bright stage; on a band or a photo scrim it stays in the line's ink.
const numColor = tone === "surface" && !scene ? T.accent : ink
/** The bonus as an object standing straight on the card: its Spot (or supplied art) springs up on its deal over a soft contact shadow. */
const picture = (b: BonusCard, i: number, size: number, style: React.CSSProperties) => {
const kp = springAt(f, (outAt[i] ?? 0) + 3, fps, SPRINGS.pop)
const grow = (0.86 + 0.14 * kp) * artPush
return (
<div style={{ position: "relative", ...style }}>
<div aria-hidden style={{
position: "absolute", left: "50%", top: `calc(50% + ${s(size * 0.4).toFixed(2)}px)`, width: s(size * 0.68), height: s(size * 0.1), borderRadius: "50%",
transform: `translate(-50%, -50%) scaleX(${(0.8 + 0.2 * kp).toFixed(4)})`, background: `radial-gradient(closest-side, oklch(from ${SHADOW} l c h / 0.26), transparent)`,
}} />
<div style={{
position: "absolute", left: "50%", top: "50%", width: s(size), height: s(size), display: "flex", alignItems: "center", justifyContent: "center",
transform: `translate(-50%, -54%) scale(${grow.toFixed(4)})`, transformOrigin: "50% 90%",
}}>
{b.image
? <Img src={b.image} alt="" style={{ width: "100%", height: "100%", objectFit: "contain", filter: artShadow }} />
: <Spot src={b.spot || gift} size={s(size)} />}
</div>
</div>
)
}
const card = (b: BonusCard, i: number) => {
const p = outP[i], kk = Math.min(1, Math.max(0, p)), lift = Math.sin(Math.PI * kk)
let ahead = 0
for (let j = 0; j < i; j++) ahead += Math.min(1, outP[j])
// Depth in the stack (cards still above it), continuous so the stack steps up as each card leaves.
const d = Math.min(3, Math.max(0, i - ahead))
const deep = Math.sin(d * 2.4) * 2.4 * Math.min(1, d)
// The card before this one tucks back a touch as this one deals.
const tuck = i < n - 1 ? Math.min(1, Math.max(0, outP[i + 1])) : 0
const t = slotAt(i, sp)
const sx = colW / 2 + Math.sin(d * 1.7) * 6, sy = stackY + d * 9
// The deal flourish turns and swells the card in flight; it never lifts a card toward the top edge.
const x = sx + (t.x - sx) * p + (portrait ? lift * 30 : 0)
const y = sy + (t.y - sy) * p + (portrait ? 0 : tuck * 6)
const rot = deep + (t.r - deep) * p + lift * (portrait ? -3 : t.m < 0 ? -4 : 4)
const scale = (1 - 0.025 * tuck) * (1 + 0.03 * lift)
const value = b.value?.trim()
// Cards still buried in the closed stack show a clean blank back: only the top card's face reads until it deals.
const show = i === 0 ? 1 : Math.max(Math.min(1, kk * 4), 1 - Math.min(1, d))
const shell: React.CSSProperties = {
position: "absolute", left: s(x - cW / 2), top: s(y - cH / 2), width: s(cW), height: s(cH), boxSizing: "border-box", zIndex: n - i + 1,
display: "flex", background: T.card, color: T.ink, border: `${s(1.5)}px solid ${T.cardBorder}`, borderRadius: radius, boxShadow: shadow, overflow: "hidden",
transform: `rotate(${rot.toFixed(3)}deg) scale(${scale.toFixed(4)})`,
}
const nameStyle = (size: number): React.CSSProperties => ({ ...display(txt(size), { lineHeight: 1.06 }), color: T.ink })
const valueEl = value ? (
<div style={{
marginTop: sz(portrait ? VERT.valGap : LAND.valGap), fontFamily: T.body, fontWeight: 700, fontSize: txt(portrait ? VERT.val : LAND.val),
lineHeight: 1.15, color: T.accent, fontVariantNumeric: "tabular-nums",
}}>{valueLabel.split("{value}").join(value)}</div>
) : null
if (portrait) return (
<div key={i} style={{ ...shell, flexDirection: "row", alignItems: "center", gap: sz(VERT.inner), padding: sz(VERT.pad) }}>
{picture(b, i, VERT.spot * cv * 0.96, { flex: "none", width: sz(VERT.spot), height: sz(VERT.spot), opacity: show })}
<div style={{ flex: "1 1 0", minWidth: 0, display: "flex", flexDirection: "column", opacity: show }}>
<div ref={i === longestAt ? nameRef : undefined} style={nameStyle(VERT.name)}>{b.name}</div>
{valueEl}
</div>
</div>
)
return (
<div key={i} style={{ ...shell, flexDirection: "column", padding: `${sz(LAND.pad)}px ${sz(LAND.pad)}px ${sz(LAND.padB)}px` }}>
{picture(b, i, artL, { flex: "1 1 0", minHeight: 0, opacity: show })}
<div style={{ flex: "none", paddingTop: sz(LAND.gap), opacity: show }}>
<div ref={i === longestAt ? nameRef : undefined} style={{ ...nameStyle(LAND.name), minHeight: linesL * txt(LAND.name) * 1.06 }}>{b.name}</div>
{valueEl}
</div>
</div>
)
}
// The total line is a headline, measured in the theme's face (1 row in 16:9, 2 in 9:16 for the sample).
const head = React.useRef<HTMLHeadingElement>(null)
const fit = useFitText(head, keyText, {
boxW: keyW * u, boxH: keyBoxH * u, guess: keyMax * 0.85 * u,
max: keyMax * u, min: 72 * u, lines: portrait ? [1, 2, 3] : [1, 2],
})
const numberEl = (
<span key="total" style={{ display: "inline-grid", color: numColor, transform: `scale(${beat.toFixed(4)})`, transformOrigin: "50% 60%", fontVariantNumeric: "tabular-nums" }}>
<span aria-hidden style={{ gridArea: "1 / 1", visibility: "hidden" }}>{sum}</span>
<CountUp value={sum} at={countAt} dur={countDur} style={{ gridArea: "1 / 1", justifySelf: "center" }} />
</span>
)
const lineParts = keyTpl
? keyTpl.split(/([{]count[}]|[{]total[}])/).filter(Boolean).map((part, i) =>
part === "{total}" ? numberEl : <React.Fragment key={i}>{part === "{count}" ? count : part}</React.Fragment>)
: keyText
return (
<VideoStage format={format} tone={tone}>
{scene
? <StagePhoto src={scene} frame={tt} dur={live} push={[1.02, 1.08]} treatment={treatment} tone={tone} side="bottom" position={focus} />
: <StageField tone={tone} texture={noise} opacity={tone === "band" ? 0.14 : 0.12} drift={10} frame={tt} />}
<StageLight x="50%" strength={tone === "band" ? 0.24 : 0.3} tone={tone === "band" ? "band-ink" : "card"} floor={!portrait} />
{n > 0 && (
<div style={{
position: "absolute", left: s(colL), top: s(fanTop), width: s(colW), height: s(fanH),
opacity: Math.min(1, enter * 1.6), transform: `translateY(${((1 - enter) * 60 * u).toFixed(2)}px) scale(${cam.toFixed(4)})`, transformOrigin: "50% 50%",
}}>
{cards.map(card)}
</div>
)}
{keyText && (
<div style={{ position: "absolute", left: s(colL), top: s(lineTop), width: s(colW), height: s(lineH), display: "flex", flexDirection: "column", alignItems: "center", textAlign: "center" }}>
<div style={{ height: s(keyBoxH), width: "100%", display: "flex", alignItems: showSup ? "flex-end" : "center", justifyContent: "center" }}>
<h2 ref={head} style={{
...display(fit, { lineHeight: 1.04 }), margin: 0, color: ink, maxWidth: s(keyW),
opacity: f >= slamAt ? 1 : 0, transform: `scale(${(slam * (keyTpl ? 1 : beat)).toFixed(4)})`, transformOrigin: "50% 55%",
}}>{lineParts}</h2>
</div>
{showSup && (
<Rise at={closeAt} y={16} dur={14}>
<p style={{ margin: `${s(supGap)}px 0 0`, fontWeight: 700, fontSize: s(SUP), lineHeight: 1.2, color: ink, textWrap: "pretty" }}>{support}</p>
</Rise>
)}
</div>
)}
</VideoStage>
)
}
/** The sum of the stated values when every one is a plain amount in the same currency ("$49" + "$27" → "$76"); otherwise empty. */
function sumValues(values: (string | undefined)[]) {
if (!values.length) return ""
let prefix = "", suffix = "", sum = 0, dec = 0
for (let i = 0; i < values.length; i++) {
const m = (values[i] ?? "").trim().match(/^([^0-9 .,]*) ?([0-9][0-9,]*(?:[.][0-9]+)?) ?([^0-9 ]*)$/)
if (!m) return ""
if (!i) { prefix = m[1]; suffix = m[3] } else if (m[1] !== prefix || m[3] !== suffix) return ""
sum += parseFloat(m[2].split(",").join(""))
dec = Math.max(dec, m[2].split(".")[1]?.length ?? 0)
}
const [int, frac] = sum.toFixed(dec).split(".")
return `${prefix}${int.replace(/(?!^)(?=(?:[0-9]{3})+$)/g, ",")}${frac ? "." + frac : ""}${suffix}`
}
export default BonusCardsFan
pieces/video/bonus-cards-fan/specimen.tsx 33 lines
import * as React from "react"
import book from "../../fx/spots/book"
import checklist from "../../fx/spots/checklist"
import calendar from "../../fx/spots/calendar"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { BonusCardsFan, video, type BonusCardsFanProps } from "../bonus-cards-fan"
export const states = ["landscape", "vertical"]
/** The first card landed off the closed stack, all three dealt and settling, the total counted (with its close where it fits), the final hold. */
export const keyframes = [14, 84, 152, 239]
// Fictional sample: Brightdesk's launch bonuses (names, values and the close stand in for the page's own).
export const sample: BonusCardsFanProps = {
bonuses: [
{ name: "Launch email pack", value: "$49", spot: book },
{ name: "Checklist", value: "$27", spot: checklist },
{ name: "Office hours replay", value: "$88", spot: calendar },
],
close: "Included.",
tone: "band",
}
/** The sample business in its own colours and type (sample-brands.json); Original and every preset stay one click away. */
export const sampleBrand = {"name":"Brightdesk","theme":"light","background":"#f1f8f8","colors":["#0e7c7b","#f2a541"],"fonts":["Bricolage Grotesque","Figtree"],"band":"#d2eeee"}
const ITEM_SLOTS = ["item-1", "item-2", "item-3"] as const
export default function BonusCardsFanSpecimen({ state = "landscape" }: { state?: string }) {
// A brand's own bonus art (item-n slots) replaces the Spot illustration on its card; without it the Spot shows.
const bonuses = (sample.bonuses ?? []).map((b, i) => (i < ITEM_SLOTS.length ? { ...b, image: slot(ITEM_SLOTS[i], "") || undefined } : b))
return <VideoPreview component={BonusCardsFan} props={{ ...sample, bonuses }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalBonusCardsFan |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalBonusCardsFan |
number |
Default video.durationInFrames
|
bonuses OptionalBonusCardsFan |
BonusCard[] |
Default []
|
total OptionalBonusCardsFan |
string |
Default ""
|
totalLine OptionalBonusCardsFan |
string |
Default "{count} bonuses, {total} value"
|
totalLineOne OptionalBonusCardsFan |
string |
Default "{count} bonus, {total} value"
|
countWords OptionalBonusCardsFan |
string[] |
Default COUNT_WORDS
|
valueLabel OptionalBonusCardsFan |
string |
Default "{value} value"
|
close OptionalBonusCardsFan |
string |
Default ""
|
words OptionalBonusCardsFan |
Word[] |
|
tone OptionalBonusCardsFan |
"surface" | "band" |
Default "band"
|
scene OptionalBonusCardsFan |
string |
Default ""
|
treatment OptionalBonusCardsFan |
BackdropTreatment |
Default "natural"
|
focus OptionalBonusCardsFan |
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.
--card-shadow- Cards and panels: radius, border and shadow.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
321240b3188e2da4.webp
image/webp · 18.7 KB
-
63571cb07acc4626.webp
image/webp · 17.3 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
bec2a41897a3364d.webp
image/webp · 51.2 KB
-
d0943b629c0b1324.webp
image/webp · 8.87 KB