Split Reveal Statement 1
Split reveal statement: one giant line cracks open like a scoreboard flap as the reader scrolls, and the line nobody says out loud appears in the gap.
Use it in a prompt
Use content/split-reveal-statement 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/split-reveal-statement.tsx. - Import it and pass your copy and images (Props tab):
import { SplitRevealStatement } from "@/components/funneldna/content/split-reveal-statement"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/split-reveal-statement/component.tsx 316 lines
// layout: fact-scoreboard
// Split reveal statement: one giant line cracks open like a scoreboard flap as the reader scrolls, and the line nobody says out loud appears in the gap.
// Scroll-linked and scrubbable. Both lines stay in the DOM and are announced once. Reduced motion shows the finished, stacked composition.
import * as React from "react";
import { Divider, FX_HOST, Pattern } from "../fx/fx";
export type SplitRevealStatementProps = {
/** The giant statement. It wraps on phones, and every line splits on its own. */
statement?: string;
/** The line that appears inside the split, set in the accent colour. Leave it empty and the statement stands alone. */
reveal?: string;
/** Dark band (--band) or light band (--surface). */
tone?: "dark" | "light";
align?: "center" | "left";
/** Heading level of the statement on the page. */
as?: "h2" | "h3";
/** Pins the reveal to one frame (0 closed, 1 open) instead of following scroll. Use it for still previews. */
progress?: number;
/** Stepped hand-off into the next section. */
edge?: "step" | "chevron" | "none";
/** Token colour of the next section the edge steps into. Defaults to surface on a dark band and band on a light one. */
edgeInto?: "surface" | "band" | "card";
className?: string;
};
type Split = {
key: string;
lines: string[];
lineH: number;
seam: number;
half: number;
padTop: number;
padBottom: number;
offsets: [number, number][];
};
const DEFAULT_STATEMENT = "Anyone can launch a funnel.";
const DEFAULT_REVEAL = "…but nobody tells you this part.";
const useIsoLayoutEffect = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
export function SplitRevealStatement({
statement = DEFAULT_STATEMENT,
reveal = DEFAULT_REVEAL,
tone = "dark",
align = "center",
as: headingTag = "h2",
progress,
edge = "step",
edgeInto,
className,
}: SplitRevealStatementProps) {
const uid = React.useId();
const headingId = `${uid}-statement`;
const stageRef = React.useRef<HTMLDivElement>(null);
const headingRef = React.useRef<HTMLHeadingElement>(null);
const revealRef = React.useRef<HTMLParagraphElement>(null);
const [split, setSplit] = React.useState<Split | null>(null);
const words = React.useMemo(() => (statement ?? "").trim().split(/\s+/).filter(Boolean), [statement]);
const text = words.join(" ");
const revealText = (reveal ?? "").trim();
const hasReveal = revealText.length > 0;
// Measure where the statement wraps (on width and font changes only, never per scroll frame).
useIsoLayoutEffect(() => {
const heading = headingRef.current;
const stage = stageRef.current;
if (!heading || !stage || !hasReveal || !text) {
setSplit(null);
return;
}
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
let alive = true;
let lastWidth = -1;
const measure = () => {
if (!alive) return;
const revealEl = revealRef.current;
if (mq.matches || !revealEl) {
setSplit(null);
return;
}
const spans = Array.from(heading.querySelectorAll<HTMLElement>("[data-srs-word]"));
const lines: string[] = [];
let current: string[] = [];
let lastTop = Number.NEGATIVE_INFINITY;
for (const span of spans) {
// A word broken across two lines (very long word, hyphenation): keep the static composition.
if (span.getClientRects().length !== 1) {
setSplit(null);
return;
}
const top = span.offsetTop;
if (top > lastTop + 2) {
if (current.length) lines.push(current.join(" "));
current = [];
lastTop = top;
}
current.push(span.textContent ?? "");
}
if (current.length) lines.push(current.join(" "));
if (!lines.length) {
setSplit(null);
return;
}
const fontSize = parseFloat(getComputedStyle(heading).fontSize) || 48;
const next = buildSplit(lines, heading.getBoundingClientRect().height, fontSize, revealEl.offsetHeight);
setSplit((prev) => (prev && prev.key === next.key ? prev : next));
};
measure();
const ro = new ResizeObserver((entries) => {
const width = Math.round(entries[0]?.contentRect.width ?? 0);
if (width !== lastWidth) {
lastWidth = width;
measure();
}
});
ro.observe(stage);
const fonts = document.fonts;
fonts?.ready.then(measure).catch(() => undefined);
fonts?.addEventListener?.("loadingdone", measure);
mq.addEventListener?.("change", measure);
return () => {
alive = false;
ro.disconnect();
fonts?.removeEventListener?.("loadingdone", measure);
mq.removeEventListener?.("change", measure);
};
}, [text, revealText, hasReveal, headingTag, align, tone]);
// One rAF-throttled scroll read writes a single --p; halves move with transform only.
useIsoLayoutEffect(() => {
const stage = stageRef.current;
if (!stage) return;
if (!split) {
stage.style.removeProperty("--p");
return;
}
if (typeof progress === "number") {
stage.style.setProperty("--p", ease(clamp01(progress)).toFixed(4));
return;
}
let raf = 0;
let listening = false;
const update = () => {
raf = 0;
const rect = stage.getBoundingClientRect();
const vh = window.innerHeight || 1;
const centre = rect.top + rect.height / 2;
const t = clamp01((vh * 0.9 - centre) / (vh * 0.4));
stage.style.setProperty("--p", ease(t).toFixed(4));
};
const request = () => {
if (!raf) raf = requestAnimationFrame(update);
};
const listen = (on: boolean) => {
if (on === listening) return;
listening = on;
if (on) {
window.addEventListener("scroll", request, { passive: true, capture: true });
window.addEventListener("resize", request);
} else {
window.removeEventListener("scroll", request, { capture: true });
window.removeEventListener("resize", request);
}
};
const io = new IntersectionObserver(
(entries) => {
listen(Boolean(entries[0]?.isIntersecting));
request();
},
{ rootMargin: "25% 0px" },
);
io.observe(stage);
update();
return () => {
io.disconnect();
listen(false);
if (raf) cancelAnimationFrame(raf);
};
}, [split, progress]);
if (!text) return null;
const Heading = headingTag;
const edgeShape = edge === "none" ? null : edge;
const into = edgeInto ?? (tone === "dark" ? "surface" : "band");
const sectionStyle = { ...FX_HOST, ...(edgeShape ? { "--srs-edge": "56px" } : {}) } as React.CSSProperties;
return (
<section
className={["cf-srs", className].filter(Boolean).join(" ")}
data-tone={tone}
data-align={align}
data-mode={split ? "split" : "static"}
aria-labelledby={headingId}
style={sectionStyle}
>
<style>{CSS}</style>
<Pattern name="rings" fade="corner" />
<div className="cf-srs__inner">
<div
ref={stageRef}
className="cf-srs__stage"
style={split ? { paddingTop: split.padTop, paddingBottom: split.padBottom } : undefined}
>
<div className="cf-srs__head" style={split ? vars({ "--seam": `${split.seam.toFixed(2)}px` }) : undefined}>
<Heading ref={headingRef} id={headingId} className="cf-srs__type cf-srs__statement">
{words.map((word, i) => (
<React.Fragment key={`${i}-${word}`}>
{i > 0 ? " " : null}
<span data-srs-word="">{word}</span>
</React.Fragment>
))}
</Heading>
{split ? (
<div className="cf-srs__flaps" aria-hidden="true">
{split.lines.map((line, i) => (
<div
key={`${i}-${line}`}
className="cf-srs__type cf-srs__line"
style={{ top: i * split.lineH, height: split.lineH }}
>
<span className="cf-srs__half cf-srs__half--top" style={vars({ "--o": split.offsets[i][0].toFixed(2) })}>
{line}
</span>
<span className="cf-srs__half cf-srs__half--bottom" style={vars({ "--o": split.offsets[i][1].toFixed(2) })}>
{line}
</span>
</div>
))}
</div>
) : null}
{split ? (
<>
<span className="cf-srs__rule" aria-hidden="true" style={vars({ "--o": (-split.half).toFixed(2) })} />
<span className="cf-srs__rule" aria-hidden="true" style={vars({ "--o": split.half.toFixed(2) })} />
</>
) : null}
{hasReveal ? (
<p ref={revealRef} className="cf-srs__reveal">
{revealText}
</p>
) : null}
</div>
</div>
</div>
{edgeShape ? <Divider shape={edgeShape} tone={into} height={56} /> : null}
</section>
);
}
export default SplitRevealStatement;
// The main gap opens on the middle line's seam; every other line cracks open by a small seam of its own.
function buildSplit(lines: string[], headingH: number, fontSize: number, revealH: number): Split {
const n = lines.length;
const lineH = headingH / n;
const k = Math.floor((n - 1) / 2);
const pad = Math.max(16, fontSize * 0.22);
const half = revealH / 2 + pad;
const s = n > 1 ? fontSize * 0.12 : 0;
const offsets = lines.map((_, i): [number, number] => {
if (i < k) return [-(half + s * (k - i)), -(half + s * (k - 1 - i))];
if (i === k) return [-half, half];
return [half + s * (i - k - 1), half + s * (i - k)];
});
return {
key: `${lines.join("|")}#${Math.round(lineH)}#${Math.round(fontSize)}#${Math.round(revealH)}`,
lines,
lineH,
seam: (k + 0.5) * lineH,
half,
padTop: half + s * k,
padBottom: half + s * (n - 1 - k),
offsets,
};
}
function clamp01(v: number) {
return Math.min(1, Math.max(0, v));
}
function ease(t: number) {
return t * t * (3 - 2 * t);
}
function vars(v: Record<string, string>): React.CSSProperties {
return v as React.CSSProperties;
}
const CSS = `
.cf-srs{--srs-gap:clamp(24px,4.2cqi,52px);--srs-bg:var(--band,oklch(0.27 0.067 256));--srs-text:var(--band-ink,oklch(1 0 0));--srs-accent:var(--reveal-accent,oklch(from var(--accent-fill,var(--accent,oklch(0.5 0.17 257))) max(l, 0.82) min(c, 0.12) h));position:relative;isolation:isolate;overflow:clip;background:var(--srs-bg);color:var(--srs-text);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) calc(clamp(64px,8.5vw,120px) + var(--srs-edge,0px));}
.cf-srs[data-tone="light"]{--srs-bg:var(--surface,oklch(1 0 0));--srs-text:var(--ink,oklch(0.21 0.034 263));--srs-accent:var(--reveal-accent,var(--accent,oklch(0.5 0.17 257)));}
.cf-srs__inner{position:relative;z-index:1;max-inline-size:1120px;margin-inline:auto;min-width:0;container-type:inline-size;--srs-gap:clamp(24px,4.2cqi,52px);}
.cf-srs__stage,.cf-srs__head{position:relative;min-width:0;}
.cf-srs__type{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2.5rem,9.5cqi,9rem);line-height:1.02;color:var(--srs-text);font-kerning:normal;}
.cf-srs__statement{text-wrap:balance;overflow-wrap:break-word;hyphens:manual;}
.cf-srs__reveal{margin:var(--srs-gap) 0 0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(1.5rem,4.6cqi,3.5rem);line-height:1.12;color:var(--srs-accent);text-wrap:balance;overflow-wrap:break-word;hyphens:manual;}
.cf-srs[data-align="center"] .cf-srs__type,.cf-srs[data-align="center"] .cf-srs__reveal{text-align:center;}
.cf-srs[data-align="left"] .cf-srs__type,.cf-srs[data-align="left"] .cf-srs__reveal{text-align:start;}
.cf-srs[data-mode="split"] .cf-srs__statement{opacity:0;}
.cf-srs__flaps{position:absolute;inset:0;pointer-events:none;}
.cf-srs__line{position:absolute;inset-inline:0;}
.cf-srs__half{position:absolute;inset:0;display:block;white-space:nowrap;transform:translate3d(0,calc(var(--p,0) * var(--o,0) * 1px),0);will-change:transform;}
.cf-srs__half--top{clip-path:inset(-0.45em -0.35em 50% -0.35em);}
.cf-srs__half--bottom{clip-path:inset(50% -0.35em -0.45em -0.35em);}
.cf-srs__rule{position:absolute;inset-inline:0;top:var(--seam,50%);display:block;height:1px;background:oklch(from var(--srs-text) l c h / 0.2);opacity:var(--p,0);transform:translate3d(0,calc(var(--p,0) * var(--o,0) * 1px),0);pointer-events:none;}
.cf-srs[data-mode="split"] .cf-srs__reveal{position:absolute;inset-inline:0;top:var(--seam,50%);margin:0;transform:translate3d(0,-50%,0) scale(calc(0.94 + var(--p,0) * 0.06));opacity:clamp(0,calc(var(--p,0) * 1.7 - 0.35),1);clip-path:inset(calc((1 - var(--p,0)) * 50% - 0.2em) -0.5em);will-change:transform,opacity;}
@media (prefers-reduced-motion: reduce){
.cf-srs__flaps,.cf-srs__rule{display:none;}
.cf-srs[data-mode="split"] .cf-srs__statement{opacity:1;}
.cf-srs[data-mode="split"] .cf-srs__reveal{position:static;transform:none;opacity:1;clip-path:none;margin-top:var(--srs-gap);}
}
`;
pieces/content/split-reveal-statement/specimen.tsx 16 lines
// Specimen: Copy Cohort Studio's scroll-stopper. The claim cracks open and the truth inside it appears.
import SplitRevealStatement from "../split-reveal-statement";
export const states = ["default"];
export default function SplitRevealStatementSpecimen(_props: { state?: "default" }) {
return (
<SplitRevealStatement
statement="Good copy sells."
reveal="Bad copy sells too, once."
tone="dark"
align="center"
edge="step"
/>
);
}
| Name | Type | Details |
|---|---|---|
statement OptionalSplitRevealStatement |
string |
Default DEFAULT_STATEMENT
|
reveal OptionalSplitRevealStatement |
string |
Default DEFAULT_REVEAL
|
tone OptionalSplitRevealStatement |
"dark" | "light" |
Default "dark"
|
align OptionalSplitRevealStatement |
"center" | "left" |
Default "center"
|
as OptionalSplitRevealStatement |
"h2" | "h3" |
Default "h2"
|
progress OptionalSplitRevealStatement |
number |
|
edge OptionalSplitRevealStatement |
"step" | "chevron" | "none" |
Default "step"
|
edgeInto OptionalSplitRevealStatement |
"surface" | "band" | "card" |
|
className OptionalSplitRevealStatement |
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.
--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.
This piece reads no image slots.