Event Date Card 1
The webinar or event's when card for the CTA beat: the training title fitted as the headline, the day and time set huge on a solid panel in the page's own colour over a seminar photo, the host as a portrait chip with her name (and, in 16:9, the length beside it) on the same panel, and the page's button landing last.
Use it in a prompt
Use the video/event-date-card 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/event-date-card.tsx. - Import it and pass your copy and images (Props tab):
import { EventDateCard } from "@/components/funneldna/video/event-date-card"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/video/event-date-card/component.tsx 341 lines
// When to use: The webinar or event's when card for the CTA beat: the training title fitted as the headline, the day and time set huge on a solid panel in the page's own colour over a seminar photo, the host as a portrait chip with her name (and, in 16:9, the length beside it) on the same panel, and the page's button landing last.
import * as React from "react"
import { Img, useVideoConfig } from "remotion"
import noise from "../fx/textures/noise"
import {
HOLD, IN_OUT, SafeArea, SPRINGS, StageButton, StageField, StageLight, StagePhoto, T, TONES, VideoStage, cue, display, progress, springAt, tween,
useFitText, useHeld, useStage, useWords,
type VideoFormat, type VideoMeta, type Word,
} from "../fx/video-kit"
export const video = { fps: 30, durationInFrames: 180, formats: ["landscape", "vertical"], poster: 175 } satisfies VideoMeta
export type EventDateCardProps = {
format?: VideoFormat
durationInFrames?: number
/** The training or event title, fitted above the date. */
title?: string
/** The host's name. */
host?: string
/** The line that carries the host's name; {host} is replaced with `host`. Say "live" only when the session really is live, never for a replay. */
hostLine?: string
/** Day and date of the one real session ("Thu 14 May"), the hero of the frame. Ignored when `sessions` is given. */
date?: string
/** Time with its zone ("1 p.m. ET"), set huge under the date. Ignored when `sessions` is given. */
time?: string
/** Length and price as the page states them ("50 minutes · free"), beside the host in 16:9; phones leave it out so the host line stays large. */
length?: string
/** Evergreen sessions: up to three real times, set huge instead of `date` and `time`. */
sessions?: string[]
/** A word or phrase inside `length` set in the heavy weight, with one scale beat when spoken ("free"); empty emphasises none. */
pulse?: string
/** The page's primary button label, word for word. */
button?: string
/** The host on a transparent background (pass slot("presenter-cutout", …)); cropped to head and shoulders in a portrait chip. */
presenter?: string
/** Scene photo behind the stack (pass slot("scene", …)); keeps its own colours under an even scrim, slow push. The date, time and host line then sit on one solid panel in the page's own colour. Without one, the lit set with a drifting texture. */
scene?: string
/** Photo focal point (CSS object-position). */
focus?: string
/** Voice timings for the scene: the date and time land when spoken, or by their set frame, whichever is first. */
words?: Word[]
/** The field: band (the stage, default) or surface (the bright end). */
tone?: "surface" | "band"
}
/** CTA: the title rises, the date slams in huge, the time rises under it, a rule draws, the host chip arrives, the button lands and is pressed, hold. */
export function EventDateCard({
format = "landscape",
durationInFrames = video.durationInFrames,
title = "",
host = "",
hostLine = "with {host}",
date = "",
time = "",
length = "",
sessions = [],
pulse = "",
button = "",
presenter = "",
scene = "",
focus,
words,
tone = "band",
}: EventDateCardProps) {
const f = useHeld(durationInFrames)
const { fps } = useVideoConfig()
const { u, portrait, width, height, text } = useStage()
const live = durationInFrames - HOLD
const colors = TONES[tone]
const s = (n: number) => n * u
const voiced = !!words?.length
const spoken = useWords("", words, durationInFrames)
// Content: one real date and time, or up to three evergreen sessions. The host row carries the name, and in 16:9
// the length beside it; on phones every line stays 44px+, so the length is left out rather than shrunk.
const sess = sessions.map((x) => x.trim()).filter(Boolean).slice(0, 3)
const dateText = sess.length ? "" : date.trim()
const timeText = sess.length ? "" : time.trim()
const hostText = host ? hostLine.replace("{host}", host) : ""
const lengthText = portrait ? "" : length.trim()
const hasHostRow = !!(hostText || lengthText)
const chipOn = !!presenter && hasHostRow
// Layout in stage px. The stack starts at least 148px down (clear air above the title in 16:9; 250 in 9:16) and
// is centred in the text-safe area above the caption band.
const W = width / u
const topIn = Math.max(text.top, s(148))
const avail = (height - topIn - text.bottom) / u
const col = portrait ? W - (text.left + text.right) / u : Math.min(1440, W - (text.left + text.right) / u)
// Over a photo the facts and the host line sit on one solid panel in the page's own colour (--surface with --ink,
// the pair every theme fits), so they hold 4.5:1 on every frame whatever the photo does, and a light theme gets a
// light panel, not a navy box.
const panel = !!scene
const factInk = panel ? T.ink : colors.ink
const padY = panel ? (portrait ? 32 : 28) : 0, padX = panel ? (portrait ? 48 : 64) : 0
const hostInPanel = panel && hasHostRow
const footerHost = hasHostRow && !hostInPanel
// The date block, measured in the theme's own face: one row each, as large as the column allows.
const factCol = col - padX * 2
const dateMax = portrait ? 172 : 200, timeMax = portrait ? 124 : 140
const sessMax = sess.length <= 1 ? dateMax : sess.length === 2 ? (portrait ? 120 : 136) : (portrait ? 100 : 104)
const dateRef = React.useRef<HTMLDivElement>(null)
const timeRef = React.useRef<HTMLDivElement>(null)
const sessRef = React.useRef<HTMLDivElement>(null)
const longestSess = [...sess].sort((a, b) => b.length - a.length)[0] ?? ""
const dateSize = useFitText(dateRef, dateText || " ", { boxW: factCol * u, boxH: dateMax * 1.1 * u, guess: dateMax * u, max: dateMax * u, min: 72 * u, lines: [1] }) / u
const timeSize = useFitText(timeRef, timeText || " ", { boxW: factCol * u, boxH: timeMax * 1.1 * u, guess: timeMax * u, max: timeMax * u, min: 56 * u, lines: [1] }) / u
const sessSize = useFitText(sessRef, longestSess || " ", { boxW: factCol * u, boxH: sessMax * 1.1 * u, guess: sessMax * u, max: sessMax * u, min: 56 * u, lines: [1] }) / u
const factsH = sess.length
? sess.length * sessSize * 1.04 + (sess.length - 1) * 8
: (dateText ? dateSize * 0.96 : 0) + (timeText ? (dateText ? 8 : 0) + timeSize : 0)
// The host row (portrait chip, name, 16:9 length): on the panel over a photo, else beside the button in 16:9 and
// stacked above it in 9:16.
const chip = portrait ? 128 : 120
const nameSize = portrait ? 52 : 46, lenSize = 42
const hostGap = 24
const nameRoom = (hostInPanel ? factCol : col) - (chipOn ? chip + 28 : 0)
const nameLines = hostText ? Math.min(2, Math.max(1, Math.ceil((hostText.length * 0.56 * nameSize) / nameRoom))) : 0
const hostTextH = nameLines * nameSize * 1.2 + (lengthText ? lenSize * 1.25 : 0)
const hostRowH = hasHostRow ? Math.max(chipOn ? chip : 0, hostTextH) : 0
const panelBody = factsH + (hostInPanel ? (factsH > 0 ? hostGap : 0) + hostRowH : 0)
const dateH = panelBody > 0 ? panelBody + padY * 2 : 0
const groupW = Math.min(col, (chipOn ? chip + 28 : 0) + Math.max(hostText.length * 0.56 * nameSize, lengthText.length * 0.54 * lenSize))
const rowGap = 64, footGap = 36
const budget = col - (footerHost ? groupW + rowGap : 0)
const label = Math.max(10, button.length)
const stacked = portrait || (!!button && footerHost && budget < 420)
const btnFont = portrait
? Math.max(48, Math.min(60, (col - 112) / (label * 0.58)))
: Math.max(34, Math.min(50, ((stacked ? col : budget) - 112) / (label * 0.58)))
const btnH = portrait ? Math.max(156, btnFont * 2.7) : Math.max(chip, btnFont * 2.3)
const footerHostH = footerHost ? hostRowH : 0
const footerH = !button ? footerHostH : !footerHost ? btnH : stacked ? footerHostH + footGap + btnH : Math.max(footerHostH, btnH)
// The title takes the height the date block and footer leave, fitted to fill the column.
const ruleOn = dateH > 0 && footerH > 0
const gapA = portrait ? 40 : 32, ruleBox = ruleOn ? 8 + 24 * 2 : 0, gapB = ruleOn ? 0 : footerH ? 40 : 0
const titleH = Math.max(140, avail - (dateH ? gapA + dateH : 0) - ruleBox - gapB - footerH - 8)
const titleRef = React.useRef<HTMLHeadingElement>(null)
const titleSize = useFitText(titleRef, title || " ", {
boxW: col * u, boxH: titleH * u, guess: (portrait ? 96 : 104) * u, max: 120 * u, min: 64 * u, lines: portrait ? [2, 3, 4] : [1, 2],
})
// The whole stack, measured as drawn in the theme's face, scales together to fit the height above the caption band.
const stackRef = React.useRef<HTMLDivElement>(null)
const [fit, setFit] = React.useState(1)
const room = height - topIn - text.bottom - 4 * u
const measureStack = React.useCallback(() => {
const el = stackRef.current
if (!el) return
const h = el.offsetHeight
const k = h > 0 ? Math.min(1, room / h) : 1
setFit((prev) => (Math.abs(prev - k) > 0.002 ? k : prev))
}, [room])
React.useLayoutEffect(measureStack)
React.useEffect(() => {
if (typeof document === "undefined" || !document.fonts) return
let on = true
document.fonts.ready.then(() => { if (on) measureStack() }, () => {})
document.fonts.addEventListener?.("loadingdone", measureStack)
return () => { on = false; document.fonts.removeEventListener?.("loadingdone", measureStack) }
}, [measureStack])
// Timing. Title rises (2–14), the date slams in by 10 (110% → 100% in 6 frames), the time rises by 16, the rule
// draws, the host chip and length arrive, the button lands, one press, the pulse word's scale beat, then the hold.
const titleAt = 2
const dateAt = Math.max(4, voiced && dateText ? Math.min(cue(spoken, dateText, 10), 10) : 10)
const timeAt = Math.max(dateAt + 5, voiced && timeText ? Math.min(cue(spoken, timeText, 16), 16) : 16)
const sessAt = sess.map((x, i) => Math.max(4 + i * 5, voiced ? Math.min(cue(spoken, x, 10 + i * 5), 10 + i * 5) : 10 + i * 5))
const firstFact = sess.length ? sessAt[0] : dateText ? dateAt : timeText ? timeAt : 8
const lastFact = sess.length ? sessAt[sessAt.length - 1] : timeText ? timeAt : dateText ? dateAt : 8
const ruleAt = lastFact + 6
const hostAt = lastFact + 8
const btnLatest = live - 34
const btnAt = Math.min(Math.max(hostAt + 12, voiced && button ? cue(spoken, button, hostAt + 16) : hostAt + 16), btnLatest)
const pressAt = Math.min(btnAt + 30, live - 18)
const press = tween(f, [pressAt, pressAt + 4], [0, 1], IN_OUT) - tween(f, [pressAt + 9, pressAt + 16], [0, 1], IN_OUT)
const btn = springAt(f, btnAt, fps, SPRINGS.firm)
// The pulse word's one scale beat (100 → 106 → 100%), on its spoken frame, finished well before the hold.
const beatAt = Math.min(Math.max(hostAt + 14, voiced && pulse ? cue(spoken, pulse, hostAt + 20) : hostAt + 20), live - 20)
const beat = tween(f, [beatAt, beatAt + 5], [0, 1], IN_OUT) - tween(f, [beatAt + 5, beatAt + 12], [0, 1], IN_OUT)
const titleK = progress(f, titleAt, titleAt + 12)
const dateSlam = progress(f, dateAt, dateAt + 6)
const dateOp = progress(f, dateAt, dateAt + 3, (t) => t)
const timeK = progress(f, timeAt, timeAt + 10)
// The panel is fully solid by the frame the first fact appears, so no fact or host line is ever drawn over the photo.
const panelK = progress(f, Math.max(0, firstFact - 4), firstFact, (t) => t)
const panelRise = progress(f, Math.max(0, firstFact - 4), firstFact + 6)
const draw = progress(f, ruleAt, ruleAt + 14, IN_OUT)
const chipK = springAt(f, hostAt, fps, SPRINGS.pop)
const hostK = progress(f, hostAt + 3, hostAt + 15)
// The length line: the pulse word or phrase is set in the heavy weight in the host line's ink, with one scale beat.
const lenWords = lengthText.split(/\s+/).filter(Boolean)
const pWords = pulse.split(/\s+/).filter(Boolean).map(norm)
let pStart = -1
if (pWords.length) for (let i = 0; i + pWords.length <= lenWords.length; i++) {
if (pWords.every((w, k) => norm(lenWords[i + k]) === w)) { pStart = i; break }
}
const lengthNodes = lenWords.flatMap((w, i) => {
const on = pStart >= 0 && i >= pStart && i < pStart + pWords.length
const el = !on ? <React.Fragment key={i}>{w}</React.Fragment> : (
<span key={i} style={{
display: "inline-block", fontWeight: 800, color: factInk,
transform: `scale(${1 + 0.06 * beat})`, transformOrigin: "50% 70%",
}}>{w}</span>
)
return i ? [" ", el] : [el]
})
const accentFill = T.accentFill
const fact = (size: number, lh: number): React.CSSProperties => ({
...display(s(size), { lineHeight: lh, textWrap: "nowrap" }), whiteSpace: "nowrap", color: factInk, fontVariantNumeric: "tabular-nums",
})
const hostGroup = hasHostRow ? (
<div style={{ display: "flex", alignItems: "center", gap: s(28), textAlign: "left", flex: "none", maxWidth: s(hostInPanel ? factCol : col) }}>
{chipOn && (
<div style={{
position: "relative", flex: "none", width: s(chip), height: s(chip), overflow: "hidden",
borderRadius: `calc(var(--radius, 12px) * ${1.8 * u})`,
background: `linear-gradient(oklch(from ${accentFill} calc(l + 0.06) c h), oklch(from ${accentFill} calc(l - 0.07) c h))`,
boxShadow: [
`inset 0 ${2 * u}px 0 oklch(from ${accentFill} calc(l + 0.14) c h / 0.6)`,
`0 ${2 * u}px ${3 * u}px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35)`,
`0 ${12 * u}px ${20 * u}px ${-8 * u}px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.45)`,
].join(", "),
opacity: Math.min(1, chipK * 1.6), transform: `translateY(${(1 - chipK) * s(16)}px) scale(${0.86 + 0.14 * chipK})`,
}}>
<Img src={presenter} alt={host} style={{
position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", objectPosition: "50% 0%",
transform: "scale(1.55)", transformOrigin: "50% 12%",
}} />
</div>
)}
<div style={{ display: "flex", flexDirection: "column", gap: s(2), opacity: hostK, transform: `translateY(${(1 - hostK) * s(14)}px)` }}>
{hostText && <div style={{ fontSize: s(nameSize), fontWeight: 700, lineHeight: 1.2, color: factInk, textWrap: "pretty" }}>{hostText}</div>}
{lengthText && <div style={{ fontSize: s(lenSize), fontWeight: 500, lineHeight: 1.25, color: factInk, textWrap: "pretty" }}>{lengthNodes}</div>}
</div>
</div>
) : null
const btnNode = button ? (
<div style={{
flex: "none", width: portrait ? "100%" : undefined, opacity: Math.min(1, btn * 2),
transform: `scale(${0.8 + 0.2 * btn})`, transformOrigin: "50% 50%",
}}>
<StageButton label={button} press={press} height={btnH} fontSize={btnFont} style={portrait ? { width: "100%" } : undefined} />
</div>
) : null
// The panel belongs to the set: the page's own colour, a hairline edge, a lit top edge and a close, dark shadow
// (contact + short ambient), no outline box in a foreign colour.
const panelStyle: React.CSSProperties = panel ? {
position: "relative", padding: `${s(padY)}px ${s(padX)}px`, maxWidth: s(col),
background: T.surface,
borderRadius: `calc(var(--card-radius, var(--radius, 12px)) * ${1.8 * u})`,
border: `${Math.max(1, u)}px solid oklch(from var(--ink) l c h / 0.1)`,
boxShadow: [
`inset 0 ${2 * u}px 0 oklch(from var(--surface) calc(l + 0.04) c h / 0.6)`,
`0 ${2 * u}px ${3 * u}px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.4)`,
`0 ${12 * u}px ${22 * u}px ${-8 * u}px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.5)`,
].join(", "),
opacity: panelK, transform: `translateY(${(1 - panelRise) * s(12)}px)`,
} : { maxWidth: s(col) }
return (
<VideoStage format={format} tone={tone}>
{scene
? <StagePhoto src={scene} frame={f} dur={live} push={[1.03, 1.1]} treatment="natural" tone={tone} side="center" position={focus} />
: <>
<StageField tone={tone} texture={noise} opacity={tone === "band" ? 0.16 : 0.1} drift={8} frame={f} />
<StageLight x="50%" strength={tone === "band" ? 0.22 : 0.16} tone={tone === "band" ? "band-ink" : "accent-fill"} floor={false} />
</>}
<SafeArea inset={{ top: topIn }} style={{ justifyContent: "center", alignItems: "center", textAlign: "center" }}>
<div ref={stackRef} style={{
flex: "none", width: "100%", display: "flex", flexDirection: "column", alignItems: "center",
transform: `scale(${fit})`, transformOrigin: "50% 50%",
}}>
{title && (
<h2 ref={titleRef} style={{
...display(titleSize, { lineHeight: 1.04 }), margin: 0, maxWidth: s(col), color: colors.ink,
opacity: Math.min(1, titleK * 1.6), transform: `translateY(${(1 - titleK) * s(28)}px)`,
}}>{title}</h2>
)}
{dateH > 0 && (
<div style={{ marginTop: title ? s(gapA) : 0, display: "flex", flexDirection: "column", alignItems: "center", ...panelStyle }}>
{sess.length > 0 ? (
<div ref={sessRef} style={{ ...fact(sessSize, 1.04), display: "flex", flexDirection: "column", alignItems: "center", gap: s(8) }}>
{sess.map((x, i) => {
const k = progress(f, sessAt[i], sessAt[i] + 6)
return (
<div key={i} style={{ opacity: progress(f, sessAt[i], sessAt[i] + 3, (t) => t), transform: `scale(${1.1 - 0.1 * k})` }}>{x}</div>
)
})}
</div>
) : (
<>
{dateText && (
<div ref={dateRef} style={{ ...fact(dateSize, 0.96), opacity: dateOp, transform: `scale(${1.1 - 0.1 * dateSlam})` }}>{dateText}</div>
)}
{timeText && (
<div ref={timeRef} style={{
...fact(timeSize, 1), marginTop: dateText ? s(8) : 0, opacity: timeK, transform: `translateY(${(1 - timeK) * s(24)}px)`,
}}>{timeText}</div>
)}
</>
)}
{hostInPanel && (
<div style={{ marginTop: factsH > 0 ? s(hostGap) : 0, display: "flex", justifyContent: "center" }}>{hostGroup}</div>
)}
</div>
)}
{ruleOn && (
<div aria-hidden style={{
margin: `${s(24)}px auto`, width: s(140), height: s(8), borderRadius: s(4), background: accentFill, flex: "none",
transform: `scaleX(${draw})`, transformOrigin: "50% 50%",
}} />
)}
{footerH > 0 && (
<div style={{
marginTop: ruleOn ? 0 : s(gapB), display: "flex", flexDirection: stacked ? "column" : "row", alignItems: "center", justifyContent: "center",
gap: s(stacked ? footGap : rowGap), width: portrait ? "100%" : undefined, maxWidth: s(col),
}}>
{footerHost && hostGroup}
{btnNode}
</div>
)}
</div>
</SafeArea>
</VideoStage>
)
}
export default EventDateCard
const norm = (v: string) => v.toLowerCase().replace(/[^a-z0-9$%']/g, "")
pieces/video/event-date-card/specimen.tsx 35 lines
import __studioImagede6cb814 from "../assets/5131a642cc93ff95.webp";
import * as React from "react"
import seminar from "../../fx/backdrops/seminar"
import { slot } from "../../slots"
import { VideoPreview, type VideoFormat } from "../../fx/video-kit"
import { EventDateCard, video, type EventDateCardProps } from "../event-date-card"
export const states = ["landscape", "vertical"]
/** Title in and the date and time set, host chip (and the bold length word in 16:9) and button in, final hold. */
export const keyframes = [18, 62, 175]
// Fictional sample: Nadia Corwin's free SEO training, one real session.
// Her existing transparent cut-out, cropped to head and shoulders in the portrait chip.
const nadiaCutout = __studioImagede6cb814
export const sample: EventDateCardProps = {
title: "The Three Pages Google Ranks First",
host: "Nadia Corwin",
date: "Thu 14 May",
time: "1 p.m. ET",
length: "50 minutes · free",
pulse: "free",
button: "Save My Seat",
presenter: nadiaCutout,
// The designed still (fx seminar room, natural colour under a scrim); the brand's scene slot replaces it.
scene: seminar,
focus: "50% 40%",
}
/** The sample business in its own colours and type (sample-palettes.md: forest-night · friendly); Original and every preset stay one click away. */
export const sampleBrand = { name: "Nadia Corwin", theme: "dark", background: "#0f1f19", colors: ["#3ddc97", "#f4b860"], fonts: ["Lexend", "Public Sans"] }
export default function EventDateCardSpecimen({ state = "landscape" }: { state?: string }) {
return <VideoPreview component={EventDateCard} props={{ ...sample, presenter: slot("presenter-cutout", nadiaCutout), scene: slot("scene", seminar) }} format={state as VideoFormat} meta={video} />
}
| Name | Type | Details |
|---|---|---|
format OptionalEventDateCard |
VideoFormat |
Default "landscape"
|
durationInFrames OptionalEventDateCard |
number |
Default video.durationInFrames
|
title OptionalEventDateCard |
string |
Default ""
|
host OptionalEventDateCard |
string |
Default ""
|
hostLine OptionalEventDateCard |
string |
Default "with {host}"
|
date OptionalEventDateCard |
string |
Default ""
|
time OptionalEventDateCard |
string |
Default ""
|
length OptionalEventDateCard |
string |
Default ""
|
sessions OptionalEventDateCard |
string[] |
Default []
|
pulse OptionalEventDateCard |
string |
Default ""
|
button OptionalEventDateCard |
string |
Default ""
|
presenter OptionalEventDateCard |
string |
Default ""
|
scene OptionalEventDateCard |
string |
Default ""
|
focus OptionalEventDateCard |
string |
|
words OptionalEventDateCard |
Word[] |
|
tone OptionalEventDateCard |
"surface" | "band" |
Default "band"
|
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-radius- Cards and panels: radius, border and shadow.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter-cutout- The presenter on a transparent background.
scene- A wide atmosphere photo behind or beside the copy.
-
43adf3b56422e1e1.webp
image/webp · 58.2 KB
-
5131a642cc93ff95.webp
image/webp · 47.8 KB
-
bec2a41897a3364d.webp
image/webp · 51.2 KB