Three Secrets 2
Deals the three secrets of a free masterclass as a hand of cards: one teaser face-up, two locked. The reader draws each one, then registers to get the answers.
Use it in a prompt
Use content/three-secrets-2 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/three-secrets-2.tsx. - Import it and pass your copy and images (Props tab):
import { ThreeSecrets2 } from "@/components/funneldna/content/three-secrets-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/three-secrets-2/component.tsx 585 lines
// layout: card-fan
// Deals the three secrets of a free masterclass as a hand of cards: one teaser face-up, two locked. The reader draws each one, then registers to get the answers.
'use client'
import * as React from 'react'
import { AlertCircle, Loader2, MonitorPlay, X } from 'lucide-react'
import { FX_HOST, Glow, Spot, Texture } from '../fx/fx'
import lock from '../fx/spots/lock'
import linen from '../fx/textures/linen'
/** States the piece implements (the specimen renders each one). Loading shows while a promise returned by onAction is pending. */
export type ThreeSecrets2State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type FanSecret = {
/** The false belief this secret breaks, in the reader’s own words (vehicle, internal or external). */
belief: string
/** Teaser headline. It opens the loop and never gives the answer. */
teaser: string
}
/** An imported fx texture asset (the type the shared Texture layer accepts). */
export type ThreeSecrets2Texture = React.ComponentProps<typeof Texture>['src']
export type ThreeSecrets2Props = {
headline?: string
/** Phrase inside the headline that gets one marker stroke (matched case-insensitively). */
emphasis?: string
/** Line under the headline; omit to hide. */
lead?: string
/** Three secrets, one card each. Only the first three render. */
secrets?: FanSecret[]
/** Index of the face-up card on first render. */
defaultActive?: number
/** Card label and counter. The {n} and {total} placeholders are replaced. */
counterLabel?: string
/** Hidden prefix read before each belief. */
beliefPrefix?: string
/** Line at the foot of the face-up card; omit to hide. */
revealNote?: string
/** Word on a locked card; omit to hide. */
lockedNote?: string
/** Accessible name of a locked card. The {n} placeholder becomes its number. */
lockedAria?: string
/** Accessible name of the card fan. */
fanLabel?: string
/** Hint under the fan on wide screens. */
hint?: string
/** Hint under the swipe deck on phones. */
deckHint?: string
/** Accessible name of each deck dot. The {n} placeholder becomes the card number. */
dotLabel?: string
/** Button text. */
label?: string
/** One short reassurance line under the button; omit to hide. */
sublabel?: string
/** Button text while a promise returned by onAction is pending. */
loadingLabel?: string
/** Shown under the button when onAction throws or rejects, or in the error state. */
errorMessage?: string
/** Where the button goes (e.g. '#register'); the button renders as a link when set. */
href?: string
/** Called on click. A returned promise shows loadingLabel; a rejection shows errorMessage. */
onAction?: () => void | Promise<unknown>
/** Lock illustration on locked cards: an fx spot asset URL. */
lockSpot?: string
/** Band texture: an imported fx texture asset (e.g. `import linen from "../fx/textures/linen"`); null hides it. */
texture?: ThreeSecrets2Texture | null
/** Forces a visual state for previews; 'default' lets the piece manage its own. */
state?: ThreeSecrets2State
/** Id on the root section, e.g. as an anchor target. */
id?: string
className?: string
}
export function ThreeSecrets2(props: ThreeSecrets2Props) {
const {
headline = 'Three secrets to a handmade shop that sells while you make',
emphasis = 'sells while you make',
lead = 'The free Shopfloor Masterclass reveals all three. Draw a card to see what’s waiting.',
secrets = DEFAULT_SECRETS,
defaultActive = 0,
counterLabel = 'Secret {n} of {total}',
beliefPrefix = 'The belief it breaks: ',
revealNote = 'Revealed in the free masterclass',
lockedNote = 'Locked',
lockedAria = 'Secret {n}, locked. Bring it to the front',
fanLabel = 'Three secrets. Use the arrow keys to draw the next card',
hint = 'Tap a card or drag the hand to draw the next secret.',
deckHint = 'Swipe to draw the next secret.',
dotLabel = 'Show secret {n}',
label = 'Send Me The Masterclass',
sublabel = 'Free masterclass · Watch online',
loadingLabel = 'Sending your masterclass…',
errorMessage = 'We couldn’t complete your registration. Please try again.',
href,
onAction,
lockSpot = lock,
texture = linen,
state = 'default',
id,
className,
} = props
const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, '')
const headingId = `ts2-h-${uid}`
const errId = `ts2-e-${uid}`
const cards = secrets.slice(0, 3)
const count = cards.length
const [active, setActive] = React.useState(() => clampIndex(defaultActive, count))
const [announce, setAnnounce] = React.useState('')
const [deck, setDeck] = React.useState(false)
const [status, setStatus] = React.useState<'idle' | 'loading' | 'error'>('idle')
const alive = React.useRef(true)
const fanRef = React.useRef<HTMLDivElement | null>(null)
const cardRefs = React.useRef<Array<HTMLButtonElement | null>>([])
const activeRef = React.useRef(active)
const drag = React.useRef<{ id: number; x: number; dx: number; moved: boolean } | null>(null)
const suppress = React.useRef(false)
const raf = React.useRef(0)
const current = clampIndex(active, count)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
if (typeof cancelAnimationFrame === 'function') cancelAnimationFrame(raf.current)
}
}, [])
React.useEffect(() => {
activeRef.current = current
}, [current])
React.useEffect(() => {
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return
const mq = window.matchMedia('(max-width: 720px)')
const sync = () => setDeck(mq.matches)
sync()
mq.addEventListener('change', sync)
return () => mq.removeEventListener('change', sync)
}, [])
React.useEffect(() => {
if (deck) scrollToCard(activeRef.current, true)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [deck])
const view = state === 'error' && status === 'idle' ? 'error' : status
const disabled = state === 'disabled'
const busy = view === 'loading'
const inert = disabled || busy
const force = state === 'hover' || state === 'active' ? state : undefined
function scrollToCard(i: number, instant?: boolean) {
const el = fanRef.current
const card = cardRefs.current[i]
if (!el || !card) return
const left = card.offsetLeft - (el.clientWidth - card.offsetWidth) / 2
if (typeof el.scrollTo === 'function') el.scrollTo({ left, behavior: instant || prefersReduced() ? 'auto' : 'smooth' })
else el.scrollLeft = left
}
function go(next: number, opts: { focus?: boolean } = {}) {
if (!count) return
const i = ((next % count) + count) % count
activeRef.current = i
setActive(i)
setAnnounce(`${fmt(counterLabel, i + 1, count)}. ${cards[i]?.teaser ?? ''}`)
if (deck) scrollToCard(i)
if (opts.focus) cardRefs.current[i]?.focus({ preventScroll: true })
}
function onCardKey(event: React.KeyboardEvent<HTMLButtonElement>) {
const key = event.key
let next: number | null = null
if (key === 'ArrowRight' || key === 'ArrowDown') next = activeRef.current + 1
else if (key === 'ArrowLeft' || key === 'ArrowUp') next = activeRef.current - 1
else if (key === 'Home') next = 0
else if (key === 'End') next = count - 1
if (next === null) return
event.preventDefault()
go(next, { focus: true })
}
function onPointerDown(event: React.PointerEvent<HTMLDivElement>) {
suppress.current = false
if (deck || count < 2) return
if (event.pointerType === 'mouse' && event.button !== 0) return
drag.current = { id: event.pointerId, x: event.clientX, dx: 0, moved: false }
}
function onPointerMove(event: React.PointerEvent<HTMLDivElement>) {
const d = drag.current
const el = fanRef.current
if (!d || !el || d.id !== event.pointerId) return
d.dx = event.clientX - d.x
if (!d.moved && Math.abs(d.dx) > 6) {
d.moved = true
try {
el.setPointerCapture(event.pointerId)
} catch {
// capture is an enhancement only
}
el.setAttribute('data-dragging', '')
}
if (d.moved) el.style.setProperty('--ts2-drag', `${Math.max(-180, Math.min(180, d.dx))}px`)
}
function endDrag(event: React.PointerEvent<HTMLDivElement>, commit: boolean) {
const d = drag.current
const el = fanRef.current
if (!d || d.id !== event.pointerId) return
drag.current = null
if (el) {
el.removeAttribute('data-dragging')
el.style.setProperty('--ts2-drag', '0px')
if (el.hasPointerCapture(event.pointerId)) el.releasePointerCapture(event.pointerId)
}
if (!d.moved) return
suppress.current = true
if (commit && Math.abs(d.dx) > 56) go(activeRef.current + (d.dx < 0 ? 1 : -1))
}
function onClickCapture(event: React.MouseEvent<HTMLDivElement>) {
if (!suppress.current) return
suppress.current = false
event.preventDefault()
event.stopPropagation()
}
function onScroll() {
if (typeof requestAnimationFrame !== 'function') return
cancelAnimationFrame(raf.current)
raf.current = requestAnimationFrame(() => {
const el = fanRef.current
const first = cardRefs.current[0]
const second = cardRefs.current[1]
if (!el || !first) return
const step = second ? second.offsetLeft - first.offsetLeft : first.offsetWidth
if (step <= 0) return
const i = clampIndex(Math.round(el.scrollLeft / step), count)
if (i !== activeRef.current) {
activeRef.current = i
setActive(i)
setAnnounce(`${fmt(counterLabel, i + 1, count)}. ${cards[i]?.teaser ?? ''}`)
}
})
}
function handle(event: React.MouseEvent<HTMLElement>) {
if (inert) {
event.preventDefault()
return
}
if (!onAction) return
setStatus('idle')
let result: unknown
try {
result = onAction()
} catch {
setStatus('error')
return
}
if (!isThenable(result)) return
setStatus('loading')
result.then(
() => {
if (alive.current) setStatus('idle')
},
() => {
if (alive.current) setStatus('error')
},
)
}
const inner = busy ? (
<>
<Loader2 className='ts2-spin' aria-hidden='true' strokeWidth={2.5} />
<span>{loadingLabel}</span>
</>
) : (
<span>{label}</span>
)
const shared = {
'data-view': disabled ? 'disabled' : view,
'aria-busy': busy || undefined,
'aria-disabled': inert || undefined,
'aria-describedby': view === 'error' ? errId : undefined,
onClick: handle,
}
const button = href ? (
<a {...shared} className='ts2-btn' href={inert ? undefined : href}>
{inner}
</a>
) : (
<button {...shared} className='ts2-btn' type='button' disabled={disabled}>
{inner}
</button>
)
return (
<section
id={id}
className={['cf-three-secrets-2', className].filter(Boolean).join(' ')}
style={FX_HOST}
aria-labelledby={headingId}
data-force={force}
>
<style>{CSS}</style>
{texture ? <Texture src={texture} tone='band-ink' /> : null}
<Glow />
<div className='ts2-wrap'>
<header className='ts2-head'>
<h2 className='ts2-h' id={headingId}>{withEmphasis(headline, emphasis)}</h2>
{lead ? <p className='ts2-lead'>{lead}</p> : null}
</header>
<div
ref={fanRef}
className='ts2-fan'
role='group'
aria-label={fanLabel}
data-mode={deck ? 'deck' : 'fan'}
onPointerDown={onPointerDown}
onPointerMove={onPointerMove}
onPointerUp={(event) => endDrag(event, true)}
onPointerCancel={(event) => endDrag(event, false)}
onClickCapture={onClickCapture}
onScroll={deck ? onScroll : undefined}
>
{cards.map((secret, i) => {
const rank = (i - current + count) % count
const on = rank === 0
const side = rank === 1 ? 'right' : rank === 2 ? 'left' : undefined
return (
<button
key={i}
ref={(el) => {
cardRefs.current[i] = el
}}
type='button'
className='ts2-card'
data-rank={rank}
tabIndex={on ? 0 : -1}
aria-current={on ? 'true' : undefined}
aria-label={on ? undefined : fmt(lockedAria, i + 1, count)}
onClick={() => go(on ? i + 1 : i)}
onKeyDown={onCardKey}
>
{on ? (
<span className='ts2-face'>
<span className='ts2-top'>
<span className='ts2-num' aria-hidden='true'>{pad(i + 1)}</span>
<span className='ts2-k'>{fmt(counterLabel, i + 1, count)}</span>
</span>
<span className='ts2-belief'>
<span className='ts2-x' aria-hidden='true'>
<X strokeWidth={3} />
</span>
<span>
<span className='ts2-sr'>{beliefPrefix}</span>
{secret.belief}
</span>
</span>
<span className='ts2-teaser'>{secret.teaser}</span>
{revealNote ? (
<span className='ts2-foot'>
<MonitorPlay className='ts2-ic' aria-hidden='true' strokeWidth={2.5} />
{revealNote}
</span>
) : null}
</span>
) : (
<span className='ts2-locked' data-side={side} aria-hidden='true'>
<span className='ts2-lnum'>{pad(i + 1)}</span>
<span className='ts2-lbot'>
<span className='ts2-spot'>
<Spot src={lockSpot} size={72} />
</span>
{lockedNote ? <span className='ts2-lnote'>{lockedNote}</span> : null}
</span>
</span>
)}
</button>
)
})}
</div>
<p className='ts2-sr' aria-live='polite'>{announce}</p>
<div className='ts2-nav'>
<p className='ts2-hint ts2-fan-only'>
<strong>{fmt(counterLabel, current + 1, count)}</strong>
<span aria-hidden='true'> · </span>
{hint}
</p>
<div className='ts2-dots ts2-deck-only'>
{cards.map((_, i) => (
<button
key={i}
type='button'
className='ts2-dot'
aria-label={fmt(dotLabel, i + 1, count)}
aria-current={i === current ? 'true' : undefined}
onClick={() => go(i)}
/>
))}
</div>
<p className='ts2-hint ts2-deck-only'>{deckHint}</p>
</div>
<div className='ts2-act'>
{button}
{sublabel ? (
<p className='ts2-sub'>
<MonitorPlay className='ts2-ic' aria-hidden='true' strokeWidth={2.5} />
{sublabel}
</p>
) : null}
{view === 'error' ? (
<p className='ts2-err' id={errId} role='alert'>
<AlertCircle className='ts2-ic' aria-hidden='true' strokeWidth={2.5} />
{errorMessage}
</p>
) : null}
</div>
</div>
</section>
)
}
export default ThreeSecrets2
const DEFAULT_SECRETS: FanSecret[] = [
{
belief: '“I need a bigger range before anyone will buy.”',
teaser: 'Why one hero product outsells a shelf full of listings',
},
{
belief: '“I’m a maker, not a salesperson.”',
teaser: 'The product story that sells your work without feeling like selling',
},
{
belief: '“The marketplace algorithm decides who gets seen.”',
teaser: 'How makers get found when the marketplace stops showing them',
},
]
function clampIndex(i: number, count: number) {
if (count <= 0) return 0
return Math.min(Math.max(Math.round(i) || 0, 0), count - 1)
}
function pad(n: number) {
return String(n).padStart(2, '0')
}
function fmt(template: string, n: number, total: number) {
return template.split('{n}').join(String(n)).split('{total}').join(String(total))
}
function prefersReduced() {
return (
typeof window !== 'undefined' &&
typeof window.matchMedia === 'function' &&
window.matchMedia('(prefers-reduced-motion: reduce)').matches
)
}
function isThenable(value: unknown): value is PromiseLike<unknown> {
return Boolean(value) && typeof (value as PromiseLike<unknown>).then === 'function'
}
function withEmphasis(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text
const at = text.toLowerCase().indexOf(phrase.toLowerCase())
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='ts2-em'>{text.slice(at, at + phrase.length)}</span>
{text.slice(at + phrase.length)}
</>
)
}
const R = '.cf-three-secrets-2'
const CSS = `
${R}{--ts2-gutter:clamp(16px,5vw,48px);--ts2-cw:340px;--ts2-ch:420px;--ts2-ease:cubic-bezier(.2,.7,.2,1);--ts2-sh:var(--shadow,oklch(0.22 0.03 260));position:relative;isolation:isolate;overflow:hidden;background:var(--band,oklch(0.27 0.067 256));color:var(--band-ink,oklch(1 0 0));font-family:var(--font-body,system-ui,sans-serif);padding:clamp(56px,8vw,112px) var(--ts2-gutter) clamp(64px,8.5vw,120px)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .ts2-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;text-align:center}
${R} .ts2-head{max-width:46rem;margin:0 auto;animation:ts2-rise .45s var(--ts2-ease) both}
${R} .ts2-h{margin:0;font-family:var(--font-display,inherit);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.08;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--band-ink,oklch(1 0 0));text-wrap:balance}
${R} .ts2-em{padding:0 .12em;margin:0 -.02em;border-radius:.06em .3em .08em .24em;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .ts2-lead{margin:16px auto 0;max-width:40rem;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--band-ink,oklch(1 0 0));text-wrap:pretty}
${R} .ts2-fan{position:relative;max-width:780px;height:calc(var(--ts2-ch) + 72px);margin:clamp(32px,5vw,56px) auto 0;text-align:left;touch-action:pan-y;cursor:grab;-webkit-user-select:none;user-select:none;animation:ts2-rise .45s var(--ts2-ease) .07s both}
${R} .ts2-fan[data-dragging]{cursor:grabbing}
${R} .ts2-card{--x:0px;--y:0px;--r:0deg;--s:1;--dx:0px;position:absolute;top:28px;left:50%;display:flex;flex-direction:column;width:var(--ts2-cw);height:var(--ts2-ch);margin:0 0 0 calc(var(--ts2-cw) / -2);padding:28px;-webkit-appearance:none;appearance:none;font:inherit;text-align:left;color:var(--ink);background:color-mix(in oklch,var(--ink) 5%,var(--card));border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(from var(--ts2-sh) l c h / .22),0 4px 10px -2px oklch(from var(--ts2-sh) l c h / .2)));cursor:pointer;transform-origin:50% 135%;transform:translateX(calc(var(--x) + var(--dx))) translateY(var(--y)) rotate(var(--r)) scale(var(--s));transition:transform .45s var(--ts2-ease),box-shadow .16s ease,background-color .2s ease,border-color .2s ease;-webkit-tap-highlight-color:transparent}
${R} .ts2-card[data-rank='0']{--y:-6px;--dx:var(--ts2-drag,0px);z-index:3;background:var(--card);border-color:color-mix(in oklch,var(--accent) 45%,var(--card));box-shadow:var(--shadow-lg,0 2px 4px oklch(from var(--ts2-sh) l c h / .22),0 12px 24px -8px oklch(from var(--ts2-sh) l c h / .32))}
${R} .ts2-card[data-rank='1']{--x:42%;--y:18px;--r:7deg;z-index:2}
${R} .ts2-card[data-rank='2']{--x:-42%;--y:18px;--r:-7deg;z-index:1}
${R} .ts2-fan[data-dragging] .ts2-card[data-rank='0']{transition:box-shadow .16s ease}
@media (hover:hover){
${R} .ts2-fan:not([data-dragging]) .ts2-card[data-rank='0']:hover{--y:-12px}
${R} .ts2-fan:not([data-dragging]) .ts2-card:not([data-rank='0']):hover{--y:2px;background:var(--card)}
}
${R} .ts2-card:active{--s:.985}
${R} .ts2-card:focus-visible{outline:3px solid var(--band-ink,oklch(1 0 0));outline-offset:4px}
${R} .ts2-face{display:flex;flex-direction:column;gap:16px;height:100%;animation:ts2-rise .45s var(--ts2-ease) both}
${R} .ts2-top{display:flex;align-items:flex-end;gap:12px}
${R} .ts2-num,${R} .ts2-lnum{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(3.5rem,5vw,4.5rem);line-height:.9;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
${R} .ts2-num{color:var(--accent)}
${R} .ts2-lnum{color:var(--muted)}
${R} .ts2-k,${R} .ts2-lnote{font-size:.875rem;line-height:1.2;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
${R} .ts2-k{padding-bottom:6px}
${R} .ts2-belief{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--ink);text-wrap:pretty}
${R} .ts2-x{flex:none;display:grid;place-items:center;width:22px;height:22px;border-radius:999px;background:var(--danger);color:var(--ts2-glyph,#fff)}
${R} .ts2-x svg{width:14px;height:14px}
${R} .ts2-teaser{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-transform:var(--display-case,none);color:var(--ink);text-wrap:balance}
${R} .ts2-foot{margin-top:auto;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
${R} .ts2-ic{display:inline-block;width:16px;height:16px;vertical-align:-.15em;margin-inline-end:.4em}
${R} .ts2-foot .ts2-ic{color:var(--accent)}
${R} .ts2-locked{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:12px;height:100%;text-align:center}
${R} .ts2-lbot{display:flex;flex-direction:column;align-items:inherit;gap:10px;padding-bottom:8px}
${R} .ts2-locked[data-side='right']{align-items:flex-end;text-align:right}
${R} .ts2-locked[data-side='left']{align-items:flex-start;text-align:left}
${R} .ts2-spot{display:block;line-height:0}
${R} .ts2-nav{margin-top:8px}
${R} .ts2-hint{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--band-ink,oklch(1 0 0));text-wrap:pretty}
${R} .ts2-hint strong{font-weight:800}
${R} .ts2-deck-only{display:none}
${R} .ts2-dots{justify-content:center;gap:4px;margin:0 0 4px}
${R} .ts2-dot{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:999px;background:transparent;cursor:pointer;-webkit-appearance:none;appearance:none}
${R} .ts2-dot::before{content:'';width:10px;height:10px;border-radius:999px;background:oklch(from var(--band-ink,oklch(1 0 0)) l c h / .45);transition:width .2s ease,background-color .2s ease}
${R} .ts2-dot[aria-current='true']::before{width:26px;background:var(--band-ink,oklch(1 0 0))}
${R} .ts2-dot:focus-visible{outline:3px solid var(--band-ink,oklch(1 0 0));outline-offset:0}
${R} .ts2-act{display:flex;flex-direction:column;align-items:center;gap:12px;margin-top:clamp(32px,4vw,48px);animation:ts2-rise .45s var(--ts2-ease) .14s both}
${R} .ts2-btn{--ts2-b:var(--button-bg,var(--cta));--ts2-b2:var(--button-bg-2,var(--cta-2));display:inline-flex;align-items:center;justify-content:center;gap:10px;width:min(100%,30rem);min-height:72px;margin:0;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--ts2-b) calc(l + .04) c h),oklch(from var(--ts2-b2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display,inherit));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;text-align:center;text-decoration:none;text-wrap:balance;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ts2-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--ts2-b) calc(l - .16) c h),0 1px 2px oklch(from var(--ts2-sh) l c h / .35),0 8px 16px -6px oklch(from var(--ts2-sh) l c h / .5));transition:transform .16s ease,box-shadow .16s ease,background .16s ease;-webkit-tap-highlight-color:transparent}
${R} .ts2-btn:not([aria-disabled='true']):hover,${R}[data-force='hover'] .ts2-btn{background:linear-gradient(oklch(from var(--ts2-b) calc(l - .01) c h),oklch(from var(--ts2-b2) calc(l - .07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ts2-b) calc(l + .1) c h / .7),inset 0 -3px 0 oklch(from var(--ts2-b) calc(l - .2) c h),0 1px 2px oklch(from var(--ts2-sh) l c h / .4),0 12px 20px -6px oklch(from var(--ts2-sh) l c h / .55))}
${R} .ts2-btn:not([aria-disabled='true']):active,${R}[data-force='active'] .ts2-btn{background:linear-gradient(oklch(from var(--ts2-b) calc(l - .03) c h),oklch(from var(--ts2-b2) calc(l - .09) c h));transform:translateY(1px);box-shadow:var(--button-shadow,inset 0 2px 3px oklch(from var(--ts2-b) calc(l - .22) c h / .45),inset 0 -2px 0 oklch(from var(--ts2-b) calc(l - .16) c h),0 1px 1px oklch(from var(--ts2-sh) l c h / .3))}
${R} .ts2-btn:focus-visible{outline:3px solid var(--band-ink,oklch(1 0 0));outline-offset:4px}
${R} .ts2-btn[data-view='disabled'],${R} .ts2-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;transform:none;cursor:not-allowed}
${R} .ts2-btn[data-view='loading']{cursor:progress}
${R} .ts2-btn .ts2-spin{width:20px;height:20px;flex:none;animation:ts2-spin .8s linear infinite}
${R} .ts2-sub{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--band-ink,oklch(1 0 0));text-wrap:pretty}
${R} .ts2-err{margin:0;max-width:30rem;padding:10px 14px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:600;text-align:left;text-wrap:pretty}
${R} .ts2-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@keyframes ts2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ts2-spin{to{transform:rotate(360deg)}}
@media (max-width:960px){
${R}{--ts2-cw:300px;--ts2-ch:410px}
${R} .ts2-card{padding:24px}
}
@media (max-width:720px){
${R} .ts2-fan{display:flex;gap:10px;height:auto;max-width:none;margin:32px calc(-1 * var(--ts2-gutter)) 0;padding:12px 36px 16px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;touch-action:auto;cursor:auto;-webkit-user-select:auto;user-select:auto}
${R} .ts2-fan::-webkit-scrollbar{display:none}
${R} .ts2-card{position:relative;top:auto;left:auto;flex:0 0 100%;width:auto;height:auto;min-height:400px;margin:0;transform:scale(var(--s));scroll-snap-align:center;scroll-snap-stop:always}
${R} .ts2-card[data-rank='0']{--y:0px}
${R} .ts2-locked,${R} .ts2-locked[data-side='left'],${R} .ts2-locked[data-side='right']{align-items:center;justify-content:center;gap:16px;text-align:center}
${R} .ts2-lbot{padding-bottom:0}
${R} .ts2-fan-only{display:none}
${R} .ts2-deck-only{display:block}
${R} .ts2-dots.ts2-deck-only{display:flex}
${R} .ts2-btn{width:100%;min-height:64px;padding:12px 16px;font-size:clamp(1rem,4.4vw,1.125rem);white-space:nowrap}
}
@media (max-width:340px){
${R} .ts2-btn{white-space:normal}
}
@media (prefers-reduced-motion:reduce){
${R} *,${R} *::before,${R} *::after{animation:none!important;transition:none!important}
${R} .ts2-fan{scroll-behavior:auto}
}
`
pieces/content/three-secrets-2/specimen.tsx 38 lines
import * as React from 'react'
import { ThreeSecrets2, type FanSecret, type ThreeSecrets2State } from '../three-secrets-2'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
const SECRETS: FanSecret[] = [
{
belief: '“I need a bigger range before anyone will buy.”',
teaser: 'Why one hero product outsells a shelf full of listings',
},
{
belief: '“I’m a maker, not a salesperson.”',
teaser: 'The product story that sells your work without feeling like selling',
},
{
belief: '“The marketplace algorithm decides who gets seen.”',
teaser: 'How makers get found when the marketplace stops showing them',
},
]
export default function ThreeSecrets2Specimen({ state = 'default' }: { state?: ThreeSecrets2State }) {
return (
<ThreeSecrets2
state={state}
headline='Three secrets to a handmade shop that sells while you make'
emphasis='sells while you make'
lead='The free Shopfloor Masterclass reveals all three. Draw a card to see what’s waiting.'
secrets={SECRETS}
revealNote='Revealed in the free Shopfloor Masterclass'
label='Send Me The Masterclass'
sublabel='Free masterclass · Watch online'
loadingLabel='Sending your masterclass…'
errorMessage={defaults.sample.registration.error}
onAction={() => undefined}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalThreeSecrets2 |
string |
|
emphasis OptionalThreeSecrets2 |
string |
|
lead OptionalThreeSecrets2 |
string |
|
secrets OptionalThreeSecrets2 |
FanSecret[] |
|
defaultActive OptionalThreeSecrets2 |
number |
|
counterLabel OptionalThreeSecrets2 |
string |
|
beliefPrefix OptionalThreeSecrets2 |
string |
|
revealNote OptionalThreeSecrets2 |
string |
|
lockedNote OptionalThreeSecrets2 |
string |
|
lockedAria OptionalThreeSecrets2 |
string |
|
fanLabel OptionalThreeSecrets2 |
string |
|
hint OptionalThreeSecrets2 |
string |
|
deckHint OptionalThreeSecrets2 |
string |
|
dotLabel OptionalThreeSecrets2 |
string |
|
label OptionalThreeSecrets2 |
string |
|
sublabel OptionalThreeSecrets2 |
string |
|
loadingLabel OptionalThreeSecrets2 |
string |
|
errorMessage OptionalThreeSecrets2 |
string |
|
href OptionalThreeSecrets2 |
string |
|
onAction OptionalThreeSecrets2 |
() => void | Promise<unknown> |
|
lockSpot OptionalThreeSecrets2 |
string |
|
texture OptionalThreeSecrets2 |
ThreeSecrets2Texture | null |
|
state OptionalThreeSecrets2 |
ThreeSecrets2State |
|
id OptionalThreeSecrets2 |
string |
|
className OptionalThreeSecrets2 |
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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
2c539f422023a290.webp
image/webp · 115 KB
-
4788bc008c79471c.webp
image/webp · 13.9 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB