Webinar Room 5
The giving room: sits under a nonprofit briefing's real video and turns the ask into a tangible impact choice. An outcome photo on a colour block, a donation card breaking its edge, and an impact line that rewrites with every amount.
Use it in a prompt
Use hero/webinar-room-5 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/webinar-room-5.tsx. - Import it and pass your copy and images (Props tab):
import { WebinarRoom5 } from "@/components/funneldna/hero/webinar-room-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/webinar-room-5/component.tsx 589 lines
// layout: photo-overlap-card
// The giving room: sits under a nonprofit briefing's real video and turns the ask into a tangible impact choice. An outcome photo on a colour block, a donation card breaking its edge, and an impact line that rewrites with every amount.
'use client'
import * as React from 'react'
import { AlertCircle, Check, Clock3, Loader2, Lock } from 'lucide-react'
export type WebinarRoom5Amount = {
amount: number
/** What this gift does, from supplied copy. {amount} becomes the formatted amount. */
impact: string
/** Short line under the amount on its tile. */
tag?: string
}
export type WebinarRoom5Gift = {
amount: number
/** The amount as shown, e.g. "$40". */
display: string
/** true when the visitor typed their own amount. */
custom: boolean
/** Index in amounts when a tile was chosen. */
index?: number
}
export type WebinarRoom5State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type WebinarRoom5Copy = {
/** Accessible name of the amount group. */
amountsLegend?: string
otherLabel?: string
otherPlaceholder?: string
/** Impact line before any amount is chosen. */
impactPrompt?: string
/** Impact line while the own-amount field is chosen but not yet valid. */
otherPrompt?: string
/** Impact line for a typed amount. Replaces {amount}. */
otherImpact?: string
errorEmpty?: string
errorInvalid?: string
/** Replaces {min}. */
errorMin?: string
/** Replaces {max}. */
errorMax?: string
/** Button label once an amount is chosen. Replaces {amount} and {charity}. */
label?: string
/** Shorter label for narrow cards and phones. Replaces {amount} and {charity}. */
labelShort?: string
/** Disabled button label before an amount is chosen. */
idleLabel?: string
loadingText?: string
submitError?: string
/** Announced when askOpen turns on. */
openedMessage?: string
}
export type WebinarRoom5Props = {
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string
lead?: string
/** scene slot: a photo of the outcome the gift creates. */
sceneImage?: string
sceneAlt?: string
/** CSS object-position for the scene photo; keep the subject clear of the card. */
sceneFocus?: string
/** An italic aside in the presenter's own words, shown on the colour block. */
aside?: string
asideBy?: string
/** false before the briefing's ask moment: the card shows the calm wait line instead of the amounts. */
askOpen?: boolean
waitTitle?: string
waitText?: string
panelTitle?: string
panelHint?: string
/** Three to five supplied amounts with their impact copy. */
amounts?: WebinarRoom5Amount[]
/** Index of the amount chosen at first; -1 for none. */
defaultAmount?: number
currency?: string
locale?: string
/** Smallest own amount accepted. */
minOther?: number
/** Largest own amount accepted, if any. */
maxOther?: number
/** Replaces {charity} in the button labels. */
charityName?: string
/** One reassurance line under the button. */
reassurance?: string
/** Called with the validated gift. A returned promise shows loadingText; a rejection shows submitError. */
onSubmit?: (gift: WebinarRoom5Gift) => void | Promise<void>
state?: WebinarRoom5State
copy?: WebinarRoom5Copy
id?: string
className?: string
}
type Choice = number | 'other' | null
export function WebinarRoom5({
headline = 'Turn what you just heard into real help',
highlight = 'real help',
lead = 'Choose the part of the work you’ll fund, and see exactly what your gift does before you give.',
sceneImage,
sceneAlt = '',
sceneFocus = '35% 50%',
aside,
asideBy,
askOpen = true,
waitTitle = 'Stay to the end to hear how you can help',
waitText,
panelTitle = 'Choose what your gift does',
panelHint = 'Tap an amount to see where it goes.',
amounts = DEFAULT_AMOUNTS,
defaultAmount = -1,
currency = '$',
locale = 'en-US',
minOther = 5,
maxOther,
charityName = '',
reassurance,
onSubmit,
state = 'default',
copy,
id,
className,
}: WebinarRoom5Props) {
const c = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const headingId = uid + '-h'
const titleId = uid + '-t'
const otherId = uid + '-o'
const errId = uid + '-e'
const count = amounts.length
const errorSample = String(Math.max(0, Math.floor(minOther) - 1))
const initialChoice = (s: WebinarRoom5State): Choice =>
s === 'disabled' ? null : s === 'error' ? 'other' : defaultAmount >= 0 && defaultAmount < count ? defaultAmount : null
const [sel, setSel] = React.useState<Choice>(() => initialChoice(state))
const [other, setOther] = React.useState(() => (state === 'error' ? errorSample : ''))
const [touched, setTouched] = React.useState(state === 'error')
const [busy, setBusy] = React.useState(false)
const [failed, setFailed] = React.useState(false)
const [announce, setAnnounce] = React.useState('')
const otherRef = React.useRef<HTMLInputElement | null>(null)
const mounted = React.useRef(true)
const wasOpen = React.useRef(askOpen)
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
React.useEffect(() => {
setSel(initialChoice(state))
setOther(state === 'error' ? errorSample : '')
setTouched(state === 'error')
setBusy(false)
setFailed(false)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state, defaultAmount, count, errorSample])
React.useEffect(() => {
if (askOpen && !wasOpen.current) setAnnounce(c.openedMessage)
wasOpen.current = askOpen
}, [askOpen, c.openedMessage])
const fmt = (n: number) =>
currency + n.toLocaleString(locale, { minimumFractionDigits: Number.isInteger(n) ? 0 : 2, maximumFractionDigits: 2 })
const check = checkAmount(other, currency, minOther, maxOther)
let gift: WebinarRoom5Gift | null = null
if (sel === 'other') {
if (check.value !== null) gift = { amount: check.value, display: fmt(check.value), custom: true }
} else if (sel !== null && amounts[sel]) {
gift = { amount: amounts[sel].amount, display: fmt(amounts[sel].amount), custom: false, index: sel }
}
const showError = sel === 'other' && touched && check.error !== null
const errorText =
check.error === 'empty'
? c.errorEmpty
: check.error === 'invalid'
? c.errorInvalid
: check.error === 'min'
? fill(c.errorMin, { min: fmt(minOther) })
: check.error === 'max'
? fill(c.errorMax, { max: fmt(maxOther ?? 0) })
: ''
const top = Math.max(1, ...amounts.map((a) => a.amount))
const level = gift ? Math.min(1, Math.max(0.14, gift.amount / top)) : 0.08
const impactKey = sel === null ? 'none' : sel === 'other' ? (gift ? 'other' : 'other-empty') : 'tile-' + sel
const impact = gift
? renderAmount(gift.custom ? c.otherImpact : amounts[gift.index ?? 0].impact, gift.display)
: sel === 'other'
? c.otherPrompt
: c.impactPrompt
const forceTile = state === 'hover' || state === 'active' ? amounts.findIndex((_, i) => i !== sel) : -1
const tileForce = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-press' : ''
const btnForce = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : ''
const choose = (i: number) => {
setSel(i)
setTouched(false)
setFailed(false)
}
const submit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (busy) return
if (!gift) {
if (sel === 'other') {
setTouched(true)
otherRef.current?.focus()
}
return
}
if (!onSubmit) return
setFailed(false)
let result: void | Promise<void>
try {
result = onSubmit(gift)
} catch {
setFailed(true)
return
}
if (result && typeof (result as Promise<void>).then === 'function') {
setBusy(true)
;(result as Promise<void>).then(
() => {
if (mounted.current) setBusy(false)
},
() => {
if (mounted.current) {
setBusy(false)
setFailed(true)
}
},
)
}
}
const labelValues = { amount: gift ? gift.display : '', charity: charityName }
return (
<section id={id} aria-labelledby={headingId} className={['cf-webinar-room-5', className].filter(Boolean).join(' ')}>
<style>{CSS}</style>
<div className='wr5-wrap'>
<header className='wr5-head'>
<h2 id={headingId} className='wr5-h'>
{withHighlight(headline, highlight)}
</h2>
{lead ? <p className='wr5-lead'>{lead}</p> : null}
</header>
<div className={'wr5-stage' + (sceneImage ? '' : ' no-scene')}>
<div className='wr5-visual'>
{sceneImage ? (
<img
className='wr5-photo'
src={sceneImage}
alt={sceneAlt}
width={1200}
height={825}
loading='lazy'
decoding='async'
style={{ objectPosition: sceneFocus }}
/>
) : null}
{aside ? (
<figure className='wr5-aside'>
<blockquote>
<p>{aside}</p>
</blockquote>
{asideBy ? <figcaption>{asideBy}</figcaption> : null}
</figure>
) : null}
</div>
<div className='wr5-card'>
<p className='wr5-sr' aria-live='polite'>
{announce}
</p>
<div key={askOpen ? 'ask' : 'wait'} className='wr5-card-in'>
{askOpen ? (
<form className='wr5-form' noValidate onSubmit={submit} aria-labelledby={titleId}>
<h3 id={titleId} className='wr5-title'>
{panelTitle}
</h3>
{panelHint ? <p className='wr5-hint'>{panelHint}</p> : null}
<fieldset className='wr5-set'>
<legend className='wr5-sr'>{c.amountsLegend}</legend>
<div className='wr5-tiles'>
{amounts.map((item, i) => {
const on = sel === i
return (
<label
key={i}
className={'wr5-tile' + (on ? ' is-on' : '') + (i === forceTile ? tileForce : '')}
>
<input
className='wr5-sr'
type='radio'
name={uid + '-amount'}
value={String(item.amount)}
checked={on}
onChange={() => choose(i)}
/>
<span className='wr5-amt'>{fmt(item.amount)}</span>
{item.tag ? <span className='wr5-tag'>{item.tag}</span> : null}
<span className='wr5-tick' aria-hidden='true'>
<Check size={14} strokeWidth={3} />
</span>
</label>
)
})}
</div>
</fieldset>
<div className={'wr5-other' + (sel === 'other' ? ' is-on' : '') + (showError ? ' is-error' : '')}>
<label htmlFor={otherId}>{c.otherLabel}</label>
<div className='wr5-money' style={{ '--wr5-pre': String(Math.max(1, currency.length)) } as React.CSSProperties}>
<span className='wr5-cur' aria-hidden='true'>
{currency}
</span>
<input
ref={otherRef}
id={otherId}
className='wr5-input'
type='text'
inputMode='decimal'
autoComplete='off'
placeholder={c.otherPlaceholder}
value={other}
aria-invalid={showError || undefined}
aria-describedby={showError ? errId : undefined}
onFocus={() => {
if (other.trim()) setSel('other')
}}
onChange={(event) => {
setOther(event.target.value)
setSel('other')
setFailed(false)
}}
onBlur={() => {
if (sel === 'other') setTouched(true)
}}
onKeyDown={(event) => {
if (event.key === 'Enter') setTouched(true)
}}
/>
</div>
{showError ? (
<p id={errId} className='wr5-err' role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{errorText}
</p>
) : null}
</div>
<div className='wr5-impact' style={{ '--wr5-lvl': String(level) } as React.CSSProperties}>
<span className='wr5-gauge' aria-hidden='true'>
<i />
</span>
<p className={'wr5-line' + (gift ? '' : ' is-prompt')} aria-live='polite'>
<span key={impactKey} className='wr5-swap'>
{impact}
</span>
</p>
</div>
<div className='wr5-give'>
<button type='submit' className={'wr5-btn' + btnForce} disabled={!gift} aria-busy={busy || undefined}>
{busy ? (
<>
<Loader2 className='wr5-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{c.loadingText}</span>
</>
) : gift ? (
<>
<span className='wr5-full'>{fill(c.label, labelValues)}</span>
<span className='wr5-short'>{fill(c.labelShort, labelValues)}</span>
</>
) : (
<span>{c.idleLabel}</span>
)}
</button>
{failed ? (
<p className='wr5-err' role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{c.submitError}
</p>
) : null}
</div>
{reassurance ? (
<p className='wr5-note'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
</form>
) : (
<div className='wr5-wait'>
<span className='wr5-disc' aria-hidden='true'>
<Clock3 size={20} strokeWidth={2.5} />
</span>
<h3 className='wr5-title'>{waitTitle}</h3>
{waitText ? <p className='wr5-hint'>{waitText}</p> : null}
</div>
)}
</div>
</div>
</div>
</div>
</section>
)
}
export default WebinarRoom5
const DEFAULT_AMOUNTS: WebinarRoom5Amount[] = [
{ amount: 25, impact: '{amount} goes straight to the work you just heard about.' },
{ amount: 50, impact: '{amount} goes straight to the work you just heard about.' },
{ amount: 100, impact: '{amount} goes straight to the work you just heard about.' },
{ amount: 250, impact: '{amount} goes straight to the work you just heard about.' },
]
const DEFAULT_COPY: Required<WebinarRoom5Copy> = {
amountsLegend: 'Choose an amount to give',
otherLabel: 'Or give your own amount',
otherPlaceholder: '25',
impactPrompt: 'Pick an amount to see exactly what it does.',
otherPrompt: 'Type an amount to see where it goes.',
otherImpact: '{amount} goes straight to the work you just heard about.',
errorEmpty: 'Enter the amount you’d like to give.',
errorInvalid: 'Use numbers only, like 25 or 25.50.',
errorMin: 'The smallest gift here is {min}.',
errorMax: 'For gifts over {max}, please get in touch with our team.',
label: 'Yes! I’ll give {amount} today',
labelShort: 'Yes! I’ll give {amount}',
idleLabel: 'Choose an amount to give',
loadingText: 'Opening secure donation…',
submitError: 'We couldn’t open the donation step. Please try again.',
openedMessage: 'The giving options are open.',
}
type AmountCheck = { value: number | null; error: 'empty' | 'invalid' | 'min' | 'max' | null }
function checkAmount(raw: string, currency: string, min: number, max?: number): AmountCheck {
const stripped = (currency ? raw.split(currency).join('') : raw).replace(/[\s,]/g, '')
if (!stripped) return { value: null, error: 'empty' }
if (!/^\d+(\.\d{1,2})?$/.test(stripped)) return { value: null, error: 'invalid' }
const value = Number(stripped)
if (value <= 0 || value < min) return { value: null, error: 'min' }
if (max !== undefined && value > max) return { value: null, error: 'max' }
return { value, error: null }
}
function fill(template: string, values: Record<string, string>): string {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? values[key] : match))
}
function renderAmount(template: string, display: string): React.ReactNode {
const parts = template.split('{amount}')
return parts.map((part, i) => (
<React.Fragment key={i}>
{part}
{i < parts.length - 1 ? <b>{display}</b> : null}
</React.Fragment>
))
}
function withHighlight(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='wr5-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
const CSS = `
.cf-webinar-room-5{--wr5-gut:clamp(16px,5vw,48px);--wr5-overlap:clamp(56px,8vw,120px);--wr5-pad:clamp(20px,3vw,32px);--wr5-sh:var(--shadow,oklch(0.22 0.03 260));--wr5-marker:oklch(from var(--marker,#fae37c) l c h / 1);position:relative;isolation:isolate;overflow-x:clip;padding-block:clamp(56px,8vw,112px) clamp(40px,5vw,64px);background:var(--surface,#fff);color:var(--ink,#101828);font-family:var(--font-body,system-ui,sans-serif)}
.cf-webinar-room-5 :where(*,*::before,*::after){box-sizing:border-box}
.cf-webinar-room-5 .wr5-wrap{width:min(1120px,100% - 2 * var(--wr5-gut));margin-inline:auto}
.cf-webinar-room-5 .wr5-head{max-width:46rem;margin-bottom:clamp(64px,7vw,96px);animation:wr5-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-webinar-room-5 .wr5-h{margin:0;font-family:var(--font-display,inherit);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--ink,#101828);text-wrap:balance}
.cf-webinar-room-5 .wr5-mark{padding:0 .1em;margin:0 -.03em;border-radius:.3em .12em .28em .1em;background:linear-gradient(transparent 30%,var(--wr5-marker) 30%,var(--wr5-marker) 92%,transparent 92%);color:inherit;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-webinar-room-5 .wr5-lead{margin:16px 0 0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted,#475467);text-wrap:pretty}
.cf-webinar-room-5 .wr5-stage{display:flex;align-items:flex-start}
.cf-webinar-room-5 .wr5-visual{position:relative;flex:1 1 auto;min-width:0;display:flex;flex-direction:column;padding-block:clamp(32px,4vw,56px);background-color:var(--band,#1d2b4f);color:var(--band-ink,#fff);border-image:linear-gradient(var(--band,#1d2b4f) 0 0) fill 0 / 0 / 0 100vmax}
.cf-webinar-room-5 .wr5-photo{display:block;width:100%;height:auto;aspect-ratio:16/11;object-fit:cover;border-radius:12px;background:oklch(from var(--band,#1d2b4f) calc(l + .06) c h)}
.cf-webinar-room-5 .wr5-aside{margin:24px 0 0;padding-inline-end:calc(var(--wr5-overlap) + 24px);color:var(--band-ink,#fff)}
.cf-webinar-room-5 .no-scene .wr5-aside{margin-top:0}
.cf-webinar-room-5 .wr5-aside blockquote{margin:0}
.cf-webinar-room-5 .wr5-aside p{margin:0;max-width:52ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;font-style:italic;text-wrap:pretty}
.cf-webinar-room-5 .wr5-aside figcaption{margin-top:8px;font-size:.9375rem;line-height:1.4;font-weight:700}
.cf-webinar-room-5 .wr5-card{position:relative;z-index:1;flex:0 0 min(468px,46%);min-width:0;margin-top:-40px;margin-inline-start:calc(-1 * var(--wr5-overlap));padding:var(--wr5-pad);background:var(--card,#fff);color:var(--ink,#101828);border:1px solid var(--card-border,oklch(from var(--ink,#101828) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)))}
.cf-webinar-room-5 .wr5-card-in{animation:wr5-rise .45s .07s cubic-bezier(.2,.7,.2,1) both}
.cf-webinar-room-5 .wr5-form{display:flex;flex-direction:column;margin:0}
.cf-webinar-room-5 .wr5-title{margin:0;font-family:var(--font-display,inherit);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);color:var(--ink,#101828);text-wrap:balance}
.cf-webinar-room-5 .wr5-hint{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#475467);text-wrap:pretty}
.cf-webinar-room-5 .wr5-set{margin:20px 0 0;padding:0;border:0;min-width:0}
.cf-webinar-room-5 .wr5-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.cf-webinar-room-5 .wr5-tile{position:relative;display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:88px;padding:12px 14px;border:1px solid oklch(from var(--ink,#101828) l c h / .12);border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#fff));color:var(--ink,#101828);cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;transition:transform .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease}
.cf-webinar-room-5 .wr5-tile:last-child:nth-child(odd){grid-column:1 / -1;flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;min-height:72px;padding-inline-end:44px}
.cf-webinar-room-5 .wr5-tile.is-hover:not(.is-on){background:color-mix(in oklch,var(--ink,#101828) 7%,var(--card,#fff));border-color:oklch(from var(--ink,#101828) l c h / .26);transform:translateY(-1px)}
@media (hover:hover){.cf-webinar-room-5 .wr5-tile:hover:not(.is-on){background:color-mix(in oklch,var(--ink,#101828) 7%,var(--card,#fff));border-color:oklch(from var(--ink,#101828) l c h / .26);transform:translateY(-1px)}}
.cf-webinar-room-5 .wr5-tile:active:not(.is-on),.cf-webinar-room-5 .wr5-tile.is-press:not(.is-on){background:color-mix(in oklch,var(--ink,#101828) 10%,var(--card,#fff));border-color:oklch(from var(--ink,#101828) l c h / .3);transform:scale(.98)}
.cf-webinar-room-5 .wr5-tile:has(input:focus-visible){outline:3px solid oklch(from var(--field-focus,var(--accent,#2563eb)) l c h / .55);outline-offset:2px}
.cf-webinar-room-5 .wr5-tile.is-on{background:var(--accent-fill,var(--accent,#2563eb));border-color:var(--accent-fill,var(--accent,#2563eb));color:var(--accent-fill-ink,var(--card,#fff));box-shadow:inset 0 1px 0 oklch(from var(--accent-fill,var(--accent,#2563eb)) calc(l + .12) c h / .5),var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2));transform:translateY(-1px)}
.cf-webinar-room-5 .wr5-tile.is-on:active{transform:scale(.98)}
.cf-webinar-room-5 .wr5-amt{font-family:var(--font-display,inherit);font-size:2rem;line-height:1;font-weight:var(--display-weight,800);letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-webinar-room-5 .wr5-tag{font-size:.875rem;line-height:1.25;font-weight:700;color:var(--ink,#101828);text-wrap:balance}
.cf-webinar-room-5 .wr5-tile.is-on .wr5-tag{color:inherit}
.cf-webinar-room-5 .wr5-tick{position:absolute;top:8px;right:8px;display:none;place-items:center;width:22px;height:22px;border-radius:999px;background:var(--accent-fill-ink,var(--card,#fff));color:var(--accent-fill,var(--accent,#2563eb))}
.cf-webinar-room-5 .wr5-tile.is-on .wr5-tick{display:grid;animation:wr5-pop .3s ease-out both}
.cf-webinar-room-5 .wr5-tile:last-child:nth-child(odd) .wr5-tick{top:50%;right:14px;margin-top:-11px}
.cf-webinar-room-5 .wr5-other{margin-top:16px}
.cf-webinar-room-5 .wr5-other label{display:block;margin-bottom:8px;font-size:1.0625rem;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink,#101828))}
.cf-webinar-room-5 .wr5-money{position:relative}
.cf-webinar-room-5 .wr5-cur{position:absolute;inset-block:0;inset-inline-start:16px;display:flex;align-items:center;font-size:1.0625rem;font-weight:800;color:var(--field-ink,#101828);pointer-events:none}
.cf-webinar-room-5 .wr5-input{display:block;width:100%;height:56px;margin:0;padding:0 16px 0 calc(22px + var(--wr5-pre,1) * .7em);font:inherit;font-size:1.0625rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--field-ink,#101828);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#101828) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
.cf-webinar-room-5 .wr5-input::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#fff));opacity:1;font-weight:500}
@media (hover:hover){.cf-webinar-room-5 .wr5-input:hover{border-color:color-mix(in oklch,var(--ink,#101828) 40%,transparent)}}
.cf-webinar-room-5 .wr5-input:focus{outline:none;border-color:var(--field-focus,var(--accent,#2563eb));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent,#2563eb)) l c h / .35)}
.cf-webinar-room-5 .wr5-other.is-on .wr5-input{border-color:var(--accent,#2563eb);box-shadow:0 0 0 1px var(--accent,#2563eb)}
.cf-webinar-room-5 .wr5-other.is-on .wr5-input:focus{box-shadow:0 0 0 1px var(--accent,#2563eb),0 0 0 4px oklch(from var(--accent,#2563eb) l c h / .3)}
.cf-webinar-room-5 .wr5-other.is-error .wr5-input{border-color:var(--danger,#b42318);box-shadow:0 0 0 1px var(--danger,#b42318)}
.cf-webinar-room-5 .wr5-other.is-error .wr5-input:focus{box-shadow:0 0 0 1px var(--danger,#b42318),0 0 0 4px oklch(from var(--danger,#b42318) l c h / .25)}
.cf-webinar-room-5 .wr5-err{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger,#b42318);text-wrap:pretty}
.cf-webinar-room-5 .wr5-err svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-webinar-room-5 .wr5-impact{display:grid;grid-template-columns:28px minmax(0,1fr);gap:16px;min-height:104px;margin-top:20px;padding:16px 18px 16px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#fff))}
.cf-webinar-room-5 .wr5-gauge{position:relative;overflow:hidden;border-radius:999px;background:color-mix(in oklch,var(--ink,#101828) 10%,var(--card,#fff));box-shadow:inset 0 1px 2px oklch(from var(--wr5-sh) l c h / .2)}
.cf-webinar-room-5 .wr5-gauge i{position:absolute;inset-inline:0;bottom:0;height:calc(var(--wr5-lvl,.08) * 100%);border-radius:inherit;background:linear-gradient(oklch(from var(--accent-fill,var(--accent,#2563eb)) calc(l + .1) c h),var(--accent-fill,var(--accent,#2563eb)));transition:height .45s cubic-bezier(.2,.7,.2,1)}
.cf-webinar-room-5 .wr5-line{align-self:center;margin:0;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.25;font-weight:500;color:var(--ink,#101828);text-wrap:pretty}
.cf-webinar-room-5 .wr5-line b{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-variant-numeric:tabular-nums}
.cf-webinar-room-5 .wr5-line.is-prompt{font-size:1.0625rem;line-height:1.5}
.cf-webinar-room-5 .wr5-swap{display:block;animation:wr5-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-webinar-room-5 .wr5-give{margin-top:24px}
.cf-webinar-room-5 .wr5-btn{--wr5-b:var(--button-bg,var(--cta,#d92d20));--wr5-b2:var(--button-bg-2,var(--cta-2,#b42318));display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin:0;padding:10px 20px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--wr5-b) calc(l + .04) c h),oklch(from var(--wr5-b2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#fff));font-family:var(--button-font,var(--font-display,inherit));font-size:1.125rem;line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--wr5-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--wr5-b) calc(l - .16) c h),0 1px 2px oklch(from var(--wr5-sh) l c h / .3),0 8px 16px -6px oklch(from var(--wr5-sh) l c h / .38));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-webinar-room-5 .wr5-btn > span{text-wrap:balance}
.cf-webinar-room-5 .wr5-btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--wr5-b) calc(l - .01) c h),oklch(from var(--wr5-b2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--wr5-b) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--wr5-b) calc(l - .2) c h),0 1px 2px oklch(from var(--wr5-sh) l c h / .32),0 12px 20px -8px oklch(from var(--wr5-sh) l c h / .45);transform:translateY(-1px)}
@media (hover:hover){.cf-webinar-room-5 .wr5-btn:not(:disabled):hover{background:linear-gradient(oklch(from var(--wr5-b) calc(l - .01) c h),oklch(from var(--wr5-b2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--wr5-b) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--wr5-b) calc(l - .2) c h),0 1px 2px oklch(from var(--wr5-sh) l c h / .32),0 12px 20px -8px oklch(from var(--wr5-sh) l c h / .45);transform:translateY(-1px)}}
.cf-webinar-room-5 .wr5-btn:not(:disabled):active,.cf-webinar-room-5 .wr5-btn.is-active:not(:disabled){background:linear-gradient(oklch(from var(--wr5-b) calc(l - .05) c h),oklch(from var(--wr5-b2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--wr5-b) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--wr5-b) calc(l - .16) c h),0 1px 1px oklch(from var(--wr5-sh) l c h / .25);transform:translateY(1px)}
.cf-webinar-room-5 .wr5-btn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent,#2563eb)) l c h / .6);outline-offset:3px}
.cf-webinar-room-5 .wr5-btn:disabled{cursor:not-allowed;background:var(--button-2-bg,var(--secondary,#e8ebf1));color:var(--button-2-ink,var(--secondary-ink,#101828));text-shadow:none;box-shadow:none;transform:none}
.cf-webinar-room-5 .wr5-btn[aria-busy='true']{cursor:progress}
.cf-webinar-room-5 .wr5-short{display:none}
.cf-webinar-room-5 .wr5-spin{flex:none;animation:wr5-spin .8s linear infinite}
.cf-webinar-room-5 .wr5-note{margin:12px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#475467);text-wrap:pretty}
.cf-webinar-room-5 .wr5-note svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-webinar-room-5 .wr5-wait{display:grid;justify-items:start}
.cf-webinar-room-5 .wr5-disc{display:grid;place-items:center;width:40px;height:40px;margin-bottom:16px;border-radius:999px;background:var(--accent-fill,var(--accent,#2563eb));color:var(--accent-fill-ink,var(--card,#fff))}
.cf-webinar-room-5 .wr5-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@keyframes wr5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes wr5-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@keyframes wr5-spin{to{transform:rotate(360deg)}}
@media (min-width:960px) and (max-width:1179px),(max-width:520px){.cf-webinar-room-5 .wr5-full{display:none}.cf-webinar-room-5 .wr5-short{display:inline}}
@media (max-width:959px){
.cf-webinar-room-5 .wr5-head{margin-bottom:40px}
.cf-webinar-room-5 .wr5-stage{flex-direction:column;align-items:stretch}
.cf-webinar-room-5 .wr5-visual{padding-block:24px 0}
.cf-webinar-room-5 .no-scene .wr5-visual{padding-bottom:24px}
.cf-webinar-room-5 .wr5-aside{order:-1;margin:0 0 20px;padding-inline-end:0}
.cf-webinar-room-5 .wr5-photo{aspect-ratio:4/3}
.cf-webinar-room-5 .wr5-card{flex:none;margin:-56px 0 0}
.cf-webinar-room-5 .no-scene .wr5-card{margin-top:0}
}
@media (max-width:640px){
.cf-webinar-room-5 .wr5-give{margin-top:20px}
.cf-webinar-room-5 .wr5-amt{font-size:1.75rem}
}
@media (forced-colors:active){.cf-webinar-room-5 .wr5-tile.is-on{outline:3px solid Highlight;outline-offset:2px}}
@media (prefers-reduced-motion:reduce){
.cf-webinar-room-5 .wr5-head,.cf-webinar-room-5 .wr5-card-in,.cf-webinar-room-5 .wr5-swap,.cf-webinar-room-5 .wr5-tile.is-on .wr5-tick,.cf-webinar-room-5 .wr5-spin{animation:none}
.cf-webinar-room-5 .wr5-tile,.cf-webinar-room-5 .wr5-input,.cf-webinar-room-5 .wr5-btn,.cf-webinar-room-5 .wr5-gauge i{transition:none}
}
`
pieces/hero/webinar-room-5/specimen.tsx 45 lines
import __studioImage089f47b7 from "../assets/d145c624aece7a92.webp";
// Specimen: Wellspring Trust's Clean Water Briefing, at the moment the ask opens.
import * as React from 'react'
import { WebinarRoom5, type WebinarRoom5State } from '../webinar-room-5'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function WebinarRoom5Specimen({ state = 'default' }: { state?: WebinarRoom5State }) {
return (
<WebinarRoom5
state={state}
headline='Give a family clean water for a whole year'
highlight='clean water'
lead='You just heard how one serviced well keeps a whole village going. Choose the part you’ll fund, and see exactly what your gift does.'
sceneImage={slot(
'scene',
__studioImage089f47b7,
)}
sceneAlt='A mother and two children filling water containers at a village hand pump'
sceneFocus='30% 50%'
aside='(I know. $40 sounds too small for a whole year of water. I thought so too.)'
asideBy='Amara Osei, field director, Wellspring Trust'
waitTitle='Stay to the end to hear how you can help'
waitText='Amara shares the giving options in the last minutes of the Clean Water Briefing.'
panelTitle='Choose what your gift does'
panelHint='Tap an amount to see where it goes.'
amounts={[
{ amount: 15, tag: 'Test a well', impact: '{amount} tests one village well so families know the water is safe.' },
{ amount: 40, tag: 'One family, one year', impact: '{amount} keeps one family’s well serviced for a year.' },
{ amount: 120, tag: 'Fix a pump', impact: '{amount} replaces a broken hand pump and gets the water flowing again.' },
{ amount: 300, tag: 'Train a mechanic', impact: '{amount} trains a local mechanic to keep every pump in the valley running.' },
]}
defaultAmount={1}
minOther={5}
charityName='Wellspring'
reassurance='Secure donation · You’ll review your gift before it’s made'
copy={{
label: 'Yes! I’ll give {amount} to {charity}',
labelShort: 'Yes! I’ll give {amount}',
otherImpact: '{amount} goes to the Clean Water Fund, wherever a well needs it most.',
}}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalWebinarRoom5 |
string |
Default 'Turn what you just heard into real help'
|
highlight OptionalWebinarRoom5 |
string |
Default 'real help'
|
lead OptionalWebinarRoom5 |
string |
Default 'Choose the part of the work you’ll fund, and see exactly what your gift does before you give.'
|
sceneImage OptionalWebinarRoom5 |
string |
|
sceneAlt OptionalWebinarRoom5 |
string |
Default ''
|
sceneFocus OptionalWebinarRoom5 |
string |
Default '35% 50%'
|
aside OptionalWebinarRoom5 |
string |
|
asideBy OptionalWebinarRoom5 |
string |
|
askOpen OptionalWebinarRoom5 |
boolean |
Default true
|
waitTitle OptionalWebinarRoom5 |
string |
Default 'Stay to the end to hear how you can help'
|
waitText OptionalWebinarRoom5 |
string |
|
panelTitle OptionalWebinarRoom5 |
string |
Default 'Choose what your gift does'
|
panelHint OptionalWebinarRoom5 |
string |
Default 'Tap an amount to see where it goes.'
|
amounts OptionalWebinarRoom5 |
WebinarRoom5Amount[] |
Default DEFAULT_AMOUNTS
|
defaultAmount OptionalWebinarRoom5 |
number |
Default -1
|
currency OptionalWebinarRoom5 |
string |
Default '$'
|
locale OptionalWebinarRoom5 |
string |
Default 'en-US'
|
minOther OptionalWebinarRoom5 |
number |
Default 5
|
maxOther OptionalWebinarRoom5 |
number |
|
charityName OptionalWebinarRoom5 |
string |
Default ''
|
reassurance OptionalWebinarRoom5 |
string |
|
onSubmit OptionalWebinarRoom5 |
(gift: WebinarRoom5Gift) => void | Promise<void> |
|
state OptionalWebinarRoom5 |
WebinarRoom5State |
Default 'default'
|
copy OptionalWebinarRoom5 |
WebinarRoom5Copy |
|
id OptionalWebinarRoom5 |
string |
|
className OptionalWebinarRoom5 |
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- 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.
scene- A wide atmosphere photo behind or beside the copy.
-
d145c624aece7a92.webp
image/webp · 86.2 KB