Typewriter Bold Hero 1
Typewriter-to-bold hero: a hesitant typed draft is selected, struck and replaced in one cut by a giant promise,
Use it in a prompt
Use hero/typewriter-bold-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/typewriter-bold-hero.tsx. - Import it and pass your copy and images (Props tab):
import { TypewriterBoldHero } from "@/components/funneldna/hero/typewriter-bold-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/typewriter-bold-hero/component.tsx 515 lines
// layout: scroll-panels
// Typewriter-to-bold hero: a hesitant typed draft is selected, struck and replaced in one cut by a giant promise,
// then the offer panel lands the price and a heavy Add To Cart button, so the visitor watches the decision get made.
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
import { Lock, Pause, Play, RotateCcw, ShoppingCart } from "lucide-react";
import { Divider, FX_HOST, Texture } from "../fx/fx";
import paper from "../fx/textures/paper";
export type TypewriterBoldHeroCopy = {
/** Read by screen readers before the struck draft line. */
draftPrefix: string;
pause: string;
play: string;
replay: string;
};
export type TypewriterBoldHeroProps = {
/** The hesitant draft that types out, gets selected and stays as a faint struck line. */
draft?: string;
/** The giant bold line that replaces the draft. */
headline?: string;
/** A phrase inside the headline that gets the colour-block wipe. */
emphasis?: string;
subhead?: React.ReactNode;
/** Price exactly as supplied; the price line and the button price hide without it. */
price?: string;
/** Template: {price} is replaced with the price. */
priceLabel?: string;
/** The value said in words beside the price. */
priceNote?: string;
actionLabel?: string;
/** One short reassurance line under the button. */
reassurance?: string;
psLabel?: string;
/** P.S. line restating the guarantee or main benefit. */
ps?: React.ReactNode;
/** Slot: scene. The writing-desk photo behind the draft and headline. */
sceneImage?: string;
sceneImageAlt?: string;
/** Slot: product. Transparent cut-out shown beside the offer. */
productImage?: string;
productImageAlt?: string;
productCaption?: string;
href?: string;
onAction?: () => void;
disabled?: boolean;
headingLevel?: "h1" | "h2";
/** Play the sequence when the block enters view. */
autoplay?: boolean;
state?: "default" | "hover" | "active" | "disabled";
copy?: Partial<TypewriterBoldHeroCopy>;
className?: string;
};
export function TypewriterBoldHero(props: TypewriterBoldHeroProps) {
const {
draft = "maybe I'll start my business next year...",
headline = "START IT THIS WEEKEND.",
emphasis = "THIS WEEKEND.",
subhead = "Stop waiting for the perfect month. Take the idea you keep postponing and turn it into a live offer in two focused days.",
price,
priceLabel = "Just {price}",
priceNote,
actionLabel = "Add To Cart",
reassurance = "Secure checkout · Instant access",
psLabel = "P.S.",
ps,
sceneImage,
sceneImageAlt = "",
productImage,
productImageAlt = "",
productCaption,
href,
onAction,
disabled: disabledProp,
headingLevel = "h1",
autoplay = true,
state = "default",
copy: copyProp,
className,
} = props;
const copy: TypewriterBoldHeroCopy = { ...DEFAULT_COPY, ...copyProp };
const disabled = Boolean(disabledProp) || state === "disabled";
const still = !autoplay || state !== "default";
const Heading = headingLevel;
const model = useMemo(() => buildDraft(draft), [draft]);
const t = useMemo(() => getTiming(model.count, model.words.length), [model]);
const parts = splitEmphasis(headline, emphasis);
const hasAfter = Boolean(reassurance || ps);
const lastA = parts.mark ? "cftw-wipe" : "cftw-slam";
const lastB = hasAfter ? "cftw-after" : "cftw-land";
const rootRef = useRef<HTMLElement>(null);
const bRef = useRef<HTMLDivElement>(null);
const draftRef = useRef<HTMLParagraphElement>(null);
const headRef = useRef<HTMLSpanElement>(null);
const playingRef = useRef(false);
const pendingRef = useRef(false);
const [run, setRun] = useState(0);
const [bRun, setBRun] = useState(0);
const [bDelay, setBDelay] = useState(0);
const [bPending, setBPending] = useState(false);
const [paused, setPaused] = useState(false);
const [aDone, setADone] = useState(false);
const [bDone, setBDone] = useState(false);
const [motionOk, setMotionOk] = useState(false);
const [geo, setGeo] = useState({ drop: 0, from: 0 });
const start = useCallback(() => {
const d = draftRef.current;
const h = headRef.current;
let drop = 0;
let from = 0;
if (d && h) {
const dBottom = d.offsetTop + d.offsetHeight;
drop = Math.max(0, (h.offsetTop + h.offsetHeight - dBottom) / 2);
from = d.offsetTop + d.offsetHeight / 2 + drop - h.offsetTop;
}
setGeo({ drop: Math.round(drop), from: Math.round(from) });
playingRef.current = true;
setPaused(false);
setADone(false);
setBDone(false);
setRun((r) => r + 1);
const b = bRef.current;
const vh = window.innerHeight || 800;
const bVisible = b ? b.getBoundingClientRect().top < vh * 0.88 : false;
if (bVisible) {
pendingRef.current = false;
setBPending(false);
setBDelay(t.b);
setBRun((r) => r + 1);
} else {
pendingRef.current = true;
setBPending(true);
setBRun(0);
}
}, [t.b]);
const reset = useCallback(() => {
playingRef.current = false;
pendingRef.current = false;
setRun(0);
setBRun(0);
setBPending(false);
setPaused(false);
}, []);
useIsoLayoutEffect(() => {
if (still) {
reset();
setMotionOk(false);
return undefined;
}
if (typeof window === "undefined" || typeof IntersectionObserver === "undefined" || !window.matchMedia) return undefined;
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
if (mq.matches) {
setMotionOk(false);
return undefined;
}
setMotionOk(true);
const root = rootRef.current;
const b = bRef.current;
if (!root) return undefined;
const vh = window.innerHeight || 800;
const r0 = root.getBoundingClientRect();
if (!playingRef.current && r0.top < vh * 0.8 && r0.bottom > vh * 0.2) start();
const io = new IntersectionObserver(
(entries) => {
entries.forEach((e) => {
if (e.target === root) {
if (e.isIntersecting && e.intersectionRatio >= 0.15) {
if (!playingRef.current) start();
} else if (!e.isIntersecting && playingRef.current) {
reset();
}
} else if (e.target === b && e.isIntersecting && e.intersectionRatio >= 0.15 && pendingRef.current) {
pendingRef.current = false;
setBPending(false);
setBDelay(120);
setBRun((n) => n + 1);
}
});
},
{ threshold: [0, 0.15] }
);
io.observe(root);
if (b) io.observe(b);
const onChange = () => {
if (mq.matches) {
reset();
setMotionOk(false);
}
};
mq.addEventListener("change", onChange);
return () => {
io.disconnect();
mq.removeEventListener("change", onChange);
};
}, [still, start, reset]);
const finished = run === 0 || (aDone && (bDone || bPending));
const controlLabel = finished ? copy.replay : paused ? copy.play : copy.pause;
const ControlIcon = finished ? RotateCcw : paused ? Play : Pause;
const onControl = () => {
if (finished) start();
else setPaused((p) => !p);
};
const rootClass = ["cf-tw", run > 0 ? "is-play" : "", paused ? "is-paused" : "", className || ""].filter(Boolean).join(" ");
const rootStyle = cssVars({
"--t-type": `${t.type}ms`,
"--t-char": `${t.char}ms`,
"--t-blink": `${t.blink}ms`,
"--t-sel": `${t.sel}ms`,
"--t-cut": `${t.cut}ms`,
"--tw-drop": `${geo.drop}px`,
"--tw-from": `${geo.from}px`,
});
const ctaClass = ["cf-tw__cta", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""].filter(Boolean).join(" ");
const priceText = price ? priceLabel.split("{price}").join(price) : "";
const ctaInner = (
<>
<ShoppingCart size={20} strokeWidth={2.5} aria-hidden="true" />
<span className="cf-tw__cta-label">{actionLabel}</span>
{price ? (
<>
<span className="cf-tw__cta-sep" aria-hidden="true" />
<span className="cf-tw__cta-price">{price}</span>
</>
) : null}
</>
);
const cta =
href && !disabled ? (
<a className={ctaClass} href={href} onClick={onAction}>
{ctaInner}
</a>
) : (
<button type="button" className={ctaClass} disabled={disabled} onClick={onAction}>
{ctaInner}
</button>
);
return (
<section ref={rootRef} className={rootClass} style={rootStyle}>
<style>{CSS}</style>
<div className="cf-tw__a" style={FX_HOST}>
{sceneImage ? (
<div className="cf-tw__layers" key={`l${run}`}>
<img className="cf-tw__photo" src={sceneImage} alt={sceneImageAlt} width={1600} height={1000} loading="eager" decoding="async" />
<div className="cf-tw__scrim" />
<div className="cf-tw__dim" />
</div>
) : (
<Texture src={paper} tone="band-ink" />
)}
<div
className="cf-tw__a-inner"
key={`a${run}`}
onAnimationEnd={(e) => {
if (e.animationName === lastA) setADone(true);
}}
>
{model.count > 0 ? (
<>
<p className="cf-tw__sr">
{copy.draftPrefix} <del>{draft}</del>
</p>
<p className="cf-tw__draft" ref={draftRef} aria-hidden="true">
{model.words.map((word, wi) => (
<span className="cf-tw__w" key={wi} style={cssVars({ "--w": wi })}>
{word.map((c) => (
<span key={c.i} className={c.i === model.count - 1 ? "cf-tw__c is-last" : "cf-tw__c"} style={cssVars({ "--i": c.i })}>
{c.ch}
</span>
))}
</span>
))}
</p>
</>
) : null}
<Heading className="cf-tw__h">
<span className="cf-tw__head-in" ref={headRef}>
{parts.before ? <span className="cf-tw__line">{parts.before}</span> : null}
{parts.before && parts.mark ? " " : null}
{parts.mark ? (
<span className="cf-tw__line cf-tw__line--mark">
<span className="cf-tw__mark">{parts.mark}</span>
</span>
) : null}
{parts.after ? (
<>
{" "}
<span className="cf-tw__line">{parts.after}</span>
</>
) : null}
</span>
</Heading>
</div>
{motionOk ? (
<button type="button" className="cf-tw__ctrl" onClick={onControl} aria-label={controlLabel} title={controlLabel}>
<ControlIcon size={18} strokeWidth={2.5} aria-hidden="true" />
</button>
) : null}
<Divider shape="curve" tone="surface" height={56} />
</div>
<div className="cf-tw__b" ref={bRef}>
<div
className={bRun > 0 ? "cf-tw__b-in is-play" : "cf-tw__b-in"}
key={`b${bRun}`}
style={cssVars({ "--b0": `${bDelay}ms` })}
onAnimationEnd={(e) => {
if (e.animationName === lastB) setBDone(true);
}}
>
<div className={productImage ? "cf-tw__grid" : "cf-tw__grid is-solo"}>
{productImage ? (
<figure className="cf-tw__visual">
<img src={productImage} alt={productImageAlt} width={900} height={900} loading="lazy" decoding="async" />
{productCaption ? <figcaption>{productCaption}</figcaption> : null}
</figure>
) : null}
<div className="cf-tw__copy">
{subhead ? <p className="cf-tw__sub">{subhead}</p> : null}
{priceText ? (
<p className="cf-tw__price">
<strong>{priceText}</strong>
{priceNote ? <span>{priceNote}</span> : null}
</p>
) : null}
<div className="cf-tw__cta-wrap">{cta}</div>
{hasAfter ? (
<div className="cf-tw__after">
{reassurance ? (
<p className="cf-tw__reassure">
<Lock size={16} strokeWidth={2.5} aria-hidden="true" />
{reassurance}
</p>
) : null}
{ps ? (
<p className="cf-tw__ps">
<b>{psLabel}</b> {ps}
</p>
) : null}
</div>
) : null}
</div>
</div>
</div>
</div>
</section>
);
}
export default TypewriterBoldHero;
const DEFAULT_COPY: TypewriterBoldHeroCopy = {
draftPrefix: "Crossed out:",
pause: "Pause animation",
play: "Play animation",
replay: "Replay animation",
};
const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
function cssVars(vars: Record<string, string | number>): React.CSSProperties {
return vars as React.CSSProperties;
}
function buildDraft(text: string) {
const words = text.trim().split(" ").filter(Boolean);
let i = 0;
const out = words.map((w, wi) => Array.from(wi < words.length - 1 ? `${w} ` : w).map((ch) => ({ ch, i: i++ })));
return { words: out, count: i };
}
// The promise must land fast: typing, selection and the cut finish in about 1.6s, and the offer
// panel (price and button) is readable from the first frame and only settles in with the house reveal.
function getTiming(count: number, words: number) {
if (count === 0) return { type: 0, char: 0, blink: 0, sel: 0, cut: 160, b: 120 };
const type = 160;
const char = Math.max(12, Math.min(22, Math.round(640 / count)));
const blink = 200;
const sel = type + count * char + blink * 2;
const cut = sel + words * 35 + 140;
return { type, char, blink, sel, cut, b: 120 };
}
function splitEmphasis(text: string, phrase?: string) {
const at = phrase ? text.indexOf(phrase) : -1;
if (!phrase || at < 0) return { before: text, mark: "", after: "" };
return { before: text.slice(0, at).trim(), mark: phrase, after: text.slice(at + phrase.length).trim() };
}
const CSS = `
.cf-tw{--tw-gutter:clamp(16px,5vw,48px);--tw-shadow:var(--shadow,oklch(0.22 0.03 260));--tw-ease:cubic-bezier(.2,.7,.2,1);--tw-draft-ink:color-mix(in oklab,var(--band-ink) 86%,var(--band));position:relative;inline-size:100%;overflow:hidden;overflow:clip;background:var(--surface);color:var(--ink);font-family:var(--font-body)}
.cf-tw *,.cf-tw *::before,.cf-tw *::after{box-sizing:border-box}
.cf-tw__sr{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.cf-tw__a{position:relative;isolation:isolate;overflow:hidden;display:grid;align-content:center;min-block-size:clamp(26rem,66vh,44rem);min-block-size:clamp(26rem,66svh,44rem);padding:clamp(72px,8vw,112px) var(--tw-gutter) calc(clamp(64px,8vw,104px) + 56px);background:var(--band);color:var(--band-ink)}
.cf-tw__layers{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.cf-tw__photo{position:absolute;inset:0;inline-size:100%;block-size:100%;object-fit:cover;object-position:50% 45%;filter:saturate(.9) brightness(.78);transform-origin:50% 50%}
.cf-tw__scrim{position:absolute;inset:0;background:oklch(from var(--band) l c h / .74)}
.cf-tw__dim{position:absolute;inset:0;background:oklch(from var(--band) l c h / .16)}
.cf-tw__a-inner{position:relative;z-index:1;inline-size:100%;max-inline-size:1200px;margin-inline:auto;container-type:inline-size;text-align:center;min-inline-size:0}
.cf-tw__draft{margin:0 auto clamp(16px,3cqi,32px);max-inline-size:40ch;font-family:var(--font-body);font-weight:500;font-size:clamp(1.25rem,2.6vw,2rem);font-size:clamp(1.25rem,2.8cqi,2rem);line-height:1.4;letter-spacing:-0.005em;color:var(--tw-draft-ink);text-wrap:balance;overflow-wrap:anywhere}
.cf-tw__w{position:relative;z-index:0}
.cf-tw__w::before{content:"";position:absolute;inset:-.06em -.04em;z-index:-1;border-radius:2px;background:oklch(from var(--accent-fill,var(--accent)) l c h / .5);transform-origin:0 50%;opacity:0;pointer-events:none}
.cf-tw__w::after{content:"";position:absolute;inset-inline:0;inset-block-start:52%;block-size:max(2px,.075em);border-radius:1px;background:currentColor;transform-origin:0 50%;pointer-events:none}
.cf-tw__c{position:relative}
.cf-tw__c::after{content:"";position:absolute;inset-block:.1em;inset-inline-end:-.08em;inline-size:.1em;background:var(--band-ink);opacity:0;pointer-events:none}
.cf-tw__h{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,11vw,7.5rem);font-size:clamp(2.5rem,13cqi,7.5rem);line-height:1.02;color:var(--band-ink);text-wrap:balance;overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto}
.cf-tw__head-in{display:block;transform-origin:50% 0}
.cf-tw__line{display:block;text-wrap:balance}
.cf-tw__line--mark{margin-block-start:.12em;line-height:1}
.cf-tw__mark{display:inline-block;max-inline-size:100%;vertical-align:top;padding:.06em .16em .1em;border-radius:.08em;line-height:1.02;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));text-wrap:balance}
.cf-tw__ctrl{position:absolute;z-index:3;inset-block-start:clamp(12px,2vw,20px);inset-inline-end:clamp(12px,2vw,20px);inline-size:44px;block-size:44px;display:grid;place-items:center;padding:0;border-radius:999px;border:1px solid oklch(from var(--band-ink) l c h / .32);background:oklch(from var(--band) l c h / .62);color:var(--band-ink);cursor:pointer;transition:background .16s ease,transform .16s ease}
.cf-tw__ctrl:hover{background:oklch(from var(--band) calc(l + .06) c h / .85)}
.cf-tw__ctrl:active{transform:scale(.94)}
.cf-tw__ctrl:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-tw__b{position:relative;isolation:isolate;background:var(--surface);color:var(--ink);padding:clamp(40px,6vw,88px) var(--tw-gutter) clamp(64px,8.5vw,120px)}
.cf-tw__b-in{position:relative;z-index:1;max-inline-size:1120px;margin-inline:auto}
.cf-tw__grid{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(32px,5vw,72px);align-items:start}
.cf-tw__grid.is-solo{grid-template-columns:minmax(0,1fr);max-inline-size:46rem;margin-inline:auto;justify-items:center;text-align:center}
.cf-tw__grid>*{min-inline-size:0}
.cf-tw__visual{margin:0;inline-size:100%;max-inline-size:460px;justify-self:center}
.cf-tw__visual img{display:block;inline-size:100%;block-size:auto;aspect-ratio:1/1;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--tw-shadow) l c h / .28)) drop-shadow(0 18px 22px oklch(from var(--tw-shadow) l c h / .22))}
.cf-tw__visual figcaption{margin-block-start:12px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-align:center;text-wrap:pretty}
.cf-tw__copy{display:flex;flex-direction:column;align-items:flex-start;padding-block-start:clamp(0px,2vw,24px)}
.cf-tw__grid.is-solo .cf-tw__copy{align-items:center}
.cf-tw__sub{margin:0 0 28px;max-inline-size:44ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--ink);text-wrap:pretty}
.cf-tw__sub b,.cf-tw__sub strong{font-weight:800}
.cf-tw__price{margin:0 0 24px;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:16px;row-gap:16px}
.cf-tw__grid.is-solo .cf-tw__price{justify-content:center}
.cf-tw__price strong{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-tw__price span{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:600;color:var(--muted)}
.cf-tw__cta-wrap{inline-size:100%;max-inline-size:32rem;transform-origin:50% 100%}
.cf-tw__cta{--tw-b:var(--button-bg,var(--cta));--tw-b2:var(--button-bg-2,var(--cta-2));appearance:none;border:0;margin:0;cursor:pointer;text-decoration:none;display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 12px;inline-size:100%;min-block-size:72px;padding:10px 28px;border-radius:var(--button-radius,var(--radius,12px));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.55vw,1.375rem);line-height:1.15;letter-spacing:-0.01em;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--tw-b) calc(l + .04) c h),oklch(from var(--tw-b2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--tw-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--tw-b) calc(l - .16) c h),0 1px 2px oklch(from var(--tw-shadow) l c h / .3),0 10px 18px -6px oklch(from var(--tw-shadow) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-tw__cta svg{flex:none}
.cf-tw__cta-label,.cf-tw__cta-price{white-space:nowrap}
.cf-tw__cta-price{font-variant-numeric:tabular-nums}
.cf-tw__cta-sep{inline-size:2px;block-size:1.05em;border-radius:2px;background:oklch(from var(--button-ink,var(--cta-ink)) l c h / .4)}
.cf-tw__cta:hover:not(:disabled),.cf-tw__cta.is-hover:not(:disabled){transform:translateY(-1px);background:linear-gradient(oklch(from var(--tw-b) calc(l - .01) c h),oklch(from var(--tw-b2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--tw-b) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--tw-b) calc(l - .2) c h),0 1px 2px oklch(from var(--tw-shadow) l c h / .34),0 14px 22px -8px oklch(from var(--tw-shadow) l c h / .5)}
.cf-tw__cta:active:not(:disabled),.cf-tw__cta.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--tw-b) calc(l - .06) c h),oklch(from var(--tw-b2) calc(l - .09) c h));box-shadow:inset 0 2px 4px oklch(from var(--tw-b) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--tw-b) calc(l - .18) c h),0 1px 2px oklch(from var(--tw-shadow) l c h / .3)}
.cf-tw__cta:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:4px}
.cf-tw__cta:disabled{cursor:not-allowed;transform:none;background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm))}
.cf-tw__cta:disabled .cf-tw__cta-sep{background:oklch(from var(--secondary-ink) l c h / .35)}
.cf-tw__after{inline-size:100%}
.cf-tw__reassure{margin:14px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
.cf-tw__reassure svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-tw__ps{margin:24px 0 0;max-inline-size:60ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
.cf-tw__ps b{font-weight:800}
.cf-tw__grid.is-solo .cf-tw__ps{margin-inline:auto}
@media (max-width:859px){
.cf-tw__grid{grid-template-columns:minmax(0,1fr);justify-items:center;text-align:center}
.cf-tw__visual{max-inline-size:min(260px,72%)}
.cf-tw__copy{align-items:center;padding-block-start:0}
.cf-tw__price{justify-content:center}
.cf-tw__sub,.cf-tw__ps{margin-inline:auto}
}
@media (max-width:600px){
.cf-tw__a{min-block-size:auto;padding-block:72px calc(56px + 56px)}
}
.cf-tw.is-paused *,.cf-tw.is-paused *::before,.cf-tw.is-paused *::after{animation-play-state:paused}
@keyframes cftw-type{from{opacity:0}to{opacity:1}}
@keyframes cftw-caret{0%{opacity:1}100%{opacity:0}}
@keyframes cftw-blink{0%,55%{opacity:1}56%,100%{opacity:0}}
@keyframes cftw-sel-in{from{opacity:1;transform:scaleX(0)}to{opacity:1;transform:scaleX(1)}}
@keyframes cftw-sel-out{from{opacity:1}to{opacity:0}}
@keyframes cftw-strike{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes cftw-lift{from{transform:translateY(var(--tw-drop,0px))}to{transform:none}}
@keyframes cftw-slam{0%{opacity:0;transform:translateY(var(--tw-from,0px)) scale(.3)}1%{opacity:1}68%{opacity:1;transform:translateY(0) scale(1.035)}100%{opacity:1;transform:none}}
@keyframes cftw-wipe{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes cftw-zoom{from{transform:scale(1.08)}to{transform:scale(1)}}
@keyframes cftw-fade{from{opacity:0}to{opacity:1}}
@keyframes cftw-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cftw-land{0%{opacity:.82;transform:translateY(8px) scale(.97)}60%{opacity:1;transform:translateY(0) scale(1.015)}100%{opacity:1;transform:none}}
@keyframes cftw-after{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
.cf-tw.is-play .cf-tw__photo{animation:cftw-zoom 3.2s var(--tw-ease) both}
.cf-tw.is-play .cf-tw__dim{animation:cftw-fade .2s linear var(--t-cut) both}
.cf-tw.is-play .cf-tw__c{animation:cftw-type .01s steps(1,end) calc(var(--t-type) + var(--i) * var(--t-char)) both}
.cf-tw.is-play .cf-tw__c::after{animation:cftw-caret var(--t-char) steps(1,end) calc(var(--t-type) + var(--i) * var(--t-char)) forwards}
.cf-tw.is-play .cf-tw__c.is-last::after{animation:cftw-blink var(--t-blink) linear calc(var(--t-type) + var(--i) * var(--t-char)) 2 forwards}
.cf-tw.is-play .cf-tw__w::before{animation:cftw-sel-in .18s var(--tw-ease) calc(var(--t-sel) + var(--w) * 35ms) forwards,cftw-sel-out .01s steps(1,end) var(--t-cut) forwards}
.cf-tw.is-play .cf-tw__w::after{animation:cftw-strike .24s var(--tw-ease) calc(var(--t-cut) + var(--w) * 22ms) both}
.cf-tw.is-play .cf-tw__draft{animation:cftw-lift .34s var(--tw-ease) var(--t-cut) both}
.cf-tw.is-play .cf-tw__head-in{animation:cftw-slam .46s var(--tw-ease) var(--t-cut) both}
.cf-tw.is-play .cf-tw__mark{animation:cftw-wipe .34s cubic-bezier(.7,0,.2,1) calc(var(--t-cut) + 280ms) both}
.cf-tw__b-in.is-play .cf-tw__visual{animation:cftw-rise .45s var(--tw-ease) var(--b0) both}
.cf-tw__b-in.is-play .cf-tw__sub{animation:cftw-rise .45s var(--tw-ease) calc(var(--b0) + 70ms) both}
.cf-tw__b-in.is-play .cf-tw__price{animation:cftw-rise .45s var(--tw-ease) calc(var(--b0) + 140ms) both}
.cf-tw__b-in.is-play .cf-tw__cta-wrap{animation:cftw-land .5s var(--tw-ease) calc(var(--b0) + 210ms) both}
.cf-tw__b-in.is-play .cf-tw__after{animation:cftw-after .45s var(--tw-ease) calc(var(--b0) + 280ms) both}
}
`;
pieces/hero/typewriter-bold-hero/specimen.tsx 48 lines
import __studioImage9eb104d5 from "../assets/7ca58e95b69487f1.webp";
import __studioImageab54fc45 from "../assets/015fcaea2e817f62.webp";
// Specimen: the Weekend Launch course from Copy Cohort Studio, a fictional launch offer.
import React from "react";
import { TypewriterBoldHero } from "../typewriter-bold-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 TypewriterBoldHeroSpecimen({ state = "default" }: { state?: SpecimenState }) {
const sample = defaults.sample;
return (
<TypewriterBoldHero
state={state}
draft="maybe I'll start my business next year..."
headline="START IT THIS WEEKEND."
emphasis="THIS WEEKEND."
subhead={
<>
The <b>Weekend Launch</b> course from Copy Cohort Studio takes you from a blank page to a live offer, a one-page sales letter and your first launch email in two focused days.
</>
}
price={sample.price}
priceLabel="Just {price}"
priceNote="less than one client call"
actionLabel="Add To Cart"
reassurance="Secure checkout · Instant course access"
psLabel="P.S."
ps={`Do the whole weekend with us. If it isn't for you, the ${sample.guarantee} gives you every cent back.`}
sceneImage={slot(
"scene",
__studioImageab54fc45
)}
sceneImageAlt="A writing desk at dawn with an open notebook, a pen and a typewriter"
productImage={slot(
"product",
__studioImage9eb104d5
)}
productImageAlt="The Weekend Launch workbook lying open with a pen"
productCaption="Your Weekend Launch workbook: one page for every hour of the two days."
onAction={() => undefined}
/>
);
}
| Name | Type | Details |
|---|---|---|
draft OptionalTypewriterBoldHero |
string |
|
headline OptionalTypewriterBoldHero |
string |
|
emphasis OptionalTypewriterBoldHero |
string |
|
subhead OptionalTypewriterBoldHero |
React.ReactNode |
|
price OptionalTypewriterBoldHero |
string |
|
priceLabel OptionalTypewriterBoldHero |
string |
|
priceNote OptionalTypewriterBoldHero |
string |
|
actionLabel OptionalTypewriterBoldHero |
string |
|
reassurance OptionalTypewriterBoldHero |
string |
|
psLabel OptionalTypewriterBoldHero |
string |
|
ps OptionalTypewriterBoldHero |
React.ReactNode |
|
sceneImage OptionalTypewriterBoldHero |
string |
|
sceneImageAlt OptionalTypewriterBoldHero |
string |
|
productImage OptionalTypewriterBoldHero |
string |
|
productImageAlt OptionalTypewriterBoldHero |
string |
|
productCaption OptionalTypewriterBoldHero |
string |
|
href OptionalTypewriterBoldHero |
string |
|
onAction OptionalTypewriterBoldHero |
() => void |
|
disabled OptionalTypewriterBoldHero |
boolean |
|
headingLevel OptionalTypewriterBoldHero |
"h1" | "h2" |
|
autoplay OptionalTypewriterBoldHero |
boolean |
|
state OptionalTypewriterBoldHero |
"default" | "hover" | "active" | "disabled" |
|
copy OptionalTypewriterBoldHero |
Partial<TypewriterBoldHeroCopy> |
|
className OptionalTypewriterBoldHero |
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.
--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.
product- The main product shot or cover (ebook, kit, bottle).
scene- A wide atmosphere photo behind or beside the copy.
-
015fcaea2e817f62.webp
image/webp · 65.3 KB
-
63fe29663bde8280.webp
image/webp · 99.8 KB
-
7ca58e95b69487f1.webp
image/webp · 132 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB