Before After Timeline 1
Before → after timeline: shows the buyer's path from a blank page to launch as four milestone notes on a track that fills, then closes with the kit and one action.
Use it in a prompt
Use proof/before-after-timeline 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/proof/before-after-timeline.tsx. - Import it and pass your copy and images (Props tab):
import { BeforeAfterTimeline } from "@/components/funneldna/proof/before-after-timeline"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/proof/before-after-timeline/component.tsx 662 lines
// layout: annotated-board
// Before → after timeline: shows the buyer's path from a blank page to launch as four milestone notes on a track that fills, then closes with the kit and one action.
import * as React from "react";
import { Check, ShieldCheck } from "lucide-react";
export type BeforeAfterTimelineMilestone = {
/** Big label above the track ("Before", "Week 2"…). */
label: string;
/** Small caps tag naming what carries this step (usually a kit item). */
tag?: string;
/** The one milestone line for this step. */
text: React.ReactNode;
/** Slot image for this step (scene, item-1 … item-n). */
image?: string;
/** Alt text for the step image; empty marks it decorative. */
imageAlt?: string;
};
export type BeforeAfterTimelineState = "default" | "hover" | "active" | "disabled";
export type BeforeAfterTimelineProps = {
/** Section headline; a string headline gets the marker stroke on `highlight`. */
headline?: React.ReactNode;
/** Phrase inside a string headline that gets the marker stroke. */
highlight?: string;
/** One line under the headline. */
subheadline?: React.ReactNode;
/** Steps from before to after, left to right (top to bottom on phones). */
milestones?: BeforeAfterTimelineMilestone[];
/** Accessible name of the milestone list. */
journeyLabel?: string;
/** Small caps label above the kit name. */
kitLabel?: string;
/** Offer name in the close; an empty string hides the kit block. */
kitName?: string;
/** One quiet line under the kit name (terms, access). */
kitNote?: string;
/** Primary button label; an empty string hides the offer close. */
actionLabel?: string;
/** One plain line under the button. */
secondaryLine?: string;
/** Destination of the secondary line; makes it a text link. */
secondaryHref?: string;
/** Click handler of the secondary line; renders a text button when there is no `secondaryHref`. */
onSecondary?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
/** Small caps label before the guarantee line. */
guaranteeLabel?: string;
/** Guarantee line beside the shield; an empty string hides it. */
guarantee?: string;
/** Navigation destination of the primary button. */
href?: string;
/** Click handler of the primary button. */
onAction?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
/** Renders the primary button disabled. */
disabled?: boolean;
/** Forces a primary button state for previews. */
state?: BeforeAfterTimelineState;
/** Root class for page-level placement. */
className?: string;
};
export function BeforeAfterTimeline(props: BeforeAfterTimelineProps) {
const {
headline = "Build your first funnel with a clear plan",
highlight = "a clear plan",
subheadline = "Your journey with The Funnel Starter Kit",
milestones = DEFAULT_MILESTONES,
journeyLabel = "Your journey, step by step",
kitLabel = "The kit",
kitName = "The Funnel Starter Kit",
kitNote = "One payment · Lifetime access",
actionLabel = "Start My Funnel Plan",
secondaryLine = "or keep reading to see what's inside",
secondaryHref,
onSecondary,
guaranteeLabel = "The guarantee",
guarantee = "30-day money-back guarantee",
href,
onAction,
disabled = false,
state = "default",
className = "",
} = props;
const rootRef = React.useRef<HTMLDivElement>(null);
const [play, setPlay] = React.useState<"idle" | "pending" | "play">("idle");
// Fill the track once when the timeline scrolls into view; skipped entirely under reduced motion.
useIsoLayoutEffect(() => {
const el = rootRef.current;
if (!el || typeof window === "undefined" || !("IntersectionObserver" in window)) return;
if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
setPlay("pending");
const io = new IntersectionObserver(
(entries) => {
if (entries.some((entry) => entry.isIntersecting)) {
setPlay("play");
io.disconnect();
}
},
{ rootMargin: "0px 0px -12% 0px", threshold: 0 },
);
io.observe(el);
return () => io.disconnect();
}, []);
const isDisabled = disabled || state === "disabled";
const forced = state === "hover" || state === "active" ? state : undefined;
const count = milestones.length;
const button =
href && !isDisabled ? (
<a className="bat-btn" href={href} data-state={forced} onClick={onAction}>
{actionLabel}
</a>
) : (
<button type="button" className="bat-btn" data-state={forced} disabled={isDisabled} onClick={onAction}>
{actionLabel}
</button>
);
let secondary: React.ReactNode = null;
if (secondaryLine) {
if (secondaryHref) {
secondary = (
<a className="bat-quiet bat-quiet-link" href={secondaryHref} onClick={onSecondary}>
{secondaryLine}
</a>
);
} else if (onSecondary) {
secondary = (
<button type="button" className="bat-quiet bat-quiet-link" onClick={onSecondary}>
{secondaryLine}
</button>
);
} else {
secondary = <p className="bat-quiet">{secondaryLine}</p>;
}
}
return (
<div
ref={rootRef}
className={`cf-before-after-timeline${className ? ` ${className}` : ""}`}
data-play={play === "idle" ? undefined : play}
>
<style>{CSS}</style>
{headline || subheadline ? (
<header className="bat-head">
{headline ? <h2 className="bat-title">{renderHeadline(headline, highlight)}</h2> : null}
{subheadline ? <p className="bat-sub">{subheadline}</p> : null}
</header>
) : null}
<ol className="bat-list" aria-label={journeyLabel} style={{ "--bat-n": count } as React.CSSProperties}>
{milestones.map((m, i) => {
const last = i === count - 1;
return (
<li
key={`${m.label}-${i}`}
className={`bat-step${last ? " is-last" : ""}`}
style={
{
"--bat-i": i,
"--bat-tilt": `${TILTS[i % TILTS.length]}deg`,
"--bat-d": `${Math.min(i * 0.1, 0.3)}s`,
} as React.CSSProperties
}
>
<h3 className="bat-label">
<span className="bat-label-text">
{m.label}
</span>
</h3>
<div className="bat-rail" aria-hidden="true">
<span className="bat-seg">
<span className="bat-fill" />
</span>
<span className="bat-node">{last ? <Check size={18} strokeWidth={3} /> : null}</span>
</div>
<div className={`bat-note${m.image ? "" : " no-photo"}`}>
{m.image ? (
<img
className="bat-photo"
src={m.image}
alt={m.imageAlt ?? ""}
width={480}
height={360}
loading="lazy"
decoding="async"
/>
) : null}
<div className="bat-copy">
{m.tag ? <span className="bat-tag">{m.tag}</span> : null}
<p className="bat-text">{m.text}</p>
</div>
</div>
</li>
);
})}
</ol>
{actionLabel ? (
<div className="bat-close">
{kitName ? (
<div className="bat-kit">
{kitLabel ? <span className="bat-caps">{kitLabel}</span> : null}
<p className="bat-kit-name">{kitName}</p>
{kitNote ? <p className="bat-kit-note">{kitNote}</p> : null}
</div>
) : null}
<div className="bat-act">
<div className="bat-cta">{button}</div>
{secondary}
</div>
{guarantee ? (
<p className="bat-guar">
<ShieldCheck className="bat-guar-icon" size={22} strokeWidth={2.25} aria-hidden="true" />
{guaranteeLabel ? <span className="bat-caps bat-caps-inline">{guaranteeLabel}</span> : null}
<span className="bat-guar-text">{guarantee}</span>
</p>
) : null}
</div>
) : null}
</div>
);
}
export default BeforeAfterTimeline;
const DEFAULT_MILESTONES: BeforeAfterTimelineMilestone[] = [
{ label: "Before", tag: "Where you start", text: "An offer idea, a blank page and no map yet." },
{ label: "Week 2", tag: "Funnel Planning Guide", text: "Map your offer and the pages your funnel needs." },
{ label: "Week 6", tag: "Page Copy Workbook", text: "Draft your headline, offer, and call to action." },
{ label: "After", tag: "Launch Checklist", text: "Review the links, forms, and next steps before launch." },
];
/** Resting tilt (deg) of each milestone note, repeating past four. */
const TILTS = [-1.4, 0.9, -0.7, 1.2];
const useIsoLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
/** Wraps `phrase` inside a string headline in the marker stroke; rich headlines pass through untouched. */
function renderHeadline(text: React.ReactNode, phrase?: string): React.ReactNode {
if (typeof text !== "string" || !phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="bat-mark">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
const R = ".cf-before-after-timeline";
/*
* Colour exceptions (theme-contract.md):
* - #fae37c is only the documented --marker fallback.
* - #fff is only the fallback of --bat-badge-glyph, the white glyph of the solid success badge on the final node
* (status icon badges rule).
* The secondary text-link button reads --button-radius for its focus-ring corner (capped so it stays a link).
*/
const CSS = `
${R} {
--bat-gap: clamp(16px, 2.2vw, 32px);
--bat-track: oklch(from var(--ink) l c h / 0.16);
--bat-marker: color-mix(in oklch, var(--marker, #fae37c) 92%, transparent);
--bat-radius: var(--card-radius, var(--radius, 14px));
--bat-border: var(--card-border, color-mix(in oklch, var(--ink) 12%, transparent));
--bat-sh-sm: var(--shadow-sm, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.25));
--bat-sh-md: var(--shadow-md, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2));
--bat-sh-lg: var(--shadow-lg, 0 2px 4px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 12px 24px -8px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.32));
--bat-btn: var(--button-bg, var(--cta));
--bat-btn-2: var(--button-2-bg, var(--secondary));
box-sizing: border-box;
width: 100%;
max-width: 1240px;
margin-inline: auto;
color: var(--ink);
font-family: var(--font-body);
}
${R} *, ${R} *::before, ${R} *::after { box-sizing: border-box; }
${R} .bat-head { text-align: center; margin: 0 auto clamp(36px, 4.5vw, 60px); }
${R} .bat-title {
margin: 0 0 0.28em;
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(2.125rem, 5vw, 4.25rem);
line-height: 1.05;
text-wrap: balance;
color: var(--ink);
}
${R} .bat-mark {
color: var(--field-ink, var(--ink));
background-image: linear-gradient(var(--bat-marker), var(--bat-marker));
background-repeat: no-repeat;
background-size: 100% 86%;
background-position: 0 58%;
padding: 0 0.14em;
margin: 0 -0.04em;
border-radius: 0.2em 0.5em 0.28em 0.44em / 0.42em 0.3em 0.5em 0.32em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
${R} .bat-sub {
margin: 0;
font-size: clamp(1.125rem, 1.7vw, 1.5rem);
font-weight: 500;
line-height: 1.4;
color: var(--muted);
text-wrap: pretty;
}
${R} .bat-list {
list-style: none;
margin: 0;
padding: 0;
display: grid;
grid-template-columns: repeat(var(--bat-n, 4), minmax(0, 1fr));
grid-template-rows: auto auto 1fr;
column-gap: var(--bat-gap);
row-gap: 0;
}
${R} .bat-step {
position: relative;
display: grid;
grid-row: span 3;
grid-template-rows: subgrid;
row-gap: 0;
min-width: 0;
text-align: center;
}
${R} .bat-label {
align-self: end;
margin: 0 0 14px;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.02em);
font-size: clamp(1.5rem, 2.5vw, 2.375rem);
line-height: 1.1;
color: var(--ink);
text-wrap: balance;
}
${R} .is-last .bat-label { color: var(--accent); }
${R} .bat-label-text { position: relative; display: inline-block; isolation: isolate; }
${R} .bat-rail {
position: relative;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
${R} .bat-seg {
position: absolute;
top: 50%;
left: calc(var(--bat-gap) / -2);
right: calc(var(--bat-gap) / -2);
height: 4px;
margin-top: -2px;
border-radius: 4px;
background: var(--bat-track);
overflow: hidden;
}
${R} .bat-step:first-child .bat-seg { left: 50%; }
${R} .bat-step:last-child .bat-seg { right: 50%; }
${R} .bat-fill {
position: absolute;
inset: 0;
background: var(--accent-fill, var(--accent));
transform-origin: left center;
}
${R} .bat-node {
position: relative;
z-index: 1;
display: grid;
place-items: center;
width: 26px;
height: 26px;
border-radius: 50%;
background: var(--card);
border: 3px solid var(--accent-fill, var(--accent));
}
/* The final tick is a solid status badge: --success fill, white glyph; the halo is the guaranteed --success-soft. */
${R} .is-last .bat-node {
width: 32px;
height: 32px;
border: 0;
background: var(--success);
color: var(--bat-badge-glyph, #fff);
outline: 5px solid var(--success-soft);
}
${R} .bat-note {
margin-top: 20px;
display: flex;
flex-direction: column;
padding: 10px 10px 20px;
background: var(--card);
border: 1px solid var(--bat-border);
border-radius: var(--bat-radius);
box-shadow: inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6), var(--card-shadow, var(--bat-sh-md));
rotate: var(--bat-tilt, 0deg);
transition: rotate 0.25s ease, translate 0.25s ease, box-shadow 0.25s ease;
}
${R} .is-last .bat-note { border-color: color-mix(in oklch, var(--accent-fill, var(--accent)) 50%, transparent); }
${R} .bat-photo {
display: block;
width: 100%;
height: auto;
aspect-ratio: 4 / 3;
object-fit: cover;
object-position: center;
border-radius: calc(var(--bat-radius) * 0.65);
background: color-mix(in oklch, var(--ink) 4%, var(--card));
}
${R} .bat-copy { display: grid; gap: 8px; padding: 16px 8px 0; }
${R} .no-photo .bat-copy { padding-top: 10px; }
${R} .bat-tag {
font-size: 0.875rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
line-height: 1.3;
color: var(--accent);
}
${R} .bat-text {
margin: 0;
font-size: 1.0625rem;
font-weight: 600;
line-height: 1.42;
color: var(--ink);
text-wrap: pretty;
}
@media (hover: hover) and (pointer: fine) {
${R} .bat-note:hover {
rotate: 0deg;
translate: 0 -6px;
box-shadow: inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6), var(--bat-sh-lg);
}
}
${R} .bat-close {
margin: clamp(44px, 5.5vw, 72px) auto 0;
max-width: 780px;
display: grid;
justify-items: center;
gap: clamp(22px, 2.8vw, 30px);
padding: clamp(26px, 4vw, 44px) clamp(20px, 4vw, 48px);
text-align: center;
background: var(--card);
border: 1px solid var(--bat-border);
border-radius: var(--bat-radius);
box-shadow: inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6), var(--card-shadow, var(--bat-sh-lg));
}
${R} .bat-caps {
display: block;
margin-bottom: 12px;
font-family: var(--font-body);
font-size: 0.875rem;
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
line-height: 1.2;
color: var(--muted);
}
${R} .bat-caps-inline { display: inline; margin: 0; }
${R} .bat-kit-name {
margin: 0 0 6px;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.015em);
font-size: clamp(1.5rem, 2.6vw, 2rem);
line-height: 1.15;
color: var(--ink);
text-wrap: balance;
}
${R} .bat-kit-note { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
${R} .bat-act { display: grid; justify-items: center; gap: 14px; width: 100%; }
${R} .bat-cta { position: relative; display: inline-flex; max-width: 100%; }
${R} .bat-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
min-height: 62px;
padding: 0 clamp(26px, 3vw, 40px);
border: 1px solid oklch(from var(--bat-btn) calc(l - 0.12) c h);
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--bat-btn) calc(l + 0.04) c h), var(--button-bg-2, var(--cta-2)));
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.5vw, 1.3125rem);
line-height: 1.15;
letter-spacing: -0.005em;
text-align: center;
text-decoration: none;
text-shadow: var(--button-text-shadow, none);
white-space: nowrap;
cursor: pointer;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--bat-btn) calc(l + 0.12) c h / 0.6), inset 0 -3px 0 oklch(from var(--bat-btn) calc(l - 0.16) c h), var(--bat-sh-md));
transition: translate 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
${R} .bat-btn[data-state="hover"] {
translate: 0 -1px;
background: linear-gradient(oklch(from var(--bat-btn) calc(l - 0.02) c h), oklch(from var(--bat-btn) calc(l - 0.1) c h));
box-shadow: inset 0 1px 0 oklch(from var(--bat-btn) calc(l + 0.1) c h / 0.55), inset 0 -3px 0 oklch(from var(--bat-btn) calc(l - 0.2) c h), var(--bat-sh-lg);
}
@media (hover: hover) and (pointer: fine) {
${R} .bat-btn:not(:disabled):hover {
translate: 0 -1px;
background: linear-gradient(oklch(from var(--bat-btn) calc(l - 0.02) c h), oklch(from var(--bat-btn) calc(l - 0.1) c h));
box-shadow: inset 0 1px 0 oklch(from var(--bat-btn) calc(l + 0.1) c h / 0.55), inset 0 -3px 0 oklch(from var(--bat-btn) calc(l - 0.2) c h), var(--bat-sh-lg);
}
}
${R} .bat-btn:not(:disabled):active, ${R} .bat-btn[data-state="active"] {
translate: 0 1px;
background: linear-gradient(oklch(from var(--bat-btn) calc(l - 0.07) c h), oklch(from var(--bat-btn) calc(l - 0.11) c h));
box-shadow: inset 0 2px 3px oklch(from var(--bat-btn) calc(l - 0.24) c h / 0.55), var(--bat-sh-sm);
}
${R} .bat-btn:focus-visible {
outline: 3px solid var(--field-focus, var(--accent));
outline-offset: 3px;
}
${R} .bat-btn:disabled {
cursor: not-allowed;
translate: none;
border-color: transparent;
background: var(--bat-btn-2);
color: var(--button-2-ink, var(--secondary-ink));
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--shadow-sm));
}
${R} .bat-quiet {
margin: 0;
padding: 0;
border: 0;
background: none;
font: inherit;
font-size: 1rem;
line-height: 1.4;
color: var(--muted);
text-wrap: pretty;
}
${R} .bat-quiet-link {
cursor: pointer;
color: var(--link, var(--accent));
text-decoration: underline;
text-decoration-color: oklch(from var(--link, var(--accent)) l c h / 0.45);
text-underline-offset: 0.18em;
border-radius: min(var(--button-radius, 4px), 6px);
}
${R} .bat-quiet-link:hover {
color: oklch(from var(--link, var(--accent)) calc(l - 0.08) c h);
text-decoration-color: currentColor;
}
${R} .bat-quiet-link:focus-visible { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 3px; }
${R} .bat-guar {
margin: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 6px 10px;
font-size: 1rem;
line-height: 1.35;
}
${R} .bat-guar-icon { flex: 0 0 auto; color: var(--success); }
${R} .bat-guar-text { font-weight: 700; color: var(--ink); text-wrap: pretty; }
@media (max-width: 859px) {
${R} .bat-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
${R} .bat-step {
grid-row: auto;
grid-template-rows: auto auto;
grid-template-columns: 34px minmax(0, 1fr);
grid-template-areas: "rail label" "rail note";
column-gap: 14px;
padding-bottom: 22px;
text-align: left;
}
${R} .bat-step:last-child { padding-bottom: 0; }
${R} .bat-label { grid-area: label; align-self: start; margin: 0 0 10px; font-size: 1.5rem; }
${R} .bat-rail { grid-area: rail; height: auto; align-items: flex-start; }
${R} .bat-node { margin-top: 0; }
${R} .is-last .bat-node { margin-top: -3px; }
${R} .bat-seg { top: 0; bottom: -22px; left: 50%; right: auto; width: 4px; height: auto; margin: 0 0 0 -2px; }
${R} .bat-step:first-child .bat-seg { top: 13px; }
${R} .bat-step:last-child .bat-seg { right: auto; bottom: auto; height: 13px; }
${R} .bat-fill { transform-origin: center top; }
${R} .bat-note {
grid-area: note;
margin-top: 0;
rotate: 0deg;
display: grid;
grid-template-columns: 96px minmax(0, 1fr);
align-items: start;
gap: 14px;
padding: 10px;
}
${R} .bat-note.no-photo { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
${R} .bat-photo { aspect-ratio: 1 / 1; }
${R} .bat-copy, ${R} .no-photo .bat-copy { gap: 6px; padding: 4px 4px 4px 0; }
${R} .bat-text { font-size: 1rem; }
}
@media (max-width: 639px) {
${R} .bat-cta { display: flex; width: 100%; }
${R} .bat-btn { width: 100%; white-space: normal; text-wrap: balance; padding: 14px 20px; min-height: 60px; }
}
@keyframes cf-bat-fill-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cf-bat-fill-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes cf-bat-pop { from { scale: 0.6; opacity: 0.5; } to { scale: 1; opacity: 1; } }
@keyframes cf-bat-rise { from { opacity: 0.82; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
${R}[data-play="pending"] .bat-fill { transform: scaleX(0); }
${R}[data-play="play"] .bat-fill {
animation: cf-bat-fill-x 0.42s cubic-bezier(0.3, 0.7, 0.3, 1) backwards;
animation-delay: calc(var(--bat-i, 0) * 0.18s);
}
${R}[data-play="pending"] .bat-node { scale: 0.6; opacity: 0.5; }
${R}[data-play="play"] .bat-node {
animation: cf-bat-pop 0.3s ease-out backwards;
animation-delay: calc(var(--bat-i, 0) * 0.18s + 0.12s);
}
${R}[data-play="pending"] .bat-note { opacity: 0.82; translate: 0 10px; }
${R}[data-play="play"] .bat-note {
animation: cf-bat-rise 0.45s ease-out backwards;
animation-delay: var(--bat-d, 0s);
}
@media (max-width: 859px) {
${R}[data-play="pending"] .bat-fill { transform: scaleY(0); }
${R}[data-play="play"] .bat-fill { animation-name: cf-bat-fill-y; }
}
@media (prefers-reduced-motion: reduce) {
${R}[data-play] .bat-fill,
${R}[data-play] .bat-node,
${R}[data-play] .bat-note { animation: none; transform: none; scale: none; translate: none; opacity: 1; }
${R} .bat-note, ${R} .bat-btn { transition: none; }
${R} .bat-note:hover { translate: none; }
${R} .bat-btn:not(:disabled):hover, ${R} .bat-btn:not(:disabled):active, ${R} .bat-btn[data-state] { translate: none; }
}
`;
pieces/proof/before-after-timeline/specimen.tsx 37 lines
// Specimen: the before → after timeline with the sample kit's three items as the milestones after the starting scene.
import __studioImageafc1661b from "../assets/a459223230946fd4.webp";
import { BeforeAfterTimeline } from "../before-after-timeline";
import type { BeforeAfterTimelineState } from "../before-after-timeline";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states: BeforeAfterTimelineState[] = ["default", "hover", "active", "disabled"];
export default function BeforeAfterTimelineSpecimen({ state = "default" }: { state?: BeforeAfterTimelineState }) {
const sample = defaults.sample;
const [guide, workbook, checklist] = sample.items;
return (
<BeforeAfterTimeline
state={state}
headline={sample.headline}
highlight="a clear plan"
subheadline={`Your journey with ${sample.name}`}
milestones={[
{
label: "Before",
tag: "Where you start",
text: "An offer idea, a blank page and no map yet.",
image: slot("scene", __studioImageafc1661b),
imageAlt: "A clean desk with a blank notebook and scattered sticky notes",
},
{ label: "Week 2", tag: guide.name, text: guide.detail, image: slot("item-1", guide.image), imageAlt: guide.imageAlt },
{ label: "Week 6", tag: workbook.name, text: workbook.detail, image: slot("item-2", workbook.image), imageAlt: workbook.imageAlt },
{ label: "After", tag: checklist.name, text: checklist.detail, image: slot("item-3", checklist.image), imageAlt: checklist.imageAlt },
]}
kitName={sample.name}
kitNote={sample.note}
guarantee={sample.guarantee}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalBeforeAfterTimeline |
React.ReactNode |
|
highlight OptionalBeforeAfterTimeline |
string |
|
subheadline OptionalBeforeAfterTimeline |
React.ReactNode |
|
milestones OptionalBeforeAfterTimeline |
BeforeAfterTimelineMilestone[] |
|
journeyLabel OptionalBeforeAfterTimeline |
string |
|
kitLabel OptionalBeforeAfterTimeline |
string |
|
kitName OptionalBeforeAfterTimeline |
string |
|
kitNote OptionalBeforeAfterTimeline |
string |
|
actionLabel OptionalBeforeAfterTimeline |
string |
|
secondaryLine OptionalBeforeAfterTimeline |
string |
|
secondaryHref OptionalBeforeAfterTimeline |
string |
|
onSecondary OptionalBeforeAfterTimeline |
(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void |
|
guaranteeLabel OptionalBeforeAfterTimeline |
string |
|
guarantee OptionalBeforeAfterTimeline |
string |
|
href OptionalBeforeAfterTimeline |
string |
|
onAction OptionalBeforeAfterTimeline |
(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void |
|
disabled OptionalBeforeAfterTimeline |
boolean |
|
state OptionalBeforeAfterTimeline |
BeforeAfterTimelineState |
|
className OptionalBeforeAfterTimeline |
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.
--field-focus--field-ink- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
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.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
scene- A wide atmosphere photo behind or beside the copy.
-
a459223230946fd4.webp
image/webp · 64.9 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB