Lesson Player 2
Lesson theatre: the poster player leads, tabs carry the lesson, and a sticky curriculum keeps one obvious next step in view.
Use it in a prompt
Use checkout/lesson-player-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/checkout/lesson-player-2.tsx. - Import it and pass your copy and images (Props tab):
import { LessonPlayer2 } from "@/components/funneldna/checkout/lesson-player-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/lesson-player-2/component.tsx 735 lines
// layout: sticky-offer-side
// Lesson theatre: the poster player leads, tabs carry the lesson, and a sticky curriculum keeps one obvious next step in view.
'use client'
import * as React from 'react'
import { Check, CheckCircle2, ChevronDown, Download, FileText, Lock, Play } from 'lucide-react'
import { FX_HOST, Glow, Texture } from '../fx/fx'
import noise from '../fx/textures/noise'
export type LessonStatus = 'complete' | 'current' | 'available' | 'locked'
export type CourseLesson = {
id: string
title: string
/** Pre-formatted, e.g. '14 min'. */
duration?: string
status: LessonStatus
/** Drip date shown on a locked lesson, e.g. 'Dec 4'. */
opens?: string
href?: string
}
export type CourseModule = { id: string; title: string; lessons: CourseLesson[] }
export type LessonResource = {
title: string
/** e.g. 'PDF · 1.2 MB'. */
meta?: string
href: string
}
export type TranscriptLine = { time?: string; text: string }
export type LessonNotes = {
salutation?: string
paragraphs: string[]
practiceTitle?: string
practice?: string[]
signoff?: string
author?: string
authorRole?: string
/** Slot: presenter. */
authorImage?: string
}
export type NextLesson = { title: string; meta?: string; href?: string }
export type LessonPlayer2Copy = typeof DEFAULT_COPY
export type LessonPlayer2Props = {
courseName?: string
lessonTitle?: string
/** Line under the title, e.g. 'Module 2 · Lesson 3 · 14 min'. */
lessonMeta?: string
/** Slot: scene. The poster frame; the builder wires the real video to onPlay. */
posterImage?: string
onPlay?: () => void
/** The curriculum, in order. The module holding the current lesson starts open. */
modules?: CourseModule[]
onSelectLesson?: (lesson: CourseLesson, module: CourseModule) => void
/** The instructor letter for this lesson. */
notes?: LessonNotes
resources?: LessonResource[]
/** A short excerpt; link the full text with transcriptHref. */
transcript?: TranscriptLine[]
transcriptHref?: string
next?: NextLesson
onNext?: () => void
/** Controlled completion; leave undefined to let the button track it. */
completed?: boolean
onComplete?: () => void
/** Labels; templates use {title}, {done}, {total}, {n} and {date}. */
copy?: Partial<LessonPlayer2Copy>
state?: 'default' | 'hover' | 'active' | 'disabled'
className?: string
}
export function LessonPlayer2(props: LessonPlayer2Props) {
const {
courseName = 'Your course',
lessonTitle = 'Your next lesson',
lessonMeta,
posterImage,
onPlay,
modules = [],
onSelectLesson,
notes,
resources = [],
transcript = [],
transcriptHref,
next,
onNext,
completed,
onComplete,
copy: copyProp,
state = 'default',
className,
} = props
const copy = { ...DEFAULT_COPY, ...copyProp }
const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, '')
const [localDone, setLocalDone] = React.useState(false)
const done = state === 'disabled' || completed === true || (completed === undefined && localDone)
const currentModuleId =
modules.find((m) => m.lessons.some((l) => l.status === 'current'))?.id ?? modules[0]?.id
const [openModules, setOpenModules] = React.useState<string[]>(() =>
currentModuleId ? [currentModuleId] : [],
)
const [drawerOpen, setDrawerOpen] = React.useState(false)
const isDone = (l: CourseLesson) => l.status === 'complete' || (l.status === 'current' && done)
const allLessons = modules.flatMap((m) => m.lessons)
const doneCount = allLessons.filter(isDone).length
const total = allLessons.length
const pct = total ? Math.round((doneCount / total) * 100) : 0
const progressText = fill(copy.progress, { done: doneCount, total })
const tabs = [
{ id: 'notes', label: copy.tabNotes, show: !!notes },
{ id: 'resources', label: copy.tabResources, show: resources.length > 0 },
{ id: 'transcript', label: copy.tabTranscript, show: transcript.length > 0 },
].filter((t) => t.show)
const [tab, setTab] = React.useState(tabs[0]?.id ?? 'notes')
const activeTab = tabs.some((t) => t.id === tab) ? tab : tabs[0]?.id
const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])
const toggleModule = (id: string) =>
setOpenModules((open) => (open.includes(id) ? open.filter((x) => x !== id) : [...open, id]))
const onTabKey = (e: React.KeyboardEvent<HTMLButtonElement>, i: number) => {
const last = tabs.length - 1
let n = -1
if (e.key === 'ArrowRight') n = i === last ? 0 : i + 1
else if (e.key === 'ArrowLeft') n = i === 0 ? last : i - 1
else if (e.key === 'Home') n = 0
else if (e.key === 'End') n = last
if (n < 0) return
e.preventDefault()
setTab(tabs[n].id)
tabRefs.current[n]?.focus()
}
const handleComplete = () => {
if (done) return
setLocalDone(true)
onComplete?.()
}
const panelProps = (id: string) => ({
role: 'tabpanel' as const,
id: `${uid}-panel-${id}`,
'aria-labelledby': `${uid}-tab-${id}`,
hidden: activeTab !== id,
tabIndex: 0,
className: 'cf-lp2__tabpanel',
})
return (
<section
className={cx('cf-lp2', className)}
style={{ ...FX_HOST, overflowX: 'clip', overflowY: 'visible' }}
aria-labelledby={`${uid}-title`}
>
<style>{CSS}</style>
<Texture src={noise} tone='band-ink' />
<Glow />
<div className='cf-lp2__wrap'>
<div className='cf-lp2__grid'>
<header className='cf-lp2__head'>
<h2 id={`${uid}-title`} className='cf-lp2__title'>
{lessonTitle}
</h2>
{lessonMeta && <p className='cf-lp2__meta'>{keepTogether(lessonMeta)}</p>}
</header>
<div className='cf-lp2__player'>
<button
type='button'
className='cf-lp2__poster'
onClick={() => onPlay?.()}
aria-label={fill(copy.playAria, { title: lessonTitle })}
>
{posterImage && <img src={posterImage} alt='' />}
<span className='cf-lp2__scrim' aria-hidden='true' />
<span className='cf-lp2__play' aria-hidden='true'>
<Play strokeWidth={2.5} />
</span>
</button>
</div>
<aside
className='cf-lp2__side cf-lp2__card'
data-open={drawerOpen ? 'true' : 'false'}
aria-labelledby={`${uid}-course`}
>
<div className='cf-lp2__side-head'>
<h3 id={`${uid}-course`} className='cf-lp2__side-title'>
{courseName}
</h3>
<p className='cf-lp2__count'>{progressText}</p>
<div
className='cf-lp2__bar'
role='progressbar'
aria-label={copy.progressAria}
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={pct}
>
<span style={{ width: `${pct}%` }} />
</div>
</div>
<button
type='button'
className='cf-lp2__toggle'
aria-expanded={drawerOpen}
aria-controls={`${uid}-drawer`}
onClick={() => setDrawerOpen((o) => !o)}
>
<span className='cf-lp2__toggle-text'>
<strong>{courseName}</strong>
<span>{progressText}</span>
</span>
<ChevronDown className='cf-lp2__chev' strokeWidth={2.5} aria-hidden='true' />
<span className='cf-lp2__bar' aria-hidden='true'>
<span style={{ width: `${pct}%` }} />
</span>
</button>
<div className='cf-lp2__drawer' id={`${uid}-drawer`}>
<div className='cf-lp2__drawer-in'>
<ol className='cf-lp2__modules'>
{modules.map((m, mi) => {
const open = openModules.includes(m.id)
const mDone = m.lessons.filter(isDone).length
const allDone = m.lessons.length > 0 && mDone === m.lessons.length
const allLocked = m.lessons.length > 0 && m.lessons.every((l) => l.status === 'locked')
const firstOpens = m.lessons[0]?.opens
return (
<li key={m.id} className='cf-lp2__mod' data-open={open ? 'true' : 'false'}>
<button
type='button'
className='cf-lp2__mod-btn'
aria-expanded={open}
aria-controls={`${uid}-m-${mi}`}
onClick={() => toggleModule(m.id)}
>
<span className='cf-lp2__mod-text'>
<span className='cf-lp2__mod-num'>{fill(copy.moduleLabel, { n: mi + 1 })}</span>
<span className='cf-lp2__mod-title'>{m.title}</span>
</span>
<span className={cx('cf-lp2__chip', allDone && 'is-done')} aria-hidden='true'>
{allLocked ? (
<>
<Lock strokeWidth={2.5} />
{firstOpens ? fill(copy.opens, { date: firstOpens }) : null}
</>
) : (
<>
{mDone}/{m.lessons.length}
</>
)}
</span>
<span className='cf-lp2__sr'>
{allLocked
? firstOpens
? fill(copy.opens, { date: firstOpens })
: copy.lockedSr
: fill(copy.progress, { done: mDone, total: m.lessons.length })}
</span>
<ChevronDown className='cf-lp2__chev' strokeWidth={2.5} aria-hidden='true' />
</button>
<div className='cf-lp2__mod-body' id={`${uid}-m-${mi}`}>
<div className='cf-lp2__mod-in'>
<ol className='cf-lp2__lessons'>
{m.lessons.map((l) => {
const shownDone = isDone(l)
const current = l.status === 'current'
const locked = l.status === 'locked'
const badge = shownDone ? (
<span className='cf-lp2__badge is-done' aria-hidden='true'>
<Check strokeWidth={3} />
</span>
) : current ? (
<span className='cf-lp2__badge is-current' aria-hidden='true'>
<Play strokeWidth={2.5} />
</span>
) : locked ? (
<span className='cf-lp2__badge is-locked' aria-hidden='true'>
<Lock strokeWidth={2.5} />
</span>
) : (
<span className='cf-lp2__badge is-open' aria-hidden='true' />
)
const inner = (
<>
{badge}
<span className='cf-lp2__l-text'>
<span className='cf-lp2__l-title'>{l.title}</span>
{current && <span className='cf-lp2__l-sub'>{copy.nowPlaying}</span>}
{locked && l.opens && (
<span className='cf-lp2__l-sub'>{fill(copy.opens, { date: l.opens })}</span>
)}
</span>
{l.duration && <span className='cf-lp2__l-dur'>{l.duration}</span>}
{shownDone && <span className='cf-lp2__sr'>{copy.completedSr}</span>}
{locked && <span className='cf-lp2__sr'>{copy.lockedSr}</span>}
</>
)
return (
<li
key={l.id}
className={cx(
'cf-lp2__lesson',
shownDone && 'is-done',
current && 'is-current',
locked && 'is-locked',
)}
>
{locked ? (
<div className='cf-lp2__row'>{inner}</div>
) : l.href ? (
<a
className='cf-lp2__row'
href={l.href}
aria-current={current ? 'step' : undefined}
onClick={() => onSelectLesson?.(l, m)}
>
{inner}
</a>
) : (
<button
type='button'
className='cf-lp2__row'
aria-current={current ? 'step' : undefined}
onClick={() => onSelectLesson?.(l, m)}
>
{inner}
</button>
)}
</li>
)
})}
</ol>
</div>
</div>
</li>
)
})}
</ol>
</div>
</div>
</aside>
<div className='cf-lp2__panel cf-lp2__card'>
{tabs.length > 0 && (
<div className='cf-lp2__tabs' role='tablist' aria-label={copy.tabsLabel}>
{tabs.map((t, i) => {
const selected = activeTab === t.id
return (
<button
key={t.id}
ref={(el) => {
tabRefs.current[i] = el
}}
type='button'
role='tab'
id={`${uid}-tab-${t.id}`}
aria-selected={selected}
aria-controls={`${uid}-panel-${t.id}`}
tabIndex={selected ? 0 : -1}
className='cf-lp2__tab'
onClick={() => setTab(t.id)}
onKeyDown={(e) => onTabKey(e, i)}
>
{t.label}
</button>
)
})}
</div>
)}
{notes && (
<div {...panelProps('notes')}>
<div className='cf-lp2__letter'>
{notes.salutation && <p className='cf-lp2__salute'>{notes.salutation}</p>}
{notes.paragraphs.map((p, i) => (
<p key={i}>{p}</p>
))}
{notes.practice && notes.practice.length > 0 && (
<div className='cf-lp2__well'>
{notes.practiceTitle && <p className='cf-lp2__well-title'>{notes.practiceTitle}</p>}
<ul className='cf-lp2__practice'>
{notes.practice.map((item) => (
<li key={item}>
<Check strokeWidth={2.5} aria-hidden='true' />
<span>{item}</span>
</li>
))}
</ul>
</div>
)}
{(notes.signoff || notes.author) && (
<div className='cf-lp2__sign'>
{notes.authorImage && <img src={notes.authorImage} alt={notes.author ?? ''} />}
<div className='cf-lp2__sign-text'>
{notes.signoff && <span className='cf-lp2__signoff'>{notes.signoff}</span>}
{notes.author && <span className='cf-lp2__author'>{notes.author}</span>}
{notes.authorRole && <span className='cf-lp2__role'>{notes.authorRole}</span>}
</div>
</div>
)}
</div>
</div>
)}
{resources.length > 0 && (
<div {...panelProps('resources')}>
<ul className='cf-lp2__files'>
{resources.map((r) => (
<li key={r.title}>
<a className='cf-lp2__file' href={r.href}>
<span className='cf-lp2__file-ico' aria-hidden='true'>
<FileText strokeWidth={2.5} />
</span>
<span className='cf-lp2__file-text'>
<strong>{r.title}</strong>
{r.meta && <span>{r.meta}</span>}
</span>
<span className='cf-lp2__file-dl'>
<Download strokeWidth={2.5} aria-hidden='true' />
<span className='cf-lp2__sr'>{copy.download}</span>
</span>
</a>
</li>
))}
</ul>
</div>
)}
{transcript.length > 0 && (
<div {...panelProps('transcript')}>
<ol className='cf-lp2__script'>
{transcript.map((t, i) => (
<li key={i}>
{t.time && <span className='cf-lp2__time'>{t.time}</span>}
<p>{t.text}</p>
</li>
))}
</ol>
{transcriptHref && (
<a className='cf-lp2__more' href={transcriptHref}>
{copy.transcriptMore}
</a>
)}
</div>
)}
<div className='cf-lp2__close'>
{next && (
<p className='cf-lp2__upnext'>
{copy.upNext} <strong>{next.title}</strong>
{next.meta ? (
<>
{'\u00a0·'} <span className='cf-lp2__nb'>{next.meta}</span>
</>
) : null}
</p>
)}
<div className='cf-lp2__actions'>
<button
type='button'
className={cx(
'cf-lp2__btn',
done && 'cf-lp2__btn--2',
state === 'hover' && 'is-hover',
state === 'active' && 'is-active',
)}
disabled={done}
onClick={handleComplete}
>
{done ? (
<>
<CheckCircle2 strokeWidth={2.5} aria-hidden='true' />
{copy.completeDone}
</>
) : (
copy.markComplete
)}
</button>
{next &&
(next.href ? (
<a
className={cx('cf-lp2__btn', !done && 'cf-lp2__btn--2')}
href={next.href}
onClick={() => onNext?.()}
>
{copy.nextCta}
</a>
) : (
<button
type='button'
className={cx('cf-lp2__btn', !done && 'cf-lp2__btn--2')}
onClick={() => onNext?.()}
>
{copy.nextCta}
</button>
))}
</div>
</div>
</div>
</div>
</div>
</section>
)
}
export default LessonPlayer2
const DEFAULT_COPY = {
playAria: 'Play lesson: {title}',
tabsLabel: 'Lesson details',
tabNotes: 'Notes',
tabResources: 'Resources',
tabTranscript: 'Transcript',
progress: '{done} of {total} lessons done',
progressAria: 'Course progress',
moduleLabel: 'Module {n}',
nowPlaying: 'Now playing',
opens: 'Opens {date}',
completedSr: 'Completed',
lockedSr: 'Locked',
download: 'Download',
transcriptMore: 'Read the full transcript',
upNext: 'Up next:',
markComplete: 'Mark lesson complete',
completeDone: 'Lesson complete',
nextCta: 'Start next lesson',
}
function fill(template: string, values: Record<string, string | number>) {
return template.replace(/[{]([a-zA-Z0-9]+)[}]/g, (match, key: string) =>
key in values ? String(values[key]) : match,
)
}
/** Keeps each ' · ' segment of a meta line whole, so phones never strand '3 · 14 min'. */
function keepTogether(text: string) {
return text.split(' · ').map((part, i) => (
<React.Fragment key={i}>
{i > 0 && <>{'\u00a0·'} </>}
<span className='cf-lp2__nb'>{part}</span>
</React.Fragment>
))
}
function cx(...classes: Array<string | false | null | undefined>) {
return classes.filter(Boolean).join(' ')
}
const CSS = `
.cf-lp2{--lp-shadow:var(--shadow, oklch(0.22 0.03 260));--lp-line:oklch(from var(--ink) l c h / 0.12);--lp-well:color-mix(in oklch, var(--ink) 4%, var(--card));--lp-focus:var(--field-focus, var(--accent));position:relative;overflow-x:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-lp2 *,.cf-lp2 *::before,.cf-lp2 *::after{box-sizing:border-box}
.cf-lp2 :where(h2,h3,p,ol,ul,li){margin:0;padding:0}
.cf-lp2 :where(ol,ul){list-style:none}
.cf-lp2__nb{white-space:nowrap}
.cf-lp2__wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-lp2__grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(19rem,22.5rem);grid-template-areas:'head side' 'player side' 'panel side';grid-template-rows:auto auto 1fr;column-gap:clamp(24px,3vw,40px);row-gap:24px;align-items:start}
.cf-lp2__head{grid-area:head;min-width:0}
.cf-lp2__title{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--band-ink)}
.cf-lp2__meta{margin-top:16px;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--band-ink);text-wrap:pretty}
.cf-lp2__player{grid-area:player;min-width:0}
.cf-lp2__poster{position:relative;display:block;width:100%;aspect-ratio:16/9;padding:0;border:0;border-radius:12px;overflow:hidden;cursor:pointer;background:color-mix(in oklch, var(--band-ink) 10%, var(--band));-webkit-tap-highlight-color:transparent}
.cf-lp2__poster img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;transition:transform .5s cubic-bezier(.2,.7,.2,1)}
.cf-lp2__scrim{position:absolute;inset:0;background:radial-gradient(ellipse at center, oklch(from var(--band) l c h / 0.04) 0%, oklch(from var(--band) l c h / 0.4) 100%)}
.cf-lp2__play{position:absolute;left:50%;top:50%;width:84px;height:84px;margin:-42px 0 0 -42px;display:grid;place-items:center;border-radius:999px;color:var(--button-ink, var(--cta-ink));background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));box-shadow:inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 2px 3px oklch(from var(--lp-shadow) l c h / 0.45), 0 12px 20px -8px oklch(from var(--lp-shadow) l c h / 0.6);transition:transform .16s ease}
.cf-lp2__play svg{width:32px;height:32px;margin-left:4px;fill:currentColor}
.cf-lp2__poster:hover img{transform:scale(1.03)}
.cf-lp2__poster:hover .cf-lp2__play{transform:scale(1.06)}
.cf-lp2__poster:active .cf-lp2__play{transform:scale(.96)}
.cf-lp2__poster:focus-visible{outline:3px solid var(--band-ink);outline-offset:4px}
.cf-lp2__card{background:var(--card);color:var(--ink);border:1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius, var(--radius, 14px));box-shadow:var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--lp-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--lp-shadow) l c h / 0.2)))}
.cf-lp2__side{grid-area:side;position:sticky;top:24px;display:flex;flex-direction:column;max-height:calc(100vh - 48px);overflow:hidden;min-width:0}
.cf-lp2__side-head{padding:24px 24px 20px;border-bottom:1px solid var(--lp-line)}
.cf-lp2__side-title{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance}
.cf-lp2__count{margin-top:8px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.cf-lp2__bar{display:block;margin-top:12px;height:8px;border-radius:999px;background:color-mix(in oklch, var(--ink) 9%, var(--card));overflow:hidden}
.cf-lp2__bar>span{display:block;height:100%;border-radius:inherit;background:var(--accent-fill, var(--accent));transition:width .6s cubic-bezier(.2,.7,.2,1)}
.cf-lp2__toggle{display:none}
.cf-lp2__drawer{flex:1 1 auto;min-height:0;display:grid;grid-template-rows:minmax(0,1fr)}
.cf-lp2__drawer-in{min-height:0;overflow:auto;scrollbar-width:thin}
.cf-lp2__modules{padding:8px 12px 16px}
.cf-lp2__mod+.cf-lp2__mod{border-top:1px solid var(--lp-line)}
.cf-lp2__mod-btn{width:100%;display:flex;align-items:center;gap:12px;margin:4px 0;padding:12px;border:0;border-radius:10px;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:background .16s ease}
.cf-lp2__mod-btn:hover{background:var(--lp-well)}
.cf-lp2__mod-btn:focus-visible,.cf-lp2__row:focus-visible,.cf-lp2__toggle:focus-visible{outline:3px solid var(--lp-focus);outline-offset:-3px}
.cf-lp2__mod-text{flex:1;min-width:0;display:grid;gap:4px}
.cf-lp2__mod-num{font-size:.875rem;line-height:1.2;font-weight:800;color:var(--muted)}
.cf-lp2__mod-title{font-size:1rem;line-height:1.3;font-weight:800;text-wrap:pretty}
.cf-lp2__chip{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch, var(--ink) 6%, var(--card));color:var(--ink);font-size:.875rem;line-height:1.2;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-lp2__chip svg{width:16px;height:16px;flex:none}
.cf-lp2__chip.is-done{background:var(--success-soft);color:var(--success)}
.cf-lp2__chev{flex:none;width:20px;height:20px;color:var(--muted);transition:transform .3s cubic-bezier(.2,.7,.2,1)}
.cf-lp2__mod[data-open='true']>.cf-lp2__mod-btn .cf-lp2__chev{transform:rotate(180deg)}
.cf-lp2__mod-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .32s cubic-bezier(.2,.7,.2,1)}
.cf-lp2__mod[data-open='true']>.cf-lp2__mod-body{grid-template-rows:1fr}
.cf-lp2__mod-in{min-height:0;overflow:hidden;visibility:hidden;transition:visibility 0s linear .32s}
.cf-lp2__mod[data-open='true'] .cf-lp2__mod-in{visibility:visible;transition-delay:0s}
.cf-lp2__lessons{position:relative;z-index:0;display:grid;gap:4px;padding:0 0 12px}
.cf-lp2__lesson{position:relative}
.cf-lp2__lesson:not(:last-child)::before{content:'';position:absolute;left:25px;top:24px;width:2px;height:calc(100% + 4px);background:oklch(from var(--ink) l c h / 0.14);z-index:1}
.cf-lp2__lesson.is-done:not(:last-child)::before{background:var(--success)}
.cf-lp2__row{position:relative;width:100%;display:flex;align-items:flex-start;gap:12px;padding:10px 12px;border:0;border-radius:10px;background:transparent;color:var(--ink);font:inherit;text-align:left;text-decoration:none;cursor:pointer;transition:background .16s ease}
.cf-lp2__row:hover{background:var(--lp-well)}
.cf-lp2__lesson.is-current>.cf-lp2__row{background:color-mix(in oklch, var(--accent) 10%, var(--card))}
.cf-lp2__lesson.is-locked>.cf-lp2__row{cursor:default}
.cf-lp2__lesson.is-locked>.cf-lp2__row:hover{background:transparent}
.cf-lp2__badge{position:relative;z-index:2;flex:none;width:28px;height:28px;border-radius:999px;display:grid;place-items:center}
.cf-lp2__badge svg{width:16px;height:16px}
.cf-lp2__badge.is-done{background:var(--success);color:var(--badge-glyph, #fff)}
.cf-lp2__badge.is-current{background:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card))}
.cf-lp2__badge.is-current svg{width:14px;height:14px;margin-left:2px;fill:currentColor}
.cf-lp2__badge.is-open{background:var(--card);box-shadow:inset 0 0 0 2px oklch(from var(--ink) l c h / 0.24)}
.cf-lp2__badge.is-locked{background:color-mix(in oklch, var(--ink) 8%, var(--card));color:var(--muted)}
.cf-lp2__l-text{flex:1;min-width:0;display:grid;gap:2px;padding-top:3px}
.cf-lp2__l-title{font-size:1rem;line-height:1.35;font-weight:700;text-wrap:pretty}
.cf-lp2__l-sub{font-size:.875rem;line-height:1.3;font-weight:800;color:var(--ink)}
.cf-lp2__lesson.is-locked .cf-lp2__l-title{color:var(--muted);font-weight:600}
.cf-lp2__lesson.is-locked .cf-lp2__l-sub{color:var(--muted);font-weight:700}
.cf-lp2__l-dur{flex:none;padding-top:4px;font-size:.875rem;line-height:1.2;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-lp2__panel{grid-area:panel;min-width:0}
.cf-lp2__tabs{display:flex;gap:4px;margin:clamp(20px,3vw,32px) clamp(20px,3vw,32px) 0;padding:4px;border-radius:12px;background:color-mix(in oklch, var(--ink) 6%, var(--card))}
.cf-lp2__tab{flex:1 1 auto;min-width:0;min-height:48px;padding:0 12px;border:0;border-radius:9px;background:transparent;color:var(--ink);font-family:var(--font-body);font-size:1rem;line-height:1.2;font-weight:600;white-space:nowrap;cursor:pointer;transition:background .16s ease,box-shadow .16s ease}
.cf-lp2__tab:hover{background:color-mix(in oklch, var(--ink) 10%, var(--card))}
.cf-lp2__tab[aria-selected='true']{background:var(--card);font-weight:800;box-shadow:var(--shadow-sm, 0 1px 2px oklch(from var(--lp-shadow) l c h / 0.2), 0 1px 3px oklch(from var(--lp-shadow) l c h / 0.14))}
.cf-lp2__tab:focus-visible{outline:3px solid var(--lp-focus);outline-offset:2px}
.cf-lp2__tabpanel{padding:clamp(20px,3vw,32px)}
.cf-lp2__tabpanel:not([hidden]){animation:cf-lp2-rise .3s cubic-bezier(.2,.7,.2,1) both}
.cf-lp2__tabpanel:focus-visible{outline:3px solid var(--lp-focus);outline-offset:-3px;border-radius:12px}
.cf-lp2__letter{display:grid;gap:16px}
.cf-lp2__letter>p{max-width:68ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.6;text-wrap:pretty}
.cf-lp2__letter>p.cf-lp2__salute{font-weight:700}
.cf-lp2__well{margin-top:8px;padding:20px;border-radius:10px;background:var(--lp-well)}
.cf-lp2__well-title{font-size:1rem;line-height:1.3;font-weight:800}
.cf-lp2__practice{display:grid;gap:10px;margin-top:12px}
.cf-lp2__practice li{display:flex;align-items:flex-start;gap:12px;font-size:1rem;line-height:1.45}
.cf-lp2__practice svg{flex:none;width:18px;height:18px;margin-top:2px;color:var(--success)}
.cf-lp2__sign{display:flex;align-items:center;gap:16px;margin-top:8px}
.cf-lp2__sign img{flex:none;width:64px;height:64px;border-radius:12px;object-fit:cover;object-position:center 25%}
.cf-lp2__sign-text{display:grid;gap:2px;min-width:0}
.cf-lp2__signoff,.cf-lp2__role{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
.cf-lp2__author{font-family:var(--signature-font, var(--signature-face, var(--font-display)));font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em}
.cf-lp2__files{display:grid;gap:8px}
.cf-lp2__file{display:flex;align-items:center;gap:16px;padding:12px 16px 12px 12px;border-radius:10px;background:var(--lp-well);color:var(--ink);text-decoration:none;transition:background .16s ease}
.cf-lp2__file:hover{background:color-mix(in oklch, var(--ink) 8%, var(--card))}
.cf-lp2__file:hover strong{text-decoration:underline;text-decoration-color:oklch(from var(--link, var(--accent)) l c h / 0.45);text-underline-offset:.18em}
.cf-lp2__file:focus-visible{outline:3px solid var(--lp-focus);outline-offset:2px}
.cf-lp2__file-ico{flex:none;width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card))}
.cf-lp2__file-ico svg,.cf-lp2__file-dl svg{width:20px;height:20px}
.cf-lp2__file-text{flex:1;min-width:0;display:grid;gap:2px}
.cf-lp2__file-text strong{font-size:1rem;line-height:1.3;font-weight:700}
.cf-lp2__file-text span{font-size:.875rem;line-height:1.3;font-weight:600;color:var(--muted)}
.cf-lp2__file-dl{flex:none;display:grid;place-items:center;color:var(--link, var(--accent))}
.cf-lp2__script{display:grid;gap:20px;max-width:64ch}
.cf-lp2__script li{display:grid;grid-template-columns:64px minmax(0,1fr);gap:16px;align-items:baseline}
.cf-lp2__time{font-family:var(--font-display);font-size:.9375rem;font-weight:800;color:var(--accent);font-variant-numeric:tabular-nums}
.cf-lp2__script p{grid-column:2;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.6;text-wrap:pretty}
.cf-lp2__more{display:inline-block;margin-top:24px;font-size:1rem;font-weight:700;color:var(--link, var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link, var(--accent)) l c h / 0.45);text-underline-offset:.18em}
.cf-lp2__more:hover{color:oklch(from var(--link, var(--accent)) calc(l - 0.08) c h);text-decoration-color:currentColor}
.cf-lp2__more:focus-visible{outline:3px solid var(--lp-focus);outline-offset:3px;border-radius:4px}
.cf-lp2__close{display:grid;gap:16px;padding:clamp(20px,3vw,32px) clamp(20px,3vw,32px) clamp(24px,3.4vw,36px);border-top:1px solid var(--lp-line);background:color-mix(in oklch, var(--ink) 3%, var(--card));border-radius:0 0 calc(var(--card-radius, var(--radius, 14px)) - 1px) calc(var(--card-radius, var(--radius, 14px)) - 1px)}
.cf-lp2__upnext{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-lp2__upnext strong{color:var(--ink);font-weight:800}
.cf-lp2__actions{display:flex;flex-wrap:wrap;gap:12px}
.cf-lp2__actions>*{flex:1 1 220px}
.cf-lp2__btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:64px;padding:0 28px;border:0;border-radius:var(--button-radius, var(--radius, 12px));font-family:var(--button-font, var(--font-display));font-weight:var(--button-weight, 800);text-transform:var(--button-case, none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;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 + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--lp-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--lp-shadow) l c h / 0.45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-lp2__btn svg{flex:none;width:20px;height:20px}
.cf-lp2__btn:hover:not(:disabled),.cf-lp2__btn.is-hover{transform:translateY(-1px);background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--lp-shadow) l c h / 0.34), 0 10px 18px -6px oklch(from var(--lp-shadow) l c h / 0.55))}
.cf-lp2__btn:active:not(:disabled),.cf-lp2__btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.06) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - 0.22) c h / 0.6), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 1px oklch(from var(--lp-shadow) l c h / 0.3)}
.cf-lp2__btn:focus-visible{outline:3px solid var(--lp-focus);outline-offset:3px}
.cf-lp2__btn--2{color:var(--button-2-ink, var(--secondary-ink));text-shadow:none;background:var(--button-2-bg, var(--secondary));border:1px solid var(--button-2-border, transparent);box-shadow:var(--button-2-shadow, var(--shadow-sm))}
.cf-lp2__btn--2:hover:not(:disabled),.cf-lp2__btn--2.is-hover{background:oklch(from var(--button-2-bg, var(--secondary)) calc(l - 0.03) c h);box-shadow:var(--button-2-shadow, var(--shadow-sm))}
.cf-lp2__btn--2:active:not(:disabled),.cf-lp2__btn--2.is-active{background:oklch(from var(--button-2-bg, var(--secondary)) calc(l - 0.06) c h);box-shadow:none}
.cf-lp2__btn:disabled{cursor:default;transform:none}
.cf-lp2__btn--2:disabled{box-shadow:none}
.cf-lp2__btn--2:disabled svg{color:var(--success)}
.cf-lp2__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 cf-lp2-rise{from{opacity:.82;transform:translateY(8px)}}
.cf-lp2__grid>*{animation:cf-lp2-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-lp2__grid>.cf-lp2__player{animation-delay:.07s}
.cf-lp2__grid>.cf-lp2__side{animation-delay:.14s}
.cf-lp2__grid>.cf-lp2__panel{animation-delay:.21s}
@media (max-width:960px){
.cf-lp2__grid{grid-template-columns:minmax(0,1fr);grid-template-areas:'head' 'player' 'side' 'panel';grid-template-rows:auto}
.cf-lp2__side{position:relative;top:auto;max-height:none}
.cf-lp2__side-head{display:none}
.cf-lp2__toggle{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px;width:100%;padding:16px 20px 18px;border:0;border-radius:inherit;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.cf-lp2__toggle .cf-lp2__bar{grid-column:1 / -1}
.cf-lp2__toggle-text{display:grid;gap:2px;min-width:0}
.cf-lp2__toggle-text strong{font-size:1rem;line-height:1.3;font-weight:800}
.cf-lp2__toggle-text span{font-size:.875rem;line-height:1.3;font-weight:600;color:var(--muted)}
.cf-lp2__side[data-open='true'] .cf-lp2__toggle .cf-lp2__chev{transform:rotate(180deg)}
.cf-lp2__drawer{grid-template-rows:0fr;transition:grid-template-rows .32s cubic-bezier(.2,.7,.2,1)}
.cf-lp2__side[data-open='true'] .cf-lp2__drawer{grid-template-rows:1fr}
.cf-lp2__drawer-in{overflow:hidden;visibility:hidden;transition:visibility 0s linear .32s}
.cf-lp2__side[data-open='true'] .cf-lp2__drawer-in{visibility:visible;transition-delay:0s}
.cf-lp2__modules{padding:4px 8px 12px;border-top:1px solid var(--lp-line)}
}
@media (max-width:600px){
.cf-lp2__play{width:64px;height:64px;margin:-32px 0 0 -32px}
.cf-lp2__play svg{width:26px;height:26px;margin-left:3px}
.cf-lp2__tab{padding:0 8px;font-size:.9375rem}
.cf-lp2__actions>*{flex-basis:100%}
.cf-lp2__script li{grid-template-columns:minmax(0,1fr);gap:4px}
.cf-lp2__script p{grid-column:1}
}
@media (prefers-reduced-motion:reduce){
.cf-lp2 *,.cf-lp2 *::before,.cf-lp2 *::after{animation:none!important;transition:none!important}
.cf-lp2__poster:hover img,.cf-lp2__poster:hover .cf-lp2__play,.cf-lp2__btn:hover:not(:disabled),.cf-lp2__btn.is-hover{transform:none}
}
`
pieces/checkout/lesson-player-2/specimen.tsx 94 lines
import __studioImage47e9f3a5 from "../assets/effeceb8db461a9a.webp";
import __studioImage52139219 from "../assets/b5bcf4694a72d074.webp";
import { LessonPlayer2, type LessonPlayer2Props } from '../lesson-player-2'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled']
export default function LessonPlayer2Specimen({ state = 'default' }: { state?: string }) {
return (
<LessonPlayer2
state={state as LessonPlayer2Props['state']}
courseName='Watercolour Foundations'
lessonTitle='Lay a flat wash that dries without streaks'
lessonMeta='Wetbrush Academy · Module 2, Lesson 3 · 14 min'
posterImage={slot(
'scene',
__studioImage47e9f3a5,
)}
modules={[
{
id: 'm1',
title: 'Your paint, paper and brushes',
lessons: [
{ id: 'l1', title: 'Set up a calm painting corner', duration: '6 min', status: 'complete' },
{ id: 'l2', title: 'Choosing paper that forgives you', duration: '9 min', status: 'complete' },
{ id: 'l3', title: 'Mixing your first six colours', duration: '11 min', status: 'complete' },
],
},
{
id: 'm2',
title: 'Washes that behave',
lessons: [
{ id: 'l4', title: 'Water-to-paint ratios, made simple', duration: '10 min', status: 'complete' },
{ id: 'l5', title: 'Wet-on-dry or wet-on-wet?', duration: '13 min', status: 'complete' },
{ id: 'l6', title: 'Lay a flat wash that dries without streaks', duration: '14 min', status: 'current' },
{ id: 'l7', title: 'Graded washes for skies', duration: '12 min', status: 'available' },
{ id: 'l8', title: 'Lifting out soft clouds', duration: '9 min', status: 'available' },
],
},
{
id: 'm3',
title: 'Glazing and layers',
lessons: [
{ id: 'l9', title: 'Glazing in three layers', duration: '12 min', status: 'locked', opens: 'Dec 4' },
{ id: 'l10', title: 'Keeping your whites clean', duration: '8 min', status: 'locked', opens: 'Dec 4' },
{ id: 'l11', title: 'Shadows that glow', duration: '11 min', status: 'locked', opens: 'Dec 11' },
],
},
{
id: 'm4',
title: 'Your first finished landscape',
lessons: [
{ id: 'l12', title: 'Sketch and plan the scene', duration: '10 min', status: 'locked', opens: 'Dec 18' },
{ id: 'l13', title: 'Paint it, start to finish', duration: '24 min', status: 'locked', opens: 'Dec 18' },
{ id: 'l14', title: 'Sign it and frame it', duration: '7 min', status: 'locked', opens: 'Dec 18' },
],
},
]}
notes={{
salutation: 'Dear painter,',
paragraphs: [
'Streaky washes aren’t a talent problem. They’re a timing problem, and you’re about to fix it.',
'Load one big puddle of colour, tilt your board, and pull the bead down the page before it has time to dry.',
'Paint along with me once. Then do it again on a fresh sheet. The second one is always better.',
],
practiceTitle: 'Paint this tonight',
practice: [
'Two flat washes on a quarter sheet',
'One in ultramarine, one in burnt sienna',
'Let each dry flat, then compare them',
],
signoff: 'See you at the easel,',
author: 'Mara Ellison',
authorRole: 'Founder, Wetbrush Academy',
authorImage: slot(
'presenter',
__studioImage52139219,
),
}}
resources={[
{ title: 'Flat wash practice sheet', meta: 'PDF · 1.2 MB', href: '#' },
{ title: 'Colour mixing chart', meta: 'PDF · 860 KB', href: '#' },
{ title: 'Brush and paper list', meta: 'PDF · 240 KB', href: '#' },
]}
transcript={[
{ time: '02:14', text: 'Load more paint than feels sensible. A flat wash that runs out halfway is where the streaks come from.' },
{ time: '04:40', text: 'Tilt the board, touch the bead, and let gravity do the work. Your brush is only a guide.' },
{ time: '07:05', text: 'If a bloom appears, leave it. Going back in while it’s damp is what turns a bloom into a mess.' },
]}
transcriptHref='#'
next={{ title: 'Graded washes for skies', meta: '12 min', href: '#' }}
/>
)
}
| Name | Type | Details |
|---|---|---|
courseName OptionalLessonPlayer2 |
string |
|
lessonTitle OptionalLessonPlayer2 |
string |
|
lessonMeta OptionalLessonPlayer2 |
string |
|
posterImage OptionalLessonPlayer2 |
string |
|
onPlay OptionalLessonPlayer2 |
() => void |
|
modules OptionalLessonPlayer2 |
CourseModule[] |
|
onSelectLesson OptionalLessonPlayer2 |
(lesson: CourseLesson, module: CourseModule) => void |
|
notes OptionalLessonPlayer2 |
LessonNotes |
|
resources OptionalLessonPlayer2 |
LessonResource[] |
|
transcript OptionalLessonPlayer2 |
TranscriptLine[] |
|
transcriptHref OptionalLessonPlayer2 |
string |
|
next OptionalLessonPlayer2 |
NextLesson |
|
onNext OptionalLessonPlayer2 |
() => void |
|
completed OptionalLessonPlayer2 |
boolean |
|
onComplete OptionalLessonPlayer2 |
() => void |
|
copy OptionalLessonPlayer2 |
Partial<LessonPlayer2Copy> |
|
state OptionalLessonPlayer2 |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalLessonPlayer2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter- A photo of the host, coach or founder.
scene- A wide atmosphere photo behind or beside the copy.
-
b5bcf4694a72d074.webp
image/webp · 160 KB
-
bec2a41897a3364d.webp
image/webp · 51.2 KB
-
effeceb8db461a9a.webp
image/webp · 76.6 KB