From 7c9c9d97d53585a1c233dd0f9fccb62d1b1131b5 Mon Sep 17 00:00:00 2001 From: n3p-tun3 Date: Tue, 27 Oct 2026 12:34:36 +0300 Subject: [PATCH] =?UTF-8?q?feat(home):=20continue=20card=20polish=20H1?= =?UTF-8?q?=E2=80=93H3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - H1: the course photo becomes a short header with the title on it and progress along its bottom edge; the full-width button sits at the card's bottom, within thumb reach - H2: the card leads with the next lesson and its length ("Up next · 5. … · 8 min") - H3: greeting and continue card form one group instead of two sections 64px apart Replaces the old .continue rules instead of layering overrides on top of them. --- packages/features/src/student.tsx | 33 ++++++++++++++++++++----------- packages/features/src/styles.css | 27 ++++++++++++++++++++----- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/packages/features/src/student.tsx b/packages/features/src/student.tsx index 0c06fca..35420da 100644 --- a/packages/features/src/student.tsx +++ b/packages/features/src/student.tsx @@ -462,8 +462,10 @@ function Home() { const others = visible.filter((c) => !owns(me, c.id)); return ( <> -

{t('home.hello', { name: me?.name.split(' ')[0] ?? '' })}

- {cont ? : nav(`/${locale}/courses`)}>{t('landing.browse')}}>{t('home.emptyMine')}} +
+

{t('home.hello', { name: me?.name.split(' ')[0] ?? '' })}

+ {cont ? : nav(`/${locale}/courses`)}>{t('landing.browse')}}>{t('home.emptyMine')}} +
{mine.length > 1 &&

{t('nav.myCourses')}

{mine.map((c) => )}
}

{t('home.categories')}

@@ -474,21 +476,30 @@ function Home() { ); } +// 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 (
- -
- {t('home.continue')} -

{ct(c, locale).title}

- {r &&

{r.index + 1}. {lessonTitle(r.lesson, locale)}

} -
- {t('my.lessonsDone', { done: p.done, total: p.total })} - {r &&
} +
+ + {t('home.continue')} +

{ct(c, locale).title}

+ +
+
+ {r &&

+ {finished ? t('course.completed') : t('player.upNext')} + {r.index + 1}. {lessonTitle(r.lesson, locale)} + {formatDuration(r.lesson.durationSec)} · {t('my.lessonsDone', { done: p.done, total: p.total })} +

} + {r && }
); diff --git a/packages/features/src/styles.css b/packages/features/src/styles.css index f693336..0c28817 100644 --- a/packages/features/src/styles.css +++ b/packages/features/src/styles.css @@ -171,9 +171,28 @@ textarea.input { min-height: 110px; resize: vertical; } .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; } } +/* 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; } +} .chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; } .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); } @@ -467,8 +486,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; }