Product Price Reveal 1
Product price reveal: a timed motion-graphics beat on a dark stage. The product rises onto a reflective floor,
Use it in a prompt
Use content/product-price-reveal 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/product-price-reveal.tsx. - Import it and pass your copy and images (Props tab):
import { ProductPriceReveal } from "@/components/funneldna/content/product-price-reveal"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/product-price-reveal/component.tsx 483 lines
// layout: classic-centred-stack
// Product price reveal: a timed motion-graphics beat on a dark stage. The product rises onto a reflective floor,
// its name slams in behind it, the regular price is slashed, today's price lands huge and the buy button lands last.
import * as React from 'react';
import { Check, Lock, Pause, Play, RotateCcw, TriangleAlert } from 'lucide-react';
import { BackdropVideo, FX_HOST } from '../fx/fx';
import stage from '../fx/loops/stage';
type Phase = 'static' | 'armed' | 'play' | 'paused';
/** Templates: {regular}, {price} and {guarantee} are replaced with the matching props. */
export type ProductPriceRevealCopy = {
priceSr: string;
priceSrToday: string;
commitLabel: string;
commitError: string;
pause: string;
play: string;
replay: string;
};
export type ProductPriceRevealProps = {
/** Product name: the section heading for screen readers and the source of the giant name lines. */
name?: string;
/** Giant display lines behind the product (two at most); defaults to the name split in two. */
nameLines?: string[];
/** `product` slot: a transparent cut-out of the product. */
productImage?: string;
productAlt?: string;
/** Bold one-line promise under the product. */
subhead?: React.ReactNode;
lead?: React.ReactNode;
/** Regular price, slashed. Shown only together with `price`. */
regularPrice?: string;
/** Today's price. Without it the whole price beat is skipped. */
price?: string;
priceNote?: React.ReactNode;
/** Guarantee name; when set, the ticked commit line appears above the button. */
guarantee?: string;
label?: string;
/** One short reassurance line under the button. */
note?: React.ReactNode;
href?: string;
onAction?: () => void;
disabled?: boolean;
/** fx loop module playing behind the band (defaults to the stage loop). */
backdropVideo?: typeof stage;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
copy?: Partial<ProductPriceRevealCopy>;
className?: string;
};
export function ProductPriceReveal(props: ProductPriceRevealProps) {
const {
name = 'The Complete Kit',
nameLines,
productImage,
productAlt,
subhead = 'Everything you need, ready the day it arrives.',
lead = 'One order, everything inside, and a clear first step the moment you open it.',
regularPrice,
price,
priceNote,
guarantee,
label = 'Get Mine Today',
note = 'Secure checkout',
href,
onAction,
disabled = false,
backdropVideo,
state = 'default',
copy,
className,
} = props;
const t: ProductPriceRevealCopy = { ...DEFAULT_COPY, ...copy };
const lines = (nameLines && nameLines.length ? nameLines : splitName(name)).filter(Boolean).slice(0, 2);
const len = Math.max(4, ...lines.map((line) => Array.from(line).length));
const hasPrice = Boolean(price && price.trim());
const hasRegular = hasPrice && Boolean(regularPrice && regularPrice.trim());
const hasCommit = Boolean(guarantee && guarantee.trim());
const forced = state !== 'default';
const isDisabled = disabled || state === 'disabled';
const beat = timeline({ sub: Boolean(subhead), lead: Boolean(lead), price: hasPrice, regular: hasRegular, commit: hasCommit });
const rootRef = React.useRef<HTMLElement>(null);
const boxRef = React.useRef<HTMLInputElement>(null);
const pending = React.useRef(false);
const [phase, setPhase] = React.useState<Phase>('static');
const [run, setRun] = React.useState(0);
const [motionOk, setMotionOk] = React.useState(false);
const [agreed, setAgreed] = React.useState(state !== 'error');
const [error, setError] = React.useState(state === 'error');
const uid = React.useId();
const checkId = uid + '-commit';
const errorId = uid + '-error';
React.useEffect(() => {
setAgreed(state !== 'error');
setError(state === 'error');
}, [state]);
const start = React.useCallback(() => {
pending.current = true;
setPhase('static');
setRun((n) => n + 1);
}, []);
// Restart: commit the still frame, force a style flush, then add the animations back before paint.
useIsoLayoutEffect(() => {
if (!pending.current || phase !== 'static') return;
pending.current = false;
void rootRef.current?.offsetWidth;
setPhase('play');
}, [phase, run]);
React.useEffect(() => {
const el = rootRef.current;
if (forced || !el || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') {
setMotionOk(false);
setPhase('static');
return;
}
const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
let io: IntersectionObserver | null = null;
let away = true;
const setup = () => {
io?.disconnect();
io = null;
pending.current = false;
if (mq.matches) {
setMotionOk(false);
setPhase('static');
return;
}
setMotionOk(true);
setPhase('armed');
away = true;
io = new IntersectionObserver(
(entries) => {
const entry = entries[entries.length - 1];
if (entry.isIntersecting && entry.intersectionRatio >= 0.2) {
if (away) {
away = false;
start();
}
} else if (!entry.isIntersecting && !away) {
away = true;
pending.current = false;
setPhase('armed');
}
},
{ threshold: [0, 0.2] },
);
io.observe(el);
};
setup();
mq.addEventListener('change', setup);
return () => {
io?.disconnect();
mq.removeEventListener('change', setup);
};
}, [forced, start]);
const toggle = () => {
if (phase === 'play') setPhase('paused');
else if (phase === 'paused') setPhase('play');
else start();
};
const act = (e: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
e.preventDefault();
return;
}
if (hasCommit && !agreed) {
e.preventDefault();
setError(true);
boxRef.current?.focus();
return;
}
onAction?.();
};
const onEnd = (e: React.AnimationEvent<HTMLElement>) => {
const target = e.target as HTMLElement;
if (target.dataset && target.dataset.final === '1') setPhase((p) => (p === 'play' ? 'static' : p));
};
const animating = phase !== 'static';
const held = phase === 'armed' || phase === 'paused';
const Ctl = phase === 'play' ? Pause : phase === 'static' ? RotateCcw : Play;
const ctlLabel = phase === 'play' ? t.pause : phase === 'static' ? t.replay : t.play;
const force = state === 'hover' || state === 'active' ? state : undefined;
const priceSr = hasRegular
? fill(t.priceSr, { regular: regularPrice || '', price: price || '' })
: fill(t.priceSrToday, { price: price || '' });
const mask = productImage ? 'url(' + JSON.stringify(productImage) + ')' : undefined;
const rootClass = ['cf-ppr', productImage ? '' : 'cf-ppr--noimg', className].filter(Boolean).join(' ');
return (
<section
ref={rootRef}
className={rootClass}
style={FX_HOST}
data-phase={phase}
data-anim={animating ? '' : undefined}
data-held={held ? '' : undefined}
onAnimationEnd={onEnd}
>
<style>{CSS}</style>
<BackdropVideo video={backdropVideo ?? stage} treatment='duotone' control='top-right' />
{motionOk && (
<button type='button' className='cf-ppr__ctl' onClick={toggle} aria-label={ctlLabel} title={ctlLabel}>
<Ctl size={18} strokeWidth={2.5} aria-hidden='true' />
</button>
)}
<div className='cf-ppr__inner' style={vars({ '--len': len })}>
<h2 className='cf-ppr__sr'>{name}</h2>
<div className='cf-ppr__stage'>
<div className='cf-ppr__lines cf-ppr__a' aria-hidden='true' style={d(beat.thud)}>
{lines.map((line, i) => (
<span
key={i}
className={'cf-ppr__line cf-ppr__a cf-ppr__line--' + (i === 0 ? '1' : '2')}
style={d(i === 0 ? beat.line1 : beat.line2)}
>
{line}
</span>
))}
</div>
{productImage && (
<>
<div className='cf-ppr__rise'>
<div className='cf-ppr__prod cf-ppr__a' style={d(beat.rise)}>
<img src={productImage} alt={productAlt ?? name} width={800} height={800} decoding='async' />
<span className='cf-ppr__sweep' aria-hidden='true' style={{ WebkitMaskImage: mask, maskImage: mask }}>
<span className='cf-ppr__beam cf-ppr__a' style={d(beat.sweep)} />
</span>
</div>
</div>
<div className='cf-ppr__reflect cf-ppr__a' aria-hidden='true' style={d(beat.reflect)}>
<img src={productImage} alt='' width={800} height={800} decoding='async' />
</div>
</>
)}
</div>
{(subhead || lead) && (
<div className='cf-ppr__copy'>
{subhead && (
<p className='cf-ppr__sub cf-ppr__a' style={d(beat.sub)}>
{subhead}
</p>
)}
{lead && (
<p className='cf-ppr__lead cf-ppr__a' style={d(beat.lead)}>
{lead}
</p>
)}
</div>
)}
{hasPrice && (
<div className='cf-ppr__price'>
<p className='cf-ppr__sr'>{priceSr}</p>
<div className='cf-ppr__prices' aria-hidden='true'>
{hasRegular && (
<span className='cf-ppr__was cf-ppr__a' style={d(beat.reg, { '--d2': beat.slash + 'ms' })}>
{regularPrice}
</span>
)}
<span className='cf-ppr__now cf-ppr__a' style={d(beat.now, { '--plen': Array.from(price || '').length })}>
{price}
</span>
</div>
{priceNote && (
<p className='cf-ppr__pnote cf-ppr__a' style={d(beat.pnote)}>
{priceNote}
</p>
)}
</div>
)}
{hasCommit && (
<div className='cf-ppr__commit cf-ppr__a' style={d(beat.commit)}>
<label className='cf-ppr__check' htmlFor={checkId}>
<input
ref={boxRef}
id={checkId}
type='checkbox'
checked={agreed}
disabled={isDisabled}
aria-invalid={error || undefined}
aria-describedby={error ? errorId : undefined}
onChange={(e) => {
setAgreed(e.target.checked);
if (e.target.checked) setError(false);
}}
/>
<span className='cf-ppr__box' aria-hidden='true'>
<Check size={18} strokeWidth={3} />
</span>
<span>{fill(t.commitLabel, { guarantee: guarantee || '' })}</span>
</label>
{error && (
<p id={errorId} className='cf-ppr__error' role='alert'>
<TriangleAlert className='cf-ppr__ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{t.commitError}
</p>
)}
</div>
)}
<div className={'cf-ppr__cta cf-ppr__a' + (hasCommit ? '' : ' cf-ppr__cta--solo')} style={d(beat.cta)} data-final='1'>
{href ? (
<a
className='cf-ppr__btn'
href={isDisabled ? undefined : href}
aria-disabled={isDisabled || undefined}
data-force={force}
onClick={act}
>
{label}
</a>
) : (
<button type='button' className='cf-ppr__btn' disabled={isDisabled} data-force={force} onClick={act}>
{label}
</button>
)}
{note && (
<p className='cf-ppr__note'>
<Lock className='cf-ppr__ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{note}
</p>
)}
</div>
</div>
</section>
);
}
export default ProductPriceReveal;
const DEFAULT_COPY: ProductPriceRevealCopy = {
priceSr: 'Regular price {regular}. Today {price}.',
priceSrToday: 'Today {price}.',
commitLabel: 'I understand I’m covered by the {guarantee}.',
commitError: 'Tick the box to confirm you’ve read the guarantee, then tap the button again.',
pause: 'Pause the price reveal',
play: 'Play the price reveal',
replay: 'Replay the price reveal',
};
const useIsoLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
function vars(values: Record<string, string | number>): React.CSSProperties {
return values as unknown as React.CSSProperties;
}
function d(ms: number, extra: Record<string, string | number> = {}): React.CSSProperties {
return vars({ '--d': ms + 'ms', ...extra });
}
function fill(template: string, values: Record<string, string>): string {
return Object.keys(values).reduce((out, key) => out.split('{' + key + '}').join(values[key]), template);
}
function splitName(name: string): string[] {
const words = name.trim().split(' ').filter(Boolean);
if (words.length < 2) return [name.trim()];
let best = 1;
let bestMax = Infinity;
for (let i = 1; i < words.length; i++) {
const widest = Math.max(words.slice(0, i).join(' ').length, words.slice(i).join(' ').length);
if (widest < bestMax) {
bestMax = widest;
best = i;
}
}
return [words.slice(0, best).join(' '), words.slice(best).join(' ')];
}
// The edit: beats in ms. Lines slide, product lands, light sweeps, copy wipes, price slashes and slams, button lands last.
function timeline(has: { sub: boolean; lead: boolean; price: boolean; regular: boolean; commit: boolean }) {
let at = 1220;
const sub = at;
if (has.sub) at += 200;
const lead = at;
if (has.lead) at += 240;
at += 160;
const reg = at;
const slash = reg + 300;
const now = has.regular ? reg + 620 : at;
const pnote = now + 400;
if (has.price) at = now + 560;
const commit = at;
if (has.commit) at += 200;
return { line1: 0, line2: 130, rise: 320, thud: 960, sweep: 980, reflect: 980, sub, lead, reg, slash, now, pnote, commit, cta: at };
}
// Colour exceptions (documented): --ppr-light is white light falling on the product photo and --ppr-tick is the
// white glyph of the solid success box; both sit behind overridable variables. Mask gradients use alpha only.
const CSS = `
.cf-ppr{--ppr-ease:cubic-bezier(.2,.7,.2,1);--ppr-name-ink:color-mix(in oklch,var(--band-ink) 82%,var(--band));--ppr-copy-ink:color-mix(in oklch,var(--band-ink) 90%,var(--band));--ppr-sub-ink:var(--subhead-ink,var(--band-ink));--ppr-price-ink:var(--price-ink,color-mix(in oklch,var(--accent) 48%,var(--band-ink)));--ppr-was-ink:color-mix(in oklch,var(--band-ink) 78%,var(--band));--ppr-slash:color-mix(in oklch,var(--danger) 72%,var(--band-ink));--ppr-shadow:var(--shadow,oklch(0.22 0.03 260));--ppr-light:var(--sweep-light,oklch(1 0 0 / 0.55));--ppr-tick:var(--tick-ink,oklch(1 0 0));position:relative;isolation:isolate;overflow:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding-block:clamp(56px,8vw,112px) clamp(64px,8.5vw,120px)}
.cf-ppr__sr{position:absolute;inline-size:1px;block-size:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.cf-ppr__ctl{position:absolute;z-index:3;inset-block-start:16px;inset-inline-start:16px;display:grid;place-items:center;inline-size:44px;block-size:44px;padding:0;border:1px solid oklch(from var(--band-ink) l c h / 0.28);border-radius:999px;background:oklch(from var(--band) l c h / 0.6);color:var(--band-ink);cursor:pointer;transition:background .16s ease,transform .16s ease}
.cf-ppr__ctl:hover{background:oklch(from var(--band) calc(l + 0.08) c h / 0.85)}
.cf-ppr__ctl:active{transform:scale(.94)}
.cf-ppr__ctl:focus-visible{outline:3px solid var(--band-ink);outline-offset:2px}
.cf-ppr__inner{--fs:clamp(3rem,calc(94cqi / (var(--len) * 0.86)),10rem);--pw:clamp(13.75rem,40cqi,23rem);position:relative;z-index:1;max-inline-size:1120px;margin-inline:auto;padding-inline:clamp(16px,5vw,48px);container-type:inline-size;text-align:center}
.cf-ppr__inner,.cf-ppr__inner *,.cf-ppr__inner *::before,.cf-ppr__inner *::after{box-sizing:border-box}
.cf-ppr__stage{position:relative;display:flex;flex-direction:column;align-items:center;min-inline-size:0}
.cf-ppr__lines{display:flex;flex-direction:column;align-items:center;inline-size:100%;min-inline-size:0;margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:var(--fs);line-height:.86;letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,uppercase);color:var(--ppr-name-ink);transform-origin:50% 100%}
.cf-ppr__line{display:block;max-inline-size:100%;min-inline-size:0;overflow-wrap:anywhere;hyphens:auto;text-wrap:balance}
.cf-ppr__rise{position:relative;z-index:1;inline-size:var(--pw);max-inline-size:100%;aspect-ratio:1;margin-block-start:calc(var(--fs) * -0.3);clip-path:inset(-60% -40% 0 -40%)}
.cf-ppr__rise::after{content:'';position:absolute;inset-inline:-30%;inset-block-end:0;block-size:1px;background:linear-gradient(90deg,transparent,oklch(from var(--band-ink) l c h / 0.32),transparent)}
.cf-ppr__prod{position:absolute;inset:0;transform-origin:50% 100%}
.cf-ppr__prod 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(--ppr-shadow) calc(l - 0.06) c h / 0.5)) drop-shadow(0 14px 18px oklch(from var(--ppr-shadow) calc(l - 0.06) c h / 0.42))}
.cf-ppr__sweep{position:absolute;inset:0;overflow:hidden;pointer-events:none;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:50% 100%;mask-position:50% 100%}
.cf-ppr__beam{position:absolute;inset-block:-10%;inset-inline-start:0;inline-size:38%;background:linear-gradient(100deg,transparent,var(--ppr-light),transparent);opacity:0;transform:translateX(-110%) skewX(-16deg)}
.cf-ppr__reflect{position:relative;inline-size:var(--pw);max-inline-size:100%;block-size:calc(var(--pw) * 0.3);overflow:hidden;pointer-events:none;transform-origin:50% 0;-webkit-mask-image:linear-gradient(to bottom,oklch(from var(--band) l c h / 0.85),transparent 80%);mask-image:linear-gradient(to bottom,oklch(from var(--band) l c h / 0.85),transparent 80%)}
.cf-ppr__reflect img{display:block;inline-size:100%;block-size:auto;aspect-ratio:1;object-fit:contain;object-position:50% 100%;transform:scaleY(-1);opacity:.3}
.cf-ppr__copy{position:relative;z-index:2;display:grid;justify-items:center;gap:12px;max-inline-size:44rem;min-inline-size:0;margin:calc(var(--pw) * -0.13 + 8px) auto 0}
.cf-ppr--noimg .cf-ppr__copy{margin-block-start:clamp(24px,3cqi,40px)}
.cf-ppr__sub{margin:0;max-inline-size:100%;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,2.4cqi,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--ppr-sub-ink);text-wrap:balance;overflow-wrap:anywhere}
.cf-ppr__lead{margin:0;max-inline-size:60ch;font-size:clamp(1.125rem,1.9cqi,1.375rem);font-weight:500;line-height:1.4;color:var(--ppr-copy-ink);text-wrap:pretty}
.cf-ppr__price{display:grid;justify-items:center;min-inline-size:0;margin-block-start:clamp(24px,3.2cqi,40px)}
.cf-ppr__prices{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;column-gap:clamp(16px,2.6cqi,36px);row-gap:4px;max-inline-size:100%;min-inline-size:0}
.cf-ppr__was{position:relative;display:inline-block;min-inline-size:0;padding-inline:.08em;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,6cqi,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ppr-was-ink)}
.cf-ppr__was::after{content:'';position:absolute;inset-inline:-0.04em;inset-block-start:calc(50% - 0.05em);block-size:.1em;border-radius:999px;background:var(--ppr-slash);transform:rotate(-14deg);transform-origin:0 50%}
.cf-ppr__now{display:inline-block;min-inline-size:0;max-inline-size:100%;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(3.25rem,min(calc(88cqi / (var(--plen) * 0.62)),20cqi),8.5rem);line-height:1.08;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ppr-price-ink);overflow-wrap:anywhere;transform-origin:50% 60%}
.cf-ppr__pnote{margin:16px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--ppr-copy-ink);text-wrap:pretty}
.cf-ppr__commit{display:grid;justify-items:center;min-inline-size:0;margin-block-start:clamp(24px,3cqi,32px)}
.cf-ppr__check{position:relative;display:flex;align-items:flex-start;gap:12px;max-inline-size:40rem;min-inline-size:0;text-align:start;font-size:1.0625rem;font-weight:600;line-height:1.4;color:var(--ppr-copy-ink);cursor:pointer}
.cf-ppr__check input{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:28px;block-size:28px;margin:0;opacity:0;cursor:inherit}
.cf-ppr__check > span:last-child{min-inline-size:0;padding-block-start:1px;text-wrap:pretty}
.cf-ppr__box{flex:none;display:grid;place-items:center;inline-size:28px;block-size:28px;border:2px solid oklch(from var(--band-ink) l c h / 0.72);border-radius:8px;background:oklch(from var(--band) calc(l - 0.04) c h / 0.5);color:transparent;transition:background .16s ease,border-color .16s ease}
.cf-ppr__check:hover .cf-ppr__box{border-color:var(--band-ink)}
.cf-ppr__check input:checked + .cf-ppr__box{background:var(--success);border-color:var(--success);color:var(--ppr-tick)}
.cf-ppr__check input:focus-visible + .cf-ppr__box{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-ppr__check input[aria-invalid='true'] + .cf-ppr__box{border-color:var(--ppr-slash)}
.cf-ppr__check:has(input:disabled){cursor:not-allowed;opacity:.7}
.cf-ppr__error{margin:12px 0 0;max-inline-size:40rem;padding:8px 16px;border-radius:var(--radius,12px);background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
.cf-ppr__ico{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-ppr__cta{display:grid;justify-items:center;inline-size:100%;min-inline-size:0;margin-block-start:clamp(16px,2cqi,24px)}
.cf-ppr__cta--solo{margin-block-start:clamp(24px,3.2cqi,40px)}
.cf-ppr__btn{--ppr-bb:var(--button-bg,var(--cta));--ppr-bb2:var(--button-bg-2,var(--cta-2));display:inline-flex;align-items:center;justify-content:center;inline-size:min(100%,36rem);min-block-size:clamp(72px,7cqi,80px);margin:0;padding:12px clamp(20px,3.5cqi,48px);border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--ppr-bb) calc(l + 0.04) c h),oklch(from var(--ppr-bb2) 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);font-size:clamp(1.25rem,0.9rem + 1.2cqi,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-transform:var(--button-case,none);text-align:center;text-decoration:none;text-wrap:balance;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ppr-bb) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--ppr-bb) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ppr-shadow) calc(l - 0.08) c h / 0.5),0 8px 16px -6px oklch(from var(--ppr-shadow) calc(l - 0.08) c h / 0.6));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-ppr__btn:is(:hover,[data-force='hover']):not(:disabled):not([aria-disabled='true']){background:linear-gradient(oklch(from var(--ppr-bb) calc(l - 0.01) c h),oklch(from var(--ppr-bb2) calc(l - 0.07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ppr-bb) calc(l + 0.1) c h / 0.7),inset 0 -3px 0 oklch(from var(--ppr-bb) calc(l - 0.2) c h),0 1px 2px oklch(from var(--ppr-shadow) calc(l - 0.08) c h / 0.55),0 12px 20px -6px oklch(from var(--ppr-shadow) calc(l - 0.08) c h / 0.7))}
.cf-ppr__btn:is(:active,[data-force='active']):not(:disabled):not([aria-disabled='true']){background:linear-gradient(oklch(from var(--ppr-bb) calc(l - 0.06) c h),oklch(from var(--ppr-bb2) calc(l - 0.08) c h));transform:translateY(1px);box-shadow:var(--button-shadow,inset 0 2px 5px oklch(from var(--ppr-bb) calc(l - 0.24) c h / 0.55),inset 0 -2px 0 oklch(from var(--ppr-bb) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ppr-shadow) calc(l - 0.08) c h / 0.5))}
.cf-ppr__btn:focus-visible{outline:3px solid var(--band-ink);outline-offset:4px}
.cf-ppr__btn:disabled,.cf-ppr__btn[aria-disabled='true']{background:var(--secondary);color:var(--secondary-ink);box-shadow:var(--button-2-shadow,var(--shadow-sm));text-shadow:none;cursor:not-allowed}
.cf-ppr__note{margin:12px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--ppr-copy-ink);text-wrap:pretty}
@keyframes cf-ppr-left{0%{opacity:0;transform:translateX(-105%)}35%{opacity:1}78%{transform:translateX(1.5%)}100%{opacity:1;transform:none}}
@keyframes cf-ppr-right{0%{opacity:0;transform:translateX(105%)}35%{opacity:1}78%{transform:translateX(-1.5%)}100%{opacity:1;transform:none}}
@keyframes cf-ppr-thud{0%,100%{transform:none}40%{transform:translateY(1.2%) scale(.985)}}
@keyframes cf-ppr-rise{0%{opacity:0;transform:translateY(62%) scale(.94)}30%{opacity:1}72%{transform:translateY(-2.5%) scale(1.01)}100%{opacity:1;transform:none}}
@keyframes cf-ppr-sweep{0%{opacity:0;transform:translateX(-110%) skewX(-16deg)}18%{opacity:1}80%{opacity:1}100%{opacity:0;transform:translateX(280%) skewX(-16deg)}}
@keyframes cf-ppr-reflect{from{opacity:0;transform:scaleY(.5)}to{opacity:1;transform:none}}
@keyframes cf-ppr-wipe{from{clip-path:inset(-20% 100% -20% -2%)}to{clip-path:inset(-20% -2% -20% -2%)}}
@keyframes cf-ppr-up{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes cf-ppr-slash{from{transform:rotate(-14deg) scaleX(0)}to{transform:rotate(-14deg) scaleX(1)}}
@keyframes cf-ppr-slam{0%{opacity:0;transform:scale(2.4)}40%{opacity:1}62%{transform:scale(.93)}82%{transform:scale(1.03)}100%{opacity:1;transform:none}}
@keyframes cf-ppr-land{0%{opacity:0;transform:translateY(48px) scale(.86)}45%{opacity:1}70%{transform:translateY(-5px) scale(1.025)}100%{opacity:1;transform:none}}
@media (prefers-reduced-motion: no-preference){
.cf-ppr[data-anim] .cf-ppr__a{animation-delay:var(--d,0ms);animation-fill-mode:both;animation-timing-function:var(--ppr-ease)}
.cf-ppr[data-anim] .cf-ppr__line--1{animation-name:cf-ppr-left;animation-duration:.52s}
.cf-ppr[data-anim] .cf-ppr__line--2{animation-name:cf-ppr-right;animation-duration:.52s}
.cf-ppr[data-anim] .cf-ppr__lines{animation-name:cf-ppr-thud;animation-duration:.38s;animation-timing-function:ease-out}
.cf-ppr[data-anim] .cf-ppr__prod{animation-name:cf-ppr-rise;animation-duration:.68s}
.cf-ppr[data-anim] .cf-ppr__beam{animation-name:cf-ppr-sweep;animation-duration:.72s;animation-timing-function:ease-in-out}
.cf-ppr[data-anim] .cf-ppr__reflect{animation-name:cf-ppr-reflect;animation-duration:.52s}
.cf-ppr[data-anim] .cf-ppr__sub{animation-name:cf-ppr-wipe;animation-duration:.46s}
.cf-ppr[data-anim] .cf-ppr__lead{animation-name:cf-ppr-up;animation-duration:.45s}
.cf-ppr[data-anim] .cf-ppr__was{animation-name:cf-ppr-up;animation-duration:.32s}
.cf-ppr[data-anim] .cf-ppr__was::after{animation:cf-ppr-slash .26s var(--ppr-ease) var(--d2,0ms) both}
.cf-ppr[data-anim] .cf-ppr__now{animation-name:cf-ppr-slam;animation-duration:.5s;animation-timing-function:cubic-bezier(.25,.8,.3,1)}
.cf-ppr[data-anim] .cf-ppr__pnote{animation-name:cf-ppr-up;animation-duration:.3s}
.cf-ppr[data-anim] .cf-ppr__commit{animation-name:cf-ppr-up;animation-duration:.34s}
.cf-ppr[data-anim] .cf-ppr__cta{animation-name:cf-ppr-land;animation-duration:.56s}
.cf-ppr[data-held] .cf-ppr__a,.cf-ppr[data-held] .cf-ppr__was::after{animation-play-state:paused}
}
`;
pieces/content/product-price-reveal/specimen.tsx 33 lines
import __studioImageaf2b65ad from "../assets/0fc6a11932a4428c.webp";
// Specimen: Morrow Greens, a fictional daily greens powder, revealed with its price beat.
import { ProductPriceReveal } from '../product-price-reveal';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error';
export default function ProductPriceRevealSpecimen({ state = 'default' }: { state?: string }) {
const sample = defaults.sample;
return (
<ProductPriceReveal
state={state as SpecimenState}
name='Morrow Greens'
nameLines={['Morrow', 'Greens']}
productImage={slot(
'product',
__studioImageaf2b65ad,
)}
productAlt='Morrow Greens tub of daily greens powder'
subhead='Your whole produce drawer, in one morning scoop.'
lead='Stir one scoop into cold water before your coffee. No blender, no chopping, nothing left to wilt in the fridge.'
regularPrice={sample.regularPrice}
price={sample.price}
priceNote='One tub · 30 morning scoops'
guarantee={sample.guarantee}
label='Send Me My First Tub'
note='Secure checkout · One payment'
/>
);
}
| Name | Type | Details |
|---|---|---|
name OptionalProductPriceReveal |
string |
|
nameLines OptionalProductPriceReveal |
string[] |
|
productImage OptionalProductPriceReveal |
string |
|
productAlt OptionalProductPriceReveal |
string |
|
subhead OptionalProductPriceReveal |
React.ReactNode |
|
lead OptionalProductPriceReveal |
React.ReactNode |
|
regularPrice OptionalProductPriceReveal |
string |
|
price OptionalProductPriceReveal |
string |
|
priceNote OptionalProductPriceReveal |
React.ReactNode |
|
guarantee OptionalProductPriceReveal |
string |
|
label OptionalProductPriceReveal |
string |
|
note OptionalProductPriceReveal |
React.ReactNode |
|
href OptionalProductPriceReveal |
string |
|
onAction OptionalProductPriceReveal |
() => void |
|
disabled OptionalProductPriceReveal |
boolean |
|
backdropVideo OptionalProductPriceReveal |
typeof stage |
|
state OptionalProductPriceReveal |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
copy OptionalProductPriceReveal |
Partial<ProductPriceRevealCopy> |
|
className OptionalProductPriceReveal |
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-shadow- Secondary button.
--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.
product- The main product shot or cover (ebook, kit, bottle).
- 072db41e2182d662.mp4 video/mp4 · 138 KB
-
0fc6a11932a4428c.webp
image/webp · 74.3 KB
-
5a0469686decd6b8.webp
image/webp · 11.1 KB
- b1336bef45e58203.webm video/webm · 65.2 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB