Vip Pass Upgrade 3
Future-paces a challenge VIP upgrade: drag the day scrubber and the free pass and the VIP pass each show what you have on that day, then one upgrade action.
Use it in a prompt
Use offer/vip-pass-upgrade-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/offer/vip-pass-upgrade-3.tsx. - Import it and pass your copy and images (Props tab):
import { VipPassUpgrade3 } from "@/components/funneldna/offer/vip-pass-upgrade-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/vip-pass-upgrade-3/component.tsx 689 lines
// layout: comparison-columns
// Future-paces a challenge VIP upgrade: drag the day scrubber and the free pass and the VIP pass each show what you have on that day, then one upgrade action.
'use client'
import * as React from 'react'
import { AlertCircle, CalendarClock, Check, Crown, Loader2, ShieldCheck, Ticket, X } from 'lucide-react'
import { FX_HOST, Texture } from '../fx/fx'
import wash from '../fx/textures/wash'
export type ChallengeDay = {
/** The day’s live lesson, e.g. ‘Mixing greens from two blues’. */
lesson: string
/** A VIP-only live session on this day (a feedback call). Shown only when supplied. */
vipSession?: string
}
export type VipPerk = {
/** Shown on the VIP side every day. ‘{day}’ and ‘{range}’ (e.g. ‘Days 1–7’) are replaced. */
label: string
/** Shown as a cross on the free side. Omit to keep it off the free side. */
freeLabel?: string
}
export type VipPassUpgrade3State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type VipPassUpgrade3Copy = {
/** Headline. ‘{day}’ becomes the scrubbed day label, set in the accent colour. */
headline: string
/** Day label. ‘{day}’ is the day number. */
dayLabel: string
/** Replay range on Day 1. */
rangeOne: string
/** Replay range from Day 2 on. ‘{day}’ is replaced. */
rangeMany: string
/** Accessible name of the scrubber. ‘{challenge}’ is replaced. */
scrubberLabel: string
scrubberHint: string
/** Spoken value of the scrubber. ‘{day}’, ‘{total}’ and ‘{lesson}’ are replaced. */
valueText: string
/** Added to the spoken value on a VIP session day. ‘{session}’ is replaced. */
valueTextSession: string
sessionLegend: string
/** Free card heading. ‘{dayLabel}’ is replaced. */
freeHeading: string
/** VIP card heading. ‘{dayLabel}’ is replaced. */
vipHeading: string
/** Line under the lesson name. ‘{dayLabel}’ is replaced. */
lessonLabel: string
everythingFree: string
todayChip: string
/** Next VIP session row. ‘{dayLabel}’ is replaced. */
nextSession: string
/** Free side cross on a VIP session day. ‘{session}’ is replaced. */
freeMissesToday: string
/** Reasons heading. ‘{price}’ is replaced. */
reasonsTitle: string
/** Screen-reader prefixes for ticks and crosses. */
srIncluded: string
srMissing: string
}
export type VipPassUpgrade3Props = {
/** Supporting labels and templates; named placeholders are documented on the copy type. */
copy?: Partial<VipPassUpgrade3Copy>
lead?: React.ReactNode
challengeName?: string
/** One entry per challenge day, in order. */
days?: ChallengeDay[]
/** Day the scrubber starts on (1-based). */
initialDay?: number
/** Small line under the free card heading. */
freeTitle?: string
/** Access the free pass gives every day (supplied rules only). */
freeIncludes?: string[]
/** Cross on the free side for the VIP live sessions on non-session days. */
sessionsFreeLabel?: string
/** Small line under the VIP card heading. */
vipTitle?: string
/** Extras the VIP pass gives every day (supplied rules only). */
vipPerks?: VipPerk[]
/** Photo heading the VIP side (scene slot). */
sceneImage?: string
sceneImageAlt?: string
price?: string
/** Short line beside the price, e.g. ‘One payment’. */
priceNote?: string
/** Supplied per-day breakdown beside the price. */
priceBreakdown?: string
label?: string
loadingLabel?: string
errorText?: string
/** Guarantee line under the button. Shown only when supplied. */
guarantee?: string
declineLabel?: string
/** Numbered reasons under the free side (after the action on phones). */
reasons?: React.ReactNode[]
disabled?: boolean
/** Studio / preview state. */
state?: VipPassUpgrade3State
/** Called on upgrade. While its promise is pending the button shows loadingLabel; a rejection shows errorText. */
onAction?: () => void | Promise<void>
onDecline?: () => void
/** Called with the 1-based day whenever the scrubber moves. */
onDayChange?: (day: number) => void
className?: string
id?: string
}
export function VipPassUpgrade3({
copy,
lead = 'Drag through all 21 days of the challenge and see the same day on your free pass and on VIP.',
challengeName = '21-Day Watercolour Challenge',
days = DEFAULT_DAYS,
initialDay = 7,
freeTitle = 'Your free pass',
freeIncludes = DEFAULT_FREE_INCLUDES,
sessionsFreeLabel = 'No live feedback calls',
vipTitle = 'VIP Pass',
vipPerks = DEFAULT_PERKS,
sceneImage,
sceneImageAlt = '',
price = '$47',
priceNote = 'One payment',
priceBreakdown = 'about $2.24 a day for the 21 days',
label = 'Yes! I want the VIP Pass',
loadingLabel = 'Upgrading your pass…',
errorText = 'We couldn’t upgrade your pass. Please try again.',
guarantee,
declineLabel = 'No thanks, I’ll keep my free pass',
reasons = DEFAULT_REASONS,
disabled = false,
state = 'default',
onAction,
onDecline,
onDayChange,
className,
id,
}: VipPassUpgrade3Props) {
const text = { ...DEFAULT_COPY, ...copy }
const total = Math.max(1, days.length)
const [day, setDayState] = React.useState(() => clampDay(initialDay, total))
React.useEffect(() => {
setDayState(clampDay(initialDay, total))
}, [initialDay, total])
const [phase, setPhase] = React.useState<Phase>(() => phaseFor(state))
React.useEffect(() => {
setPhase(phaseFor(state))
}, [state])
const mounted = React.useRef(true)
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const uid = React.useId()
const headingId = uid + '-h'
const freeId = uid + '-free'
const vipId = uid + '-vip'
const reasonsId = uid + '-why'
const errorId = uid + '-err'
const isDisabled = disabled || state === 'disabled'
const force = !isDisabled && (state === 'hover' || state === 'active') ? state : undefined
const loading = phase === 'loading'
const setDay = (next: number) => {
const d = clampDay(next, total)
if (d === day) return
setDayState(d)
onDayChange?.(d)
}
// Page Up / Page Down jump a week; arrows, Home and End are native.
const onKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key !== 'PageUp' && e.key !== 'PageDown') return
e.preventDefault()
setDay(day + (e.key === 'PageUp' ? 7 : -7))
}
const upgrade = async () => {
if (isDisabled || loading || !onAction) return
setPhase('loading')
try {
await onAction()
if (mounted.current) setPhase('idle')
} catch {
if (mounted.current) setPhase('error')
}
}
const decline = () => {
if (!loading) onDecline?.()
}
const today: ChallengeDay = days[day - 1] ?? { lesson: '' }
const sessionDays = days.reduce<number[]>((list, d, i) => (d.vipSession ? [...list, i + 1] : list), [])
const nextDay = sessionDays.find((d) => d > day)
const n = String(day)
const dayLabel = fill(text.dayLabel, { day: n })
const range = day === 1 ? fill(text.rangeOne, { day: n }) : fill(text.rangeMany, { day: n })
const lessonSub = fill(text.lessonLabel, { dayLabel })
const pct = total > 1 ? (day - 1) / (total - 1) : 0
const labelDays = pickLabels([1, ...sessionDays, total], total)
const valueText =
fill(text.valueText, { day: n, total: String(total), lesson: today.lesson }) +
(today.vipSession ? fill(text.valueTextSession, { session: today.vipSession }) : '')
const headlineParts = text.headline.split('{day}')
return (
<section
id={id}
className={['cf-vip-pass-upgrade-3', className].filter(Boolean).join(' ')}
style={FX_HOST}
aria-labelledby={headingId}
data-phase={phase}
>
<style>{CSS}</style>
<Texture src={wash} tone='accent-fill' position='top right' />
<div className='vp3-wrap'>
<header className='vp3-head'>
<h2 id={headingId} className='vp3-h'>
{headlineParts.map((part, i) => (
<React.Fragment key={i}>
{i > 0 ? <span className='vp3-day'>{dayLabel}</span> : null}
{part}
</React.Fragment>
))}
</h2>
{lead ? <p className='vp3-lead'>{lead}</p> : null}
</header>
<div className='vp3-scrub' style={{ '--pct': String(pct) } as React.CSSProperties}>
<div className='vp3-scrub-top'>
<p className='vp3-hint'>
{challengeName ? <b>{challengeName}</b> : null}
<span>{text.scrubberHint}</span>
</p>
{sessionDays.length ? (
<p className='vp3-legend'>
<i aria-hidden='true' />
{text.sessionLegend}
</p>
) : null}
</div>
<div className='vp3-bubble-row' aria-hidden='true'>
<span className='vp3-bubble'>{dayLabel}</span>
</div>
<div className='vp3-track'>
<div className='vp3-rail' aria-hidden='true'>
<span className='vp3-fill' />
</div>
<div className='vp3-ticks' aria-hidden='true'>
{days.map((d, i) => (
<span
key={i}
className='vp3-tick'
style={{ left: pos(i + 1, total) + '%' }}
data-session={d.vipSession ? '' : undefined}
data-past={i + 1 <= day ? '' : undefined}
/>
))}
</div>
<input
type='range'
className='vp3-range'
min={1}
max={total}
step={1}
value={day}
aria-label={fill(text.scrubberLabel, { challenge: challengeName })}
aria-valuetext={valueText}
onChange={(e) => setDay(Number(e.currentTarget.value))}
onKeyDown={onKey}
/>
</div>
<div className='vp3-labels' aria-hidden='true'>
{labelDays.map((d) => (
<span
key={d}
className='vp3-label'
data-align={d === 1 ? 'start' : d === total ? 'end' : 'center'}
data-current={d === day ? '' : undefined}
style={{ left: pos(d, total) + '%' }}
>
{fill(text.dayLabel, { day: String(d) })}
</span>
))}
</div>
</div>
<div className='vp3-grid'>
<article className='vp3-card vp3-free' aria-labelledby={freeId}>
<div className='vp3-card-head'>
<span className='vp3-disc' aria-hidden='true'>
<Ticket strokeWidth={2.5} />
</span>
<div className='vp3-card-title'>
<h3 id={freeId} className='vp3-h3'>
{fill(text.freeHeading, { dayLabel })}
</h3>
{freeTitle ? <p className='vp3-pass'>{freeTitle}</p> : null}
</div>
</div>
<ul className='vp3-rows'>
<Row key={'lesson-' + day} kind='yes' sr={text.srIncluded}>
<strong>{today.lesson}</strong>
<span className='vp3-row-sub'>{lessonSub}</span>
</Row>
{freeIncludes.map((item) => (
<Row key={'free-' + item} kind='yes' sr={text.srIncluded}>
{item}
</Row>
))}
{vipPerks
.filter((perk) => perk.freeLabel)
.map((perk) => (
<Row key={'miss-' + perk.freeLabel} kind='no' sr={text.srMissing}>
{perk.freeLabel}
</Row>
))}
{today.vipSession ? (
<Row key={'miss-today-' + day} kind='no' sr={text.srMissing}>
<strong>{fill(text.freeMissesToday, { session: today.vipSession })}</strong>
</Row>
) : sessionDays.length && sessionsFreeLabel ? (
<Row key='miss-sessions' kind='no' sr={text.srMissing}>
{sessionsFreeLabel}
</Row>
) : null}
</ul>
</article>
<article className='vp3-card vp3-vip' aria-labelledby={vipId}>
{sceneImage ? (
<img className='vp3-photo' src={sceneImage} alt={sceneImageAlt} width={1200} height={525} loading='lazy' decoding='async' />
) : null}
<div className='vp3-card-head'>
<span className='vp3-disc' aria-hidden='true'>
<Crown strokeWidth={2.5} />
</span>
<div className='vp3-card-title'>
<h3 id={vipId} className='vp3-h3'>
{fill(text.vipHeading, { dayLabel })}
</h3>
{vipTitle ? <p className='vp3-pass'>{vipTitle}</p> : null}
</div>
</div>
<ul className='vp3-rows'>
<Row key={'lesson-' + day} kind='yes' sr={text.srIncluded}>
<strong>{today.lesson}</strong>
<span className='vp3-row-sub'>{lessonSub}</span>
</Row>
{freeIncludes.length ? (
<Row key='everything' kind='yes' sr={text.srIncluded}>
{text.everythingFree}
</Row>
) : null}
{vipPerks.map((perk, i) => {
const line = fill(perk.label, { day: n, range })
return (
<Row key={'perk-' + i + line} kind='yes' sr={text.srIncluded}>
{line}
</Row>
)
})}
{today.vipSession ? (
<Row key={'today-' + day} kind='yes' today sr={text.srIncluded}>
<span className='vp3-chip'>{text.todayChip}</span>
<strong>{today.vipSession}</strong>
</Row>
) : nextDay ? (
<Row key={'next-' + nextDay} kind='next'>
<strong>{fill(text.nextSession, { dayLabel: fill(text.dayLabel, { day: String(nextDay) }) })}</strong>
<span className='vp3-row-sub'>{days[nextDay - 1]?.vipSession}</span>
</Row>
) : null}
</ul>
<div className='vp3-close'>
{price ? (
<div className='vp3-price'>
<strong className='vp3-amount'>{price}</strong>
{priceNote || priceBreakdown ? (
<p className='vp3-per'>
{priceNote ? <b>{priceNote}</b> : null}
{priceBreakdown ? <span>{priceBreakdown}</span> : null}
</p>
) : null}
</div>
) : null}
<button
type='button'
className='vp3-btn'
data-force={force}
disabled={isDisabled}
aria-busy={loading || undefined}
aria-describedby={phase === 'error' && errorText ? errorId : undefined}
onClick={upgrade}
>
{loading ? (
<>
<Loader2 className='vp3-spin' aria-hidden='true' strokeWidth={2.5} />
<span>{loadingLabel}</span>
</>
) : (
<span>{label}</span>
)}
</button>
<p className='vp3-sr' aria-live='polite'>
{loading ? loadingLabel : ''}
</p>
{phase === 'error' && errorText ? (
<p id={errorId} className='vp3-error' role='alert'>
<AlertCircle aria-hidden='true' strokeWidth={2.5} />
{errorText}
</p>
) : null}
{guarantee ? (
<p className='vp3-guarantee'>
<ShieldCheck aria-hidden='true' strokeWidth={2.5} />
{guarantee}
</p>
) : null}
{declineLabel ? (
<button type='button' className='vp3-decline' onClick={decline}>
{declineLabel}
</button>
) : null}
</div>
</article>
{reasons.length ? (
<section className='vp3-reasons' aria-labelledby={reasonsId}>
<h3 id={reasonsId} className='vp3-h3'>
{fill(text.reasonsTitle, { price })}
</h3>
<ol>
{reasons.map((reason, i) => (
<li key={i}>
<span className='vp3-num' aria-hidden='true'>
{i + 1}
</span>
<span>{reason}</span>
</li>
))}
</ol>
</section>
) : null}
</div>
</div>
</section>
)
}
export default VipPassUpgrade3
type Phase = 'idle' | 'loading' | 'error'
function phaseFor(state: VipPassUpgrade3State): Phase {
return state === 'error' ? 'error' : 'idle'
}
function clampDay(value: number, total: number) {
const d = Math.round(Number(value)) || 1
return Math.min(total, Math.max(1, d))
}
function pos(d: number, total: number) {
return total > 1 ? ((d - 1) / (total - 1)) * 100 : 0
}
// Day labels under the track: first, session days, last; drop any that would crowd a neighbour.
function pickLabels(list: number[], total: number) {
const sorted = Array.from(new Set(list)).sort((a, b) => a - b)
const gap = Math.max(2, Math.ceil(total / 7))
const out: number[] = []
for (const d of sorted) {
if (d === total) {
while (out.length && out[out.length - 1] !== 1 && total - out[out.length - 1] < gap) out.pop()
out.push(d)
} else if (!out.length || d - out[out.length - 1] >= gap) {
out.push(d)
}
}
return out
}
function fill(template: string, vars: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in vars ? vars[key] : match))
}
function Row({ kind, today, sr, children }: { kind: 'yes' | 'no' | 'next'; today?: boolean; sr?: string; children: React.ReactNode }) {
return (
<li className={today ? 'vp3-row vp3-row-today' : 'vp3-row'} data-kind={kind}>
{kind === 'next' ? (
<span className='vp3-next-ic' aria-hidden='true'>
<CalendarClock strokeWidth={2.5} />
</span>
) : (
<span className='vp3-badge' data-kind={kind} aria-hidden='true'>
{kind === 'yes' ? <Check strokeWidth={3} /> : <X strokeWidth={3} />}
</span>
)}
<span className='vp3-row-text'>
{sr ? <span className='vp3-sr'>{sr} </span> : null}
{children}
</span>
</li>
)
}
const DEFAULT_COPY: VipPassUpgrade3Copy = {
headline: 'It’s {day} of your challenge. Which pass are you holding?',
dayLabel: 'Day {day}',
rangeOne: 'Day 1',
rangeMany: 'Days 1–{day}',
scrubberLabel: '{challenge}: choose a day',
scrubberHint: 'Drag the slider or use your arrow keys',
valueText: 'Day {day} of {total}: {lesson}',
valueTextSession: '. VIP live session: {session}',
sessionLegend: 'VIP live session',
freeHeading: '{dayLabel} on the free pass',
vipHeading: '{dayLabel} as a VIP',
lessonLabel: '{dayLabel} live lesson',
everythingFree: 'Everything on the free pass',
todayChip: 'Today',
nextSession: 'Next VIP live session: {dayLabel}',
freeMissesToday: 'Not on your pass: {session}',
reasonsTitle: 'Three reasons to go VIP for {price}',
srIncluded: 'Included:',
srMissing: 'Not included:',
}
const DEFAULT_DAYS: ChallengeDay[] = [
{ lesson: 'Your palette, paper and first wash' },
{ lesson: 'Flat and graded washes' },
{ lesson: 'Wet-on-wet skies' },
{ lesson: 'Colour mixing basics' },
{ lesson: 'Warm and cool pairs' },
{ lesson: 'Painting a simple leaf' },
{ lesson: 'Mixing greens from two blues', vipSession: 'Live feedback call on your colour swatches' },
{ lesson: 'Lifting and softening edges' },
{ lesson: 'Values in one colour' },
{ lesson: 'Layering clean glazes' },
{ lesson: 'Loose florals' },
{ lesson: 'Shadows that stay fresh' },
{ lesson: 'Salt and texture effects' },
{ lesson: 'Small landscape, part one', vipSession: 'Live feedback call on your landscape' },
{ lesson: 'Small landscape, part two' },
{ lesson: 'Water and reflections' },
{ lesson: 'Simple buildings, loosely' },
{ lesson: 'Light through a window' },
{ lesson: 'Choosing your final subject' },
{ lesson: 'Planning your final painting' },
{ lesson: 'Paint your final piece', vipSession: 'Live review of your finished painting' },
]
const DEFAULT_FREE_INCLUDES = ['Share your paintings in the free challenge group']
const DEFAULT_PERKS: VipPerk[] = [{ label: 'Replays of {range} in your library', freeLabel: 'No lesson replays' }]
const DEFAULT_REASONS: React.ReactNode[] = [
'Miss an evening and that lesson waits for you in your replay library.',
'Three live feedback calls on your own paintings, on Days 7, 14 and 21.',
'One payment covers every day of the challenge.',
]
const R = '.cf-vip-pass-upgrade-3'
const CSS = `
${R}{position:relative;isolation:isolate;overflow:hidden;background:var(--surface,#fff);color:var(--ink,#1b2333);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} :where(h2,h3,p,ul,ol,li){margin:0}
${R} :where(ul,ol){list-style:none;padding:0}
${R} .vp3-wrap{position:relative;z-index:1;width:min(100%,1120px);margin-inline:auto}
${R} .vp3-head{max-width:56rem;margin-inline:auto;text-align:center}
${R} .vp3-h{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;color:var(--ink);text-wrap:balance}
${R} .vp3-day{color:var(--accent);font-variant-numeric:tabular-nums;white-space:nowrap}
${R} .vp3-lead{max-width:62ch;margin:16px auto 0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .vp3-scrub{--thumb:32px;margin-top:clamp(28px,3.5vw,40px);padding:clamp(16px,2.4vw,24px) clamp(24px,3vw,36px);background:var(--card);color:var(--ink);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))}
${R} .vp3-scrub-top{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:8px 24px}
${R} .vp3-hint{display:grid;gap:2px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
${R} .vp3-hint b{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;color:var(--ink)}
${R} .vp3-legend{display:inline-flex;align-items:center;gap:8px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
${R} .vp3-legend i{flex:none;width:16px;height:16px;border-radius:50%;background:var(--card);border:3px solid var(--accent-fill,var(--accent))}
${R} .vp3-bubble-row{position:relative;height:48px}
${R} .vp3-bubble{position:absolute;bottom:8px;left:calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pct));transform:translateX(-50%);display:inline-flex;align-items:center;justify-content:center;min-width:72px;height:32px;padding:0 12px;border-radius:999px;background:var(--band);color:var(--band-ink);font-size:.875rem;font-weight:800;line-height:1;font-variant-numeric:tabular-nums;white-space:nowrap;box-shadow:var(--shadow-sm)}
${R} .vp3-bubble::after{content:'';position:absolute;left:50%;bottom:-4px;width:10px;height:10px;border-radius:2px;background:inherit;transform:translateX(-50%) rotate(45deg)}
${R} .vp3-track{position:relative;height:44px}
${R} .vp3-rail{position:absolute;inset-inline:0;top:50%;height:8px;transform:translateY(-50%);overflow:hidden;border-radius:999px;background:color-mix(in oklab,var(--ink) 13%,var(--card))}
${R} .vp3-fill{position:absolute;inset-block:0;left:0;width:calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pct));border-radius:999px;background:var(--accent-fill,var(--accent))}
${R} .vp3-ticks{position:absolute;inset-block:0;inset-inline:calc(var(--thumb) / 2);pointer-events:none}
${R} .vp3-tick{position:absolute;top:50%;width:2px;height:12px;border-radius:2px;transform:translate(-50%,-50%);background:oklch(from var(--ink) l c h / .3)}
${R} .vp3-tick[data-past]{background:oklch(from var(--accent-fill-ink,var(--card)) l c h / .7)}
${R} .vp3-tick[data-session]{width:16px;height:16px;border-radius:50%;border:3px solid var(--accent-fill,var(--accent));background:var(--card)}
${R} .vp3-tick[data-session][data-past]{border-color:var(--card);background:var(--accent-fill,var(--accent))}
${R} .vp3-range{position:absolute;inset:0;z-index:2;width:100%;height:100%;margin:0;padding:0;background:transparent;-webkit-appearance:none;appearance:none;cursor:grab}
${R} .vp3-range:active{cursor:grabbing}
${R} .vp3-range:focus{outline:none}
${R} .vp3-range::-webkit-slider-runnable-track{height:var(--thumb);border:0;background:transparent}
${R} .vp3-range::-moz-range-track{height:var(--thumb);border:0;background:transparent}
${R} .vp3-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;box-sizing:border-box;width:var(--thumb);height:var(--thumb);border-radius:50%;border:6px solid var(--accent-fill,var(--accent));background:var(--card);box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .3));transition:transform .16s ease,box-shadow .16s ease}
${R} .vp3-range::-moz-range-thumb{box-sizing:border-box;width:var(--thumb);height:var(--thumb);border-radius:50%;border:6px solid var(--accent-fill,var(--accent));background:var(--card);box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .3));transition:transform .16s ease,box-shadow .16s ease}
${R} .vp3-range:hover::-webkit-slider-thumb{transform:scale(1.08)}
${R} .vp3-range:hover::-moz-range-thumb{transform:scale(1.08)}
${R} .vp3-range:active::-webkit-slider-thumb{transform:scale(1.14)}
${R} .vp3-range:active::-moz-range-thumb{transform:scale(1.14)}
${R} .vp3-range:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 3px var(--card),0 0 0 6px var(--field-focus,var(--accent))}
${R} .vp3-range:focus-visible::-moz-range-thumb{box-shadow:0 0 0 3px var(--card),0 0 0 6px var(--field-focus,var(--accent))}
${R} .vp3-labels{position:relative;height:20px;margin:4px calc(var(--thumb) / 2) 0}
${R} .vp3-label{position:absolute;top:0;transform:translateX(-50%);font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap;color:var(--ink);font-variant-numeric:tabular-nums}
${R} .vp3-label[data-align='start']{transform:translateX(calc(var(--thumb) / -2))}
${R} .vp3-label[data-align='end']{transform:translateX(calc(var(--thumb) / 2 - 100%))}
${R} .vp3-label[data-current]{color:var(--accent)}
${R} .vp3-grid{display:grid;gap:clamp(20px,2.5vw,32px);margin-top:clamp(20px,2.5vw,32px);align-items:start}
@media (min-width:880px){${R} .vp3-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);grid-template-rows:auto 1fr;grid-template-areas:'free vip' 'reasons vip'}${R} .vp3-free{grid-area:free}${R} .vp3-vip{grid-area:vip}${R} .vp3-reasons{grid-area:reasons}}
${R} .vp3-card{min-width:0;padding:clamp(20px,3vw,32px);background:var(--card);color:var(--ink);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))}
${R} .vp3-vip{border:2px solid oklch(from var(--accent-fill,var(--accent)) l c h / .6);box-shadow:var(--shadow-lg)}
${R} .vp3-photo{display:block;width:100%;height:auto;aspect-ratio:16/7;object-fit:cover;object-position:center 60%;border-radius:12px;margin-bottom:clamp(16px,2vw,24px)}
${R} .vp3-card-head{display:flex;align-items:flex-start;gap:14px;margin-bottom:clamp(14px,1.8vw,20px)}
${R} .vp3-card-title{min-width:0}
${R} .vp3-disc{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--secondary);color:var(--secondary-ink)}
${R} .vp3-vip .vp3-disc{background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
${R} .vp3-disc svg{width:20px;height:20px}
${R} .vp3-h3{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--ink);text-wrap:balance}
${R} .vp3-pass{margin-top:4px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
${R} .vp3-rows{display:grid;gap:4px}
${R} .vp3-row{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;margin-inline:-12px;padding:10px 12px;border-radius:10px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.45;animation:vp3-in .45s cubic-bezier(.2,.7,.2,1) both}
${R} .vp3-row-today{background:color-mix(in oklab,var(--accent-fill,var(--accent)) 12%,var(--card))}
${R} .vp3-badge{display:grid;place-items:center;width:24px;height:24px;margin-top:1px;border-radius:50%;background:var(--success);color:var(--badge-glyph,#fff)}
${R} .vp3-badge[data-kind='no']{background:var(--danger)}
${R} .vp3-badge svg{width:14px;height:14px}
${R} .vp3-next-ic{display:grid;place-items:center;width:24px;height:24px;color:var(--accent)}
${R} .vp3-next-ic svg{width:20px;height:20px}
${R} .vp3-row-text{min-width:0;text-wrap:pretty}
${R} .vp3-row-text strong{display:block;font-weight:700}
${R} .vp3-row-sub{display:block;margin-top:2px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
${R} .vp3-row[data-kind='no'] .vp3-row-text{color:var(--muted)}
${R} .vp3-row[data-kind='no'] strong{color:var(--ink)}
${R} .vp3-row-today .vp3-row-sub{color:var(--ink)}
${R} .vp3-chip{display:inline-flex;align-items:center;min-height:28px;margin-bottom:6px;padding:4px 12px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));font-size:.875rem;font-weight:800;line-height:1.2}
${R} .vp3-close{display:grid;gap:16px;margin-top:clamp(24px,3vw,32px)}
${R} .vp3-price{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px 18px;padding:16px 20px;border-radius:10px;background:color-mix(in oklab,var(--ink) 4%,var(--card))}
${R} .vp3-amount{font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
${R} .vp3-per{display:grid;gap:2px;min-width:0;font-size:.9375rem;line-height:1.4;color:var(--ink);text-wrap:pretty}
${R} .vp3-per b{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700}
${R} .vp3-per span{font-weight:500}
${R} .vp3-btn{display:flex;width:100%;min-height:64px;align-items:center;justify-content:center;gap:10px;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;text-align:center;text-wrap:balance;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .3)));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .vp3-btn:hover:not(:disabled),${R} .vp3-btn[data-force='hover']{transform:translateY(-1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .12) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .18) c h),var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .3)))}
${R} .vp3-btn:active:not(:disabled),${R} .vp3-btn[data-force='active']{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 3px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .6),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / .25))}
${R} .vp3-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .vp3-btn:disabled{cursor:not-allowed;transform:none;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:none}
${R} .vp3-btn[aria-busy='true']{cursor:progress}
${R} .vp3-spin{flex:none;width:20px;height:20px;animation:vp3-spin .8s linear infinite}
${R} .vp3-error{padding:12px 16px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:600;text-align:center;text-wrap:pretty}
${R} .vp3-guarantee{font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-align:center;text-wrap:pretty}
${R} .vp3-guarantee svg,${R} .vp3-error svg{display:inline-block;width:16px;height:16px;vertical-align:-.15em;margin-inline-end:.4em}
${R} .vp3-guarantee svg{color:var(--success)}
${R} .vp3-decline{justify-self:center;min-height:44px;padding:8px 12px;border:0;border-radius:8px;background:none;font-family:var(--font-body);font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-decoration:underline;text-decoration-color:oklch(from var(--muted) l c h / .5);text-underline-offset:.18em;cursor:pointer;transition:color .16s ease}
${R} .vp3-decline:hover{color:var(--ink);text-decoration-color:currentColor}
${R} .vp3-decline:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
${R} .vp3-reasons{min-width:0;padding:clamp(4px,1vw,8px) clamp(4px,1.5vw,12px)}
${R} .vp3-reasons ol{display:grid;gap:14px;margin-top:16px}
${R} .vp3-reasons li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;align-items:baseline;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
${R} .vp3-num{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;color:var(--accent);font-variant-numeric:tabular-nums}
${R} .vp3-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 vp3-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes vp3-spin{to{transform:rotate(360deg)}}
@media (max-width:520px){${R} .vp3-btn{padding:0 14px;font-size:1.0625rem}${R} .vp3-photo{aspect-ratio:2/1}${R} .vp3-price{padding:14px 16px;gap:12px 14px}${R} .vp3-legend{width:100%}}
@media (prefers-reduced-motion:reduce){
${R} .vp3-row{animation:none}
${R} .vp3-spin{animation:none}
${R} .vp3-btn,${R} .vp3-btn:hover:not(:disabled),${R} .vp3-btn[data-force='hover'],${R} .vp3-btn:active:not(:disabled),${R} .vp3-btn[data-force='active']{transition:none;transform:none}
${R} .vp3-range::-webkit-slider-thumb{transition:none}
${R} .vp3-range::-moz-range-thumb{transition:none}
${R} .vp3-range:hover::-webkit-slider-thumb,${R} .vp3-range:active::-webkit-slider-thumb{transform:none}
${R} .vp3-range:hover::-moz-range-thumb,${R} .vp3-range:active::-moz-range-thumb{transform:none}
}
`
pieces/offer/vip-pass-upgrade-3/specimen.tsx 34 lines
import __studioImageca73a618 from "../assets/05e93ab92a736a2a.webp";
import * as React from 'react'
import { VipPassUpgrade3, type VipPassUpgrade3State } from '../vip-pass-upgrade-3'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function VipPassUpgrade3Specimen({ state = 'default' }: { state?: VipPassUpgrade3State }) {
const sample = defaults.sample
return (
<VipPassUpgrade3
state={state}
challengeName='21-Day Watercolour Challenge'
lead='Drag through all 21 days of the challenge and see the same day on your free pass and on VIP.'
initialDay={7}
price={sample.price}
priceNote='One payment'
priceBreakdown='about $2.24 a day for the 21 days'
label='Yes! I want the VIP Pass'
guarantee={sample.guarantee}
declineLabel='No thanks, I’ll keep my free pass'
sceneImage={slot('scene', __studioImageca73a618)}
sceneImageAlt='A painter’s desk with a watercolour palette, brushes in water and a half-finished landscape'
reasons={[
'Miss an evening and that lesson waits for you in your replay library.',
'Three live feedback calls on your own paintings, on Days 7, 14 and 21.',
`One payment of ${sample.price} covers all 21 days, and it comes with a ${sample.guarantee}.`,
]}
onAction={() => undefined}
onDecline={() => undefined}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalVipPassUpgrade3 |
Partial<VipPassUpgrade3Copy> |
|
lead OptionalVipPassUpgrade3 |
React.ReactNode |
Default 'Drag through all 21 days of the challenge and see the same day on your free pass and on VIP.'
|
challengeName OptionalVipPassUpgrade3 |
string |
Default '21-Day Watercolour Challenge'
|
days OptionalVipPassUpgrade3 |
ChallengeDay[] |
Default DEFAULT_DAYS
|
initialDay OptionalVipPassUpgrade3 |
number |
Default 7
|
freeTitle OptionalVipPassUpgrade3 |
string |
Default 'Your free pass'
|
freeIncludes OptionalVipPassUpgrade3 |
string[] |
Default DEFAULT_FREE_INCLUDES
|
sessionsFreeLabel OptionalVipPassUpgrade3 |
string |
Default 'No live feedback calls'
|
vipTitle OptionalVipPassUpgrade3 |
string |
Default 'VIP Pass'
|
vipPerks OptionalVipPassUpgrade3 |
VipPerk[] |
Default DEFAULT_PERKS
|
sceneImage OptionalVipPassUpgrade3 |
string |
|
sceneImageAlt OptionalVipPassUpgrade3 |
string |
Default ''
|
price OptionalVipPassUpgrade3 |
string |
Default '$47'
|
priceNote OptionalVipPassUpgrade3 |
string |
Default 'One payment'
|
priceBreakdown OptionalVipPassUpgrade3 |
string |
Default 'about $2.24 a day for the 21 days'
|
label OptionalVipPassUpgrade3 |
string |
Default 'Yes! I want the VIP Pass'
|
loadingLabel OptionalVipPassUpgrade3 |
string |
Default 'Upgrading your pass…'
|
errorText OptionalVipPassUpgrade3 |
string |
Default 'We couldn’t upgrade your pass. Please try again.'
|
guarantee OptionalVipPassUpgrade3 |
string |
|
declineLabel OptionalVipPassUpgrade3 |
string |
Default 'No thanks, I’ll keep my free pass'
|
reasons OptionalVipPassUpgrade3 |
React.ReactNode[] |
Default DEFAULT_REASONS
|
disabled OptionalVipPassUpgrade3 |
boolean |
Default false
|
state OptionalVipPassUpgrade3 |
VipPassUpgrade3State |
Default 'default'
|
onAction OptionalVipPassUpgrade3 |
() => void | Promise<void> |
|
onDecline OptionalVipPassUpgrade3 |
() => void |
|
onDayChange OptionalVipPassUpgrade3 |
(day: number) => void |
|
className OptionalVipPassUpgrade3 |
string |
|
id OptionalVipPassUpgrade3 |
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-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
05e93ab92a736a2a.webp
image/webp · 84.6 KB
-
54caa6134d96bb15.webp
image/webp · 110 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB