Cutout Parallax Type Hero 1
Cutout parallax type hero: a giant two-line promise with the subject standing between the type layers, cut like a
Use it in a prompt
Use hero/cutout-parallax-type-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/cutout-parallax-type-hero.tsx. - Import it and pass your copy and images (Props tab):
import { CutoutParallaxTypeHero } from "@/components/funneldna/hero/cutout-parallax-type-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/cutout-parallax-type-hero/component.tsx 647 lines
// layout: sticky-offer-side
// Cutout parallax type hero: a giant two-line promise with the subject standing between the type layers, cut like a
// motion-graphics ad that plays as it enters view (type slides, subject rises, one word slams in front), beside an offer card whose two-line button lands last.
import React, { useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
import { ShieldCheck } from 'lucide-react';
import { Backdrop, Divider, FX_HOST } from '../fx/fx';
import torn from '../fx/dividers/torn';
import studio from '../fx/backdrops/studio';
export type CutoutParallaxTypeHeroProps = {
/** First line of the giant headline, fitted to the stage width. */
headlineTop?: string;
/** Second line of the giant headline, fitted on its own. */
headlineBottom?: string;
/** One word from either line, layered in front of the subject. Empty keeps all type behind. */
frontWord?: string;
/** Sub-headline under the stage. */
lead?: React.ReactNode;
/** presenter-cutout slot: person or product on a transparent background. Empty shows type only. */
subjectImage?: string;
subjectAlt?: string;
/** scene slot: full-bleed scene behind the block, themed through the fx Backdrop. */
sceneImage?: string;
offerTitle?: string;
offerDetail?: React.ReactNode;
/** Supplied price, such as $47. Empty hides the price. */
price?: string;
priceNote?: string;
buttonLabel?: string;
/** Benefit line inside the button, under the label. */
buttonSub?: string;
href?: string;
onAction?: () => void;
guarantee?: string;
/** {price} is replaced with the price. */
reasonsHeading?: string;
reasons?: { title: string; text?: string }[];
/** reasonsFallback is the reasons heading used when no price is given. pause/play/replay are kept for API
* compatibility: the sequence now runs about two seconds as the block enters view, so no control renders. */
copy?: { pause?: string; play?: string; replay?: string; reasonsFallback?: string };
state?: 'default' | 'hover' | 'active' | 'disabled';
className?: string;
};
// static: finished still (first render, reduced motion, print, no observer). armed: out of view, waiting at frame 0.
type Phase = 'static' | 'armed' | 'playing' | 'done';
export function CutoutParallaxTypeHero(props: CutoutParallaxTypeHeroProps) {
const {
headlineTop = 'Launch your',
headlineBottom = 'first funnel.',
frontWord = 'funnel.',
lead = 'Plan your funnel, write your page copy and check every step before you launch.',
subjectImage = '',
subjectAlt = '',
sceneImage = studio,
offerTitle = 'The Funnel Starter Kit',
offerDetail = 'The guide, the workbook and the launch checklist in one download.',
price = '$47',
priceNote = 'one-time payment',
buttonLabel = 'Get the kit',
buttonSub = 'Instant download',
href,
onAction,
guarantee = '30-day money-back guarantee',
reasonsHeading = 'Three reasons this is {price} today',
reasons = DEFAULT_REASONS,
state = 'default',
className,
} = props;
const copy = { ...DEFAULT_COPY, ...props.copy };
const h1Id = 'cf-cpt-' + useId();
const rootRef = useRef<HTMLElement>(null);
const stageRef = useRef<HTMLDivElement>(null);
const measureTop = useRef<HTMLSpanElement>(null);
const measureBottom = useRef<HTMLSpanElement>(null);
const [phase, setPhase] = useState<Phase>('static');
const [run, setRun] = useState(0);
const phaseRef = useRef<Phase>(phase);
phaseRef.current = phase;
// Decide before first paint: play now if the block is already on screen, otherwise arm it out of sight.
// Without this step (server render, no JS, reduced motion) the finished still is what shows.
useIsoLayoutEffect(() => {
const root = rootRef.current;
if (!root || !motionAllowed()) return;
const vh = window.innerHeight || 0;
if (!vh) return;
const r = root.getBoundingClientRect();
setPhase(r.top < vh && r.bottom > 0 ? 'playing' : 'armed');
}, []);
// Reduced motion switches to the finished still at any time.
useEffect(() => {
if (typeof window === 'undefined' || !window.matchMedia) return;
const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
const onChange = () => {
if (mq.matches) setPhase('static');
};
mq.addEventListener?.('change', onChange);
return () => mq.removeEventListener?.('change', onChange);
}, []);
// Play each time the stage comes into view; re-arm only once the whole block has left the viewport.
useEffect(() => {
const root = rootRef.current;
const stage = stageRef.current;
if (!root || !stage || !motionAllowed()) return;
const leave = new IntersectionObserver((entries) => {
entries.forEach((e) => {
const p = phaseRef.current;
if (!e.isIntersecting && (p === 'playing' || p === 'done')) {
setRun((n) => n + 1);
setPhase('armed');
}
});
}, { threshold: 0 });
const enter = new IntersectionObserver((entries) => {
entries.forEach((e) => {
if (e.isIntersecting && e.intersectionRatio >= 0.3 && phaseRef.current === 'armed') setPhase('playing');
});
}, { threshold: [0, 0.3, 0.6] });
leave.observe(root);
enter.observe(stage);
return () => {
leave.disconnect();
enter.disconnect();
};
}, []);
// Safety net: the sequence always settles on the finished frame, even if animationend never arrives.
useEffect(() => {
if (phase !== 'playing') return;
const t = window.setTimeout(() => setPhase((p) => (p === 'playing' ? 'done' : p)), 2600);
return () => window.clearTimeout(t);
}, [phase, run]);
// Fit each headline line to the stage width in whatever display face the theme loads.
useEffect(() => {
const st = stageRef.current;
if (!st) return;
const fit = () => {
const w = st.clientWidth * 0.97;
const h = st.clientHeight;
[measureTop.current, measureBottom.current].forEach((m, i) => {
if (!m || !m.offsetWidth) return;
const size = Math.max(28, Math.min((w / m.offsetWidth) * 100, h * 0.3, 300));
st.style.setProperty('--fs-' + (i + 1), size.toFixed(1) + 'px');
});
};
fit();
const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(fit) : null;
ro?.observe(st);
let alive = true;
document.fonts?.ready.then(() => {
if (alive) fit();
});
document.fonts?.addEventListener('loadingdone', fit);
return () => {
alive = false;
ro?.disconnect();
document.fonts?.removeEventListener('loadingdone', fit);
};
}, [headlineTop, headlineBottom]);
// Pointer parallax on mouse devices: three depths, transform only. Scrolling never drives the piece.
const live = phase === 'playing' || phase === 'done';
useEffect(() => {
const st = stageRef.current;
if (!st || !live) return;
if (!window.matchMedia || !window.matchMedia('(hover: hover) and (pointer: fine)').matches) return;
let raf = 0;
let px = 0;
let py = 0;
const apply = () => {
raf = 0;
st.style.setProperty('--px', px.toFixed(3));
st.style.setProperty('--py', py.toFixed(3));
};
const queue = () => {
if (!raf) raf = requestAnimationFrame(apply);
};
const move = (e: PointerEvent) => {
if (e.pointerType !== 'mouse') return;
const r = st.getBoundingClientRect();
px = Math.max(-1, Math.min(1, ((e.clientX - r.left) / (r.width || 1) - 0.5) * 2));
py = Math.max(-1, Math.min(1, ((e.clientY - r.top) / (r.height || 1) - 0.5) * 2));
queue();
};
const out = () => {
px = 0;
py = 0;
queue();
};
st.addEventListener('pointermove', move);
st.addEventListener('pointerleave', out);
return () => {
st.removeEventListener('pointermove', move);
st.removeEventListener('pointerleave', out);
if (raf) cancelAnimationFrame(raf);
st.style.removeProperty('--px');
st.style.removeProperty('--py');
};
}, [live]);
const onAnimEnd = (e: React.AnimationEvent<HTMLElement>) => {
if (e.animationName === 'cf-cpt-pop') setPhase((p) => (p === 'playing' ? 'done' : p));
};
const lines = [headlineTop, headlineBottom];
const target = findTarget(lines, frontWord);
const hasSubject = !!subjectImage;
const priceParts = price ? splitPrice(price) : null;
const heading = price
? reasonsHeading.split('{price}').join(price)
: reasonsHeading.includes('{price}')
? copy.reasonsFallback
: reasonsHeading;
const disabled = state === 'disabled';
const forced = state === 'hover' || state === 'active' ? state : undefined;
const renderType = (layer: 'back' | 'front') =>
lines.map((line, li) =>
line ? (
<span key={li} className={'cf-cpt-line cf-cpt-line' + (li + 1) + (layer === 'back' ? ' cf-cpt-a' : '')}>
{line.split(' ').map((w, k) => {
const isFront = !!target && target.line === li && target.index === k;
const ghost = layer === 'back' ? isFront : !isFront;
return (
<React.Fragment key={k}>
{k > 0 ? ' ' : null}
<span className={'cf-cpt-w' + (ghost ? ' cf-cpt-ghost' : '') + (layer === 'front' && isFront ? ' cf-cpt-fw cf-cpt-a' : '')}>{w}</span>
</React.Fragment>
);
})}
</span>
) : null,
);
const maskUrl = hasSubject ? 'url(' + JSON.stringify(subjectImage) + ')' : '';
const btnInner = (
<>
<span className='cf-cpt-blabel'>{buttonLabel}</span>
{buttonSub ? <span className='cf-cpt-bsub'>{buttonSub}</span> : null}
</>
);
return (
<section
ref={rootRef}
aria-labelledby={h1Id}
className={'cf-cpt' + (className ? ' ' + className : '')}
style={{ ...FX_HOST, overflow: 'clip' }}
data-phase={phase}
onAnimationEnd={onAnimEnd}
>
<style>{CSS}</style>
{sceneImage ? <Backdrop src={sceneImage} /> : null}
<div className='cf-cpt-scrim' aria-hidden='true' />
<div className='cf-cpt-wrap'>
<div className='cf-cpt-stagecol'>
<h1 id={h1Id} className='cf-cpt-sr'>
{headlineTop} {headlineBottom}
</h1>
<div
ref={stageRef}
className='cf-cpt-stage'
data-subject={hasSubject ? 'true' : 'false'}
style={{ '--n1': String(Math.max(4, headlineTop.length)), '--n2': String(Math.max(4, headlineBottom.length)) } as React.CSSProperties}
>
<span ref={measureTop} className='cf-cpt-measure' aria-hidden='true'>{headlineTop}</span>
<span ref={measureBottom} className='cf-cpt-measure' aria-hidden='true'>{headlineBottom}</span>
<div key={'rig' + run} className='cf-cpt-rig cf-cpt-a'>
<div className='cf-cpt-par' style={depth(0.25)}>
<div className='cf-cpt-type cf-cpt-back' aria-hidden='true'>{renderType('back')}</div>
</div>
{hasSubject ? (
<div className='cf-cpt-par' style={depth(0.45)}>
<div className='cf-cpt-box cf-cpt-shadow cf-cpt-a' aria-hidden='true' style={{ WebkitMaskImage: maskUrl, maskImage: maskUrl }} />
</div>
) : null}
{hasSubject ? (
<div className='cf-cpt-par' style={depth(0.7)}>
<div className='cf-cpt-box'>
<img className='cf-cpt-a' src={subjectImage} alt={subjectAlt} decoding='async' />
</div>
</div>
) : null}
{target ? (
<div className='cf-cpt-par' style={depth(1)}>
<div className='cf-cpt-type cf-cpt-front' aria-hidden='true'>{renderType('front')}</div>
</div>
) : null}
</div>
</div>
</div>
{lead ? (
<p key={'lead' + run} className='cf-cpt-lead cf-cpt-a'>{lead}</p>
) : null}
<div className='cf-cpt-offer'>
<div key={'card' + run} className='cf-cpt-card cf-cpt-a'>
{offerTitle ? <h2 className='cf-cpt-otitle'>{offerTitle}</h2> : null}
{offerDetail ? <p className='cf-cpt-odetail'>{offerDetail}</p> : null}
{priceParts ? (
<div className='cf-cpt-price'>
<p className='cf-cpt-fig'>
{priceParts.sym ? <span className='cf-cpt-sym'>{priceParts.sym}</span> : null}
<span>{priceParts.num}</span>
{priceParts.rest ? <span className='cf-cpt-rest'>{priceParts.rest}</span> : null}
</p>
{priceNote ? <p className='cf-cpt-pnote'>{priceNote}</p> : null}
</div>
) : null}
<div className='cf-cpt-btnwrap cf-cpt-a'>
{href && !disabled ? (
<a className='cf-cpt-btn' href={href} data-force={forced} onClick={() => onAction?.()}>
{btnInner}
</a>
) : (
<button type='button' className='cf-cpt-btn' data-force={forced} disabled={disabled} onClick={() => onAction?.()}>
{btnInner}
</button>
)}
</div>
{guarantee ? (
<p className='cf-cpt-guar'>
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden='true' />
{guarantee}
</p>
) : null}
</div>
</div>
{reasons.length > 0 ? (
<div className='cf-cpt-reasons'>
<h2 className='cf-cpt-rhead'>{heading}</h2>
<ol className='cf-cpt-rlist' role='list'>
{reasons.map((r, i) => (
<li key={i}>
<span className='cf-cpt-rnum' aria-hidden='true'>{i + 1}</span>
<p>
<strong>{r.title}</strong>
{r.text ? ' ' + r.text : ''}
</p>
</li>
))}
</ol>
</div>
) : null}
</div>
<Divider shape='torn' src={torn} tone='surface' height={56} />
</section>
);
}
export default CutoutParallaxTypeHero;
const useIsoLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
const DEFAULT_COPY = {
pause: 'Pause animation',
play: 'Play animation',
replay: 'Replay animation',
reasonsFallback: 'Three reasons to start today',
};
const DEFAULT_REASONS = [
{ title: 'It is the starter kit, not a course.', text: 'You get the three tools you need to plan and launch, with nothing to sit through.' },
{ title: 'It is a download, not a membership.', text: 'One payment. No monthly fee to cancel later.' },
{ title: 'It is built to use tonight.', text: 'Open the guide, fill in the workbook, tick off the checklist.' },
];
function motionAllowed() {
if (typeof window === 'undefined' || !window.matchMedia || typeof IntersectionObserver === 'undefined') return false;
if (window.matchMedia('print').matches) return false;
return !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
}
function norm(s: string) {
const n = s.toLowerCase().replace(/[^a-z0-9]/g, '');
return n || s.toLowerCase().trim();
}
function findTarget(lines: string[], word: string) {
if (!word || !word.trim()) return null;
const key = norm(word);
for (let li = 0; li < lines.length; li++) {
const words = (lines[li] || '').split(' ');
for (let k = 0; k < words.length; k++) {
if (words[k] && norm(words[k]) === key) return { line: li, index: k };
}
}
return null;
}
function splitPrice(price: string) {
const m = price.trim().match(/^([^0-9]*)([0-9][0-9.,]*)(.*)$/);
return m ? { sym: m[1].trim(), num: m[2], rest: m[3].trim() } : { sym: '', num: price.trim(), rest: '' };
}
function depth(d: number) {
return { '--d': String(d) } as React.CSSProperties;
}
const CSS = `
.cf-cpt, .cf-cpt * { box-sizing: border-box; }
.cf-cpt {
--cpt-hi: oklch(from var(--accent-fill, var(--accent)) max(l, 0.84) min(c, 0.15) h);
--cpt-sh: var(--shadow, oklch(0.22 0.03 260));
--cpt-ps: running;
container: cf-cpt / inline-size;
position: relative;
overflow: clip;
background: var(--band);
color: var(--band-ink);
font-family: var(--font-body);
padding: clamp(48px, 7vw, 96px) clamp(16px, 5vw, 48px) calc(clamp(48px, 7vw, 96px) + 56px);
}
.cf-cpt[data-phase='armed'] { --cpt-ps: paused; }
.cf-cpt-scrim { position: absolute; inset: 0; background: oklch(from var(--band) l c h / 0.42); pointer-events: none; }
.cf-cpt-wrap {
position: relative; z-index: 1;
max-inline-size: 1240px; margin-inline: auto;
display: grid; grid-template-columns: minmax(0, 1fr);
grid-template-areas: 'stage' 'lead' 'offer' 'reasons';
row-gap: clamp(24px, 3vw, 32px);
align-items: start;
}
.cf-cpt-wrap > * { min-width: 0; }
.cf-cpt-stagecol { grid-area: stage; position: relative; container: cf-cpt-stage / inline-size; }
.cf-cpt-sr { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.cf-cpt-stage { position: relative; block-size: clamp(300px, 100cqi, 520px); overflow: clip; }
.cf-cpt-stage[data-subject='false'] { block-size: clamp(190px, 44cqi, 380px); }
.cf-cpt-rig, .cf-cpt-par { position: absolute; inset: 0; pointer-events: none; }
.cf-cpt-par {
transform: translate3d(calc(var(--px, 0) * var(--d, 0) * 22px), calc(var(--py, 0) * var(--d, 0) * 12px), 0);
transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.cf-cpt-type, .cf-cpt-measure {
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.025em);
text-transform: var(--display-case, none);
}
.cf-cpt-type {
position: absolute; inset-inline: 0; inset-block-start: 4px; margin: 0;
line-height: .96; color: var(--band-ink);
overflow-wrap: anywhere; hyphens: auto;
}
.cf-cpt-line { display: block; text-wrap: balance; }
.cf-cpt-line1 { font-size: var(--fs-1, clamp(2.25rem, calc(150cqi / var(--n1, 10)), 10rem)); }
.cf-cpt-line2 { font-size: var(--fs-2, clamp(2.25rem, calc(150cqi / var(--n2, 10)), 10rem)); }
.cf-cpt-w { display: inline-block; }
.cf-cpt-ghost { visibility: hidden; }
.cf-cpt-fw { color: var(--cpt-hi); transform-origin: 50% 60%; text-shadow: 0 2px 3px oklch(from var(--cpt-sh) l c h / 0.45), 0 6px 12px oklch(from var(--cpt-sh) l c h / 0.35); }
.cf-cpt-measure {
position: absolute; inset-block-start: 0; inset-inline-start: 0;
display: inline-block; font-size: 100px; line-height: 1;
white-space: nowrap; visibility: hidden; pointer-events: none;
}
.cf-cpt-box { position: absolute; inset-block-end: -6%; inset-inline-end: 1%; block-size: 106%; inline-size: 80%; }
.cf-cpt-box img {
display: block; inline-size: 100%; block-size: 100%;
object-fit: contain; object-position: 50% 100%;
filter: drop-shadow(0 2px 3px oklch(from var(--cpt-sh) l c h / 0.4)) drop-shadow(0 14px 18px oklch(from var(--cpt-sh) l c h / 0.32));
}
.cf-cpt-shadow {
background: oklch(from var(--cpt-sh) calc(l - 0.08) c h);
-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
-webkit-mask-size: contain; mask-size: contain;
-webkit-mask-position: 50% 100%; mask-position: 50% 100%;
opacity: .5; filter: blur(8px);
transform: translate3d(-11%, -5%, 0) skewX(-8deg); transform-origin: 50% 100%;
}
@container cf-cpt-stage (min-width: 520px) {
.cf-cpt-stage { block-size: clamp(420px, 74cqi, 640px); }
.cf-cpt-stage[data-subject='false'] { block-size: clamp(240px, 40cqi, 420px); }
.cf-cpt-box { inline-size: 58%; inset-inline-end: 3%; }
}
.cf-cpt-lead {
grid-area: lead; margin: 0; max-inline-size: 60ch;
font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500;
color: var(--band-ink); text-wrap: pretty; overflow-wrap: break-word;
}
.cf-cpt-offer { grid-area: offer; max-inline-size: 520px; }
.cf-cpt-card {
background: var(--card); color: var(--ink);
border: 1px solid var(--card-border, oklch(from var(--accent) l c h / 0.35));
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)));
padding: clamp(20px, 3vw, 32px);
}
.cf-cpt-card > * { min-width: 0; }
.cf-cpt-otitle {
margin: 0 0 8px; font-family: var(--font-display);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15;
font-weight: var(--display-weight, 800); letter-spacing: -0.01em; text-transform: var(--display-case, none);
color: var(--ink); text-wrap: balance; overflow-wrap: anywhere;
}
.cf-cpt-odetail { margin: 0 0 20px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.cf-cpt-price { margin: 0 0 24px; }
.cf-cpt-fig {
margin: 0; display: flex; align-items: flex-start; flex-wrap: wrap;
font-family: var(--font-display); font-size: clamp(3.25rem, 5vw, 4.5rem); line-height: 1;
font-weight: var(--display-weight, 800); letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
color: var(--ink);
}
.cf-cpt-sym { font-size: .42em; margin-block-start: .14em; margin-inline-end: .05em; }
.cf-cpt-rest { align-self: flex-end; font-size: .3em; margin: 0 0 .35em .3em; letter-spacing: 0; }
.cf-cpt-pnote { margin: 12px 0 0; font-size: .9375rem; line-height: 1.4; font-weight: 600; color: var(--muted); }
.cf-cpt-guar { margin: 16px 0 0; text-align: center; font-size: .9375rem; line-height: 1.4; font-weight: 600; color: var(--muted); text-wrap: pretty; }
.cf-cpt-guar svg { display: inline-block; vertical-align: -0.15em; margin-inline-end: .4em; color: var(--success); }
.cf-cpt-btn {
--b1: var(--button-bg, var(--cta));
--b2: var(--button-bg-2, var(--cta-2));
appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
inline-size: 100%; min-block-size: 80px; margin: 0; padding: 14px 24px; border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--b1) calc(l + 0.04) c h), oklch(from var(--b2) calc(l - 0.02) c h));
color: var(--button-ink, var(--cta-ink));
font-family: var(--button-font, var(--font-display)); text-transform: var(--button-case, none);
text-align: center; text-decoration: none; text-shadow: var(--button-text-shadow, none);
cursor: pointer; -webkit-tap-highlight-color: transparent;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--b1) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--b1) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--cpt-sh) l c h / 0.3), 0 8px 16px -6px oklch(from var(--cpt-sh) l c h / 0.45));
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cf-cpt-btn:hover:not(:disabled), .cf-cpt-btn[data-force='hover'] {
background: linear-gradient(oklch(from var(--b1) calc(l - 0.01) c h), oklch(from var(--b2) calc(l - 0.07) c h));
transform: translateY(-1px);
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--b1) calc(l + 0.12) c h / 0.7), inset 0 -3px 0 oklch(from var(--b1) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--cpt-sh) l c h / 0.32), 0 12px 20px -8px oklch(from var(--cpt-sh) l c h / 0.5));
}
.cf-cpt-btn:active:not(:disabled), .cf-cpt-btn[data-force='active'] {
background: linear-gradient(oklch(from var(--b1) calc(l - 0.05) c h), oklch(from var(--b2) calc(l - 0.09) c h));
transform: translateY(1px);
box-shadow: inset 0 2px 5px oklch(from var(--b1) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--b1) calc(l - 0.16) c h), 0 1px 1px oklch(from var(--cpt-sh) l c h / 0.3);
}
.cf-cpt-btn:focus-visible { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 3px; }
.cf-cpt-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;
}
.cf-cpt-blabel { font-size: clamp(1.25rem, 1.7vw, 1.5rem); font-weight: var(--button-weight, 800); line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.cf-cpt-bsub { font-family: var(--font-body); font-size: .9375rem; font-weight: 600; line-height: 1.3; text-transform: none; text-wrap: pretty; }
.cf-cpt-reasons {
grid-area: reasons; color: var(--band-ink);
background: oklch(from var(--band) l c h / 0.82);
-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
border: 1px solid oklch(from var(--band-ink) l c h / 0.14);
border-radius: var(--card-radius, var(--radius, 14px));
padding: clamp(20px, 3vw, 32px);
}
.cf-cpt-rhead {
margin: 0 0 clamp(12px, 1.6vw, 16px); font-family: var(--font-display);
font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.06;
font-weight: var(--display-weight, 800); letter-spacing: var(--display-tracking, -0.025em); text-transform: var(--display-case, none);
text-wrap: balance; overflow-wrap: anywhere;
}
.cf-cpt-rlist { list-style: none; margin: 0; padding: 0; display: grid; }
.cf-cpt-rlist li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: baseline; padding-block: 16px; }
.cf-cpt-rlist li:last-child { padding-block-end: 0; }
.cf-cpt-rlist li + li { border-top: 1px solid oklch(from var(--band-ink) l c h / 0.16); }
.cf-cpt-rnum {
min-inline-size: 1.1em; font-family: var(--font-display); font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15; font-weight: var(--display-weight, 800); font-variant-numeric: tabular-nums; color: var(--cpt-hi);
}
.cf-cpt-rlist p { margin: 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; text-wrap: pretty; overflow-wrap: break-word; }
.cf-cpt-rlist strong { font-weight: 800; }
@container cf-cpt (min-width: 880px) {
.cf-cpt-wrap {
grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
grid-template-areas: 'stage offer' 'lead offer' 'reasons offer';
grid-template-rows: auto auto 1fr;
column-gap: clamp(32px, 4vw, 56px);
}
.cf-cpt-offer { align-self: start; max-inline-size: none; padding-block-start: clamp(16px, 3cqi, 48px); }
}
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-back .cf-cpt-line1 { animation: cf-cpt-slide .5s cubic-bezier(.2,.8,.2,1) 0s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-back .cf-cpt-line2 { animation: cf-cpt-slide .5s cubic-bezier(.2,.8,.2,1) .14s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-box img { animation: cf-cpt-rise .62s cubic-bezier(.16,.84,.24,1) .38s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-shadow { animation: cf-cpt-fade .5s ease-out .74s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-front .cf-cpt-fw { animation: cf-cpt-slam .42s cubic-bezier(.3,1.25,.5,1) 1s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-rig { animation: cf-cpt-jolt .34s ease-out 1.16s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-lead { animation: cf-cpt-mask .5s cubic-bezier(.2,.7,.2,1) 1.3s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-card { animation: cf-cpt-land .5s cubic-bezier(.2,.7,.2,1) 1.45s both var(--cpt-ps); }
.cf-cpt:is([data-phase='armed'], [data-phase='playing']) .cf-cpt-btnwrap { animation: cf-cpt-pop .44s cubic-bezier(.3,1.25,.5,1) 1.72s both var(--cpt-ps); }
@keyframes cf-cpt-slide {
from { transform: translate3d(-40%, 0, 0); clip-path: inset(-0.25em 100% -0.3em -0.06em); }
to { transform: none; clip-path: inset(-0.25em -0.1em -0.3em -0.06em); }
}
@keyframes cf-cpt-rise {
0% { transform: translate3d(0, 55%, 0); opacity: 0; }
35% { opacity: 1; }
100% { transform: none; opacity: 1; }
}
@keyframes cf-cpt-fade { from { opacity: 0; } }
@keyframes cf-cpt-slam {
0% { transform: scale(2.4); opacity: 0; }
50% { transform: scale(.94); opacity: 1; }
100% { transform: none; opacity: 1; }
}
@keyframes cf-cpt-jolt {
0% { transform: none; }
30% { transform: translate3d(0, 7px, 0); }
65% { transform: translate3d(0, -2px, 0); }
100% { transform: none; }
}
@keyframes cf-cpt-mask {
from { clip-path: inset(0 0 100% 0); transform: translate3d(0, .5em, 0); }
to { clip-path: inset(-0.3em -0.3em -0.3em -0.3em); transform: none; }
}
@keyframes cf-cpt-land {
from { opacity: 0; transform: translate3d(0, 28px, 0); }
to { opacity: 1; transform: none; }
}
@keyframes cf-cpt-pop {
0% { opacity: 0; transform: scale(.72); }
60% { opacity: 1; transform: scale(1.05); }
100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
/* !important: the reduced-motion still must beat every phase-scoped animation rule, whatever its specificity. */
.cf-cpt .cf-cpt-a { animation: none !important; }
.cf-cpt .cf-cpt-par { transform: none; transition: none; }
.cf-cpt .cf-cpt-btn { transition: none; }
.cf-cpt .cf-cpt-btn:hover:not(:disabled), .cf-cpt .cf-cpt-btn:active:not(:disabled) { transform: none; }
}
@media print {
/* !important: a printed page always shows the finished frame, whatever phase the screen was in. */
.cf-cpt .cf-cpt-a { animation: none !important; }
.cf-cpt .cf-cpt-par { transform: none; transition: none; }
}
`;
pieces/hero/cutout-parallax-type-hero/specimen.tsx 39 lines
import __studioImageca53a55d from "../assets/a880f27f53eb99e1.webp";
import __studioImage26baec93 from "../assets/ff01476c00160b55.webp";
import { CutoutParallaxTypeHero } from '../cutout-parallax-type-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 CutoutParallaxTypeHeroSpecimen({ state }: { state?: SpecimenState }) {
const sample = defaults.sample;
return (
<CutoutParallaxTypeHero
state={state}
headlineTop='Get strong'
headlineBottom='after forty.'
frontWord='forty.'
lead='Three 30-minute home workouts a week to rebuild the strength, posture and energy you thought were gone for good. No gym. No jumping. No guesswork.'
subjectImage={slot('presenter-cutout', __studioImageca53a55d)}
subjectAlt='Coach Rena Holt of Strong After Forty, arms crossed and smiling'
sceneImage={slot('scene', __studioImage26baec93)}
offerTitle='Your 6-week strength restart'
offerDetail='Follow-along video workouts from Strong After Forty, built for joints over forty.'
price={sample.price}
priceNote='one-time payment'
buttonLabel='Start my restart'
buttonSub='Instant access · train at home'
href='#checkout'
guarantee={sample.guarantee}
reasonsHeading='Three reasons this is {price} today'
reasons={[
{ title: 'It’s the starter plan, not live coaching.', text: 'You follow the six weeks on your own schedule, so you pay a starter price.' },
{ title: 'You train with what you already own.', text: 'A mat, a sturdy chair and a pair of dumbbells. No gym fee on top.' },
{ title: 'One payment, yours to keep.', text: 'No membership to cancel when a busy month hits.' },
]}
/>
);
}
| Name | Type | Details |
|---|---|---|
headlineTop OptionalCutoutParallaxTypeHero |
string |
|
headlineBottom OptionalCutoutParallaxTypeHero |
string |
|
frontWord OptionalCutoutParallaxTypeHero |
string |
|
lead OptionalCutoutParallaxTypeHero |
React.ReactNode |
|
subjectImage OptionalCutoutParallaxTypeHero |
string |
|
subjectAlt OptionalCutoutParallaxTypeHero |
string |
|
sceneImage OptionalCutoutParallaxTypeHero |
string |
|
offerTitle OptionalCutoutParallaxTypeHero |
string |
|
offerDetail OptionalCutoutParallaxTypeHero |
React.ReactNode |
|
price OptionalCutoutParallaxTypeHero |
string |
|
priceNote OptionalCutoutParallaxTypeHero |
string |
|
buttonLabel OptionalCutoutParallaxTypeHero |
string |
|
buttonSub OptionalCutoutParallaxTypeHero |
string |
|
href OptionalCutoutParallaxTypeHero |
string |
|
onAction OptionalCutoutParallaxTypeHero |
() => void |
|
guarantee OptionalCutoutParallaxTypeHero |
string |
|
reasonsHeading OptionalCutoutParallaxTypeHero |
string |
|
reasons OptionalCutoutParallaxTypeHero |
{ title: string; text?: string }[] |
|
copy OptionalCutoutParallaxTypeHero |
{ pause?: string; play?: string; replay?: string; reasonsFallback?: string } |
|
state OptionalCutoutParallaxTypeHero |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalCutoutParallaxTypeHero |
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- Form inputs: background, ink, border, radius and focus colour.
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.
-
9a2ebdab5ff4fcc4.webp
image/webp · 3.64 KB
-
a880f27f53eb99e1.webp
image/webp · 107 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c18141ad9dda999d.webp
image/webp · 14.4 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
ff01476c00160b55.webp
image/webp · 66.6 KB