Three Beats CTA 1
Three beats CTA: a six-second motion-graphics ad on the page. The problem, the turn and the promise cut like an edit over one photo when the block enters view, then the button lands. The finished state (every line, the photo and the button) is the static render.
Use it in a prompt
Use content/three-beats-cta from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details 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/content/three-beats-cta.tsx. - Import it and pass your copy and images (Props tab):
import { ThreeBeatsCta } from "@/components/funneldna/content/three-beats-cta"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/three-beats-cta/component.tsx 583 lines
// layout: annotated-board
// Three beats CTA: a six-second motion-graphics ad on the page. The problem, the turn and the promise cut like an edit over one photo when the block enters view, then the button lands. The finished state (every line, the photo and the button) is the static render.
import React, { useEffect, useId, useRef, useState } from "react";
import { Pause, Play, RotateCcw, ShieldCheck } from "lucide-react";
import { Divider, FX_HOST, Glow } from "../fx/fx";
export type ThreeBeatsCtaProps = {
/** Beat one: the problem, played big over the dim photo. An empty string skips the beat. */
problem?: string;
/** Beat two: the turn, a hard cut onto the accent colour. An empty string skips the beat. */
turn?: string;
/** Beat three: the promise over the bright photo. This is the section heading. */
promise?: string;
/** Scene photo (image slot "scene"). Without one the stage is a plain band panel. */
image?: string;
imageAlt?: string;
/** object-position for the photo, e.g. "50% 35%". */
imagePosition?: string;
/** Primary button label (one line, first-person outcome). */
label?: string;
/** One-line risk reverser under the button. */
riskReverser?: string;
href?: string;
onAction?: () => void;
/** Quiet secondary line under the button; shown when it has an href. */
secondaryLabel?: string;
secondaryHref?: string;
disabled?: boolean;
/** Play the sequence once when the block enters view, and again when the reader scrolls back to it. */
autoplay?: boolean;
/** Stepped edge handing off to the next (surface) section. */
showEdge?: boolean;
state?: "default" | "hover" | "active" | "disabled";
/** Control labels. counter uses {action}, {current} and {total}. */
copy?: { play?: string; pause?: string; resume?: string; replay?: string; counter?: string };
className?: string;
};
type Mode = "idle" | "playing" | "paused" | "done";
export function ThreeBeatsCta(props: ThreeBeatsCtaProps) {
const {
problem = "Your week is buried in busywork.",
turn = "What if it handled itself?",
promise,
image,
imageAlt = "",
imagePosition = "50% 40%",
label = "Show Me The Simpler Way",
riskReverser = "See exactly how it works before you decide.",
href,
onAction,
secondaryLabel = "Or keep reading to see how it works",
secondaryHref,
disabled = false,
autoplay = true,
showEdge = true,
state = "default",
copy,
className = "",
} = props;
const c = { ...DEFAULT_COPY, ...copy };
const headingId = useId();
const stageRef = useRef<HTMLDivElement>(null);
const armed = useRef(true);
const p = problem.trim();
const t = turn.trim();
const pr = (promise ?? "").trim() || DEFAULT_PROMISE;
// The edit: every beat gets a length from its word count, cuts land back to back.
const l1 = p ? beatLength(p) : 0;
const tt = l1;
const lt = t ? beatLength(t) : 0;
const tp = tt + lt;
const lp = Math.min(1800, Math.max(1200, 600 + countWords(pr) * 110));
const tc = tp + lp;
const segments = [
...(p ? [{ start: 0, length: l1 }] : []),
...(t ? [{ start: tt, length: lt }] : []),
{ start: tp, length: lp },
];
const total = segments.length;
const notes = [...(p ? [p] : []), ...(t ? [t] : [])];
const [mode, setMode] = useState<Mode>("idle");
const [beat, setBeat] = useState(total);
const [reduced, setReduced] = useState(false);
const isDisabled = disabled || state === "disabled";
const running = mode === "playing" || mode === "paused";
const shouldAutoplay = autoplay && state === "default" && !reduced;
useEffect(() => {
if (typeof window === "undefined" || !window.matchMedia) return;
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
const sync = () => {
setReduced(mq.matches);
if (mq.matches) setMode("idle");
};
sync();
mq.addEventListener("change", sync);
return () => mq.removeEventListener("change", sync);
}, []);
// Plays once on entering view; leaving re-arms it so scrolling back replays the edit.
useEffect(() => {
const el = stageRef.current;
if (!shouldAutoplay || !el || typeof IntersectionObserver === "undefined") return;
const io = new IntersectionObserver(
(entries) => {
for (const entry of entries) {
if (entry.isIntersecting && entry.intersectionRatio >= 0.45) {
if (armed.current) {
armed.current = false;
setBeat(1);
setMode("playing");
}
} else if (!entry.isIntersecting) {
armed.current = true;
setMode((m) => (m === "playing" || m === "paused" ? "idle" : m));
}
}
},
{ threshold: [0, 0.45] },
);
io.observe(el);
return () => io.disconnect();
}, [shouldAutoplay]);
const toggle = () => {
if (reduced) return;
if (mode === "playing") setMode("paused");
else if (mode === "paused") setMode("playing");
else {
armed.current = false;
setBeat(1);
setMode("playing");
}
};
// Keyboard users reaching the action never wait for the edit.
const finish = () => {
if (running) {
setMode("done");
setBeat(total);
}
};
const handleAction = (e: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
e.preventDefault();
return;
}
onAction?.();
};
const action = mode === "playing" ? c.pause : mode === "paused" ? c.resume : mode === "done" ? c.replay : c.play;
const HudIcon = mode === "playing" ? Pause : mode === "done" ? RotateCcw : Play;
const current = running ? beat : total;
const rootClass = [
"cf-tbc",
running ? "is-playing" : "",
mode === "paused" ? "is-paused" : "",
state === "hover" ? "is-hover" : "",
state === "active" ? "is-active" : "",
showEdge ? "has-edge" : "",
className,
]
.filter(Boolean)
.join(" ");
return (
<section className={rootClass} style={FX_HOST} aria-labelledby={headingId}>
<style>{CSS}</style>
<Glow />
<div className="cf-tbc__inner">
<div className="cf-tbc__board" style={vars({ "--t1": 0, "--l1": l1, "--tt": tt, "--lt": lt, "--tp": tp })}>
{notes.length > 0 ? (
<ol className="cf-tbc__notes">
{notes.map((text, i) => (
<li key={i} className={`cf-tbc__note${running && beat === i + 1 ? " is-live" : ""}`}>
<span className="cf-tbc__note-num" aria-hidden="true">
{i + 1}
</span>
<span className="cf-tbc__note-text">{text}</span>
</li>
))}
</ol>
) : null}
<div ref={stageRef} className={`cf-tbc__stage${image ? "" : " is-plain"}`}>
{image ? (
<img className="cf-tbc__photo" src={image} alt={imageAlt} style={{ objectPosition: imagePosition }} decoding="async" />
) : null}
<div className="cf-tbc__dim" aria-hidden="true" />
{t ? <div className="cf-tbc__cut" aria-hidden="true" /> : null}
<div className="cf-tbc__scrim" aria-hidden="true" />
{p ? (
<div className="cf-tbc__beat cf-tbc__beat--problem" aria-hidden="true">
<p className="cf-tbc__line">
<Words text={p} start={40} step={110} />
</p>
</div>
) : null}
{t ? (
<div className="cf-tbc__beat cf-tbc__beat--turn" aria-hidden="true">
<p className="cf-tbc__line">
<Words text={t} start={tt + 110} step={85} />
</p>
</div>
) : null}
<h2 id={headingId} className="cf-tbc__line cf-tbc__promise">
<Words text={pr} start={tp + 120} step={90} />
</h2>
<button type="button" className="cf-tbc__hud" onClick={toggle} aria-label={fill(c.counter, { action, current, total })}>
<HudIcon size={16} strokeWidth={2.5} aria-hidden="true" />
<span className="cf-tbc__count" aria-hidden="true">
<b key={current}>{current}</b>
<span>/{total}</span>
</span>
<span className="cf-tbc__segs" aria-hidden="true">
{segments.map((s, i) => (
<span key={i} className="cf-tbc__seg">
<span
className="cf-tbc__seg-fill"
style={vars({ "--d": s.start, "--l": s.length })}
onAnimationStart={(e) => {
if (e.animationName === "cf-tbc-fill") setBeat(i + 1);
}}
/>
</span>
))}
</span>
</button>
</div>
<div className="cf-tbc__cta" style={vars({ "--tc": tc })} onFocusCapture={finish}>
{label ? (
href && !isDisabled ? (
<a className="cf-tbc__btn" href={href} onClick={handleAction}>
<span className="cf-tbc__btn-label">{label}</span>
</a>
) : (
<button type="button" className="cf-tbc__btn" disabled={isDisabled} onClick={handleAction}>
<span className="cf-tbc__btn-label">{label}</span>
</button>
)
) : null}
{riskReverser ? (
<p className="cf-tbc__risk">
<ShieldCheck size={18} strokeWidth={2.5} aria-hidden="true" />
{riskReverser}
</p>
) : null}
{secondaryLabel && secondaryHref ? (
<a className="cf-tbc__link" href={secondaryHref}>
{secondaryLabel}
</a>
) : null}
</div>
<span
className="cf-tbc__clock"
aria-hidden="true"
style={vars({ "--tend": tc + 560 })}
onAnimationEnd={(e) => {
if (e.animationName === "cf-tbc-clock") {
setMode("done");
setBeat(total);
}
}}
/>
</div>
</div>
{showEdge ? (
<div className="cf-tbc__edge" aria-hidden="true">
<Divider shape="step" tone="surface" height={56} />
</div>
) : null}
</section>
);
}
export default ThreeBeatsCta;
const DEFAULT_PROMISE = "Here is the simpler way to get it done.";
const DEFAULT_COPY = {
play: "Play the three beats",
pause: "Pause",
resume: "Resume",
replay: "Replay",
counter: "{action}, beat {current} of {total}",
};
function countWords(text: string) {
return text.split(/\s+/).filter(Boolean).length;
}
function beatLength(text: string) {
return Math.min(2200, Math.max(1300, 700 + countWords(text) * 150));
}
function fill(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? String(values[key]) : match));
}
function vars(values: Record<string, string | number>): React.CSSProperties {
return values as unknown as React.CSSProperties;
}
function Words({ text, start, step }: { text: string; start: number; step: number }) {
const words = text.split(/\s+/).filter(Boolean);
return (
<>
{words.map((word, i) => (
<React.Fragment key={i}>
{i > 0 ? " " : null}
<span className="cf-tbc__w" style={vars({ "--d": start + i * step })}>
{word}
</span>
</React.Fragment>
))}
</>
);
}
// The base styles are the finished end state: notes, photo, promise and button are always laid out and visible.
// Motion lives only under .is-playing inside prefers-reduced-motion: no-preference, and only the stage's beat
// overlays ever cover anything; the notes and the button never hide (the button lands with a settle, not a fade-in).
// animation-play-state keeps !important: the per-element animation shorthands carry higher specificity.
const CSS = `
.cf-tbc {
position: relative;
isolation: isolate;
overflow: clip;
background: var(--band);
color: var(--band-ink);
font-family: var(--font-body);
padding-block: clamp(48px, 7vw, 96px) calc(clamp(48px, 7vw, 96px) + var(--tbc-edge, 0px));
}
.cf-tbc.has-edge { --tbc-edge: 56px; }
.cf-tbc *, .cf-tbc *::before, .cf-tbc *::after { box-sizing: border-box; }
.cf-tbc__inner { position: relative; z-index: 2; max-inline-size: 1120px; margin-inline: auto; padding-inline: clamp(16px, 5vw, 48px); }
.cf-tbc__board { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); container: tbc-board / inline-size; }
.cf-tbc__board > * { min-width: 0; }
.cf-tbc__notes { position: relative; z-index: 4; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.cf-tbc__note {
display: flex; align-items: baseline; gap: 12px; min-width: 0;
padding: 16px 20px;
background: var(--card); color: var(--ink);
border: 1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 260 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 260 / 0.32)));
rotate: var(--tbc-rot, 0deg);
transition: background 0.2s ease, border-color 0.2s ease, translate 0.2s cubic-bezier(.2,.7,.2,1);
}
.cf-tbc__note.is-live {
background: color-mix(in oklch, var(--accent) 10%, var(--card));
border-color: oklch(from var(--accent) l c h / 0.55);
translate: 0 -3px;
}
.cf-tbc__note-num { flex: none; font-family: var(--font-display); font-weight: var(--display-weight, 800); font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.cf-tbc__note-text { min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.28; text-wrap: pretty; overflow-wrap: anywhere; hyphens: auto; }
@container tbc-board (min-width: 480px) {
.cf-tbc__notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container tbc-board (min-width: 760px) {
.cf-tbc__notes { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0; align-items: start; margin-block-end: -30px; padding-inline: clamp(16px, 3cqi, 40px); }
.cf-tbc__note:nth-child(1) { grid-column: 1 / span 4; --tbc-rot: -1.1deg; }
.cf-tbc__note:nth-child(2) { grid-column: 5 / span 4; margin-block-start: 22px; margin-inline-start: 16px; --tbc-rot: 0.9deg; }
}
/* Content-sized stage: a floor height from the board width, growing with the tallest beat, never a viewport or scroll runway. */
.cf-tbc__stage {
position: relative; z-index: 1; isolation: isolate;
display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
min-block-size: clamp(340px, 42cqi, 500px);
border-radius: 12px;
overflow: clip;
container: tbc-stage / inline-size;
background: oklch(from var(--band) calc(l + 0.05) c h);
}
.cf-tbc__photo { position: absolute; inset: 0; z-index: 0; display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.cf-tbc__dim { position: absolute; inset: 0; z-index: 1; background: oklch(from var(--band) l c h / 0.84); opacity: 0; }
.cf-tbc__cut { position: absolute; inset: 0; z-index: 2; background: var(--accent-fill, var(--accent)); opacity: 0; }
.cf-tbc__scrim {
position: absolute; inset: 0; z-index: 2;
background: linear-gradient(to top, oklch(from var(--band) l c h / 0.92) 0%, oklch(from var(--band) l c h / 0.8) 48%, oklch(from var(--band) l c h / 0) 88%);
}
.cf-tbc__stage.is-plain .cf-tbc__scrim { display: none; }
.cf-tbc__beat { grid-area: 1 / 1; position: relative; z-index: 3; align-self: center; padding: clamp(56px, 8cqi, 88px) clamp(24px, 5.5cqi, 72px); text-align: center; pointer-events: none; opacity: 0; }
.cf-tbc__beat--turn { color: var(--accent-fill-ink, var(--card)); }
.cf-tbc__line {
margin: 0;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.025em);
font-size: clamp(2rem, 10.5cqi, 7rem);
line-height: 0.98;
text-wrap: balance;
overflow-wrap: anywhere;
hyphens: auto;
}
.cf-tbc__line.cf-tbc__promise {
grid-area: 1 / 1; position: relative; z-index: 3; align-self: end;
padding: clamp(72px, 10cqi, 104px) clamp(16px, 5.5cqi, 72px) clamp(24px, 5cqi, 56px);
text-align: center;
color: var(--band-ink);
font-size: clamp(1.875rem, 9.4cqi, 6rem);
}
@container tbc-stage (min-width: 640px) {
.cf-tbc__line { font-size: clamp(2rem, 8.6cqi, 7rem); }
.cf-tbc__line.cf-tbc__promise { font-size: clamp(1.875rem, 7.4cqi, 6rem); }
}
.cf-tbc__w { display: inline-block; max-inline-size: 100%; }
.cf-tbc__hud {
position: absolute; z-index: 5;
inset-block-start: clamp(10px, 2cqi, 18px); inset-inline-end: clamp(10px, 2cqi, 18px);
display: inline-flex; align-items: center; gap: 10px;
min-block-size: 44px; padding: 0 14px 0 12px;
border-radius: 999px;
border: 1px solid oklch(from var(--band-ink) l c h / 0.2);
background: oklch(from var(--band) l c h / 0.82);
-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
color: var(--band-ink);
font-family: var(--button-font, var(--font-body));
font-weight: var(--button-weight, 800);
font-size: 0.875rem;
line-height: 1;
font-variant-numeric: tabular-nums;
cursor: pointer;
transition: background 0.16s ease, transform 0.16s ease;
-webkit-tap-highlight-color: transparent;
}
.cf-tbc__hud:hover { background: oklch(from var(--band) calc(l + 0.06) c h / 0.9); }
.cf-tbc__hud:active { transform: scale(0.96); }
.cf-tbc__hud:focus-visible { outline: 3px solid var(--band-ink); outline-offset: 3px; }
.cf-tbc__hud svg { flex: none; }
.cf-tbc__count { display: inline-flex; align-items: baseline; }
.cf-tbc__count b { display: inline-block; font-weight: 800; }
.cf-tbc__segs { display: inline-flex; gap: 4px; }
.cf-tbc__seg { display: block; inline-size: 18px; block-size: 4px; border-radius: 999px; overflow: clip; background: oklch(from var(--band-ink) l c h / 0.28); }
.cf-tbc__seg-fill { display: block; inline-size: 100%; block-size: 100%; background: var(--band-ink); transform-origin: left center; }
.cf-tbc__cta { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-block-start: clamp(28px, 4vw, 40px); text-align: center; }
.cf-tbc__btn {
display: inline-flex; align-items: center; justify-content: center;
max-inline-size: 100%;
min-inline-size: min(100%, 360px);
min-block-size: 72px;
padding: 12px clamp(20px, 4vw, 56px);
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));
color: var(--button-ink, var(--cta-ink));
font-family: var(--button-font, var(--font-display));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: clamp(1.125rem, 1.8vw, 1.5rem);
line-height: 1.15;
text-decoration: none;
text-shadow: var(--button-text-shadow, none);
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7),
inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),
0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.45),
0 8px 16px -6px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.6));
cursor: pointer;
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
-webkit-tap-highlight-color: transparent;
}
.cf-tbc__btn-label { min-width: 0; text-wrap: balance; overflow-wrap: anywhere; }
.cf-tbc__btn:hover:not(:disabled), .cf-tbc.is-hover .cf-tbc__btn:not(:disabled) {
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h));
box-shadow:
inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.7),
inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h),
0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.5),
0 12px 20px -6px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.7);
}
.cf-tbc__btn:active:not(:disabled), .cf-tbc.is-active .cf-tbc__btn:not(:disabled) {
transform: translateY(2px);
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.09) c h));
box-shadow:
inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - 0.24) c h / 0.5),
inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h),
0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.45);
}
.cf-tbc__btn:focus-visible { outline: 3px solid var(--band-ink); outline-offset: 4px; }
.cf-tbc__btn:disabled {
background: var(--button-2-bg, var(--secondary));
color: var(--button-2-ink, var(--secondary-ink));
box-shadow: var(--button-2-shadow, var(--shadow-sm));
text-shadow: none;
cursor: not-allowed;
transform: none;
}
@container tbc-board (max-width: 559.98px) { .cf-tbc__btn { inline-size: 100%; } }
.cf-tbc__risk { margin: 0; max-inline-size: 60ch; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; text-wrap: pretty; color: var(--band-ink); }
.cf-tbc__risk svg { display: inline-block; vertical-align: -0.18em; margin-inline-end: 0.4em; }
.cf-tbc__link {
color: var(--band-ink); font-size: 0.9375rem; font-weight: 500; line-height: 1.4;
text-decoration: underline; text-decoration-color: oklch(from var(--band-ink) l c h / 0.5); text-underline-offset: 0.18em;
border-radius: 4px;
}
.cf-tbc__link:hover { text-decoration-color: var(--band-ink); }
.cf-tbc__link:focus-visible { outline: 3px solid var(--band-ink); outline-offset: 3px; }
.cf-tbc__clock { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; pointer-events: none; }
.cf-tbc__edge { position: absolute; inset-inline: 0; inset-block-end: 0; z-index: 1; block-size: 56px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
.cf-tbc__hud { display: none; }
.cf-tbc__note { transition: none; }
}
@media print {
.cf-tbc__hud { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
.cf-tbc.is-playing .cf-tbc__photo { animation: cf-tbc-push 1.7s cubic-bezier(.2,.7,.2,1) calc(var(--tp) * 1ms) both; }
.cf-tbc.is-playing .cf-tbc__dim { opacity: 1; animation: cf-tbc-off .16s linear calc(var(--tp) * 1ms) forwards; }
.cf-tbc.is-playing .cf-tbc__scrim { opacity: 0; animation: cf-tbc-on .35s ease calc(var(--tp) * 1ms) forwards; }
.cf-tbc.is-playing .cf-tbc__cut { animation: cf-tbc-cut calc(var(--lt) * 1ms) linear calc(var(--tt) * 1ms) forwards; }
.cf-tbc.is-playing .cf-tbc__beat--problem { animation: cf-tbc-window calc(var(--l1) * 1ms) linear calc(var(--t1) * 1ms) forwards; }
.cf-tbc.is-playing .cf-tbc__beat--turn { animation: cf-tbc-window calc(var(--lt) * 1ms) linear calc(var(--tt) * 1ms) forwards; }
.cf-tbc.is-playing .cf-tbc__beat--problem .cf-tbc__line { animation: cf-tbc-grow calc(var(--l1) * 1ms) linear calc(var(--t1) * 1ms) both; }
.cf-tbc.is-playing .cf-tbc__beat--turn .cf-tbc__line { animation: cf-tbc-settle calc(var(--lt) * 1ms) cubic-bezier(.2,.7,.2,1) calc(var(--tt) * 1ms) both; }
.cf-tbc.is-playing .cf-tbc__beat--problem .cf-tbc__w { animation: cf-tbc-slam .3s cubic-bezier(.2,.8,.2,1) calc(var(--d) * 1ms) both; }
.cf-tbc.is-playing .cf-tbc__beat--turn .cf-tbc__w { animation: cf-tbc-slide .38s cubic-bezier(.2,.8,.2,1) calc(var(--d) * 1ms) both; }
.cf-tbc.is-playing .cf-tbc__promise .cf-tbc__w { animation: cf-tbc-rise .46s cubic-bezier(.2,.8,.2,1) calc(var(--d) * 1ms) both; }
.cf-tbc.is-playing .cf-tbc__cta { animation: cf-tbc-land .52s cubic-bezier(.2,.8,.25,1) calc(var(--tc) * 1ms); }
.cf-tbc.is-playing .cf-tbc__seg-fill { animation: cf-tbc-fill calc(var(--l) * 1ms) linear calc(var(--d) * 1ms) both; }
.cf-tbc.is-playing .cf-tbc__count b { animation: cf-tbc-tick .3s cubic-bezier(.2,.7,.2,1) both; }
.cf-tbc.is-playing .cf-tbc__clock { animation: cf-tbc-clock calc(var(--tend) * 1ms) linear both; }
.cf-tbc.is-paused, .cf-tbc.is-paused * { animation-play-state: paused !important; }
}
@keyframes cf-tbc-window { 0%, 99.9% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cf-tbc-cut {
0% { opacity: 1; clip-path: inset(0 0 0 100%); }
6% { opacity: 1; clip-path: inset(0 0 0 0); }
99.9% { opacity: 1; clip-path: inset(0 0 0 0); }
100% { opacity: 0; clip-path: inset(0 0 0 0); }
}
@keyframes cf-tbc-off { to { opacity: 0; } }
@keyframes cf-tbc-on { to { opacity: 1; } }
@keyframes cf-tbc-push { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes cf-tbc-grow { from { transform: scale(.97); } to { transform: scale(1.03); } }
@keyframes cf-tbc-settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes cf-tbc-slam { 0% { opacity: 0; transform: scale(1.35); } 55% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
@keyframes cf-tbc-slide {
from { opacity: 0; transform: translateX(-.5em); clip-path: inset(-.3em 100% -.3em -.3em); }
to { opacity: 1; transform: none; clip-path: inset(-.3em -.3em -.3em -.3em); }
}
@keyframes cf-tbc-rise {
from { opacity: 0; transform: translateY(.5em); clip-path: inset(100% -.3em -.35em -.3em); }
to { opacity: 1; transform: none; clip-path: inset(-.35em -.3em -.35em -.3em); }
}
@keyframes cf-tbc-land {
0% { transform: none; }
38% { transform: translateY(-10px) scale(1.04); }
70% { transform: translateY(2px) scale(.995); }
100% { transform: none; }
}
@keyframes cf-tbc-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cf-tbc-tick { from { opacity: 0; transform: translateY(-40%); } to { opacity: 1; transform: none; } }
@keyframes cf-tbc-clock { from { opacity: .99; } to { opacity: 1; } }
`;
pieces/content/three-beats-cta/specimen.tsx 28 lines
import __studioImage854cc085 from "../assets/08a53d5d13c8e5f1.webp";
// Specimen: Tallywise, a fictional receipt-to-books app, plays its three-beat ad on entering view and lands the signup button.
import ThreeBeatsCta from "../three-beats-cta";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled"];
export default function ThreeBeatsCtaSpecimen({ state = "default" }: { state?: "default" | "hover" | "active" | "disabled" }) {
return (
<ThreeBeatsCta
problem="Receipts in a shoebox. Panic every April."
turn="What if your books kept themselves?"
promise="Snap the receipt. Tallywise does the rest."
image={slot("scene", __studioImage854cc085)}
imageAlt="A freelancer at a sunny kitchen table photographs a paper receipt with her phone"
imagePosition="50% 35%"
label="Start My Free Account"
riskReverser={`Free to start · ${defaults.sample.guarantee} on paid plans`}
href="#start"
secondaryLabel="Or keep reading to see how it works"
secondaryHref="#how-it-works"
state={state}
autoplay={state === "default"}
disabled={state === "disabled"}
/>
);
}
| Name | Type | Details |
|---|---|---|
problem OptionalThreeBeatsCta |
string |
|
turn OptionalThreeBeatsCta |
string |
|
promise OptionalThreeBeatsCta |
string |
|
image OptionalThreeBeatsCta |
string |
|
imageAlt OptionalThreeBeatsCta |
string |
|
imagePosition OptionalThreeBeatsCta |
string |
|
label OptionalThreeBeatsCta |
string |
|
riskReverser OptionalThreeBeatsCta |
string |
|
href OptionalThreeBeatsCta |
string |
|
onAction OptionalThreeBeatsCta |
() => void |
|
secondaryLabel OptionalThreeBeatsCta |
string |
|
secondaryHref OptionalThreeBeatsCta |
string |
|
disabled OptionalThreeBeatsCta |
boolean |
|
autoplay OptionalThreeBeatsCta |
boolean |
|
showEdge OptionalThreeBeatsCta |
boolean |
|
state OptionalThreeBeatsCta |
"default" | "hover" | "active" | "disabled" |
|
copy OptionalThreeBeatsCta |
{ play?: string; pause?: string; resume?: string; replay?: string; counter?: string } |
|
className OptionalThreeBeatsCta |
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.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
08a53d5d13c8e5f1.webp
image/webp · 51.8 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB