StealThis .dev

LMS — Streak / XP Badges

A friendly e-learning gamification panel bundling four widgets: a daily-streak card with an animated flame and a seven-dot weekly calendar, an XP and level-progress bar with a hexagon rank badge, a daily-goal progress ring, and an eight-tile achievement grid of locked and unlocked badges. Interactions are vanilla JS — check in to grow the streak, claim a badge with a confetti burst and pop animation, earn XP that can trigger a level-up, and toggle a calm dark study mode.

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

Code

Streak / XP Badges

A compact gamification dashboard for a learning platform, built from four reusable widgets. The streak card pairs a big day count with an animated SVG flame and a row of seven calendar dots showing this week’s activity — six green check-offs and a highlighted “today” ring. Beside it, the level card shows a hexagon rank badge, a shimmering XP progress bar with floor and ceiling labels, and a circular daily-goal ring that fills toward 50 XP. Below, an achievement grid lays out eight badges in friendly unlocked, claimable, and locked states.

Everything is interactive with plain vanilla JS. “Check in for today” increments the streak, pulses the flame, pops the today dot green, awards XP, advances the goal ring, and celebrates a new personal best with confetti. Claimable badges respond to a click with a spin-and-pop unlock animation, a confetti burst, and a bonus XP reward; banking enough XP rolls the level up and bumps the rank title. A small toast() helper drives every confirmation, and a study-mode toggle swaps the whole panel into a calm dark theme.

The layout uses the LMS design tokens — indigo brand, emerald progress, amber accents, soft shadows, and pill-shaped difficulty and level badges — and is responsive from desktop down to roughly 360px, where the badge grid reflows to two columns. Semantic landmarks, ARIA progressbar and image roles, a skip link, and keyboard-usable controls keep it accessible.

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