Poster Frame Hero 1
Poster Frame Hero: the trailer poster is the first-screen hook, a rail of big chapter numerals opens the loops the
Use it in a prompt
Use hero/poster-frame-hero 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/hero/poster-frame-hero.tsx. - Import it and pass your copy and images (Props tab):
import { PosterFrameHero } from "@/components/funneldna/hero/poster-frame-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/poster-frame-hero/component.tsx 507 lines
// layout: number-rail
// Poster Frame Hero: the trailer poster is the first-screen hook, a rail of big chapter numerals opens the loops the
// video closes, and one two-line action sits under the frame. On play the frame widens and the headline steps back.
import * as React from "react";
import { motion, useReducedMotion } from "motion/react";
import { Clock3, MessageSquareQuote, Minimize2, Play } from "lucide-react";
import { Divider, FX_HOST, Pattern } from "../fx/fx";
type DividerTone = React.ComponentProps<typeof Divider>["tone"];
export type PosterChapter = {
/** Chapter title, shown beside its numeral. */
title: string;
/** Start time in seconds; when videoSrc exists the chapter seeks the player here. */
time?: number;
/** Shown start time; derived from `time` when omitted. */
timeLabel?: string;
};
export type PosterFrameHeroCopy = {
/** Accessible name of the play control; {label} is replaced. */
playAria: string;
/** Same, when a duration is supplied; {label} and {duration} are replaced. */
playAriaTimed: string;
/** Accessible name of the control that leaves the wide view. */
exitWide: string;
/** Accessible name of the chapter list. */
chapters: string;
/** Accessible name of a seekable chapter; {number} and {title} are replaced. */
chapterAria: string;
/** Accessible name of the video element. */
video: string;
};
export type PosterFrameHeroProps = {
headline?: string;
/** A phrase inside the headline, set in the accent colour. */
headlineMark?: string;
subhead?: React.ReactNode;
/** Poster frame image (scene slot). */
posterImage?: string;
posterAlt?: string;
/** Real video file. Without it, play widens the frame and calls onPlay; chapters stay a plain list. */
videoSrc?: string;
/** Running time, shown only when supplied. */
duration?: string;
playLabel?: string;
/** Supplied chapter titles (three reads best). */
chapters?: PosterChapter[];
ctaLabel?: string;
/** Benefit line inside the button, under the label. */
ctaSub?: string;
href?: string;
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
onPlay?: () => void;
onChapter?: (index: number, chapter: PosterChapter) => void;
/** Today's price, shown beside the alternative it replaces. */
price?: string;
/** What the supplied alternative is, e.g. "vs. hiring an agency". */
priceAlternative?: string;
/** Short proof line; renders nothing when empty. */
proof?: React.ReactNode;
disabled?: boolean;
state?: "default" | "hover" | "active" | "disabled";
/** Curved hand-off into the next section. */
showEdge?: boolean;
/** Token name of the next section's background for the curve. */
edgeTone?: DividerTone;
copy?: Partial<PosterFrameHeroCopy>;
className?: string;
};
const DEFAULT_COPY: PosterFrameHeroCopy = {
playAria: "{label}",
playAriaTimed: "{label}, {duration}",
exitWide: "Exit wide view",
chapters: "Chapters",
chapterAria: "Play from chapter {number}: {title}",
video: "Trailer video",
};
const EASE = [0.2, 0.7, 0.2, 1] as [number, number, number, number];
export function PosterFrameHero(props: PosterFrameHeroProps) {
const {
headline = "See exactly how it works before you start",
headlineMark = "how it works",
subhead = "A short walkthrough of the plan, the first steps and what you will have when you finish.",
posterImage,
posterAlt = "Trailer poster",
videoSrc,
duration,
playLabel = "Watch the trailer",
chapters = [],
ctaLabel = "Start now",
ctaSub = "Instant access",
href,
onAction,
onPlay,
onChapter,
price,
priceAlternative,
proof,
disabled = false,
state = "default",
showEdge = true,
edgeTone,
copy,
className,
} = props;
const c = { ...DEFAULT_COPY, ...copy };
const reduce = useReducedMotion() ?? false;
const layoutOn = !reduce;
const isDisabled = disabled || state === "disabled";
const hasRail = chapters.length > 0;
const tone = (edgeTone ?? "band") as DividerTone;
const [playing, setPlaying] = React.useState(false);
const [active, setActive] = React.useState(-1);
const [seekTick, setSeekTick] = React.useState(0);
const videoRef = React.useRef<HTMLVideoElement>(null);
const playRef = React.useRef<HTMLButtonElement>(null);
const pendingSeek = React.useRef<number | null>(null);
const focusVideo = React.useRef(false);
const restoreFocus = React.useRef(false);
const applyPendingSeek = () => {
const video = videoRef.current;
if (!video || pendingSeek.current === null) return;
try {
video.currentTime = pendingSeek.current;
} catch {
return;
}
pendingSeek.current = null;
};
React.useEffect(() => {
if (!playing || !videoSrc) return;
const video = videoRef.current;
if (!video) return;
if (video.readyState >= 1) applyPendingSeek();
if (focusVideo.current) {
focusVideo.current = false;
video.focus({ preventScroll: true });
}
const started = video.play();
if (started && typeof started.catch === "function") started.catch(() => undefined);
}, [playing, videoSrc, seekTick]);
React.useEffect(() => {
if (!playing && restoreFocus.current) {
restoreFocus.current = false;
playRef.current?.focus({ preventScroll: true });
}
}, [playing]);
const handlePlay = () => {
focusVideo.current = true;
setPlaying(true);
onPlay?.();
};
const handleExit = () => {
videoRef.current?.pause();
restoreFocus.current = true;
setPlaying(false);
};
const handleChapter = (index: number) => {
const chapter = chapters[index];
if (!chapter || typeof chapter.time !== "number") return;
pendingSeek.current = chapter.time;
setActive(index);
setPlaying(true);
setSeekTick((tick) => tick + 1);
onChapter?.(index, chapter);
};
const handleTimeUpdate = () => {
const video = videoRef.current;
if (!video) return;
let index = -1;
chapters.forEach((chapter, i) => {
if (typeof chapter.time === "number" && video.currentTime >= chapter.time) index = i;
});
setActive(index);
};
const rise = reduce ? false : { opacity: 0.82, y: 8 };
const layoutTransition = { duration: reduce ? 0 : 0.5, ease: EASE };
const enter = (delay: number) => ({
duration: reduce ? 0 : 0.45,
ease: EASE,
delay: reduce ? 0 : delay,
layout: layoutTransition,
});
const playName = duration
? c.playAriaTimed.replace("{label}", playLabel).replace("{duration}", duration)
: c.playAria.replace("{label}", playLabel);
const forced = state === "hover" || state === "active" ? state : undefined;
const buttonBody = (
<>
<span className="pfh-btn-label">{ctaLabel}</span>
{ctaSub ? <span className="pfh-btn-sub">{ctaSub}</span> : null}
</>
);
const action =
href && !isDisabled ? (
<a className="pfh-btn" href={href} onClick={onAction} data-state={forced}>
{buttonBody}
</a>
) : (
<button type="button" className="pfh-btn" onClick={onAction} disabled={isDisabled} data-state={forced}>
{buttonBody}
</button>
);
return (
<section
className={["cf-poster-frame-hero", className].filter(Boolean).join(" ")}
style={FX_HOST}
data-playing={playing ? "" : undefined}
data-rail={hasRail ? "" : undefined}
data-edge={showEdge ? "" : undefined}
>
<style>{CSS}</style>
<Pattern name="rings" fade="corner" />
<div className="pfh-inner">
<div className="pfh-grid">
<header className="pfh-head">
<h1 key={playing ? "wide" : "frame"} className="pfh-title">
{markPhrase(headline, headlineMark)}
</h1>
</header>
<motion.div
className="pfh-frame"
layout={layoutOn}
initial={rise}
animate={{ opacity: 1, y: 0 }}
transition={enter(0.07)}
style={{ borderRadius: 12 }}
>
{playing && videoSrc ? (
<video
ref={videoRef}
className="pfh-video"
src={videoSrc}
poster={posterImage}
controls
playsInline
preload="metadata"
aria-label={c.video}
onLoadedMetadata={applyPendingSeek}
onTimeUpdate={handleTimeUpdate}
/>
) : (
<>
{posterImage ? (
<img className="pfh-poster" src={posterImage} alt={posterAlt} width={1600} height={900} decoding="async" />
) : (
<span className="pfh-empty" aria-hidden="true" />
)}
<span className="pfh-shade" aria-hidden="true" />
<button ref={playRef} type="button" className="pfh-play" onClick={handlePlay} aria-label={playName}>
<span className="pfh-disc">
<Play size={32} strokeWidth={2.5} fill="currentColor" aria-hidden="true" />
</span>
<span className="pfh-chip">
<span>{playLabel}</span>
{duration ? (
<>
<span className="pfh-chip-dot" aria-hidden="true">
·
</span>
<span className="pfh-chip-time">
<Clock3 size={16} strokeWidth={2.5} aria-hidden="true" />
{duration}
</span>
</>
) : null}
</span>
</button>
</>
)}
{playing ? (
<button type="button" className="pfh-exit" onClick={handleExit} aria-label={c.exitWide}>
<Minimize2 size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
) : null}
</motion.div>
<motion.div
className="pfh-close"
layout={layoutOn ? "position" : false}
initial={rise}
animate={{ opacity: 1, y: 0 }}
transition={enter(0.14)}
>
{subhead || proof ? (
<div className="pfh-copy">
{subhead ? <p className="pfh-sub">{subhead}</p> : null}
{proof ? (
<p className="pfh-proof">
<MessageSquareQuote size={16} strokeWidth={2.5} aria-hidden="true" />
{proof}
</p>
) : null}
</div>
) : null}
<div className="pfh-action">
{action}
{price ? (
<p className="pfh-price">
<strong>{price}</strong>
{priceAlternative ? <span>{priceAlternative}</span> : null}
</p>
) : null}
</div>
</motion.div>
{hasRail ? (
<motion.ol
className="pfh-rail"
aria-label={c.chapters}
layout={layoutOn ? "position" : false}
initial={rise}
animate={{ opacity: 1, y: 0 }}
transition={enter(0.21)}
>
{chapters.map((chapter, i) => {
const number = String(i + 1).padStart(2, "0");
const label =
chapter.timeLabel ?? (typeof chapter.time === "number" ? formatTime(chapter.time) : undefined);
const seekable = Boolean(videoSrc) && typeof chapter.time === "number";
const body = (
<>
<span className="pfh-num" aria-hidden="true">
{number}
</span>
<span className="pfh-ch">
<span className="pfh-ch-title">{chapter.title}</span>
{label ? (
<span className="pfh-ch-time">
<Clock3 size={16} strokeWidth={2.5} aria-hidden="true" />
{label}
</span>
) : null}
</span>
</>
);
return (
<motion.li
key={i}
className="pfh-item"
data-active={active === i ? "" : undefined}
layout={layoutOn ? "position" : false}
transition={{ layout: layoutTransition }}
>
{seekable ? (
<button
type="button"
className="pfh-chapter"
onClick={() => handleChapter(i)}
aria-current={active === i ? "true" : undefined}
aria-label={c.chapterAria.replace("{number}", String(i + 1)).replace("{title}", chapter.title)}
>
{body}
</button>
) : (
<div className="pfh-chapter">{body}</div>
)}
</motion.li>
);
})}
</motion.ol>
) : null}
</div>
</div>
{showEdge ? <Divider shape="curve" tone={tone} height={56} /> : null}
</section>
);
}
export default PosterFrameHero;
function markPhrase(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="pfh-mark">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
function formatTime(seconds: number): string {
const total = Math.max(0, Math.floor(seconds));
const hours = Math.floor(total / 3600);
const minutes = Math.floor((total % 3600) / 60);
const secs = String(total % 60).padStart(2, "0");
return hours ? `${hours}:${String(minutes).padStart(2, "0")}:${secs}` : `${minutes}:${secs}`;
}
const CSS = `
.cf-poster-frame-hero{position:relative;overflow:hidden;overflow:clip;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding-block:clamp(40px,6vw,88px) clamp(56px,7vw,96px);padding-inline:clamp(16px,5vw,48px)}
.cf-poster-frame-hero[data-edge]{padding-block-end:calc(clamp(40px,5vw,72px) + 56px)}
.cf-poster-frame-hero .pfh-inner{position:relative;z-index:1;max-inline-size:1120px;margin-inline:auto;container-type:inline-size}
.cf-poster-frame-hero .pfh-grid{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:'head' 'frame' 'close' 'rail';row-gap:24px;align-items:start}
.cf-poster-frame-hero .pfh-grid>*{min-width:0}
.cf-poster-frame-hero .pfh-head{grid-area:head}
.cf-poster-frame-hero .pfh-frame{grid-area:frame}
.cf-poster-frame-hero .pfh-close{grid-area:close}
.cf-poster-frame-hero .pfh-rail{grid-area:rail}
.cf-poster-frame-hero .pfh-title{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(2.5rem,1.2rem + 5.2cqi,4.875rem);line-height:1.04;color:var(--ink);text-wrap:balance;overflow-wrap:break-word;animation:cf-pfh-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-poster-frame-hero[data-playing] .pfh-title{font-size:clamp(1.75rem,1rem + 2.8cqi,3rem);line-height:1.08}
.cf-poster-frame-hero .pfh-mark{color:var(--accent)}
@keyframes cf-pfh-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
.cf-poster-frame-hero .pfh-frame{position:relative;aspect-ratio:16 / 9;border-radius:12px;overflow:hidden;background:var(--band);isolation:isolate;filter:drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.3)) drop-shadow(0 16px 20px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24))}
.cf-poster-frame-hero .pfh-poster,.cf-poster-frame-hero .pfh-video,.cf-poster-frame-hero .pfh-empty{position:absolute;inset:0;display:block;inline-size:100%;block-size:100%}
.cf-poster-frame-hero .pfh-poster{object-fit:cover;object-position:center}
.cf-poster-frame-hero .pfh-video{object-fit:contain;background:var(--band)}
.cf-poster-frame-hero .pfh-empty{background:color-mix(in oklch, var(--band-ink) 8%, var(--band))}
.cf-poster-frame-hero .pfh-shade{position:absolute;inset:0;pointer-events:none;background:radial-gradient(55% 70% at 50% 50%, oklch(from var(--band) l c h / 0.34), oklch(from var(--band) l c h / 0) 72%)}
.cf-poster-frame-hero .pfh-play{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;margin:0;padding:16px;border:0;background:transparent;color:var(--ink);font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cf-poster-frame-hero .pfh-play:focus-visible{outline:none}
.cf-poster-frame-hero .pfh-disc{display:grid;place-items:center;inline-size:clamp(64px,8cqi,96px);aspect-ratio:1;border-radius:999px;background:var(--card);color:var(--ink);box-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));transition:transform .16s ease, box-shadow .16s ease}
.cf-poster-frame-hero .pfh-disc svg{inline-size:36%;block-size:36%;margin-inline-start:9%}
.cf-poster-frame-hero .pfh-play:hover .pfh-disc{transform:scale(1.06)}
.cf-poster-frame-hero .pfh-play:active .pfh-disc{transform:scale(.96)}
.cf-poster-frame-hero .pfh-play:hover .pfh-chip{background:color-mix(in oklch, var(--ink) 5%, var(--card))}
.cf-poster-frame-hero .pfh-play:focus-visible .pfh-disc{outline:3px solid var(--field-focus, var(--accent));outline-offset:4px}
.cf-poster-frame-hero .pfh-chip{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;min-block-size:32px;max-inline-size:100%;padding:4px 14px;border-radius:999px;background:var(--card);color:var(--ink);font-size:.9375rem;font-weight:700;line-height:1.2;text-wrap:balance;box-shadow:var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2))}
.cf-poster-frame-hero .pfh-chip-dot{color:var(--muted)}
.cf-poster-frame-hero .pfh-chip-time{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-variant-numeric:tabular-nums}
.cf-poster-frame-hero .pfh-exit{position:absolute;inset-block-start:12px;inset-inline-end:12px;z-index:2;display:grid;place-items:center;inline-size:44px;block-size:44px;padding:0;border:0;border-radius:999px;background:var(--card);color:var(--ink);cursor:pointer;box-shadow:var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2));transition:background .16s ease, transform .16s ease}
.cf-poster-frame-hero .pfh-exit:hover{background:color-mix(in oklch, var(--ink) 6%, var(--card))}
.cf-poster-frame-hero .pfh-exit:active{transform:scale(.95)}
.cf-poster-frame-hero .pfh-exit:focus-visible{outline:3px solid var(--field-focus, var(--accent));outline-offset:3px}
.cf-poster-frame-hero .pfh-close{display:flex;flex-direction:column;gap:24px}
.cf-poster-frame-hero .pfh-copy{display:flex;flex-direction:column;gap:12px;min-width:0}
.cf-poster-frame-hero .pfh-sub{margin:0;max-inline-size:40rem;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--ink);text-wrap:pretty;overflow-wrap:anywhere}
.cf-poster-frame-hero .pfh-proof{margin:0;max-inline-size:40rem;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-poster-frame-hero .pfh-proof svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em;color:var(--accent)}
.cf-poster-frame-hero .pfh-action{display:flex;flex-direction:column;align-items:stretch;gap:12px;min-width:0}
.cf-poster-frame-hero .pfh-price{margin:0;text-align:center;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-poster-frame-hero .pfh-price strong{margin-inline-end:.35em;font-family:var(--font-display);font-size:1.0625rem;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.cf-poster-frame-hero .pfh-btn{--pfh-bb:var(--button-bg, var(--cta));display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;inline-size:100%;max-inline-size:100%;min-block-size:72px;margin:0;padding:12px 28px;border:0;border-radius:var(--button-radius, var(--radius, 12px));font-family:var(--button-font, var(--font-display));text-transform:var(--button-case, none);color:var(--button-ink, var(--cta-ink));text-align:center;text-decoration:none;text-shadow:var(--button-text-shadow, none);cursor:pointer;background:linear-gradient(oklch(from var(--pfh-bb) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--pfh-bb) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--pfh-bb) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.3), 0 8px 16px -6px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.38));transition:transform .16s ease, box-shadow .16s ease, background .16s ease;-webkit-tap-highlight-color:transparent}
.cf-poster-frame-hero .pfh-btn-label{font-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight, 800);line-height:1.15;text-wrap:balance;overflow-wrap:anywhere}
.cf-poster-frame-hero .pfh-btn-sub{font-family:var(--font-body);font-size:.9375rem;font-weight:600;line-height:1.3;text-transform:none;text-wrap:pretty}
.cf-poster-frame-hero .pfh-btn:hover,.cf-poster-frame-hero .pfh-btn[data-state='hover']{transform:translateY(-1px);background:linear-gradient(oklch(from var(--pfh-bb) 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(--pfh-bb) calc(l + 0.12) c h / 0.7), inset 0 -3px 0 oklch(from var(--pfh-bb) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.34), 0 12px 20px -8px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.44)}
.cf-poster-frame-hero .pfh-btn:active,.cf-poster-frame-hero .pfh-btn[data-state='active']{transform:translateY(1px);background:linear-gradient(oklch(from var(--pfh-bb) calc(l - 0.05) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--pfh-bb) calc(l - 0.22) c h / 0.5), inset 0 -2px 0 oklch(from var(--pfh-bb) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.3)}
.cf-poster-frame-hero .pfh-btn:focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.55);outline-offset:3px}
.cf-poster-frame-hero .pfh-btn:disabled{transform:none;cursor:not-allowed;background:var(--button-2-bg, var(--secondary));color:var(--button-2-ink, var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow, var(--shadow-sm))}
.cf-poster-frame-hero .pfh-rail{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}
.cf-poster-frame-hero .pfh-item{min-width:0}
.cf-poster-frame-hero .pfh-item+.pfh-item{border-block-start:1px solid oklch(from var(--ink) l c h / 0.14)}
.cf-poster-frame-hero .pfh-chapter{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:16px;align-items:start;inline-size:100%;margin:0;padding-block:16px;padding-inline:0;border:0;background:none;color:inherit;font:inherit;text-align:start}
.cf-poster-frame-hero button.pfh-chapter{inline-size:calc(100% + 24px);margin-inline:-12px;padding-inline:12px;border-radius:10px;cursor:pointer;transition:background .16s ease}
.cf-poster-frame-hero button.pfh-chapter:hover{background:color-mix(in oklch, var(--ink) 5%, var(--surface))}
.cf-poster-frame-hero .pfh-item[data-active] button.pfh-chapter{background:color-mix(in oklch, var(--accent) 10%, var(--surface))}
.cf-poster-frame-hero button.pfh-chapter:focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.55);outline-offset:2px}
.cf-poster-frame-hero .pfh-num{min-inline-size:2ch;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.6cqi,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--accent)}
.cf-poster-frame-hero .pfh-ch{display:flex;flex-direction:column;gap:6px;min-width:0;padding-block-start:4px}
.cf-poster-frame-hero .pfh-ch-title{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;line-height:1.3;color:var(--ink);text-wrap:pretty;overflow-wrap:anywhere}
.cf-poster-frame-hero .pfh-ch-time{font-size:.9375rem;font-weight:600;line-height:1.2;color:var(--muted);font-variant-numeric:tabular-nums}
.cf-poster-frame-hero .pfh-ch-time svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.35em}
@container (min-width: 560px){
.cf-poster-frame-hero .pfh-rail{flex-direction:row;column-gap:32px}
.cf-poster-frame-hero .pfh-item{flex:1 1 0}
.cf-poster-frame-hero .pfh-item+.pfh-item{border-block-start:0}
}
@container (min-width: 860px){
.cf-poster-frame-hero .pfh-grid{row-gap:32px}
.cf-poster-frame-hero[data-rail]:not([data-playing]) .pfh-grid{grid-template-columns:minmax(0,17.5rem) minmax(0,1fr);grid-template-areas:'head head' 'rail frame' 'close close';column-gap:clamp(24px,3cqi,40px)}
.cf-poster-frame-hero[data-playing] .pfh-grid{grid-template-areas:'head' 'frame' 'rail' 'close'}
.cf-poster-frame-hero[data-rail]:not([data-playing]) .pfh-rail{flex-direction:column;align-self:stretch;column-gap:0}
.cf-poster-frame-hero[data-rail]:not([data-playing]) .pfh-item+.pfh-item{border-block-start:1px solid oklch(from var(--ink) l c h / 0.14)}
.cf-poster-frame-hero .pfh-close{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:clamp(32px,5cqi,72px);align-items:start}
.cf-poster-frame-hero .pfh-close>.pfh-action:only-child{grid-column:1 / -1;justify-self:start}
.cf-poster-frame-hero .pfh-action{align-items:center}
.cf-poster-frame-hero .pfh-btn{inline-size:auto;min-inline-size:min(21rem,100%)}
.cf-poster-frame-hero .pfh-close{margin-block-start:8px}
.cf-poster-frame-hero[data-rail]:not([data-playing]) .pfh-item{display:grid}
.cf-poster-frame-hero[data-rail]:not([data-playing]) .pfh-chapter{align-content:center}
}
@media (prefers-reduced-motion: reduce){
.cf-poster-frame-hero .pfh-title{animation:none}
.cf-poster-frame-hero .pfh-btn,.cf-poster-frame-hero .pfh-disc,.cf-poster-frame-hero .pfh-exit,.cf-poster-frame-hero button.pfh-chapter{transition:none}
.cf-poster-frame-hero .pfh-btn:hover,.cf-poster-frame-hero .pfh-btn[data-state='hover'],.cf-poster-frame-hero .pfh-btn:active,.cf-poster-frame-hero .pfh-btn[data-state='active'],.cf-poster-frame-hero .pfh-play:hover .pfh-disc,.cf-poster-frame-hero .pfh-play:active .pfh-disc,.cf-poster-frame-hero .pfh-exit:active{transform:none}
}
`;
pieces/hero/poster-frame-hero/specimen.tsx 38 lines
import __studioImagea17d72f4 from "../assets/c7d318b95e83abc5.webp";
// Specimen: the fictional Main Street Ads course trailer as a first-screen poster frame hero.
import { PosterFrameHero } from "../poster-frame-hero";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled"];
type SpecimenState = "default" | "hover" | "active" | "disabled";
export default function PosterFrameHeroSpecimen({ state = "default" }: { state?: SpecimenState }) {
const sample = defaults.sample;
return (
<PosterFrameHero
state={state}
headline="Fill your shop with one simple local ad"
headlineMark="one simple local ad"
subhead="See the exact ad any shop owner can set up in one evening, then aim it at the few streets where your customers already live."
posterImage={slot(
"scene",
__studioImagea17d72f4
)}
posterAlt="A florist behind her shop counter holding a phone, smiling toward the door"
duration="2:48"
playLabel="Watch the trailer"
chapters={[
{ title: "Find the offer your street already wants", time: 0 },
{ title: "Draw your 3-mile ad circle", time: 47 },
{ title: "Write the ad in your own voice", time: 104 },
]}
ctaLabel="Start Main Street Ads"
ctaSub="Instant access · watch tonight"
price={sample.price}
priceAlternative="one time, vs. hiring an ad agency"
proof="“My first ad was live before closing time.” Dana R., florist in Austin"
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalPosterFrameHero |
string |
|
headlineMark OptionalPosterFrameHero |
string |
|
subhead OptionalPosterFrameHero |
React.ReactNode |
|
posterImage OptionalPosterFrameHero |
string |
|
posterAlt OptionalPosterFrameHero |
string |
|
videoSrc OptionalPosterFrameHero |
string |
|
duration OptionalPosterFrameHero |
string |
|
playLabel OptionalPosterFrameHero |
string |
|
chapters OptionalPosterFrameHero |
PosterChapter[] |
|
ctaLabel OptionalPosterFrameHero |
string |
|
ctaSub OptionalPosterFrameHero |
string |
|
href OptionalPosterFrameHero |
string |
|
onAction OptionalPosterFrameHero |
(event: React.MouseEvent<HTMLElement>) => void |
|
onPlay OptionalPosterFrameHero |
() => void |
|
onChapter OptionalPosterFrameHero |
(index: number, chapter: PosterChapter) => void |
|
price OptionalPosterFrameHero |
string |
|
priceAlternative OptionalPosterFrameHero |
string |
|
proof OptionalPosterFrameHero |
React.ReactNode |
|
disabled OptionalPosterFrameHero |
boolean |
|
state OptionalPosterFrameHero |
"default" | "hover" | "active" | "disabled" |
|
showEdge OptionalPosterFrameHero |
boolean |
|
edgeTone OptionalPosterFrameHero |
DividerTone |
|
copy OptionalPosterFrameHero |
Partial<PosterFrameHeroCopy> |
|
className OptionalPosterFrameHero |
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.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c7d318b95e83abc5.webp
image/webp · 76 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB