Confirmation Hero 3
Giveaway thank-you hero. It confirms the entry as a scoreboard on the dark band, then turns the entrant into the next recruiter with a one-tap copy of their referral link, the prize, the draw date and every bonus-entry way.
Use it in a prompt
Use hero/confirmation-hero-3 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/confirmation-hero-3.tsx. - Import it and pass your copy and images (Props tab):
import { ConfirmationHero3 } from "@/components/funneldna/hero/confirmation-hero-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/confirmation-hero-3/component.tsx 658 lines
// layout: fact-scoreboard
// Giveaway thank-you hero. It confirms the entry as a scoreboard on the dark band, then turns the entrant into the next recruiter with a one-tap copy of their referral link, the prize, the draw date and every bonus-entry way.
'use client'
import * as React from 'react'
import { CalendarDays, Check, Copy, FileText, Gift, Heart, Link2, Mail, Share2, Users } from 'lucide-react'
import { FX_HOST, Pattern } from '../fx/fx'
export type ConfirmationHero3State = 'default' | 'hover' | 'active' | 'disabled' | 'success'
export type GiveawayPrize = {
/** Prize name. It becomes the highlighted phrase in the generated headline. */
name: string
/** Bold value line, e.g. 'A $640 camp setup.' Supplied facts only. */
value?: React.ReactNode
/** The value said in words beside it. */
valueNote?: React.ReactNode
}
export type GiveawayDraw = {
/** Tile heading. Defaults to copy.drawTitle. */
title?: React.ReactNode
/** The supplied draw date, set big, e.g. 'May 15'. */
date: string
detail?: React.ReactNode
}
export type GiveawayShare = {
/** The visitor's personal referral link. The share tile is hidden without one. */
link: string
/** Tile heading. Defaults to copy.shareTitle. */
title?: React.ReactNode
detail?: React.ReactNode
/** Supplied bonus entries for sharing, shown as '+N'. Omit to hide the numeral. */
entries?: number | string
/** Word under the numeral. Defaults to copy.shareUnit. */
unit?: string
fieldLabel?: string
placeholder?: string
/** One plain line under the buttons. */
note?: React.ReactNode
}
export type BonusWay = {
/** Stable key, also passed to onWay. */
id: string
/** Picks the icon. */
kind?: 'follow' | 'refer' | 'subscribe' | 'share' | 'other'
title: React.ReactNode
detail?: React.ReactNode
/** Supplied entry value, shown as '+N'. */
entries: number | string
/** Word beside the numeral, e.g. 'entries' or 'each'. */
unit?: string
actionLabel?: string
/** Destination for the way's button, e.g. the social profile. */
href?: string
/** Already earned: shows copy.wayDone instead of the button. */
done?: boolean
}
export type ConfirmationHero3Copy = {
/** '{name}' is the visitor's first name, '{prize}' the highlighted prize name. */
headline: string
/** '{prize}' is the highlighted prize name. */
headlineNoName: string
/** '{name}' is the visitor's first name. */
headlineNoPrize: string
headlineBare: string
status: string
entryOne: string
entryMany: string
scoreNote: string
drawTitle: string
shareTitle: string
shareFieldLabel: string
sharePlaceholder: string
shareUnit: string
copy: string
copied: string
copySelected: string
copiedAnnounce: string
copyFailedAnnounce: string
share: string
/** '{prize}' is the prize name. Used as the native share text. */
shareText: string
shareTextNoPrize: string
wayUnit: string
wayAction: string
wayDone: string
rules: string
}
export type ConfirmationHero3Props = {
/** The entrant's name from the entry form. */
name?: string
/** Replaces the generated headline. */
headline?: React.ReactNode
copy?: Partial<ConfirmationHero3Copy>
/** The visitor's supplied entry count. */
entries?: number
prize?: GiveawayPrize
/** Prize photo (slot: product). */
prizeImage?: string
prizeImageAlt?: string
draw?: GiveawayDraw
share?: GiveawayShare
/** Further ways to earn bonus entries, in order. */
ways?: BonusWay[]
/** Official rules page. Always shown. */
rulesHref?: string
/** One short line beside the rules link, e.g. eligibility. */
rulesNote?: React.ReactNode
/** Called after a copy attempt with the link. */
onCopy?: (link: string) => void
/** Share handler. Without one the device's share sheet opens, else the link is copied. */
onShare?: (link: string) => void
/** Called when a bonus way's button is clicked. */
onWay?: (id: string) => void
/** Studio preview: 'success' shows the button's Copied state. */
state?: ConfirmationHero3State
className?: string
}
type CopyStatus = 'ok' | 'fail' | null
export function ConfirmationHero3({
name,
headline,
copy,
entries = 1,
prize,
prizeImage,
prizeImageAlt,
draw,
share,
ways = [],
rulesHref = '#official-rules',
rulesNote,
onCopy,
onShare,
onWay,
state = 'default',
className,
}: ConfirmationHero3Props) {
const t = { ...DEFAULT_COPY, ...copy }
const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, '')
const titleId = `cfch3-title-${uid}`
const fieldId = `cfch3-link-${uid}`
const [copied, setCopied] = React.useState<CopyStatus>(null)
const [announce, setAnnounce] = React.useState('')
const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null)
const fieldRef = React.useRef<HTMLInputElement>(null)
const copyRef = React.useRef<HTMLButtonElement>(null)
React.useEffect(
() => () => {
if (timer.current) clearTimeout(timer.current)
},
[],
)
const disabled = state === 'disabled'
const shown: CopyStatus = state === 'success' ? 'ok' : copied
const first = (name ?? '').trim().split(' ').filter(Boolean)[0] ?? ''
const prizeName = (prize?.name ?? '').trim()
const hasPrize = Boolean(prize && (prizeName || prizeImage))
const link = share?.link ?? ''
const list = ways
const has = { prize: hasPrize, date: Boolean(draw), ways: list.length > 0, share: Boolean(share) }
const tpl = prizeName ? (first ? t.headline : t.headlineNoName) : first ? t.headlineNoPrize : t.headlineBare
const unit = entries === 1 ? t.entryOne : t.entryMany
const chars = String(entries).split('')
async function copyLink() {
if (disabled || !link) return
let ok = false
try {
if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {
await navigator.clipboard.writeText(link)
ok = true
}
} catch {
ok = false
}
if (!ok) {
const el = fieldRef.current
if (el) {
el.focus()
el.select()
try {
ok = document.execCommand('copy')
} catch {
ok = false
}
if (ok) copyRef.current?.focus()
}
}
setCopied(ok ? 'ok' : 'fail')
setAnnounce(ok ? t.copiedAnnounce : t.copyFailedAnnounce)
onCopy?.(link)
if (timer.current) clearTimeout(timer.current)
timer.current = setTimeout(() => setCopied(null), 2200)
}
async function shareLink() {
if (disabled || !link) return
if (onShare) {
onShare(link)
return
}
if (typeof navigator !== 'undefined' && typeof navigator.share === 'function') {
try {
const text = prizeName ? t.shareText.split('{prize}').join(prizeName) : t.shareTextNoPrize
await navigator.share({ url: link, text })
return
} catch (error) {
if ((error as { name?: string })?.name === 'AbortError') return
}
}
void copyLink()
}
const boardVars = {
['--cfch3-lg' as string]: areas(3, has),
['--cfch3-md' as string]: areas(2, has),
['--cfch3-sm' as string]: areas(1, has),
} as React.CSSProperties
return (
<section className={cx('cf-confirmation-hero-3', className)} aria-labelledby={titleId} style={FX_HOST}>
<style>{CSS}</style>
<Pattern name='grid' fade='edges' />
<div className='cfch3-shell'>
<div className='cfch3-board' style={boardVars}>
<div className='cfch3-tile cfch3-light cfch3-entry cfch3-in' style={delay(0)}>
<p className='cfch3-status'>
<span className='cfch3-badge' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
{t.status}
</p>
<h1 id={titleId} className='cfch3-h1'>
{headline ?? renderHeadline(tpl, first, prizeName)}
</h1>
<div className='cfch3-scorebox'>
<p className='cfch3-score'>
<span className='cfch3-sr'>{`${entries} ${unit}`}</span>
<span className='cfch3-digits' aria-hidden='true'>
{chars.map((ch, i) =>
/[0-9]/.test(ch) ? (
<span key={i} className='cfch3-digit'>
{ch}
</span>
) : (
<span key={i} className='cfch3-sep'>
{ch}
</span>
),
)}
</span>
<span className='cfch3-unit' aria-hidden='true'>
{unit}
</span>
</p>
{(has.share || has.ways) && t.scoreNote && <p className='cfch3-note'>{t.scoreNote}</p>}
</div>
</div>
{share && (
<div className='cfch3-tile cfch3-light cfch3-share cfch3-in' style={delay(1)}>
<div className='cfch3-share-head'>
<div className='cfch3-share-copy'>
<span className='cfch3-disc' aria-hidden='true'>
<Link2 size={20} strokeWidth={2.5} />
</span>
<h2 className='cfch3-title'>{share.title ?? t.shareTitle}</h2>
{share.detail && <p className='cfch3-muted'>{share.detail}</p>}
</div>
{share.entries !== undefined && share.entries !== '' && (
<p className='cfch3-share-num'>
<span className='cfch3-num'>{plus(share.entries)}</span>
<span className='cfch3-unit-s'>{share.unit ?? t.shareUnit}</span>
</p>
)}
</div>
<div className='cfch3-linkbox'>
<label className='cfch3-label' htmlFor={fieldId}>
{share.fieldLabel ?? t.shareFieldLabel}
</label>
<input
ref={fieldRef}
id={fieldId}
className='cfch3-field'
type='url'
readOnly
value={link}
placeholder={share.placeholder ?? t.sharePlaceholder}
onFocus={(event) => event.currentTarget.select()}
disabled={disabled}
/>
<div className='cfch3-actions'>
<button
ref={copyRef}
type='button'
className={cx(
'cfch3-copy',
shown && 'is-copied',
state === 'hover' && 'is-hover',
state === 'active' && 'is-active',
)}
disabled={disabled}
onClick={() => void copyLink()}
>
<span className='cfch3-swap'>
<span className='cfch3-swap-a'>
<Copy size={20} strokeWidth={2.5} aria-hidden='true' />
{t.copy}
</span>
<span className='cfch3-swap-b'>
{shown === 'fail' ? (
<Copy size={20} strokeWidth={2.5} aria-hidden='true' />
) : (
<Check size={20} strokeWidth={3} aria-hidden='true' />
)}
{shown === 'fail' ? t.copySelected : t.copied}
</span>
</span>
</button>
<button
type='button'
className={cx('cfch3-btn2', state === 'hover' && 'is-hover', state === 'active' && 'is-active')}
disabled={disabled}
onClick={() => void shareLink()}
>
<Share2 size={20} strokeWidth={2.5} aria-hidden='true' />
{t.share}
</button>
</div>
{share.note && <p className='cfch3-quiet'>{share.note}</p>}
<span className='cfch3-sr' aria-live='polite'>
{announce}
</span>
</div>
</div>
)}
{hasPrize && prize && (
<figure className='cfch3-tile cfch3-dark cfch3-prize cfch3-in' style={delay(2)}>
{prizeImage && (
<div className='cfch3-photo'>
<img src={prizeImage} alt={prizeImageAlt ?? prizeName} width={1200} height={750} decoding='async' />
</div>
)}
<figcaption className='cfch3-prize-copy'>
{prizeName && <h2 className='cfch3-title'>{prizeName}</h2>}
{(prize.value || prize.valueNote) && (
<p className='cfch3-value'>
{prize.value && <strong>{prize.value}</strong>}
{prize.value && prize.valueNote ? ' ' : null}
{prize.valueNote && <span>{prize.valueNote}</span>}
</p>
)}
</figcaption>
</figure>
)}
{draw && (
<div className='cfch3-tile cfch3-dark cfch3-date cfch3-in' style={delay(3)}>
<span className='cfch3-disc' aria-hidden='true'>
<CalendarDays size={20} strokeWidth={2.5} />
</span>
<h2 className='cfch3-title'>{draw.title ?? t.drawTitle}</h2>
<p className='cfch3-num cfch3-date-num'>{draw.date}</p>
{draw.detail && <p className='cfch3-soft'>{draw.detail}</p>}
</div>
)}
{list.length > 0 && (
<ul className={cx('cfch3-ways', !share && 'is-wide')}>
{list.map((way, i) => {
const Icon = WAY_ICONS[way.kind ?? 'other']
const label = way.actionLabel ?? t.wayAction
return (
<li key={way.id} className='cfch3-tile cfch3-dark cfch3-way cfch3-in' style={delay(4 + i)}>
<div className='cfch3-way-top'>
<span className='cfch3-disc' aria-hidden='true'>
<Icon size={20} strokeWidth={2.5} />
</span>
<p className='cfch3-way-num'>
<span className='cfch3-num'>{plus(way.entries)}</span>
<span className='cfch3-unit-s'>{way.unit ?? t.wayUnit}</span>
</p>
</div>
<h2 className='cfch3-title'>{way.title}</h2>
{way.detail && <p className='cfch3-soft'>{way.detail}</p>}
<div className='cfch3-way-act'>
{way.done ? (
<p className='cfch3-earned'>
<span className='cfch3-badge' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
{t.wayDone}
</p>
) : way.href ? (
<a
className='cfch3-btn2'
href={disabled ? undefined : way.href}
role={disabled ? 'link' : undefined}
aria-disabled={disabled || undefined}
onClick={(event) => {
if (disabled) {
event.preventDefault()
return
}
onWay?.(way.id)
}}
>
{label}
</a>
) : (
<button type='button' className='cfch3-btn2' disabled={disabled} onClick={() => onWay?.(way.id)}>
{label}
</button>
)}
</div>
</li>
)
})}
</ul>
)}
</div>
<p className='cfch3-rules'>
<a href={rulesHref}>
<FileText size={16} strokeWidth={2.5} aria-hidden='true' />
{t.rules}
</a>
{rulesNote && <span className='cfch3-rules-note'>{rulesNote}</span>}
</p>
</div>
</section>
)
}
export default ConfirmationHero3
const DEFAULT_COPY: ConfirmationHero3Copy = {
headline: '{name}, you’re in the draw for the {prize}',
headlineNoName: 'You’re in the draw for the {prize}',
headlineNoPrize: '{name}, you’re in the draw',
headlineBare: 'You’re in the draw',
status: 'Your entry is confirmed',
entryOne: 'entry in the draw',
entryMany: 'entries in the draw',
scoreNote: 'Every way below adds to this count.',
drawTitle: 'We draw the winner on',
shareTitle: 'Share your link and add to your count',
shareFieldLabel: 'Your personal entry link',
sharePlaceholder: 'https://example.com/enter?ref=YOURCODE',
shareUnit: 'entries',
copy: 'Copy my link',
copied: 'Copied',
copySelected: 'Link selected',
copiedAnnounce: 'Your entry link is copied.',
copyFailedAnnounce: 'Your entry link is selected. Copy it with your keyboard.',
share: 'Share',
shareText: 'I just entered to win the {prize}. Enter through my link:',
shareTextNoPrize: 'I just entered this giveaway. Enter through my link:',
wayUnit: 'entries',
wayAction: 'Earn these entries',
wayDone: 'Added to your count',
rules: 'Read the official rules',
}
const WAY_ICONS = { follow: Heart, refer: Users, subscribe: Mail, share: Link2, other: Gift } as const
type Has = { prize: boolean; date: boolean; ways: boolean; share: boolean }
function areas(cols: 1 | 2 | 3, has: Has): string {
const rows: string[][] = []
const side = [has.prize ? 'prize' : '', has.date ? 'date' : ''].filter(Boolean)
if (cols === 3) {
if (!side.length) rows.push(['entry', 'entry', 'entry'])
side.forEach((s) => rows.push(['entry', 'entry', s]))
if (has.ways && has.share) rows.push(['ways', 'share', 'share'])
else if (has.share) rows.push(['share', 'share', 'share'])
else if (has.ways) rows.push(['ways', 'ways', 'ways'])
} else if (cols === 2) {
rows.push(['entry', 'entry'])
if (side.length === 2) rows.push(['prize', 'date'])
else if (side.length === 1) rows.push([side[0], side[0]])
if (has.share) rows.push(['share', 'share'])
if (has.ways) rows.push(['ways', 'ways'])
} else {
rows.push(['entry'])
if (has.share) rows.push(['share'])
side.forEach((s) => rows.push([s]))
if (has.ways) rows.push(['ways'])
}
return rows.map((r) => `"${r.join(' ')}"`).join(' ')
}
function renderHeadline(tpl: string, first: string, prize: string): React.ReactNode {
const parts = tpl.split('{prize}')
return parts.map((part, i) => (
<React.Fragment key={i}>
{part.split('{name}').join(first)}
{i < parts.length - 1 && <mark className='cfch3-mark'>{prize}</mark>}
</React.Fragment>
))
}
function plus(value: number | string): string {
return typeof value === 'number' ? `+${value}` : value
}
function delay(i: number): React.CSSProperties {
return { ['--cfch3-d' as string]: `${Math.min(i * 0.07, 0.28)}s` } as React.CSSProperties
}
function cx(...names: Array<string | false | null | undefined>) {
return names.filter(Boolean).join(' ')
}
const SHADOW_SM =
'0 1px 1px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .18), 0 1px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .14)'
const SHADOW_MD =
'0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22), 0 4px 10px -2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .2)'
const SHADOW_LG =
'0 2px 4px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22), 0 12px 24px -8px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32)'
const SOFT = 'color-mix(in oklch, var(--band-ink) 80%, var(--band))'
const R = '.cf-confirmation-hero-3'
const CSS = `
${R}{position:relative;isolation:isolate;overflow:hidden;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :is(h1,h2,p,ul,figure){margin:0}
${R} .cfch3-shell{position:relative;z-index:1;max-width:1120px;margin-inline:auto}
${R} .cfch3-board{display:grid;gap:16px;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:var(--cfch3-lg)}
${R} .cfch3-entry{grid-area:entry}
${R} .cfch3-share{grid-area:share}
${R} .cfch3-prize{grid-area:prize}
${R} .cfch3-date{grid-area:date}
${R} .cfch3-ways{grid-area:ways;display:grid;gap:16px;grid-template-columns:minmax(0,1fr);list-style:none;padding:0}
${R} .cfch3-ways.is-wide{grid-template-columns:repeat(auto-fit,minmax(16rem,1fr))}
${R} .cfch3-tile{position:relative;min-width:0;display:flex;flex-direction:column;padding:clamp(20px,3vw,32px);border-radius:var(--card-radius,var(--radius,14px))}
${R} .cfch3-light{background:var(--card);color:var(--ink);border:1px solid var(--card-border,color-mix(in oklch,var(--ink) 12%,transparent));box-shadow:var(--card-shadow,var(--shadow-md,${SHADOW_MD}))}
${R} .cfch3-share.cfch3-light{border-color:color-mix(in oklch,var(--accent) 45%,var(--card));box-shadow:var(--shadow-lg,${SHADOW_LG})}
${R} .cfch3-dark{background:color-mix(in oklch,var(--band-ink) 7%,var(--band));color:var(--band-ink);border:1px solid oklch(from var(--band-ink) l c h / .14);box-shadow:inset 0 1px 0 oklch(from var(--band-ink) l c h / .08),var(--shadow-md,${SHADOW_MD})}
${R} .cfch3-status{font-size:.9375rem;line-height:1.4;font-weight:700;color:var(--ink);text-wrap:pretty}
${R} .cfch3-badge{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:999px;background:var(--success);color:var(--cfch3-badge-ink,#fff);vertical-align:middle;margin-inline-end:.5em}
${R} .cfch3-h1{margin-top:16px;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(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--ink)}
${R} .cfch3-mark{color:var(--marker-ink,oklch(0.2 0.03 260));background:linear-gradient(176deg,transparent 10%,var(--marker,#fae37c) 10%,var(--marker,#fae37c) 92%,transparent 92%);padding:0 .14em;margin:0 -.04em;border-radius:.2em .5em .3em .45em / .4em .3em .5em .35em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .cfch3-scorebox{margin-top:auto;padding-top:32px}
${R} .cfch3-score{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 16px}
${R} .cfch3-digits{display:flex;gap:8px;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(4.5rem,9vw,7.5rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--accent)}
${R} .cfch3-digit{position:relative;display:inline-grid;place-items:center;min-width:.8em;height:1.14em;padding:0 .1em;border-radius:10px;background:linear-gradient(color-mix(in oklch,var(--ink) 8%,var(--card)) 50%,color-mix(in oklch,var(--ink) 4%,var(--card)) 50%);box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .06)}
${R} .cfch3-digit::after{content:"";position:absolute;left:0;right:0;top:calc(50% - 1px);height:2px;background:var(--card)}
${R} .cfch3-sep{align-self:flex-end;padding-bottom:.08em}
${R} .cfch3-unit{padding-bottom:.35em;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;color:var(--ink)}
${R} .cfch3-note{margin-top:16px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .cfch3-title{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-wrap:balance}
${R} .cfch3-num{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1.1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
${R} .cfch3-soft{margin-top:12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:${SOFT};text-wrap:pretty}
${R} .cfch3-muted{margin-top:12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .cfch3-disc{display:inline-grid;place-items:center;flex:none;width:40px;height:40px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
${R} .cfch3-unit-s{font-size:.9375rem;line-height:1.4;font-weight:700;color:${SOFT}}
${R} .cfch3-photo{aspect-ratio:16/10;border-radius:12px;overflow:hidden;background:color-mix(in oklch,var(--band-ink) 10%,var(--band))}
${R} .cfch3-photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 60%}
${R} .cfch3-prize-copy{margin-top:16px}
${R} .cfch3-value{margin-top:8px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:${SOFT};text-wrap:pretty}
${R} .cfch3-value strong{color:var(--band-ink);font-weight:800}
${R} .cfch3-date .cfch3-title{margin-top:16px}
${R} .cfch3-date-num{margin-top:calc(12px + .4em);color:var(--band-ink);text-wrap:balance}
${R} .cfch3-date-num + .cfch3-soft{margin-top:16px}
${R} .cfch3-way-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
${R} .cfch3-way-num{display:flex;align-items:baseline;gap:8px;color:var(--band-ink)}
${R} .cfch3-way-num .cfch3-num{margin-bottom:.4em}
${R} .cfch3-way-act{margin-top:auto;padding-top:24px}
${R} .cfch3-earned{font-size:.9375rem;line-height:1.4;font-weight:700;color:var(--band-ink)}
${R} .cfch3-share-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
${R} .cfch3-share-copy{min-width:0}
${R} .cfch3-share-copy .cfch3-title{margin-top:16px}
${R} .cfch3-share-num{display:flex;flex:none;flex-direction:column;align-items:flex-end;gap:12px;text-align:right;color:var(--accent)}
${R} .cfch3-share-num .cfch3-unit-s{color:var(--muted)}
${R} .cfch3-share-num .cfch3-num{margin-bottom:.4em}
${R} .cfch3-linkbox{margin-top:auto;padding-top:24px}
${R} .cfch3-label{display:block;margin-bottom:8px;font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
${R} .cfch3-field{display:block;width:100%;min-height:56px;padding:0 16px;font-family:var(--font-body);font-size:1.0625rem;font-weight:600;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));text-overflow:ellipsis;outline:none;transition:border-color .16s ease,box-shadow .16s ease}
${R} .cfch3-field::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .cfch3-field:focus{border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
${R} .cfch3-field:disabled{cursor:not-allowed}
${R} .cfch3-actions{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:12px;margin-top:12px}
${R} .cfch3-quiet{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .cfch3-copy{--cfch3-b:var(--button-bg,var(--cta));--cfch3-b2:var(--button-bg-2,var(--cta-2));display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:64px;padding:0 28px;border:0;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;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);cursor:pointer;background:linear-gradient(oklch(from var(--cfch3-b) calc(l + .04) c h),oklch(from var(--cfch3-b2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--cfch3-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--cfch3-b) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45));transition:background .16s ease,box-shadow .16s ease,transform .16s ease}
${R} .cfch3-copy:hover:not(:disabled),${R} .cfch3-copy.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--cfch3-b) calc(l - .01) c h),oklch(from var(--cfch3-b2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--cfch3-b) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--cfch3-b) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32),0 10px 20px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .55)}
${R} .cfch3-copy:active:not(:disabled),${R} .cfch3-copy.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--cfch3-b) calc(l - .05) c h),oklch(from var(--cfch3-b2) calc(l - .09) c h));box-shadow:inset 0 2px 4px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .35),inset 0 -2px 0 oklch(from var(--cfch3-b) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3)}
${R} .cfch3-copy:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .6);outline-offset:3px}
${R} .cfch3-copy:disabled{cursor:not-allowed;background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:none}
${R} .cfch3-swap{display:grid}
${R} .cfch3-swap>span{grid-area:1/1;display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}
${R} .cfch3-swap-b{visibility:hidden}
${R} .cfch3-copy.is-copied .cfch3-swap-a{visibility:hidden}
${R} .cfch3-copy.is-copied .cfch3-swap-b{visibility:visible}
${R} .cfch3-copy.is-copied .cfch3-swap-b svg{animation:cfch3-pop .3s cubic-bezier(.2,.7,.2,1) both}
${R} .cfch3-btn2{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:64px;padding:0 24px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));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;text-align:center;text-decoration:none;cursor:pointer;box-shadow:var(--button-2-shadow,var(--shadow-sm,${SHADOW_SM}));transition:background .16s ease,box-shadow .16s ease,transform .16s ease}
${R} .cfch3-way .cfch3-btn2{min-height:56px}
${R} .cfch3-btn2:hover:not(:disabled):not([aria-disabled]),${R} .cfch3-btn2.is-hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h)}
${R} .cfch3-btn2:active:not(:disabled):not([aria-disabled]),${R} .cfch3-btn2.is-active:not(:disabled){transform:translateY(1px);background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .08) c h);box-shadow:inset 0 2px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22)}
${R} .cfch3-dark .cfch3-btn2{background:var(--secondary);color:var(--secondary-ink)}
${R} .cfch3-dark .cfch3-btn2:hover:not(:disabled):not([aria-disabled]){background:oklch(from var(--secondary) calc(l - .04) c h)}
${R} .cfch3-dark .cfch3-btn2:active:not(:disabled):not([aria-disabled]){background:oklch(from var(--secondary) calc(l - .08) c h)}
${R} .cfch3-btn2:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .6);outline-offset:3px}
${R} .cfch3-dark .cfch3-btn2:focus-visible{outline-color:oklch(from var(--band-ink) l c h / .85)}
${R} .cfch3-btn2:disabled,${R} .cfch3-btn2[aria-disabled]{cursor:not-allowed;box-shadow:none;border-color:oklch(from var(--button-2-ink,var(--secondary-ink)) l c h / .2)}
${R} .cfch3-rules{margin-top:24px;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:${SOFT};text-wrap:pretty}
${R} .cfch3-rules a{color:var(--band-ink);font-weight:700;text-decoration:underline;text-decoration-color:oklch(from var(--band-ink) l c h / .5);text-underline-offset:.18em;border-radius:4px}
${R} .cfch3-rules a svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
${R} .cfch3-rules a:hover{text-decoration-color:var(--band-ink)}
${R} .cfch3-rules a:focus-visible{outline:3px solid oklch(from var(--band-ink) l c h / .85);outline-offset:3px}
${R} .cfch3-rules-note{margin-inline-start:.6em}
${R} .cfch3-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 cfch3-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes cfch3-pop{from{transform:scale(.9)}}
${R} .cfch3-in{animation:cfch3-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--cfch3-d,0s)}
@media (max-width:64rem){
${R} .cfch3-board{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--cfch3-md)}
${R} .cfch3-ways{grid-template-columns:repeat(auto-fit,minmax(16rem,1fr))}
}
@media (max-width:40rem){
${R} .cfch3-board{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--cfch3-sm);gap:12px}
${R} .cfch3-ways,${R} .cfch3-ways.is-wide{grid-template-columns:minmax(0,1fr);gap:12px}
${R} .cfch3-actions{grid-template-columns:minmax(0,1fr)}
${R} .cfch3-share .cfch3-btn2{min-height:56px}
}
@media (prefers-reduced-motion:reduce){
${R} .cfch3-in,${R} .cfch3-copy.is-copied .cfch3-swap-b svg{animation:none}
${R} .cfch3-copy,${R} .cfch3-btn2,${R} .cfch3-field{transition:none}
${R} .cfch3-copy:active:not(:disabled),${R} .cfch3-copy.is-active:not(:disabled),${R} .cfch3-btn2:active:not(:disabled):not([aria-disabled]),${R} .cfch3-btn2.is-active:not(:disabled){transform:none}
}
`
pieces/hero/confirmation-hero-3/specimen.tsx 65 lines
import __studioImage97a454ec from "../assets/599718b3768b05fb.webp";
// Specimen: Basecamp Supply Co. spring camping giveaway, the entry scoreboard a visitor sees right after entering.
import { ConfirmationHero3, type ConfirmationHero3State } from '../confirmation-hero-3'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'success']
const LINK = 'https://basecampsupply.example/spring?ref=MAYA7Q2'
const REFER = `mailto:?subject=${encodeURIComponent('Enter the Basecamp spring giveaway')}&body=${encodeURIComponent(`I just entered to win the Spring Basecamp Kit. Enter here: ${LINK}`)}`
export default function ConfirmationHero3Specimen({ state }: { state?: ConfirmationHero3State }) {
return (
<ConfirmationHero3
state={state}
name='Maya'
entries={1}
prize={{
name: 'Spring Basecamp Kit',
value: 'A $640 camp setup.',
valueNote: 'Everything two people need for their first night out.',
}}
prizeImage={slot(
'product',
__studioImage97a454ec,
)}
prizeImageAlt='The Spring Basecamp Kit: a sage two-person tent, two sleeping bags, a brass lantern and a camp stove'
draw={{
title: 'We draw the winner on',
date: 'May 15',
detail: 'Friday at noon PT. The winner hears from us by email that same day.',
}}
share={{
title: 'Share your link with your camping crew',
detail: 'Post it once, anywhere, and we add these to your count.',
entries: 5,
link: LINK,
note: 'or paste it into the group chat for your next trip.',
}}
ways={[
{
id: 'refer',
kind: 'refer',
title: 'Refer a camping buddy',
detail: 'Each friend who enters through your link adds 10 more.',
entries: 10,
unit: 'each',
actionLabel: 'Email a friend',
href: REFER,
},
{
id: 'follow',
kind: 'follow',
title: 'Follow @basecampsupply',
detail: 'Watch the kit get packed before the draw.',
entries: 3,
unit: 'entries',
actionLabel: 'Follow us',
href: '#follow',
},
]}
rulesHref='#official-rules'
rulesNote='No purchase necessary. Open to US residents 18 and over.'
/>
)
}
| Name | Type | Details |
|---|---|---|
name OptionalConfirmationHero3 |
string |
|
headline OptionalConfirmationHero3 |
React.ReactNode |
|
copy OptionalConfirmationHero3 |
Partial<ConfirmationHero3Copy> |
|
entries OptionalConfirmationHero3 |
number |
Default 1
|
prize OptionalConfirmationHero3 |
GiveawayPrize |
|
prizeImage OptionalConfirmationHero3 |
string |
|
prizeImageAlt OptionalConfirmationHero3 |
string |
|
draw OptionalConfirmationHero3 |
GiveawayDraw |
|
share OptionalConfirmationHero3 |
GiveawayShare |
|
ways OptionalConfirmationHero3 |
BonusWay[] |
Default []
|
rulesHref OptionalConfirmationHero3 |
string |
Default '#official-rules'
|
rulesNote OptionalConfirmationHero3 |
React.ReactNode |
|
onCopy OptionalConfirmationHero3 |
(link: string) => void |
|
onShare OptionalConfirmationHero3 |
(link: string) => void |
|
onWay OptionalConfirmationHero3 |
(id: string) => void |
|
state OptionalConfirmationHero3 |
ConfirmationHero3State |
Default 'default'
|
className OptionalConfirmationHero3 |
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-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
599718b3768b05fb.webp
image/webp · 138 KB