StealThis .dev

LMS — Course Card

A reusable e-learning course card rendered as a responsive grid of six real-feeling variants — free, paid, in-progress and completed. Each card pairs a gradient thumbnail with a level pill, course title, instructor avatar, half-step star rating, duration and lesson counts, and either a price block or an animated progress bar. Cards lift on hover, quick-enroll inline, filter by type, and a study mode swaps the calm light theme for a focused dark palette.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Course Card

A drop-in course card for any learning platform, shown here as a responsive catalog grid of six variants. Every card leads with a gradient thumbnail carrying a difficulty pill (Beginner / Intermediate / Advanced) and a contextual ribbon — Free, Bestseller, or a Done check. Below it sit the category eyebrow, title, an auto-colored instructor avatar, a half-step star rating with review count, and compact duration and lesson meta. The footer adapts to the card’s state: paid courses show a price with strikethrough, free courses read Free, and owned courses swap in an animated progress bar plus a lessons-left summary.

Interactions are all vanilla JS. Hovering lifts the card and nudges its glyph; the Enroll button flips to an enrolled state inline and fires a toast, while in-progress cards offer Resume and completed cards offer Review. The segmented control filters the grid by All, Free, Paid, or In progress, re-running the entry animation and re-filling progress bars on each pass. A Study mode toggle recolors the whole surface to a dark, focused reading theme.

The component is self-contained — data lives in a single COURSES array, ratings and avatar colors are derived from the data, and the layout reflows cleanly from a multi-column desktop grid down to a single mobile-first column at ~360px. Reduced-motion preferences are respected throughout.

Illustrative UI only — fictional courses, not a real learning platform.