New Opportunity 1
Contrasts the old loop with a planned path and lets the reader make the switch.
Use it in a prompt
Use content/new-opportunity from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/content/new-opportunity.tsx. - Import it and pass your copy and images (Props tab):
import { NewOpportunity } from "@/components/funneldna/content/new-opportunity"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/new-opportunity/component.tsx 398 lines
// Contrasts the old loop with a planned path and lets the reader make the switch.
'use client'
import * as React from 'react'
import { Flag, MapPin, RotateCcw } from 'lucide-react'
import { Mark } from '../marks/marks'
export type NewOpportunityProps = {
headline?: string
/** A phrase inside the headline to emphasise. */
emphasis?: string
subheadline?: string
oldWay?: NewOpportunityOldWay
newWay?: NewOpportunityNewWay
turn?: NewOpportunityTurn
hereLabel?: string
loopCenter?: string
/** Reports the newly selected path after a switch click. */
onAction?: (isNew: boolean) => void
/** auto: shows the old way, then flips once when the switch is fully in view. */
start?: 'auto' | 'old' | 'new'
state?: NewOpportunityState
id?: string
className?: string
}
export function NewOpportunity({
headline = 'Stop tweaking a funnel you guessed at. Switch to one you planned.',
emphasis = 'one you planned',
subheadline = 'Another headline test won’t rescue a funnel that was never mapped. The Funnel Starter Kit gives you a new starting point: plan it, write it, check it, then launch.',
oldWay = DEFAULT_OLD,
newWay = DEFAULT_NEW,
turn = DEFAULT_TURN,
hereLabel = 'You are here',
loopCenter = 'Start over',
onAction,
start = 'auto',
state = 'default',
id,
className,
}: NewOpportunityProps) {
const uid = React.useId()
const headId = `${uid}-head`
const turnId = `${uid}-turn`
const captionId = `${uid}-caption`
const forced = state !== 'default'
const disabled = state === 'disabled'
const [isNew, setIsNew] = React.useState(start === 'new' || forced)
const [motion, setMotion] = React.useState(false)
const [seen, setSeen] = React.useState(false)
const touched = React.useRef(false)
const gridRef = React.useRef<HTMLDivElement>(null)
const turnRef = React.useRef<HTMLDivElement>(null)
React.useEffect(() => {
if (forced) setIsNew(true)
}, [forced])
React.useEffect(() => {
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches
setMotion(!reduce)
const autoFlip = start === 'auto' && !forced
const grid = gridRef.current
const sw = turnRef.current
if (reduce || !grid || !sw || typeof IntersectionObserver === 'undefined') {
setSeen(true)
if (autoFlip) setIsNew(true)
return
}
let timer = 0
const seenWatch = new IntersectionObserver(
(entries) => {
if (!entries.some((entry) => entry.isIntersecting)) return
setSeen(true)
seenWatch.disconnect()
},
{ threshold: 0.1 }
)
const flipWatch = new IntersectionObserver(
(entries) => {
if (!entries.some((entry) => entry.isIntersecting)) return
flipWatch.disconnect()
if (autoFlip) {
timer = window.setTimeout(() => {
if (!touched.current) setIsNew(true)
}, 900)
}
},
{ threshold: 0.9 }
)
seenWatch.observe(grid)
flipWatch.observe(sw)
return () => {
seenWatch.disconnect()
flipWatch.disconnect()
window.clearTimeout(timer)
}
}, [start, forced])
const flip = () => {
if (disabled) return
touched.current = true
setIsNew(!isNew)
onAction?.(!isNew)
}
return (
<section
id={id}
className={['cf-new-opportunity cfno', className].filter(Boolean).join(' ')}
aria-labelledby={headId}
data-mode={isNew ? 'new' : 'old'}
data-motion={motion ? 'on' : 'off'}
data-seen={seen ? 'yes' : undefined}
data-state={state}
>
<style>{CSS}</style>
<svg className='cfno-motif' viewBox='0 0 1440 900' preserveAspectRatio='xMidYMid slice' aria-hidden='true' focusable='false'>
<circle cx='110' cy='230' r='250' fill='none' stroke='currentColor' strokeWidth='2' strokeDasharray='16 14' />
<circle cx='110' cy='230' r='292' fill='none' stroke='currentColor' strokeWidth='2' />
<line x1='860' y1='900' x2='1440' y2='430' stroke='currentColor' strokeWidth='2' />
<line x1='930' y1='900' x2='1440' y2='487' stroke='currentColor' strokeWidth='2' />
</svg>
<div className='cfno-wrap'>
<header className='cfno-head'>
<h2 id={headId} className='cfno-title'><Headline text={headline} emphasis={emphasis} /></h2>
{subheadline ? <p className='cfno-sub'>{subheadline}</p> : null}
</header>
<div className='cfno-grid' ref={gridRef}>
<article className='cfno-card cfno-old cfno-rv' style={{ '--d': 0 } as React.CSSProperties}>
<div className='cfno-card-head'>
<span className='cfno-mark cfno-mark-x' aria-hidden='true'><Mark name='cross' width={30} height={30} /></span>
<div className='cfno-card-titles'>
<h3>{oldWay.title}</h3>
<p className='cfno-tag'>{oldWay.tag}</p>
</div>
<span className='cfno-here'><MapPin size={16} strokeWidth={2.5} aria-hidden='true' />{hereLabel}</span>
</div>
<div className='cfno-diagram'><LoopDiagram center={oldWay.center ?? loopCenter} /></div>
<ol className='cfno-steps'>
{oldWay.steps.map((step, i) => (
<li key={i}>
<span className='cfno-num' aria-hidden='true'>{i + 1}</span>
<span className='cfno-step-text'>{typeof step === 'string' ? step : step.text}</span>
</li>
))}
</ol>
<p className='cfno-note cfno-note-loop'><RotateCcw size={20} strokeWidth={2.5} aria-hidden='true' />{oldWay.loopNote}</p>
</article>
<div className='cfno-turn cfno-rv' ref={turnRef} style={{ '--d': 1 } as React.CSSProperties}>
<p className='cfno-turn-label' id={turnId}>{turn.label}</p>
<button
type='button'
role='switch'
aria-checked={isNew}
aria-labelledby={turnId}
aria-describedby={captionId}
className='cfno-toggle'
disabled={disabled}
onClick={flip}
>
<span className='cfno-knob' aria-hidden='true' />
</button>
<div className='cfno-ends' aria-hidden='true'>
<span data-on={!isNew}>{turn.off}</span>
<span data-on={isNew}>{turn.on}</span>
</div>
<p className='cfno-caption' id={captionId} aria-live='polite'>{isNew ? turn.onCaption : turn.offCaption}</p>
</div>
<article className='cfno-card cfno-new cfno-rv' style={{ '--d': 2 } as React.CSSProperties}>
<div className='cfno-card-head'>
<span className='cfno-mark cfno-mark-ok' aria-hidden='true'><Mark name='check' width={30} height={30} /></span>
<div className='cfno-card-titles'>
<h3>{newWay.title}</h3>
<p className='cfno-tag'>{newWay.tag}</p>
</div>
<span className='cfno-here'><MapPin size={16} strokeWidth={2.5} aria-hidden='true' />{hereLabel}</span>
</div>
<div className='cfno-diagram'><TrackDiagram count={newWay.steps.length} /></div>
<ol className='cfno-steps'>
{newWay.steps.map((step, i) => (
<li key={i}>
<span className='cfno-num' aria-hidden='true'>{i + 1}</span>
<span className='cfno-step-text'>
<strong>{step.label}.</strong> {step.text}
{step.source ? <span className='cfno-step-src'>{step.source}</span> : null}
</span>
</li>
))}
</ol>
<p className='cfno-note cfno-note-finish'><Flag size={20} strokeWidth={2.5} aria-hidden='true' />{newWay.finish}</p>
</article>
</div>
</div>
</section>
)
}
export default NewOpportunity
export type NewOpportunityStep = { label: string; text: string; source?: string }
export type NewOpportunityOldWay = { title: string; tag: string; steps: (string | { text: string })[]; loopNote: string; center?: string }
export type NewOpportunityNewWay = { title: string; tag: string; steps: NewOpportunityStep[]; finish: string }
export type NewOpportunityTurn = { label: string; off: string; on: string; offCaption: string; onCaption: string }
export type NewOpportunityState = 'default' | 'hover' | 'active' | 'disabled'
const DEFAULT_OLD: NewOpportunityOldWay = {
title: 'The old way',
tag: 'Tweak, relaunch, repeat.',
steps: [
'Copy a page you liked and hope it fits your offer.',
'Launch it before the plan is clear.',
'Swap the headline, the colours, the button.',
],
loopNote: 'Then back to step one.',
center: 'Start over',
}
const DEFAULT_NEW: NewOpportunityNewWay = {
title: 'The new way',
tag: 'Plan it, write it, check it, launch.',
steps: [
{ label: 'Plan', text: 'Map your offer and the pages your funnel needs.', source: 'Funnel Planning Guide' },
{ label: 'Write', text: 'Draft your headline, offer, and call to action.', source: 'Page Copy Workbook' },
{ label: 'Check', text: 'Review the links, forms, and next steps before launch.', source: 'Launch Checklist' },
],
finish: 'Launch with every step checked.',
}
const DEFAULT_TURN: NewOpportunityTurn = {
label: 'Make the switch',
off: 'Old way',
on: 'New way',
offCaption: 'You’re stuck on the loop.',
onCaption: 'You’re on a straight track.',
}
function Headline({ text, emphasis }: { text: string; emphasis?: string }) {
if (!emphasis || !text.includes(emphasis)) return <>{text}</>
const i = text.indexOf(emphasis)
return <>{text.slice(0, i)}<span className='cfno-em'>{emphasis}</span>{text.slice(i + emphasis.length)}</>
}
function LoopDiagram({ center }: { center: string }) {
const words = center.trim().split(/ +/)
const first = words[0] ?? ''
const rest = words.slice(1).join(' ')
const nodes = [
{ x: 138.1, y: 40, n: 1 },
{ x: 100, y: 106, n: 2 },
{ x: 61.9, y: 40, n: 3 },
]
return (
<svg className='cfno-loop-svg' viewBox='0 0 200 124' aria-hidden='true' focusable='false'>
<circle className='cfno-ring' cx='100' cy='62' r='44' fill='none' stroke='var(--muted)' strokeWidth='3' strokeDasharray='7 6' />
<polygon points='95,12 106,18 95,24' fill='var(--band)' />
{nodes.map((node) => (
<g key={node.n}>
<circle cx={node.x} cy={node.y} r='10' fill='var(--band)' stroke='var(--card)' strokeWidth='3' />
<text x={node.x} y={node.y + 4} textAnchor='middle' fontSize='11' fontWeight='800' fill='var(--band-ink)'>{node.n}</text>
</g>
))}
<text x='100' y={rest ? 59 : 66} textAnchor='middle' fontSize='12' fontWeight='800' fill='var(--ink)'>{first}</text>
{rest ? <text x='100' y='74' textAnchor='middle' fontSize='12' fontWeight='800' fill='var(--ink)'>{rest}</text> : null}
<g className='cfno-runner'>
<circle cx='100' cy='18' r='7' fill='var(--marker,#fae37c)' stroke='var(--ink)' strokeWidth='2.5' />
</g>
</svg>
)
}
function TrackDiagram({ count }: { count: number }) {
const n = Math.max(1, Math.min(count, 5))
const stations = Array.from({ length: n }, (_, i) => (n === 1 ? 150 : 64 + (i * 176) / (n - 1)))
const ties = Array.from({ length: 18 }, (_, i) => 14 + i * 16)
return (
<svg className='cfno-track-svg' viewBox='0 0 320 76' aria-hidden='true' focusable='false'>
{ties.map((x) => <rect key={x} x={x} y='41' width='5' height='22' rx='1.5' fill='color-mix(in oklch,var(--accent-fill,var(--accent)) 25%,var(--card))' />)}
<line className='cfno-rail-line' x1='8' y1='46' x2='304' y2='46' strokeWidth='3' strokeLinecap='round' />
<line className='cfno-rail-line' x1='8' y1='58' x2='304' y2='58' strokeWidth='3' strokeLinecap='round' />
{stations.map((x, i) => (
<g key={i}>
<line x1={x} y1='30' x2={x} y2='42' stroke='color-mix(in oklch,var(--accent-fill,var(--accent)) 45%,var(--card))' strokeWidth='2' />
<circle className='cfno-station' cx={x} cy='18' r='12' />
<text x={x} y='22.5' textAnchor='middle' fontSize='13' fontWeight='800' fill='var(--band-ink)'>{i + 1}</text>
</g>
))}
<line x1='300' y1='6' x2='300' y2='44' stroke='var(--ink)' strokeWidth='2.5' strokeLinecap='round' />
<polygon points='300,6 318,12 300,18' fill='var(--accent-fill,var(--accent))' />
<g className='cfno-car'>
<rect x='8' y='30' width='34' height='14' rx='5' fill='var(--marker,#fae37c)' stroke='var(--ink)' strokeWidth='2.5' />
<circle cx='17' cy='47' r='4' fill='var(--ink)' />
<circle cx='33' cy='47' r='4' fill='var(--ink)' />
</g>
</svg>
)
}
const CSS = `
.cf-new-opportunity{--no-band:var(--band,#0f2747);--no-band-ink:var(--band-ink,#ffffff);--no-ink:var(--ink,#101828);--no-muted:var(--muted,#4a5565);--no-card:var(--card,#ffffff);--no-accent:var(--accent,#0f5fc2);--no-you:var(--warning-soft);--no-r:var(--radius,18px);--no-soft:var(--band-ink);position:relative;isolation:isolate;overflow:hidden;background:var(--no-band);color:var(--no-band-ink);font-family:var(--font-body,Arial,sans-serif);padding:clamp(56px,8vw,112px) clamp(16px,4vw,40px);-webkit-font-smoothing:antialiased}
.cf-new-opportunity *,.cf-new-opportunity *::before,.cf-new-opportunity *::after{box-sizing:border-box}
.cf-new-opportunity :where(h2,h3,p,ol,ul,li,figure){margin:0;padding:0}
.cf-new-opportunity :where(ol,ul){list-style:none}
:where(.cf-new-opportunity) .cfno-motif{position:absolute;inset:0;width:100%;height:100%;z-index:-1;color:var(--no-band-ink);opacity:.06;pointer-events:none}
:where(.cf-new-opportunity) .cfno-wrap{position:relative;max-width:1200px;margin:0 auto}
:where(.cf-new-opportunity) .cfno-head{text-align:center}
:where(.cf-new-opportunity) .cfno-title{margin:0 auto;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(2.25rem,1.35rem + 3.7vw,4.25rem);font-weight:var(--display-weight,900);line-height:1.02;letter-spacing:var(--display-tracking,-.025em);color:var(--no-band-ink);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-new-opportunity) .cfno-em{color:var(--band-ink)}
:where(.cf-new-opportunity) .cfno-sub{max-width:60ch;margin:22px auto 0;font-size:clamp(1.0625rem,.98rem + .45vw,1.3125rem);font-weight:500;line-height:1.55;color:var(--no-soft);text-wrap:pretty}
:where(.cf-new-opportunity) .cfno-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;margin-top:clamp(40px,5vw,64px)}
@media (min-width:960px){:where(.cf-new-opportunity) .cfno-grid{grid-template-columns:minmax(0,1fr) 176px minmax(0,1fr);gap:20px;align-items:start}}
:where(.cf-new-opportunity) .cfno-card{position:relative;border-radius:var(--card-radius,var(--no-r));padding:clamp(20px,2.4vw,30px);color:var(--no-ink);text-align:left}
:where(.cf-new-opportunity) .cfno-old{background:var(--card);box-shadow:var(--card-shadow,inset 0 0 0 1px var(--card-border,oklch(from var(--ink) l c h / 0.18)),0 2px 4px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.14))}
:where(.cf-new-opportunity) .cfno-new{background:var(--no-card);box-shadow:var(--card-shadow,inset 0 0 0 1px var(--card-border,oklch(from var(--accent-fill, var(--accent)) l c h / 0.16)),0 2px 4px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.14))}
.cf-new-opportunity[data-mode=new] .cfno-new{box-shadow:var(--card-shadow,inset 0 0 0 1px var(--card-border,oklch(from var(--accent-fill, var(--accent)) l c h / 0.16)),0 0 0 4px var(--marker,#fae37c),0 2px 4px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.14))}
:where(.cf-new-opportunity) .cfno-card-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px 12px}
:where(.cf-new-opportunity) .cfno-mark{display:inline-flex;flex:none;width:30px;height:30px;margin-top:2px}
:where(.cf-new-opportunity) .cfno-mark-x{color:var(--danger)}
:where(.cf-new-opportunity) .cfno-mark-ok{color:var(--success)}
:where(.cf-new-opportunity) .cfno-card-titles{flex:1 1 150px;min-width:0}
:where(.cf-new-opportunity) .cfno-card h3{font-family:var(--font-display,Arial,sans-serif);font-size:clamp(1.5rem,1.2rem + .9vw,1.875rem);font-weight:var(--display-weight,900);line-height:1.08;letter-spacing:var(--display-tracking,-.015em);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-new-opportunity) .cfno-tag{margin-top:8px;font-size:16px;font-weight:600;line-height:1.4;text-wrap:pretty}
:where(.cf-new-opportunity) .cfno-old .cfno-tag{color:var(--muted)}
:where(.cf-new-opportunity) .cfno-new .cfno-tag{color:var(--no-muted)}
:where(.cf-new-opportunity) .cfno-here{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;background:var(--no-you);color:var(--warning);font-family:var(--font-display,Arial,sans-serif);font-size:14px;font-weight:var(--display-weight,800);line-height:1;white-space:nowrap;box-shadow:0 1px 0 oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.1),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24);text-transform:var(--display-case,none)}
.cf-new-opportunity[data-mode=old] .cfno-new .cfno-here,.cf-new-opportunity[data-mode=new] .cfno-old .cfno-here{display:none}
:where(.cf-new-opportunity) .cfno-diagram{margin-top:18px;padding:14px 16px;border-radius:calc(var(--no-r) - 6px)}
:where(.cf-new-opportunity) .cfno-old .cfno-diagram{background:color-mix(in oklch,var(--ink) 4%,var(--card));box-shadow:none}
:where(.cf-new-opportunity) .cfno-new .cfno-diagram{background:color-mix(in oklch,var(--accent-fill,var(--accent)) 7%,var(--card));box-shadow:none}
:where(.cf-new-opportunity) .cfno-diagram svg{display:block;width:100%;height:auto;margin:0 auto}
:where(.cf-new-opportunity) .cfno-loop-svg{max-width:250px}
:where(.cf-new-opportunity) .cfno-track-svg{max-width:420px}
.cf-new-opportunity svg text{font-family:var(--font-display,Arial,sans-serif);text-transform:var(--display-case,none)}
:where(.cf-new-opportunity) .cfno-ring{transition:stroke .4s ease}
.cf-new-opportunity[data-mode=new] .cfno-ring{stroke:var(--muted)}
:where(.cf-new-opportunity) .cfno-runner{transform-origin:100px 62px;transition:opacity .35s ease}
.cf-new-opportunity[data-mode=new] .cfno-runner{opacity:0}
:where(.cf-new-opportunity) .cfno-rail-line{stroke:var(--accent-fill,var(--no-accent))}
:where(.cf-new-opportunity) .cfno-station{fill:var(--band)}
:where(.cf-new-opportunity) .cfno-car{opacity:0;transition:opacity .3s ease,transform 1.8s cubic-bezier(.55,.05,.25,1) .25s}
.cf-new-opportunity[data-mode=new] .cfno-car{opacity:1;transform:translateX(250px)}
:where(.cf-new-opportunity) .cfno-steps{display:grid;gap:14px;margin-top:20px}
:where(.cf-new-opportunity) .cfno-steps li{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;align-items:start}
:where(.cf-new-opportunity) .cfno-num{display:grid;place-items:center;width:32px;height:32px;border-radius:999px;color:var(--band-ink);font-family:var(--font-display,Arial,sans-serif);font-size:15px;font-weight:var(--display-weight,800);text-transform:var(--display-case,none)}
:where(.cf-new-opportunity) .cfno-old .cfno-num{background:var(--band)}
:where(.cf-new-opportunity) .cfno-new .cfno-num{background:var(--band)}
:where(.cf-new-opportunity) .cfno-step-text{padding-top:4px;font-size:17px;line-height:1.45;text-wrap:pretty}
:where(.cf-new-opportunity) .cfno-old .cfno-step-text{color:var(--ink)}
:where(.cf-new-opportunity) .cfno-step-text strong{font-weight:800;color:var(--no-ink)}
:where(.cf-new-opportunity) .cfno-step-src{display:block;margin-top:4px;font-size:14px;font-weight:600;color:var(--no-muted)}
:where(.cf-new-opportunity) .cfno-note{display:flex;align-items:center;gap:10px;margin-top:18px;padding:12px 14px;border-radius:12px;font-size:16px;font-weight:700;line-height:1.35;text-wrap:pretty}
:where(.cf-new-opportunity) .cfno-note svg{flex:none}
:where(.cf-new-opportunity) .cfno-note-loop{background:var(--danger-soft);color:var(--danger)}
:where(.cf-new-opportunity) .cfno-note-finish{background:var(--success-soft);color:var(--success)}
:where(.cf-new-opportunity) .cfno-turn{display:flex;flex-direction:column;align-items:center;gap:12px;padding:10px 0;text-align:center}
@media (min-width:960px){:where(.cf-new-opportunity) .cfno-turn{padding-top:72px}}
:where(.cf-new-opportunity) .cfno-turn-label{font-family:var(--font-display,Arial,sans-serif);font-size:15px;font-weight:var(--display-weight,800);line-height:1.25;letter-spacing:var(--display-tracking,.06em);text-transform:var(--display-case,uppercase);color:var(--no-band-ink);text-wrap:balance}
:where(.cf-new-opportunity) .cfno-toggle{position:relative;flex:none;width:132px;height:66px;padding:0;border:2px solid oklch(from var(--no-band-ink) l c h / 0.3);border-radius:var(--button-radius,var(--radius,999px));background:var(--button-2-bg,var(--band));box-shadow:var(--button-shadow,inset 0 2px 3px oklch(from var(--surface) min(0.25,calc(l - 0.12)) c h / .55));cursor:pointer;transition:background .35s ease,border-color .35s ease;border-color:var(--button-2-border,oklch(from var(--band-ink) l c h / 0.3));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none)}
:where(.cf-new-opportunity) .cfno-toggle::before{content:'';position:absolute;top:50%;left:20px;width:12px;height:12px;margin-top:-6px;border-radius:999px;background:var(--band-ink);transition:background .35s ease,box-shadow .35s ease}
:where(.cf-new-opportunity) .cfno-toggle[aria-checked=true]{background:var(--success-soft);border-color:var(--success)}
:where(.cf-new-opportunity) .cfno-toggle[aria-checked=true]::before{background:var(--success);box-shadow:none}
:where(.cf-new-opportunity) .cfno-knob{position:absolute;top:5px;left:5px;width:52px;height:52px;border-radius:999px;background:var(--button-ink,var(--cta-ink));box-shadow:inset 0 2px 0 var(--card),inset 0 -3px 0 oklch(from var(--surface) min(0.25,calc(l - 0.12)) c h / .12),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.3);transition:transform .5s cubic-bezier(.3,1.35,.5,1),box-shadow .2s ease}
:where(.cf-new-opportunity) .cfno-knob::before{content:'';position:absolute;inset:17px 16px;border-radius:3px;background:repeating-linear-gradient(90deg,var(--muted) 0 2px,transparent 2px 6px)}
:where(.cf-new-opportunity) .cfno-toggle[aria-checked=true] .cfno-knob{transform:translateX(66px);background:var(--card)}
:where(.cf-new-opportunity) .cfno-toggle:not(:disabled):hover,.cf-new-opportunity[data-state=hover] .cfno-toggle{border-color:oklch(from var(--no-band-ink) l c h / 0.6)}
:where(.cf-new-opportunity) .cfno-toggle:not(:disabled):hover .cfno-knob,.cf-new-opportunity[data-state=hover] .cfno-knob{box-shadow:inset 0 2px 0 var(--card),inset 0 -3px 0 oklch(from var(--surface) min(0.25,calc(l - 0.12)) c h / .12),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.3)}
:where(.cf-new-opportunity) .cfno-toggle:not(:disabled):active .cfno-knob,.cf-new-opportunity[data-state=active] .cfno-knob{transform:scale(.93)}
:where(.cf-new-opportunity) .cfno-toggle[aria-checked=true]:not(:disabled):active .cfno-knob,.cf-new-opportunity[data-state=active] .cfno-toggle[aria-checked=true] .cfno-knob{transform:translateX(66px) scale(.93)}
:where(.cf-new-opportunity) .cfno-toggle:focus-visible{outline:3px solid var(--no-you);outline-offset:4px}
:where(.cf-new-opportunity) .cfno-toggle:disabled{cursor:not-allowed;filter:grayscale(1);border-color:var(--muted)}
:where(.cf-new-opportunity) .cfno-toggle:disabled::before{box-shadow:none}
:where(.cf-new-opportunity) .cfno-ends{display:flex;justify-content:space-between;width:150px;font-family:var(--font-display,Arial,sans-serif);font-size:14px;font-weight:var(--display-weight,700);color:var(--band-ink);text-transform:var(--display-case,none)}
:where(.cf-new-opportunity) .cfno-ends [data-on=true]{color:var(--band-ink)}
:where(.cf-new-opportunity) .cfno-caption{max-width:18ch;font-size:16px;font-weight:600;line-height:1.35;color:var(--no-soft);text-wrap:balance}
@media (max-width:479px){:where(.cf-new-opportunity) .cfno-card{padding:18px}}
:where(.cf-new-opportunity) .cfno-rv{transition-delay:calc(var(--d,0) * 70ms)}
.cf-new-opportunity[data-motion=on] .cfno-rv{transition-property:opacity,transform,box-shadow;transition-duration:.5s,.5s,.4s;transition-timing-function:ease}
.cf-new-opportunity[data-motion=on]:not([data-seen]) .cfno-rv{opacity:.82;transform:translateY(10px)}
@media (prefers-reduced-motion:no-preference){
.cf-new-opportunity[data-motion=on][data-seen][data-mode=old] .cfno-runner{animation:cfno-spin 1.6s linear 3}
.cf-new-opportunity[data-motion=on] .cfno-here{animation:cfno-pop .5s cubic-bezier(.3,1.5,.5,1) both}
}
@keyframes cfno-spin{to{transform:rotate(360deg)}}
@keyframes cfno-pop{from{opacity:0;transform:scale(.6) translateY(4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
.cf-new-opportunity *,.cf-new-opportunity *::before,.cf-new-opportunity *::after{animation:none !important;transition:none !important}
}
@media (forced-colors:active){
:where(.cf-new-opportunity) .cfno-card,:where(.cf-new-opportunity) .cfno-toggle{outline:1px solid CanvasText}
:where(.cf-new-opportunity) .cfno-knob{background:ButtonText}
:where(.cf-new-opportunity) .cfno-toggle:disabled{outline-color:GrayText}
}
`
pieces/content/new-opportunity/specimen.tsx 51 lines
import * as React from 'react'
import { NewOpportunity, type NewOpportunityState } from '../new-opportunity'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active', 'disabled']
const STATION_LABELS = ['Plan', 'Write', 'Check']
export default function NewOpportunitySpecimen({ state = 'default' }: { state?: string }) {
const s = defaults.sample
const current = (states.includes(state) ? state : 'default') as NewOpportunityState
return (
<div>
<NewOpportunity
state={current}
headline='Stop tweaking a funnel you guessed at. Switch to one you planned.'
emphasis='one you planned'
subheadline={`Another headline test won’t rescue a funnel that was never mapped. ${s.name} gives you a new starting point: plan it, write it, check it, then launch.`}
oldWay={{
title: 'The old way',
tag: 'Tweak, relaunch, repeat.',
steps: [
'Copy a page you liked and hope it fits your offer.',
'Launch it before the plan is clear.',
'Swap the headline, the colours, the button.',
],
loopNote: 'Then back to step one.',
center: 'Start over',
}}
newWay={{
title: 'The new way',
tag: 'Plan it, write it, check it, launch.',
steps: s.items.map((item, i) => ({
label: STATION_LABELS[i] ?? item.name,
text: item.detail,
source: item.name,
})),
finish: 'Launch with every step checked.',
}}
turn={{
label: 'Make the switch',
off: 'Old way',
on: 'New way',
offCaption: 'You’re stuck on the loop.',
onCaption: 'You’re on a straight track.',
}}
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalNewOpportunity |
string |
Default 'Stop tweaking a funnel you guessed at. Switch to one you planned.'
|
emphasis OptionalNewOpportunity |
string |
Default 'one you planned'
|
subheadline OptionalNewOpportunity |
string |
Default 'Another headline test won’t rescue a funnel that was never mapped. The Funnel Starter Kit gives you a new starting point: plan it, write it, check it, then launch.'
|
oldWay OptionalNewOpportunity |
NewOpportunityOldWay |
Default DEFAULT_OLD
|
newWay OptionalNewOpportunity |
NewOpportunityNewWay |
Default DEFAULT_NEW
|
turn OptionalNewOpportunity |
NewOpportunityTurn |
Default DEFAULT_TURN
|
hereLabel OptionalNewOpportunity |
string |
Default 'You are here'
|
loopCenter OptionalNewOpportunity |
string |
Default 'Start over'
|
onAction OptionalNewOpportunity |
(isNew: boolean) => void |
|
start OptionalNewOpportunity |
'auto' | 'old' | 'new' |
Default 'auto'
|
state OptionalNewOpportunity |
NewOpportunityState |
Default 'default'
|
id OptionalNewOpportunity |
string |
|
className OptionalNewOpportunity |
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-case--button-font--button-ink--button-radius--button-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border- 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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB