Merge pull request 'Course experience polish: course page, home, cards, catalog, player' (#4) from ui-ux-course-polish into main

This commit is contained in:
Kerod-Fresenbet-Yaltopia 2026-10-30 11:31:54 +03:00
commit d1e398eaa0
6 changed files with 408 additions and 170 deletions

View File

@ -35,22 +35,29 @@ const ct = (c: Course, l: Locale) => tr(c.translations, l) ?? { title: c.slug, d
const lessonTitle = (l: Lesson, loc: Locale) => tr(l.translations, loc)?.title ?? '';
const lessonNumber = (c: Course, id: string) => publishedLessons(c).findIndex((l) => l.id === id) + 1;
function CourseCard({ c }: { c: Course }) {
// C1: one quiet "lessons · length" line, with "new course" / student count as a tag on the photo.
// C2: the whole card is the target, so the footer is just the price. C3: owned cards say what's next.
// `tall` keeps the photo-on-top layout on phones too (the home Featured rail, C4).
function CourseCard({ c, tall }: { c: Course; tall?: boolean }) {
const { locale, nav, me, signedIn } = useApp();
const t = useTranslations();
const { catName } = useCatalog();
const p = courseProgress(c, me);
const mine = signedIn && owns(me, c.id);
const r = mine ? resumePoint(c, me) : null;
const tag = c.enrolledCount ? t('course.enrolled', { n: c.enrolledCount }) : t('course.newCourse');
return (
<button className="ccard" onClick={() => nav(`/${locale}/course/${c.slug}`)}>
<Cover course={c} locale={locale} badge={<span className="pill">{catName(c.categoryId)}</span>} />
<button className={`ccard${tall ? ' ccard-tall' : ''}`} onClick={() => nav(`/${locale}/course/${c.slug}`)}>
<Cover course={c} locale={locale} badge={<><span className="pill">{catName(c.categoryId)}</span>{!mine && <span className="ccard-tag">{tag}</span>}</>} />
<div className="ccard-body">
<h3>{ct(c, locale).title}</h3>
<span className="meta"><span><Icon name="video" size={14} />{t('course.lessons', { n: p.total })}</span><span><Icon name="clock" size={14} />{formatDuration(courseDuration(c))}</span><span><Icon name="users" size={14} />{c.enrolledCount ? t('course.enrolled', { n: c.enrolledCount }) : t('course.newCourse')}</span></span>
<span className="meta num">{t('course.lessons', { n: p.total })} · {formatDuration(courseDuration(c))}</span>
<span className="ccard-by">{t('course.by', { name: c.instructorName })}</span>
<div className="ccard-foot">
{mine ? <><div className="bar grow" aria-label={`${p.pct}%`}><i style={{ width: `${p.pct}%` }} /></div><span className="small num">{p.pct}%</span></>
: <>{c.prices.ETB != null ? <strong className="num">{formatMoney(c.prices.ETB, 'ETB')}</strong> : <span />}<span className="ccard-go" aria-hidden><Icon name="chevron" size={18} /></span></>}
{mine ? <>
{r && <span className="ccard-next">{p.pct === 100 ? <b>{t('course.completed')}</b> : <><b>{t('player.upNext')}</b> {r.index + 1}. {lessonTitle(r.lesson, locale)} · <span className="num">{formatDuration(r.lesson.durationSec)}</span></>}</span>}
<span className="ccard-prog"><span className="bar grow" aria-label={`${p.pct}%`}><i style={{ width: `${p.pct}%` }} /></span><span className="small num">{p.pct}%</span></span>
</> : c.prices.ETB != null && <strong className="num">{formatMoney(c.prices.ETB, 'ETB')}</strong>}
</div>
</div>
</button>
@ -92,9 +99,10 @@ export function StudentApp() {
const tabs: [string, string, string][] = [['', 'home', t('nav.home')], ['courses', 'grid', t('nav.courses')], ['my', 'book', t('nav.myCourses')], ['help', 'help', t('nav.help')], ['profile', 'user', t('nav.profile')]];
const links = tabs.filter(([p]) => p !== 'profile' && (p !== 'my' || signedIn));
const current = (s: string) => (s === section || (s === 'courses' && (section === 'course')) || (s === 'profile' && (section === 'progress' || section === 'history')) ? 'page' : undefined);
const focus = section === 'learn'; // L1: watching a lesson drops the site links and the marketing footer
return (
<div lang={locale}>
<div lang={locale} className={focus ? 's-focus' : undefined}>
<header className={`s-top${scrolled ? ' scrolled' : ''}`}>
<div className="s-top-in">
<button className="brand" onClick={() => go('')} aria-label={settings.brandName}><Logo size={36} /><Logo size={36} mark /></button>
@ -135,7 +143,7 @@ export function StudentApp() {
{settings.maintenanceBanner && <div className="banner small" role="status">{settings.maintenanceBanner}</div>}
<StudentRoutes />
</main>
<Footer />
{!focus && <Footer />}
{signedIn && section !== 'learn' && section !== 'course' && <nav className="s-tabs" aria-label="Main">
{tabs.map(([p, icon, label]) => <button key={p} data-tour={p} aria-current={current(p)} onClick={() => go(p ? '/' + p : '')}><Icon name={icon} size={22} />{label}</button>)}
</nav>}
@ -462,33 +470,44 @@ function Home() {
const others = visible.filter((c) => !owns(me, c.id));
return (
<>
<h1 style={{ fontSize: 'var(--fs-2xl)' }}>{t('home.hello', { name: me?.name.split(' ')[0] ?? '' })}</h1>
{cont ? <ContinueCard c={cont} /> : <Empty action={<button className="btn" onClick={() => nav(`/${locale}/courses`)}>{t('landing.browse')}</button>}>{t('home.emptyMine')}</Empty>}
<div className="home-top">
<h1 style={{ fontSize: 'var(--fs-2xl)' }}>{t('home.hello', { name: me?.name.split(' ')[0] ?? '' })}</h1>
{cont ? <ContinueCard c={cont} /> : <Empty action={<button className="btn" onClick={() => nav(`/${locale}/courses`)}>{t('landing.browse')}</button>}>{t('home.emptyMine')}</Empty>}
</div>
{mine.length > 1 && <section className="stack"><div className="section-h"><h2>{t('nav.myCourses')}</h2><button className="link" onClick={() => nav(`/${locale}/my`)}>{t('my.viewProgress')}</button></div><div className="grid-cards">{mine.map((c) => <CourseCard key={c.id} c={c} />)}</div></section>}
<section className="stack">
<div className="section-h"><h2>{t('home.categories')}</h2></div>
<div className="chips">{categories.filter((c) => c.isActive).map((c) => <button key={c.id} className="chip" onClick={() => nav(`/${locale}/courses/${c.slug}`)}>{tr(c.translations, locale)?.name}</button>)}</div>
</section>
{others.length > 0 && <section className="stack"><div className="section-h"><h2>{others.some((c) => c.isFeatured) ? t('home.featured') : t('home.new')}</h2><button className="link" onClick={() => nav(`/${locale}/courses`)}>{t('catalog.title')}</button></div><div className="grid-cards">{[...others.filter((c) => c.isFeatured), ...others.filter((c) => !c.isFeatured)].slice(0, 4).map((c) => <CourseCard key={c.id} c={c} />)}</div></section>}
{others.length > 0 && <section className="stack"><div className="section-h"><h2>{others.some((c) => c.isFeatured) ? t('home.featured') : t('home.new')}</h2><button className="link" onClick={() => nav(`/${locale}/courses`)}>{t('catalog.title')}</button></div><div className="rail">{[...others.filter((c) => c.isFeatured), ...others.filter((c) => !c.isFeatured)].slice(0, 4).map((c) => <CourseCard key={c.id} c={c} tall />)}</div></section>}
</>
);
}
// H1/H2: a short photo header carries the course and its progress; the body leads with the next lesson and how long
// it takes, with the button at the bottom where a thumb reaches it.
function ContinueCard({ c }: { c: Course }) {
const t = useTranslations();
const { me, locale, nav } = useApp();
const { me, locale, nav, ds, categories } = useApp();
const p = courseProgress(c, me);
const r = resumePoint(c, me);
const finished = p.pct === 100;
const photo = c.coverAssetId ? ds.assetUrl(c.coverAssetId) : coursePhoto(c, categories.map((k) => k.id));
return (
<section className="continue" aria-label={t('home.continue')}>
<Cover course={c} locale={locale} />
<div className="stack-sm">
<span className="small" style={{ opacity: .8 }}>{t('home.continue')}</span>
<h2 style={{ fontSize: 'var(--fs-xl)' }}>{ct(c, locale).title}</h2>
{r && <p style={{ opacity: .85 }}>{r.index + 1}. {lessonTitle(r.lesson, locale)}</p>}
<div className="bar"><i style={{ width: `${p.pct}%` }} /></div>
<span className="small num" style={{ opacity: .8 }}>{t('my.lessonsDone', { done: p.done, total: p.total })}</span>
{r && <div><button className="btn btn-accent" onClick={() => nav(`/${locale}/learn/${c.slug}/${r.lesson.id}`)}><Icon name="play" size={16} />{p.pct === 100 ? t('course.watchAgain') : t('course.continue', { n: r.index + 1 })}</button></div>}
<div className="continue-media">
<img src={photo} alt="" />
<span className="continue-kicker">{t('home.continue')}</span>
<h2>{ct(c, locale).title}</h2>
<span className="continue-bar" role="progressbar" aria-valuenow={p.pct} aria-valuemin={0} aria-valuemax={100} aria-label={t('my.lessonsDone', { done: p.done, total: p.total })}><i style={{ width: `${p.pct}%` }} /></span>
</div>
<div className="continue-body">
{r && <p className="continue-next">
<span>{finished ? t('course.completed') : t('player.upNext')}</span>
<strong>{r.index + 1}. {lessonTitle(r.lesson, locale)}</strong>
<span className="num">{formatDuration(r.lesson.durationSec)} · {t('my.lessonsDone', { done: p.done, total: p.total })}</span>
</p>}
{r && <button className="btn btn-accent btn-lg" onClick={() => nav(`/${locale}/learn/${c.slug}/${r.lesson.id}`)}><Icon name="play" size={16} />{finished ? t('course.watchAgain') : t('course.continue', { n: r.index + 1 })}</button>}
</div>
</section>
);
@ -501,27 +520,43 @@ function Catalog({ categorySlug }: { categorySlug?: string }) {
const { categories, locale, nav, catalogLoaded } = useApp();
const { visible, catName } = useCatalog();
const [q, setQ] = useState('');
const [dq, setDq] = useState('');
useEffect(() => { const id = setTimeout(() => setDq(q.trim().toLowerCase()), 300); return () => clearTimeout(id); }, [q]);
const [lang, setLang] = useState(''); // '' = any language the course is taught in (CT3)
const searchRef = useRef<HTMLInputElement>(null);
const dq = q.trim().toLowerCase(); // the list is in memory: filter on every keystroke, no debounce (CT2)
const cat = categories.find((c) => c.slug === categorySlug);
const list = visible.filter((c) => (!cat || c.categoryId === cat.id) && (!dq || [
const langs = [...new Set(visible.map((c) => c.instructionLocale))];
const list = visible.filter((c) => (!cat || c.categoryId === cat.id) && (!lang || c.instructionLocale === lang) && (!dq || [
...Object.values(c.translations).map((x) => x?.title ?? ''), c.instructorName,
...Object.values(categories.find((k) => k.id === c.categoryId)?.translations ?? {}).map((x) => x?.name ?? ''),
].some((s) => s.toLowerCase().includes(dq))));
const clear = () => { setQ(''); searchRef.current?.focus(); };
return (
<section className="stack">
<h1 style={{ fontSize: 'var(--fs-2xl)' }}>{cat ? catName(cat.id) : t('catalog.title')}</h1>
<label className="field"><span className="sr-only">{t('catalog.search')}</span>
<input id="search" className="input" type="search" placeholder={t('catalog.search')} value={q} onChange={(e) => setQ(e.target.value)} />
<label className="search">
<span className="sr-only">{t('catalog.search')}</span>
<Icon name="search" size={18} />
<input ref={searchRef} id="search" className="input" type="search" placeholder={t('catalog.search')} value={q} onChange={(e) => setQ(e.target.value)} onKeyDown={(e) => { if (e.key === 'Escape' && q) clear(); }} />
{q && <button type="button" className="search-clear" onClick={clear} aria-label={t('catalog.clearSearch')}><Icon name="x" size={16} /></button>}
</label>
<div className="chips" role="group">
<button className="chip" aria-pressed={!cat} onClick={() => nav(`/${locale}/courses`)}>{t('catalog.all')}</button>
{categories.filter((c) => c.isActive).map((c) => <button key={c.id} className="chip" aria-pressed={cat?.id === c.id} onClick={() => nav(`/${locale}/courses/${c.slug}`)}>{tr(c.translations, locale)?.name}</button>)}
</div>
{!catalogLoaded ? <Skeleton h={220} n={2} /> : list.length ? <>
<p className="muted small" aria-live="polite">{t('catalog.count', { n: list.length })}</p>
<div className="grid-cards">{list.map((c) => <CourseCard key={c.id} c={c} />)}</div>
</> : <Empty action={dq ? <button className="btn btn-ghost" onClick={() => setQ('')}>{t('catalog.all')}</button> : undefined}>{dq ? t('catalog.empty', { q }) : t('catalog.emptyCategory')}</Empty>}
{!catalogLoaded ? <Skeleton h={220} n={2} /> : <>
<div className="catalog-bar">
<p className="muted small" aria-live="polite">{t('catalog.count', { n: list.length })}</p>
{langs.length > 1 && <label className="catalog-lang">
<span>{t('catalog.taughtIn')}</span>
<select id="catalog-lang" value={lang} onChange={(e) => setLang(e.target.value)}>
<option value="">{t('catalog.anyLanguage')}</option>
{langs.map((l) => <option key={l} value={l}>{LOCALE_NAMES[l]}</option>)}
</select>
</label>}
</div>
{list.length ? <div className="grid-cards">{list.map((c) => <CourseCard key={c.id} c={c} />)}</div>
: <Empty action={dq || lang ? <button className="btn btn-ghost" onClick={() => { setQ(''); setLang(''); }}>{t('catalog.clearFilters')}</button> : undefined}>{dq ? t('catalog.empty', { q }) : lang ? t('catalog.emptyLanguage') : t('catalog.emptyCategory')}</Empty>}
</>}
</section>
);
}
@ -532,9 +567,19 @@ function CoursePage({ slug }: { slug?: string }) {
const t = useTranslations();
const { courses, categories, me, locale, nav, catalogLoaded, toast, ds } = useApp();
const { catName } = useCatalog();
const [tab, setTab] = useState('overview');
const [tab, setTab] = useState<string | null>(null); // null: the viewer's default (curriculum once they own it)
// The sticky bar repeats the buy card's button, so it only shows while that button is off screen (P1).
const [ctaEl, setCtaEl] = useState<HTMLDivElement | null>(null);
const [ctaInView, setCtaInView] = useState(true); // start hidden: the bar slides in once the button is known to be off screen, never flashes out on load
const c = courses.find((x) => x.slug === slug);
useEffect(() => { if (c) document.title = `${ct(c, locale).title} · Sirkul Makeup`; }, [c, locale]); // before the early returns: hooks must run every render
useEffect(() => {
if (!ctaEl || typeof IntersectionObserver === 'undefined') { setCtaInView(false); return; }
// The bottom margin is the bar's own height: a button still underneath the bar doesn't count as visible.
const io = new IntersectionObserver(([e]) => setCtaInView(e.isIntersecting), { rootMargin: '0px 0px -88px 0px' });
io.observe(ctaEl);
return () => io.disconnect();
}, [ctaEl]);
if (!catalogLoaded) return <Skeleton h={260} n={2} />;
if (!c || !isStudentVisible(c, me)) return <Empty action={<button className="btn" onClick={() => nav(`/${locale}/courses`)}>{t('catalog.title')}</button>}>{t('course.notFound')}</Empty>;
const text = ct(c, locale);
@ -549,21 +594,29 @@ function CoursePage({ slug }: { slug?: string }) {
const previews = lessons.filter((l) => l.isPreview).length;
const cat = categories.find((k) => k.id === c.categoryId);
const chapters = [...c.chapters].sort((a, b) => a.sortOrder - b.sortOrder);
const play = mine && r ? `/${locale}/learn/${c.slug}/${r.lesson.id}` : preview ? `/${locale}/learn/${c.slug}/${preview.id}` : null;
// The hero only offers the free preview; once owned, the progress card below carries the one "continue" button (P2).
const play = !mine && preview ? `/${locale}/learn/${c.slug}/${preview.id}` : null;
const playLabel = mine && r ? (done ? t('course.watchAgain') : t('course.continue', { n: r.index + 1 })) : t('course.watchPreview');
const share = () => { navigator.clipboard?.writeText(location.href).then(() => toast(t('course.linkCopied')), () => { /* clipboard blocked */ }); };
const teaches = courses.filter((x) => x.instructorName === c.instructorName && isStudentVisible(x, me)).length;
// No uploaded cover in the demo → a category photo stands in on the preview card.
const photo = c.coverAssetId ? ds.assetUrl(c.coverAssetId) : coursePhoto(c, categories.map((k) => k.id));
const tabs: [string, string][] = [['overview', t('course.tabOverview')], ['content', t('course.content')], ['instructor', t('course.tabInstructor')]];
// Owners come back for the curriculum, buyers for the pitch (P4). Desktop shows one tab at a time;
// phones drop the tabs and stack every section in one scroll (P3).
const active = tab ?? (mine ? 'content' : 'overview');
const tabs: [string, string][] = [['overview', t('course.tabOverview')], ['content', t('course.content')]];
const quizzes = c.assessments ?? [];
const finalQuizzes = quizzes.filter((a) => !a.chapterId || !chapters.some((ch) => ch.id === a.chapterId && ch.lessons.some((l) => l.isPublished)));
const nextChapter = mine && r ? chapters.find((ch) => ch.lessons.some((l) => l.id === r.lesson.id))?.id : undefined;
const includes: [string, ReactNode][] = [
['globe', LOCALE_NAMES[c.instructionLocale]],
['video', t('course.lessons', { n: lessons.length })],
['clock', formatDuration(courseDuration(c))],
...(previews ? [['play', t('course.previewLessons', { n: previews })] as [string, ReactNode]] : []),
...(c.assessments?.length ? [['quiz', t('assess.title')] as [string, ReactNode]] : []),
['shield', t('course.lifetimeAccess')],
];
const showBar = !!(mine ? r : c.prices.ETB != null && c.status === 'PUBLISHED');
const barHidden = showBar && ctaInView;
return (
<div className="cd">
<section className="cd-head">
@ -576,21 +629,20 @@ function CoursePage({ slug }: { slug?: string }) {
</nav>
<span className="row" style={{ gap: 6 }}>
{c.status === 'ARCHIVED' && <StatusPill status="ARCHIVED" />}
{mine && <span className="cd-chip"><Icon name="check" size={12} />{done ? t('course.completed') : t('course.owned')}</span>}
<button className="cd-share" onClick={share} aria-label={t('course.share')}><Icon name="share" size={16} /></button>
</span>
</div>
<h1>{text.title}</h1>
<div className="cd-stats">
<span className="cd-pill"><Icon name="video" size={14} /><strong className="num">{lessons.length}</strong>{t('course.lessonsLabel')}</span>
<span className="cd-pill"><Icon name="clock" size={14} /><strong className="num">{formatDuration(courseDuration(c))}</strong></span>
{previews > 0 && <span className="muted small">{t('course.previewLessons', { n: previews })}</span>}
{mine && <span className="cd-pill cd-pill-own"><Icon name="check" size={14} /><strong>{done ? t('course.completed') : t('course.owned')}</strong></span>}
</div>
{(text.subtitle || text.description) && <p className="cd-lead">{text.subtitle || text.description}</p>}
{play && <button className="cd-hero-play" onClick={() => nav(play)}><span className="play-dot"><Icon name="play" size={12} /></span>{playLabel}</button>}
<div className="cd-by">
<span className="avatar" aria-hidden>{initials(c.instructorName)}</span>
<span className="cd-by-txt"><em>{t('course.createdBy')}</em><strong>{c.instructorName}</strong></span>
<span className="cd-updated"><Icon name="calendar" size={14} />{t('course.lastUpdated')} <span className="num">{fmtDate(c.updatedAt)}</span></span>
<span className="cd-by-txt"><em>{t('course.createdBy')}</em><strong>{c.instructorName}</strong><span className="cd-by-n">{t('course.teaches', { n: teaches })}</span></span>
</div>
</section>
@ -600,25 +652,25 @@ function CoursePage({ slug }: { slug?: string }) {
<div className="row-between"><strong>{done ? t('course.completed') : t('course.owned')}</strong><span className="small num">{p.pct}%</span></div>
<div className="bar"><i style={{ width: `${p.pct}%` }} /></div>
<span className="small muted num">{t('my.lessonsDone', { done: p.done, total: p.total })}</span>
{r && <div className="cd-cta"><button className={`btn btn-lg ${done ? 'btn-ghost' : 'btn-accent'}`} onClick={() => nav(`/${locale}/learn/${c.slug}/${r.lesson.id}`)}>{playLabel}</button><button className="cd-round" onClick={share} aria-label={t('course.share')}><Icon name="share" size={18} /></button></div>}
{pre && !preDone && <p className="cd-prereq"><Icon name="lock" size={14} /><span>{t('course.prereq', { title: ct(pre, locale).title })} <button className="link" onClick={() => nav(`/${locale}/course/${pre.slug}`)}>{t('course.prereqLink', { title: ct(pre, locale).title })}</button></span></p>}
{r && !done && <p className="cd-next"><span>{t('player.upNext')}</span><strong>{r.index + 1}. {lessonTitle(r.lesson, locale)}</strong><span className="num">{clock(r.lesson.durationSec)}</span></p>}
{r && <div className="cd-cta" ref={setCtaEl}><button className={`btn btn-lg ${done ? 'btn-ghost' : 'btn-accent'}`} onClick={() => nav(`/${locale}/learn/${c.slug}/${r.lesson.id}`)}>{playLabel}</button></div>}
</> : <>
{c.prices.ETB != null && <div className="cd-price"><span className="num">{formatMoney(c.prices.ETB, 'ETB')}</span><span>{t('course.lifetime')}</span></div>}
<div className="cd-cta">
<button className="btn btn-accent btn-lg" disabled={c.status !== 'PUBLISHED' || c.prices.ETB == null} onClick={() => nav(`/${locale}/checkout/${c.slug}`)}>{t('course.buy', { price: formatMoney(c.prices.ETB ?? 0, 'ETB') })}</button>
<button className="cd-round" onClick={share} aria-label={t('course.share')}><Icon name="share" size={18} /></button>
{c.prices.ETB != null && <div className="cd-price"><span className="num">{formatMoney(c.prices.ETB, 'ETB')}</span><span>{t('checkout.lifetime')}</span></div>}
{pre && !preDone && <p className="cd-prereq"><Icon name="lock" size={14} /><span>{t('course.prereq', { title: ct(pre, locale).title })} <button className="link" onClick={() => nav(`/${locale}/course/${pre.slug}`)}>{t('course.prereqLink', { title: ct(pre, locale).title })}</button></span></p>}
<div className="cd-cta" ref={setCtaEl}>
<button className="btn btn-accent btn-lg" disabled={c.status !== 'PUBLISHED' || c.prices.ETB == null} onClick={() => nav(`/${locale}/checkout/${c.slug}`)}>{t('course.buyShort')}</button>
</div>
<div className="cd-includes">
<h2>{t('course.includes')}</h2>
<ul>{includes.map(([icon, label], k) => <li key={k}><Icon name={icon} size={18} />{label}</li>)}</ul>
{c.sequentialLessons && <p className="small muted">{t('course.sequential')}</p>}
</div>
{preview && <button className="btn btn-ghost btn-block" onClick={() => nav(`/${locale}/learn/${c.slug}/${preview.id}`)}><Icon name="play" size={16} />{t('course.watchPreview')}</button>}
<p className="cd-note"><Icon name="lock" size={14} />{t('checkout.lifetime')}</p>
</>}
<div className="cd-includes">
<h2>{t('course.includes')}</h2>
<ul>{includes.map(([icon, label], k) => <li key={k}><Icon name={icon} size={18} />{label}</li>)}</ul>
{c.sequentialLessons && <p className="small muted">{t('course.sequential')}</p>}
</div>
</div>
</aside>
{(mine ? r : c.prices.ETB != null && c.status === 'PUBLISHED') && <div className="cd-bar">
{showBar && <div className="cd-bar" data-hidden={barHidden} aria-hidden={barHidden || undefined} inert={barHidden || undefined}>
{mine && r ? <>
<span className="cd-bar-txt"><strong className="num">{p.pct}%</strong><span>{t('my.lessonsDone', { done: p.done, total: p.total })}</span></span>
<button className="btn btn-accent" onClick={() => nav(`/${locale}/learn/${c.slug}/${r.lesson.id}`)}>{playLabel}</button>
@ -628,36 +680,38 @@ function CoursePage({ slug }: { slug?: string }) {
</>}
</div>}
<section className="cd-body">
{pre && !preDone && <div className="banner">{t('course.prereq', { title: ct(pre, locale).title })} <button className="link" onClick={() => nav(`/${locale}/course/${pre.slug}`)}>{t('course.prereqLink', { title: ct(pre, locale).title })}</button></div>}
<div className="cd-tabs" role="tablist">{tabs.map(([k, label]) => <button key={k} role="tab" aria-selected={tab === k} onClick={() => setTab(k)}>{label}</button>)}</div>
{tab === 'overview' && <div className="cd-pane">
{!!text.outcomes?.length && <>
<h2><KitIcon name="brush" size={22} />{t('course.outcomes')}</h2>
<ul className="cd-learn">{text.outcomes.map((o, k) => <li key={k}><Icon name="check" size={16} />{o}</li>)}</ul>
</>}
{text.description && <p style={{ whiteSpace: 'pre-line' }}>{text.description}</p>}
{text.audience && <p className="small"><strong>{t('course.audience')}: </strong>{text.audience}</p>}
<section className={`cd-body${mine ? ' is-owner' : ''}`}>
<div className="cd-tabs" role="tablist">{tabs.map(([k, label]) => <button key={k} role="tab" aria-selected={active === k} onClick={() => setTab(k)}>{label}</button>)}</div>
{!!text.outcomes?.length && <div className="cd-pane" data-tab="overview" data-active={active === 'overview'}>
<h2><KitIcon name="brush" size={22} />{t('course.outcomes')}</h2>
<ul className="cd-learn">{text.outcomes.map((o, k) => <li key={k}><Icon name="check" size={16} />{o}</li>)}</ul>
</div>}
{tab === 'content' && <div className="cd-pane cd-content">
<div className="cd-pane cd-content" data-tab="content" data-active={active === 'content'}>
<h2 className="cd-pane-h">{t('course.content')}</h2>
<p className="small muted num">{t('course.lessons', { n: lessons.length })} · {formatDuration(courseDuration(c))}</p>
{chapters.map((ch, i) => {
const ls = [...ch.lessons].sort((a, b) => a.sortOrder - b.sortOrder).filter((l) => l.isPublished);
if (!ls.length) return null;
const d = ls.filter((l) => isCompleted(me, l.id)).length;
return (
<details key={ch.id} className="ch" open={i === 0}>
<details key={ch.id} className="ch" open={nextChapter ? ch.id === nextChapter : i === 0}>
<summary><span className="grow"><strong>{tr(ch.translations, locale)?.title}</strong><span className="small muted num">{d}/{ls.length} · {formatDuration(ls.reduce((s, l) => s + l.durationSec, 0))}</span></span><Icon name="down" size={18} /></summary>
{ls.map((l) => <LessonRow key={l.id} c={c} l={l} />)}
{quizzes.filter((a) => a.chapterId === ch.id).map((a) => <AssessmentRow key={a.id} c={c} a={a} inline />)}
</details>
);
})}
{!!c.assessments?.length && <details className="ch" open>
<summary><span className="grow"><strong>{t('assess.title')}</strong><span className="small muted num">{c.assessments.filter((a) => me?.assessments?.[a.id]?.passed).length}/{c.assessments.length}</span></span><Icon name="down" size={18} /></summary>
{c.assessments.map((a) => <AssessmentRow key={a.id} c={c} a={a} />)}
{!!finalQuizzes.length && <details className="ch" open>
<summary><span className="grow"><strong>{t('assess.title')}</strong><span className="small muted num">{finalQuizzes.filter((a) => me?.assessments?.[a.id]?.passed).length}/{finalQuizzes.length}</span></span><Icon name="down" size={18} /></summary>
{finalQuizzes.map((a) => <AssessmentRow key={a.id} c={c} a={a} />)}
</details>}
</div>
{(text.description || text.audience) && <div className="cd-pane" data-tab="overview" data-active={active === 'overview'}>
<h2>{t('course.about')}</h2>
{text.description && <p style={{ whiteSpace: 'pre-line' }}>{text.description}</p>}
{text.audience && <p className="small"><strong>{t('course.audience')}: </strong>{text.audience}</p>}
<p className="cd-updated"><Icon name="calendar" size={14} />{t('course.lastUpdated')} <span className="num">{fmtDate(c.updatedAt)}</span></p>
</div>}
{tab === 'instructor' && <div className="cd-pane"><div className="row"><span className="avatar avatar-lg" aria-hidden>{initials(c.instructorName)}</span><div><strong>{c.instructorName}</strong><p className="small muted">{t('course.teaches', { n: teaches })}</p></div></div></div>}
</section>
</div>
);
@ -672,9 +726,9 @@ function LessonRow({ c, l, current }: { c: Course; l: Lesson; current?: boolean
const seen = !done && l.durationSec ? Math.min(100, ((me?.progress?.[l.id]?.maxPositionSec ?? 0) / l.durationSec) * 100) : 0;
return (
<button className={`lesson-row${current ? ' is-current' : ''}${done ? ' is-done' : ''}${access.ok ? '' : ' is-locked'}`} aria-current={current ? 'step' : undefined} onClick={() => nav(`/${locale}/learn/${c.slug}/${l.id}`)}>
<span className="lr-ic" aria-hidden>{current && !done ? <span className="eq"><i /><i /><i /></span> : done ? <Icon name="check" size={14} /> : access.ok ? <span className="num">{n}</span> : <Icon name="lock" size={14} />}</span>
<span className="lr-ic" aria-hidden>{current && !done ? <span className="eq"><i /><i /><i /></span> : done ? <Icon name="check" size={14} /> : access.ok ? <Icon name="play" size={12} /> : <Icon name="lock" size={14} />}</span>
<span className="lr-txt">
<span className="lr-title">{current || done || !access.ok ? `${n}. ` : ''}{lessonTitle(l, locale)}</span>
<span className="lr-title">{n}. {lessonTitle(l, locale)}</span>
<span className="lr-meta num">{clock(l.durationSec)}{l.isPreview && !owns(me, c.id) && <span className="lr-tag">{t('course.preview')}</span>}{!access.ok && access.reason === 'COMING_SOON' && <span className="lr-tag">{t('course.comingSoon')}</span>}</span>
{seen > 0 && <span className="lr-seen" aria-hidden><i style={{ width: `${seen}%` }} /></span>}
</span>
@ -685,18 +739,21 @@ function LessonRow({ c, l, current }: { c: Course; l: Lesson; current?: boolean
// ---------------------------------------------------------------- assessments
function AssessmentRow({ c, a }: { c: Course; a: Assessment }) {
function AssessmentRow({ c, a, inline }: { c: Course; a: Assessment; inline?: boolean }) {
const t = useTranslations();
const { me, locale, nav } = useApp();
const r = me?.assessments?.[a.id];
const mine = owns(me, c.id);
const ch = a.chapterId ? c.chapters.find((x) => x.id === a.chapterId) : undefined;
const where = ch ? t('assess.chapter', { chapter: tr(ch.translations, locale)?.title ?? '' }) : t('assess.final');
const where = inline ? '' : ch ? t('assess.chapter', { chapter: tr(ch.translations, locale)?.title ?? '' }) : t('assess.final');
return (
<button className="lesson-row" onClick={() => nav(`/${locale}/assess/${c.slug}/${a.id}`)}>
<span className={`ic ${r?.passed ? 'done' : ''}`}>{r?.passed ? <Icon name="check" size={14} /> : owns(me, c.id) ? <Icon name="quiz" size={14} /> : <Icon name="lock" size={14} />}</span>
<span className="grow"><span style={{ display: 'block', fontWeight: 700 }}>{tr(a.translations, locale)?.title}</span>
<span className="small muted num">{where} · {t('assess.questions', { n: a.questions.length })}</span>
{r && <span className={`small num ${r.passed ? 'quiz-ok' : 'quiz-todo'}`}>{r.passed ? t('assess.passed') : t('assess.notPassed')} · {t('assess.best', { pct: r.bestPct })}</span>}</span>
<button className={`lesson-row is-quiz${r?.passed ? ' is-done' : ''}${mine ? '' : ' is-locked'}`} onClick={() => nav(`/${locale}/assess/${c.slug}/${a.id}`)}>
<span className="lr-ic" aria-hidden>{r?.passed ? <Icon name="check" size={14} /> : mine ? <Icon name="quiz" size={14} /> : <Icon name="lock" size={14} />}</span>
<span className="lr-txt">
<span className="lr-title">{tr(a.translations, locale)?.title}</span>
<span className="lr-meta num">{where && <>{where} · </>}{t('assess.questions', { n: a.questions.length })}
{r && <span className={`lr-tag ${r.passed ? 'quiz-ok' : 'quiz-todo'}`}>{r.passed ? t('assess.passed') : t('assess.notPassed')} · {t('assess.best', { pct: r.bestPct })}</span>}</span>
</span>
<Icon name="chevron" size={16} />
</button>
);
@ -791,30 +848,33 @@ function AssessmentPage({ slug, id }: { slug?: string; id?: string }) {
function Player({ slug, lessonId }: { slug?: string; lessonId?: string }) {
const t = useTranslations();
const { courses, me, locale, nav, catalogLoaded, signedIn, viewer } = useApp();
const sheet = useRef<HTMLDialogElement>(null);
useEffect(() => { sheet.current?.close(); }, [lessonId]); // picking a lesson in the sheet closes it
const c = courses.find((x) => x.slug === slug);
const lessons = c ? publishedLessons(c) : [];
const lesson = lessons.find((l) => l.id === lessonId);
if (!catalogLoaded) return <Skeleton h={320} />;
if (!c || !lesson || !isStudentVisible(c, me)) return <Empty action={<button className="btn" onClick={() => nav(`/${locale}/courses`)}>{t('catalog.title')}</button>}>{t('course.notFound')}</Empty>;
const access = lessonAccess(c, lesson, signedIn ? me : null, courses);
const p = courseProgress(c, me);
const idx = lessons.indexOf(lesson);
const next = lessons[idx + 1];
const notes = tr(lesson.translations, locale)?.description;
const chapter = c.chapters.find((ch) => ch.lessons.some((l) => l.id === lesson.id));
// L2: the video comes first; where you are (course, chapter, lesson) sits right under it
const head = (
<div className="p-head">
<p className="p-crumb">
<button onClick={() => nav(`/${locale}/course/${c.slug}`)} aria-label={`${t('player.back')}: ${ct(c, locale).title}`}><Icon name="back" size={14} />{ct(c, locale).title}</button>
{chapter && <span>{tr(chapter.translations, locale)?.title}</span>}
</p>
<h1>{idx + 1}. {lessonTitle(lesson, locale)}</h1>
</div>
);
return (
<div className="stack">
<div className="row-between">
<button className="btn btn-quiet" onClick={() => nav(`/${locale}/course/${c.slug}`)}><Icon name="back" size={16} />{t('player.back')}</button>
<span className="small muted">{ct(c, locale).title}</span>
</div>
<div className="p-wrap">
<div className="stack">
<div className="stack-sm">
<span className="small muted">{tr(chapter?.translations, locale)?.title}</span>
<h1 style={{ fontSize: 'var(--fs-xl)' }}>{idx + 1}. {lessonTitle(lesson, locale)}</h1>
</div>
{access.ok ? <VideoPanel key={lesson.id} c={c} lesson={lesson} next={next} /> : (
<div className="stack p-main">
{access.ok ? <VideoPanel key={lesson.id} c={c} lesson={lesson} next={next} head={head} /> : <>
<div className="screen"><div className="sim">
<Icon name="lock" size={36} />
<p>{t(`player.${access.reason}`)}</p>
@ -823,44 +883,63 @@ function Player({ slug, lessonId }: { slug?: string; lessonId?: string }) {
{access.reason === 'PREREQUISITE_REQUIRED' && <button className="btn btn-accent" onClick={() => { const pre = courses.find((x) => x.id === c.prerequisiteCourseId); if (pre) nav(`/${locale}/course/${pre.slug}`); }}>{t('course.prereqLink', { title: ct(courses.find((x) => x.id === c.prerequisiteCourseId) ?? c, locale).title })}</button>}
{access.reason === 'ACCOUNT_DEACTIVATED' && <button className="btn btn-accent" onClick={() => nav(`/${locale}/help`)}>{t('nav.help')}</button>}
</div></div>
)}
<div className="card stack-sm">
{head}
</>}
{/* L5: only real lesson notes; no card standing in with the course blurb */}
{notes && <div className="card stack-sm">
<h2 style={{ fontSize: 'var(--fs-lg)' }}>{t('player.notes')}</h2>
<p style={{ whiteSpace: 'pre-line', color: 'var(--ink-2)' }}>{notes || ct(c, locale).subtitle || ct(c, locale).description}</p>
</div>
<p style={{ whiteSpace: 'pre-line', color: 'var(--ink-2)' }}>{notes}</p>
</div>}
</div>
<aside className="card p-side p-side-order" aria-label={t('player.contents')}>
<div className="ps-head">
{owns(me, c.id) && <Ring pct={p.pct} size={52} />}
<div className="ps-head-txt"><span className="ps-kicker">{t('course.content')}</span><strong>{ct(c, locale).title}</strong>
{owns(me, c.id) && <span className="small muted num">{t('player.progress', { done: p.done, total: p.total })}</span>}</div>
</div>
{[...c.chapters].sort((a, b) => a.sortOrder - b.sortOrder).map((ch, ci) => {
const ls = [...ch.lessons].sort((a, b) => a.sortOrder - b.sortOrder).filter((l) => l.isPublished);
if (!ls.length) return null;
const doneN = ls.filter((l) => isCompleted(me, l.id)).length;
return <details key={ch.id} className={`ps-ch${doneN === ls.length ? ' is-done' : ''}`} open={ls.some((l) => l.id === lesson.id) || undefined}>
<summary>
<span className="ps-ch-n num">{doneN === ls.length ? <Icon name="check" size={14} /> : String(ci + 1).padStart(2, '0')}</span>
<span className="ps-ch-txt"><strong>{tr(ch.translations, locale)?.title}</strong><span className="small muted num">{doneN}/{ls.length} · {clock(ls.reduce((a, l) => a + l.durationSec, 0))}</span></span>
<Icon name="down" size={16} />
</summary>
<div className="ps-ch-list">{ls.map((l) => <LessonRow key={l.id} c={c} l={l} current={l.id === lesson.id} />)}</div>
</details>;
})}
</aside>
<aside className="card p-side p-side-order" aria-label={t('player.contents')}><CourseContents c={c} lesson={lesson} /></aside>
</div>
{viewer && !viewer.id && <p className="small muted">{t('auth.noIdentity')}</p>}
<nav className="l-bar" aria-label={t('player.contents')}>
<button disabled={idx === 0} onClick={() => nav(`/${locale}/learn/${c.slug}/${lessons[idx - 1].id}`)}><Icon name="back" size={18} />{t('player.prev')}</button>
<button onClick={() => document.querySelector('.p-side')?.scrollIntoView({ behavior: 'smooth' })}><Icon name="list" size={18} /><span className="num">{idx + 1} / {lessons.length}</span></button>
<button className="l-next" disabled={!next} onClick={() => nav(`/${locale}/learn/${c.slug}/${next.id}`)}>{t('player.next')}<Icon name="chevron" size={18} /></button>
<button aria-haspopup="dialog" onClick={() => sheet.current?.showModal()}><Icon name="list" size={18} /><span className="num">{idx + 1} / {lessons.length}</span></button>
<button className="l-next" disabled={!next} onClick={() => nav(`/${locale}/learn/${c.slug}/${next.id}`)}>{t('player.nextShort')}<Icon name="chevron" size={18} /></button>
</nav>
{/* L6: on phones and tablets the lesson list slides up over the video instead of scrolling the page away from it */}
<dialog ref={sheet} className="lsheet" aria-label={t('player.contents')} onClick={(e) => { if (e.target === sheet.current) sheet.current?.close(); }}>
<div className="lsheet-in">
<div className="lsheet-top"><span className="lsheet-grip" aria-hidden /><button className="icon-btn" aria-label={t('common.close')} onClick={() => sheet.current?.close()}><Icon name="x" size={20} /></button></div>
<CourseContents c={c} lesson={lesson} />
</div>
</dialog>
</div>
);
}
function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Lesson }) {
// The course's chapters and lessons with progress: the player's sidebar on desktop and its lesson sheet on phones.
function CourseContents({ c, lesson }: { c: Course; lesson: Lesson }) {
const t = useTranslations();
const { me, locale } = useApp();
const p = courseProgress(c, me);
return <>
<div className="ps-head">
{owns(me, c.id) && <Ring pct={p.pct} size={52} />}
<div className="ps-head-txt"><span className="ps-kicker">{t('course.content')}</span><strong>{ct(c, locale).title}</strong>
{owns(me, c.id) && <span className="small muted num">{t('player.progress', { done: p.done, total: p.total })}</span>}</div>
</div>
{[...c.chapters].sort((a, b) => a.sortOrder - b.sortOrder).map((ch, ci) => {
const ls = [...ch.lessons].sort((a, b) => a.sortOrder - b.sortOrder).filter((l) => l.isPublished);
if (!ls.length) return null;
const doneN = ls.filter((l) => isCompleted(me, l.id)).length;
return <details key={ch.id} className={`ps-ch${doneN === ls.length ? ' is-done' : ''}`} open={ls.some((l) => l.id === lesson.id) || undefined}>
<summary>
<span className="ps-ch-n num">{doneN === ls.length ? <Icon name="check" size={14} /> : String(ci + 1).padStart(2, '0')}</span>
<span className="ps-ch-txt"><strong>{tr(ch.translations, locale)?.title}</strong><span className="small muted num">{doneN}/{ls.length} · {clock(ls.reduce((a, l) => a + l.durationSec, 0))}</span></span>
<Icon name="down" size={16} />
</summary>
<div className="ps-ch-list">{ls.map((l) => <LessonRow key={l.id} c={c} l={l} current={l.id === lesson.id} />)}</div>
</details>;
})}
</>;
}
const AUTO_NEXT_SEC = 5;
function VideoPanel({ c, lesson, next, head }: { c: Course; lesson: Lesson; next?: Lesson; head?: ReactNode }) {
const t = useTranslations();
const { me, locale, nav, ds, write, signedIn, viewer } = useApp();
const vimeo = !lesson.videoAssetId; // no upload yet: play the Vimeo placeholder instead
@ -874,6 +953,9 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
const [saver, setSaver] = useState<boolean>(() => !!conn && (conn.saveData || /2g|3g/.test(conn.effectiveType ?? '')));
const [quality, setQuality] = useState('auto');
const [justDone, setJustDone] = useState(false);
// L4: when a lesson ends, "up next" appears over the video and plays it after a short count the student can cancel
const [ended, setEnded] = useState(false);
const [auto, setAuto] = useState<number | null>(null);
const videoRef = useRef<HTMLVideoElement>(null);
const frameRef = useRef<HTMLIFrameElement>(null);
const screenRef = useRef<HTMLDivElement>(null);
@ -907,8 +989,9 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
let m: any; try { m = typeof e.data === 'string' ? JSON.parse(e.data) : e.data; } catch { return; }
if (m.event === 'ready') vlisten();
else if (m.event === 'timeupdate') { setPos(m.data.seconds); if (m.data.duration) setVdur(m.data.duration); }
else if (m.event === 'play') setPlaying(true);
else if (m.event === 'pause' || m.event === 'ended') setPlaying(false);
else if (m.event === 'play') { setPlaying(true); setEnded(false); setAuto(null); }
else if (m.event === 'pause') setPlaying(false);
else if (m.event === 'ended') { setPlaying(false); setEnded(true); }
else if (m.method === 'getDuration' && m.value) setVdur(m.value);
};
addEventListener('message', on);
@ -923,6 +1006,14 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
}, [heartbeat]);
useEffect(() => { const v = videoRef.current; if (v) v.playbackRate = rate; }, [rate]);
useEffect(() => { if (vimeo && rate !== 1) vcall('setPlaybackRate', rate); }, [rate]);
const goNext = () => { if (next) nav(`/${locale}/learn/${c.slug}/${next.id}`); };
useEffect(() => { if (ended && next) setAuto(AUTO_NEXT_SEC); }, [ended, next]);
useEffect(() => {
if (auto == null) return;
if (auto <= 0) { goNext(); return; }
const id = setTimeout(() => setAuto((a) => (a == null ? null : a - 1)), 1000);
return () => clearTimeout(id);
}, [auto]);
const toggle = () => {
const v = videoRef.current;
@ -933,6 +1024,7 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
const full = () => { screenRef.current?.requestFullscreen?.().catch(() => { /* not allowed in this frame */ }); };
const onKey = (e: React.KeyboardEvent) => {
if ((e.target as HTMLElement).tagName === 'SELECT' || (e.target as HTMLElement).tagName === 'INPUT') return;
if (e.key === 'Escape' && auto != null) { setAuto(null); return; }
if (e.key === ' ') { e.preventDefault(); toggle(); } else if (e.key === 'ArrowLeft') seek(pos - 10); else if (e.key === 'ArrowRight') seek(pos + 10); else if (e.key === 'f') full(); else if (e.key === 'm' && videoRef.current) videoRef.current.muted = !videoRef.current.muted;
};
const mark = (me?.phone || me?.email || viewer?.name || 'student').replace(/^(.{3}).*(.{2})$/, '$1•••$2');
@ -944,11 +1036,20 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
{lesson.videoAssetId ? (
<video ref={videoRef} src={ds.assetUrl(lesson.videoAssetId)} playsInline preload="metadata"
onLoadedMetadata={(e) => { if (pos) e.currentTarget.currentTime = pos; }}
onTimeUpdate={(e) => setPos(e.currentTarget.currentTime)} onPlay={() => setPlaying(true)} onPause={() => setPlaying(false)} onEnded={() => setPlaying(false)} />
onTimeUpdate={(e) => setPos(e.currentTarget.currentTime)} onPlay={() => { setPlaying(true); setEnded(false); setAuto(null); }} onPause={() => setPlaying(false)} onEnded={() => { setPlaying(false); setEnded(true); }} />
) : (
<iframe ref={frameRef} src={VIMEO_PLACEHOLDER} onLoad={vlisten} title={lessonTitle(lesson, locale)} allow="autoplay; fullscreen; picture-in-picture" allowFullScreen />
)}
{canSave && <span className="wm" aria-hidden>{mark}</span>}
{auto != null && next && <div className="p-upnext" role="status">
<span className="p-upnext-k">{t('player.upNext')}</span>
<strong>{lessonNumber(c, next.id)}. {lessonTitle(next, locale)}</strong>
<span className="p-upnext-n num" aria-hidden><svg viewBox="0 0 24 24" width="18" height="18"><circle cx="12" cy="12" r="10" /></svg>{t('player.autoNext', { n: auto })}</span>
<div className="p-upnext-go">
<button className="btn btn-accent" onClick={goNext}><Icon name="play" size={14} />{t('player.playNow')}</button>
<button className="btn btn-quiet" onClick={() => setAuto(null)}>{t('common.cancel')}</button>
</div>
</div>}
{!vimeo && <div className="controls">
<input type="range" min={0} max={dur} step={1} value={Math.floor(pos)} onChange={(e) => seek(Number(e.target.value))} aria-label={`${clock(pos)} / ${clock(dur)}`} />
<div className="row">
@ -968,7 +1069,8 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
</div>
</div>}
</div>
{vimeo && <p className="small muted">{t('player.demoVideo')}{canSave && !done && <> · <button className="link" onClick={() => { setPos(dur); posRef.current = dur; heartbeat(); }}>{t('player.markWatched')}</button></>}</p>}
{head}
{vimeo && <p className="small muted">{t('player.demoVideo')}{canSave && !done && <> · <button className="link" onClick={() => { setPos(dur); posRef.current = dur; heartbeat(); setEnded(true); }}>{t('player.markWatched')}</button></>}</p>}
{done && pct === 100 && (
<div className="course-done" role="status">
<div className="confetti" aria-hidden>{Array.from({ length: 18 }, (_, k) => <i key={k} style={{ '--k': k } as React.CSSProperties} />)}</div>
@ -981,7 +1083,7 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
</div>
</div>
)}
{done && pct < 100 && (
{done && pct < 100 && auto == null && (
<div className="lesson-done" role="status">
<span className="ld-check" aria-hidden><svg viewBox="0 0 24 24" width="22" height="22"><path d="M5 12.5l4.5 4.5L19 7" /></svg></span>
<span className="ld-txt"><strong>{t('player.completed')}</strong><span className="small muted num">{t('player.courseProgress', { pct })}</span></span>

View File

@ -167,14 +167,44 @@ textarea.input { min-height: 110px; resize: vertical; }
.tone-sand { background: var(--tone-sand); } .tone-sage { background: var(--tone-sage); } .tone-ink { background: var(--tone-ink); }
.grid-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-cards > * { max-width: 440px; }
.ccard { display: flex; flex-direction: column; gap: 10px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.ccard h3 { font-size: var(--fs-lg); }
.ccard:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.ccard .meta { font-size: var(--fs-sm); color: var(--ink-3); }
.continue { display: grid; gap: 20px; grid-template-columns: 1fr; padding: 20px; border-radius: var(--r-lg); background: var(--ink); color: var(--on-ink); }
.continue .bar { background: rgba(255, 255, 255, .18); }
@media (min-width: 720px) { .continue { grid-template-columns: 260px 1fr; align-items: center; } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
/* home: greeting + continue card (H1–H3). The card is a dark photo surface in both themes. */
.home-top { display: flex; flex-direction: column; gap: 16px; }
.continue { display: grid; grid-template-columns: 1fr; border-radius: 22px; overflow: hidden; background: #111; color: #F5F5F5; }
.continue-media { position: relative; isolation: isolate; aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 16px 18px 22px; }
.continue-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; z-index: -2; }
.continue-media::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 10, 10, 0) 30%, rgba(10, 10, 10, .82)); }
.continue-kicker, .continue-next > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(245, 245, 245, .75); }
.continue-media h2 { font-size: var(--fs-xl); line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.continue-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .2); }
.continue-bar > i { display: block; height: 100%; background: #fff; }
.continue-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 18px 18px; }
.continue-next { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.continue-next strong { font-size: var(--fs-lg); line-height: 1.3; }
.continue-next > .num { font-size: var(--fs-sm); color: #A3A3A3; }
.continue-body .btn { width: 100%; border-radius: 999px; }
.continue .btn-accent { background: #F5F5F5; color: #0A0A0A; }
@media (min-width: 720px) {
.continue { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.continue-media { aspect-ratio: auto; min-height: 260px; padding: 20px 24px 26px; }
.continue-body { justify-content: center; padding: 24px 28px; }
.continue-body .btn { align-self: flex-start; width: auto; }
}
/* CT1: chip rows scroll without a visible scrollbar; the faded edge says there's more */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chips::-webkit-scrollbar { display: none; }
@media (max-width: 599px) { .chips { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 32px), transparent); } }
/* CT2: search with an icon and a clear button (the browser's own cancel glyph is hidden so there's only one) */
.search { position: relative; display: block; }
.search > svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.search .input { min-height: 48px; padding-inline: 42px 46px; border-radius: 14px; }
.search .input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear { position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .search-clear:hover { color: var(--ink); background: var(--mist); } }
/* CT3: result count with the "taught in" filter beside it */
.catalog-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.catalog-lang { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-3); }
.catalog-lang select { min-height: 40px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
@media (pointer: coarse) { .catalog-lang select { font-size: 16px; } } /* iOS zooms into anything smaller */
.chip { flex: none; border: 1px solid var(--line); background: var(--paper); padding: 8px 14px; border-radius: var(--r-pill); cursor: pointer; font-weight: 700; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
@ -261,11 +291,6 @@ table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
/* compact course rows on phones (§11.2: catalog cards are compact; the Continue card stays wide) */
@media (max-width: 599px) {
.grid-cards { grid-template-columns: 1fr; gap: 14px; }
.ccard { display: grid; grid-template-columns: 104px 1fr; gap: 2px 14px; align-items: start; }
.ccard .cover { grid-row: 1 / span 4; aspect-ratio: 1; padding: 8px; }
.ccard .cover .ttl { font-size: 13px; -webkit-line-clamp: 4; }
.ccard .cover .pill { display: none; }
.ccard h3 { font-size: var(--fs-base); }
}
/* audit fixes: no sideways scroll at 360–400px */
@media (max-width: 600px) { .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .stat { min-width: 0; } .stat .lbl { flex-wrap: wrap; letter-spacing: .03em; } .stat .lbl span { overflow-wrap: anywhere; } }
@ -273,7 +298,6 @@ table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.cover .ttl { margin-top: auto; }
.hero-card .cover { aspect-ratio: 16 / 10; }
.hero-card .cover .ttl { font-size: clamp(24px, 3.2vw, 36px); }
.ccard .cover { aspect-ratio: 16 / 9; }
/* touch targets: 40px minimum everywhere, 44px on touch screens */
.btn-sm { min-height: 40px; }
@media (pointer: coarse) { .btn-sm, .controls button, .controls select { min-height: 44px; min-width: 44px; } .lesson-row { min-height: 56px; } }
@ -363,22 +387,6 @@ h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .b
.cta-band { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; padding: 36px; border-radius: 24px; background: var(--ink); color: var(--on-ink); }
.cta-band h2 { font-size: var(--fs-xl); } .cta-band p { opacity: .8; }
/* course cards */
.ccard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; gap: 0; transition: box-shadow .2s, transform .2s; }
.ccard:hover { box-shadow: var(--shadow-soft); transform: translateY(-2px); border-color: transparent; }
.ccard:hover h3 { text-decoration: none; }
.ccard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 8px 6px; min-width: 0; }
.ccard .meta { display: flex; gap: 14px; flex-wrap: wrap; }
.ccard .meta > span { display: inline-flex; align-items: center; gap: 5px; }
.ccard-by { font-size: var(--fs-sm); color: var(--ink-2); }
.ccard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.ccard-cta { font-size: var(--fs-sm); font-weight: 700; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); }
.ccard:hover .ccard-cta { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
@media (max-width: 599px) {
.ccard { padding: 8px; grid-template-columns: 96px 1fr; gap: 0 12px; }
.ccard .cover { grid-row: auto; }
.ccard-body { padding: 2px 0; gap: 4px; } .ccard-by { display: none; } .ccard-foot { padding-top: 8px; } .ccard-cta { display: none; }
}
/* course page */
.c-page { display: flex; flex-direction: column; gap: 20px; }
@ -467,8 +475,6 @@ h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .b
.cta-band { position: relative; overflow: hidden; background: #111; color: #fff; }
.cta-band::after { content: ''; position: absolute; right: -60px; bottom: -120px; width: 280px; height: 280px; border-radius: 50%; background: #fff; opacity: .12; pointer-events: none; }
.cta-band > * { position: relative; z-index: 1; }
.continue { background: #111; color: #fff; }
.continue .bar > i { background: #fff; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.pay-mark { width: 48px; height: 28px; flex: none; display: grid; place-items: center; }
.pay-mark img { width: 48px; height: 28px; object-fit: contain; }
@ -546,8 +552,6 @@ fieldset[disabled] .quiz-opt { cursor: default; }
.thumb .cover .ttl { font-size: 15px; line-height: 1.3; -webkit-line-clamp: 2; }
/* phone course rows: square thumbnail that shows the title instead of an empty swatch */
@media (max-width: 599px) {
.ccard .cover { aspect-ratio: 1; padding: 8px; }
.ccard .cover .ttl { font-size: 13px; line-height: 1.3; -webkit-line-clamp: 3; max-width: 100%; }
.my-row .btn { flex: 1 1 100%; }
}
.prog-head .grow { flex: 1 1 160px; }
@ -798,8 +802,6 @@ fieldset[disabled] .quiz-opt { cursor: default; }
.cd-price > span:last-child { font-weight: 700; font-size: var(--fs-sm); color: var(--ink-2); }
.cd-cta { display: flex; gap: 10px; }
.cd-cta .btn { flex: 1; border-radius: 999px; min-height: 54px; }
.cd-round { flex: none; width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background 160ms; }
.cd-round:hover { background: var(--mist); }
.cd-buy .btn-ghost.btn-block { border-radius: 999px; }
.cd-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); padding: 0 4px; }
.cd-includes { padding: 6px 4px 4px; display: flex; flex-direction: column; gap: 10px; }
@ -905,6 +907,45 @@ fieldset[disabled] .quiz-opt { cursor: default; }
.cd-bar .btn { border-radius: 999px; min-height: 48px; padding-inline: 22px; }
@media (min-width: 1024px) { .cd-bar { display: none; } }
/* ---------- course page polish 2026-10-26 (P1–P5) ---------- */
/* P1: the bar repeats the buy card's button, so it steps aside while that button is on screen */
.cd-bar { transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out); }
.cd-bar[data-hidden="true"] { transform: translateY(100%); opacity: 0; pointer-events: none; }
/* P2: price once, with its terms underneath */
.cd-price { flex-direction: column; align-items: flex-start; gap: 2px; }
.cd-price > span:last-child { font-weight: 600; color: var(--ink-3); }
/* P4: owners see the next lesson instead of the sales list */
.cd-next { margin: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--mist); }
.cd-next > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cd-next > .num { font-size: var(--fs-sm); color: var(--ink-3); }
/* P5: what the instructor tab said, in the creator row */
.cd-by-n { font-size: 12px; color: var(--ink-3); }
/* P3: desktop keeps tabs (one section at a time); phones drop them and stack every section in one scroll */
.cd-pane-h { margin-bottom: 4px; }
@media (min-width: 1024px) { .cd-pane[data-active="false"], .cd-pane-h { display: none; } }
@media (max-width: 1023px) {
.cd-tabs { display: none; }
.cd-body { gap: 0; }
.cd-body.is-owner > .cd-content { order: -1; } /* P4: owners land on the curriculum */
}
/* P8: share is a quiet glass button in the hero corner, matching the preview pill */
.cd-top { flex-wrap: nowrap; align-items: flex-start; }
.cd-top > .crumbs { flex: 1; min-width: 0; }
.cd-top > .row { margin-left: auto; flex-wrap: nowrap; }
.cd-share { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(10, 10, 10, .45); backdrop-filter: blur(8px); color: #fff; cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.cd-share:active { transform: scale(.96); }
.cd-head .cd-pill-own { background: rgba(245, 245, 245, .92); border-color: transparent; color: #0A0A0A; }
.cd-head .cd-pill-own svg, .cd-head .cd-pill-own strong { color: #0A0A0A; }
@media (hover: hover) and (pointer: fine) { .cd-share:hover { background: rgba(30, 30, 30, .7); } }
/* P9: the prerequisite, said where the buying decision happens */
.cd-prereq { margin: 0; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--mist); font-size: var(--fs-sm); color: var(--ink-2); }
.cd-prereq > svg { flex: none; margin-top: 3px; color: var(--ink-3); }
.cd-prereq .link { font-weight: 700; }
/* P6: "last updated" closes the About section */
.cd-pane .cd-updated { margin: 0; }
/* P7: quiz rows inside chapters reuse the lesson row; their result is a tag, not a block line */
.lesson-row .lr-tag.quiz-ok, .lesson-row .lr-tag.quiz-todo { display: inline-block; font-weight: 600; }
/* help: big ask, three contact doors, FAQ beside the report form */
.help { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); }
.help-hero { display: flex; flex-direction: column; gap: 10px; padding-top: clamp(8px, 3vw, 32px); }
@ -1026,18 +1067,42 @@ fieldset[disabled] .quiz-opt { cursor: default; }
@media (min-width: 900px) { .tour-card.at-bottom { bottom: 32px; } }
@media (prefers-reduced-motion: reduce) { .tour-ring, .tour-card, .tour-dim { transition: none; animation: none; } }
/* ---------- course cards 2026-10-20: edge-to-edge photo, enrolled count, arrow that inverts on hover ---------- */
.ccard { padding: 0; overflow: hidden; border-radius: 22px; }
.ccard .cover { border-radius: 0; overflow: hidden; }
/* ---------- course card (C1–C4, 2026-10-27): the one place card styles live ----------
Photo on top with the category and a "new course" / students tag on it; one quiet info line; the footer is the
price, or progress plus the next lesson once owned. Phones show a compact row unless the card is .ccard-tall. */
.ccard { display: flex; flex-direction: column; min-width: 0; padding: 0; text-align: start; cursor: pointer; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.ccard .cover { aspect-ratio: 16 / 9; border-radius: 0; overflow: hidden; }
.ccard .cover img { transition: transform 700ms var(--ease-out); }
.ccard:hover .cover img { transform: scale(1.05); }
.ccard-body { padding: 16px 16px 14px; }
.ccard h3 { letter-spacing: -.02em; line-height: 1.25; }
.ccard .meta { gap: 6px 12px; }
.ccard-go { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); transition: background 200ms, color 200ms, border-color 200ms, transform 240ms var(--ease-out); }
.ccard:hover .ccard-go, .ccard:focus-visible .ccard-go { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateX(2px); }
@media (max-width: 600px) { .ccard { padding: 8px; border-radius: 18px; } .ccard .cover { border-radius: 12px; } .ccard-body { padding: 2px 0; } .ccard-go { width: 32px; height: 32px; } }
@media (hover: none) { .ccard:hover .cover img { transform: none; } }
.ccard-tag { position: absolute; z-index: 1; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(10, 10, 10, .62); backdrop-filter: blur(8px); color: #F5F5F5; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ccard-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; min-width: 0; flex: 1; }
.ccard h3 { font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -.02em; }
.ccard .meta { font-size: var(--fs-sm); color: var(--ink-3); }
.ccard-by { font-size: var(--fs-sm); color: var(--ink-2); }
.ccard-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.ccard-foot > strong { font-size: var(--fs-lg); }
.ccard-next { font-size: var(--fs-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-next b { color: var(--ink); font-weight: 700; }
.ccard-prog { display: flex; align-items: center; gap: 10px; }
@media (hover: hover) and (pointer: fine) {
.ccard:hover { box-shadow: var(--shadow-soft); transform: translateY(-2px); border-color: transparent; }
.ccard:hover .cover img { transform: scale(1.05); }
}
/* phones: compact row (square thumbnail beside the text), except tall cards in a rail */
@media (max-width: 599px) {
.ccard:not(.ccard-tall) { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 12px; align-items: start; padding: 8px; border-radius: 18px; }
.ccard:not(.ccard-tall) .cover { aspect-ratio: 1; border-radius: 12px; padding: 8px; }
.ccard:not(.ccard-tall) .cover .pill { display: none; }
.ccard:not(.ccard-tall) .ccard-tag { left: 6px; right: 6px; bottom: 6px; padding: 2px 6px; font-size: 11px; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.ccard:not(.ccard-tall) .ccard-body { padding: 2px 0; gap: 4px; }
.ccard:not(.ccard-tall) h3 { font-size: var(--fs-base); }
.ccard:not(.ccard-tall) .ccard-by { display: none; }
.ccard:not(.ccard-tall) .ccard-foot { padding-top: 8px; gap: 6px; }
}
/* C4: home Featured is a swipe rail of tall cards; the next card peeks past the edge */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (max-width: 599px) { .rail { grid-auto-columns: 78%; gap: 12px; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; } }
/* ---------- how it works: abstract art instead of portraits ---------- */
.step { background: var(--paper); border: 1px solid var(--line); color: var(--ink); justify-content: flex-end; min-height: 300px; }
@ -1100,7 +1165,7 @@ fieldset[disabled] .quiz-opt { cursor: default; }
.ps-ch summary:hover { background: var(--mist); }
.ps-ch summary > svg { flex: none; color: var(--ink-3); transition: transform 200ms var(--ease-out); }
.ps-ch[open] summary > svg { transform: rotate(180deg); }
.ps-ch-n { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--mist); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ps-ch-n { flex: none; width: 28px; height: 28px; border-radius: 50%; /* L7: same round marker as lesson rows */ display: grid; place-items: center; background: var(--mist); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ps-ch.is-done .ps-ch-n { background: var(--ink); color: var(--paper); }
.ps-ch-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ps-ch-list { padding: 2px 0 8px 18px; margin-left: 13px; border-left: 1px solid var(--line); }
@ -1151,3 +1216,38 @@ fieldset[disabled] .quiz-opt { cursor: default; }
/* the full footer is always on its dark frame, so its powered-by line keeps light text in both themes */
.foot-full .powered { color: #8A8A8A; }
.foot-full .shine, :root:not([data-theme="dark"]) .foot-full .shine { background-image: linear-gradient(110deg, #C9C9C9 40%, #fff 50%, #C9C9C9 60%); }
/* ---------- lesson player polish (L1–L6, 2026-10-27) ---------- */
/* L1: focus mode while watching: the logo and account stay, the site links and footer go */
.s-focus .s-nav { display: none; }
/* L2: the video comes first (edge to edge on phones, right under the header); course, chapter and title sit under it */
.p-head { display: flex; flex-direction: column; gap: 6px; }
.p-head h1 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; }
.p-crumb { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: var(--fs-sm); color: var(--ink-3); }
.p-crumb button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.p-crumb > span::before { content: '·'; margin-inline-end: 8px; }
@media (hover: hover) and (pointer: fine) { .p-crumb button:hover { color: var(--ink); } }
@media (max-width: 599px) { .s-focus .s-main { padding-top: 0; } .s-focus .screen { margin-inline: calc(50% - 50vw); width: 100vw; max-width: 100vw; border-radius: 0; } /* full bleed whatever the page padding is */ }
/* L4: "up next" over the finished video; the ring empties over the countdown (linear: it's a timer) */
.p-upnext { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: clamp(16px, 4vw, 32px); background: rgba(10, 10, 10, .84); backdrop-filter: blur(6px); color: #F5F5F5; animation: upnext-in 240ms var(--ease-out); }
.p-upnext-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(245, 245, 245, .7); }
.p-upnext strong { font-size: clamp(18px, 3vw, 24px); line-height: 1.25; max-width: 32ch; }
.p-upnext-n { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: rgba(245, 245, 245, .75); }
.p-upnext-n svg { rotate: -90deg; }
.p-upnext-n circle { fill: none; stroke: #F5F5F5; stroke-width: 2.5; stroke-dasharray: 63; animation: upnext-count 5s linear forwards; }
.p-upnext-go { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.p-upnext .btn-accent { background: #F5F5F5; color: #0A0A0A; }
.p-upnext .btn-quiet { color: #F5F5F5; }
@keyframes upnext-in { from { opacity: 0; } }
@keyframes upnext-count { to { stroke-dashoffset: 63; } }
/* L6: lesson list as a bottom sheet (phones and tablets; the sidebar covers desktop) */
.lsheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 80dvh; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); }
.lsheet::backdrop { background: rgba(0, 0, 0, .5); }
.lsheet[open] { animation: lsheet-up 300ms cubic-bezier(0.32, 0.72, 0, 1); }
.lsheet[open]::backdrop { animation: fade-in 300ms ease; }
@keyframes lsheet-up { from { transform: translateY(100%); } }
.lsheet-in { max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.lsheet-top { position: sticky; top: 0; z-index: 1; display: flex; justify-content: center; align-items: center; min-height: 48px; background: var(--paper); }
.lsheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.lsheet-top .icon-btn { position: absolute; inset-inline-end: 0; }
@media (min-width: 640px) { .lsheet { max-width: 560px; margin-inline: auto; } }

View File

@ -124,7 +124,12 @@
"all": "ሁሉም",
"count": "{n} ኮርሶች",
"empty": "ከ«{q}» ጋር የሚዛመድ ኮርስ የለም። አጠር ያለ ቃል ይሞክሩ።",
"emptyCategory": "በዚህ ምድብ እስካሁን ኮርስ የለም።"
"emptyCategory": "በዚህ ምድብ እስካሁን ኮርስ የለም።",
"clearSearch": "ፍለጋውን አጽዳ",
"taughtIn": "የማስተማሪያ ቋንቋ",
"anyLanguage": "ማንኛውም ቋንቋ",
"clearFilters": "ማጣሪያዎችን አጽዳ",
"emptyLanguage": "በዚህ ቋንቋ እስካሁን ኮርስ የለም።"
},
"course": {
"buyShort": "ኮርሱን ይግዙ",
@ -151,6 +156,7 @@
"watchAgain": "እንደገና ይመልከቱ",
"tabOverview": "አጠቃላይ እይታ",
"tabInstructor": "አሠልጣኝ",
"about": "ስለ ኮርሱ",
"summary": "ማጠቃለያ",
"duration": "ጠቅላላ ርዝመት",
"language": "ቋንቋ",
@ -217,6 +223,9 @@
"progress": "ከ{total} ትምህርቶች {done} ተጠናቀዋል",
"nowPlaying": "አሁን እየታየ",
"upNext": "ቀጣይ",
"nextShort": "ቀጣይ",
"playNow": "አሁን አጫውት",
"autoNext": "በ{n} ሰከንድ ይጀምራል",
"courseProgress": "ኮርሱ {pct}% ተጠናቋል",
"courseDoneT": "ኮርሱ ተጠናቋል",
"courseDone": "{course}ን ጨርሰዋል። ለዘላለም የእርስዎ ነው፤ በፈለጉ ጊዜ ወደ ማንኛውም ትምህርት ይመለሱ።",

View File

@ -124,7 +124,12 @@
"all": "All",
"count": "{n, plural, one {# course} other {# courses}}",
"empty": "No courses match “{q}”. Try a shorter word.",
"emptyCategory": "No courses in this category yet."
"emptyCategory": "No courses in this category yet.",
"clearSearch": "Clear search",
"taughtIn": "Taught in",
"anyLanguage": "Any language",
"clearFilters": "Clear filters",
"emptyLanguage": "No courses in this language here yet."
},
"course": {
"buyShort": "Buy course",
@ -151,6 +156,7 @@
"watchAgain": "Watch again",
"tabOverview": "Overview",
"tabInstructor": "Instructor",
"about": "About this course",
"summary": "Summary",
"duration": "Total duration",
"language": "Language",
@ -217,6 +223,9 @@
"progress": "{done} of {total} lessons completed",
"nowPlaying": "Now playing",
"upNext": "Up next",
"nextShort": "Next",
"playNow": "Play now",
"autoNext": "Starting in {n}",
"courseProgress": "Course {pct}% complete",
"courseDoneT": "Course complete",
"courseDone": "You finished {course}. It stays yours for life, so come back to any lesson whenever you need it.",

View File

@ -124,7 +124,12 @@
"all": "Hunda",
"count": "Koorsii {n}",
"empty": "Koorsiin “{q}” wajjin walsimu hin jiru. Jecha gabaabaa yaali.",
"emptyCategory": "Ramaddii kana keessa ammatti koorsiin hin jiru."
"emptyCategory": "Ramaddii kana keessa ammatti koorsiin hin jiru.",
"clearSearch": "Barbaacha haqi",
"taughtIn": "Afaan barsiisaa",
"anyLanguage": "Afaan kamiyyuu",
"clearFilters": "Calaltuu haqi",
"emptyLanguage": "Afaan kanaan koorsiin ammaaf hin jiru."
},
"course": {
"buyShort": "Koorsii bitadhu",
@ -151,6 +156,7 @@
"watchAgain": "Irra deebi'ii ilaali",
"tabOverview": "Overview",
"tabInstructor": "Instructor",
"about": "Waa'ee koorsii kanaa",
"summary": "Summary",
"duration": "Total duration",
"language": "Language",
@ -217,6 +223,9 @@
"progress": "Barnoota {total} keessaa {done} xumurameera",
"nowPlaying": "Amma taphachaa jira",
"upNext": "Kan itti aanu",
"nextShort": "Itti aanu",
"playNow": "Amma taphachiisi",
"autoNext": "Sekondii {n} keessatti jalqaba",
"courseProgress": "Koorsiin {pct}% xumurameera",
"courseDoneT": "Koorsiin xumurameera",
"courseDone": "{course} xumurteetta. Bara baraan kan kee ta'a; yeroo barbaadde barnoota kamittuu deebi'i.",

View File

@ -124,7 +124,12 @@
"all": "ኩሉ",
"count": "{n} ኮርሳት",
"empty": "ምስ «{q}» ዝሰማማዕ ኮርስ የለን። ሓጺር ቃል ፈትን።",
"emptyCategory": "ኣብዚ ምድብ ክሳብ ሕጂ ኮርስ የለን።"
"emptyCategory": "ኣብዚ ምድብ ክሳብ ሕጂ ኮርስ የለን።",
"clearSearch": "ምድላይ ኣጽሪ",
"taughtIn": "ቋንቋ ምምሃር",
"anyLanguage": "ዝኾነ ቋንቋ",
"clearFilters": "መጻረዪታት ኣጽሪ",
"emptyLanguage": "ብዚ ቋንቋ ክሳብ ሕጂ ኮርስ የለን።"
},
"course": {
"buyShort": "ኮርስ ግዝእ",
@ -151,6 +156,7 @@
"watchAgain": "እንደገና ርአ",
"tabOverview": "Overview",
"tabInstructor": "Instructor",
"about": "ብዛዕባ እዚ ኮርስ",
"summary": "Summary",
"duration": "Total duration",
"language": "Language",
@ -217,6 +223,9 @@
"progress": "ካብ {total} ትምህርትታት {done} ተወዲኦም",
"nowPlaying": "ሕጂ ይርአ ኣሎ",
"upNext": "ቀጻሊ",
"nextShort": "ቀጻሊ",
"playNow": "ሕጂ ኣጻውት",
"autoNext": "ኣብ {n} ካልኢት ይጅምር",
"courseProgress": "ኮርስ {pct}% ተወዲኡ",
"courseDoneT": "ኮርስ ተወዲኡ",
"courseDone": "{course} ወዲእኪ። ንሓዋሩ ናትኪ እዩ፣ ኣብ ዝደለኽዮ ግዜ ናብ ዝኾነ ትምህርቲ ተመለሲ።",