StealThis .dev
Páginas Medium

Gym — Class Management

A high-energy gym admin for managing the weekly class schedule as a full CRUD. A live stats strip tracks totals, active classes, weekly capacity and trainers above a sortable table listing each class with its type, trainer, day and time, room, a capacity progress bar and a status badge. An Add class button opens a validated modal form, rows edit in place via the same pre-filled dialog, deletes use an inline confirm, and a search box plus type and trainer filters narrow the list instantly.

Abrir no Lab
html css vanilla-js
Targets: JS HTML

Code

Class Management

An athletic, dark-themed admin screen for running a gym’s weekly class schedule. A four-tile stats strip surfaces total classes, active classes, summed weekly capacity and the number of distinct trainers, recomputing every time the roster changes. Below it, a table lists each class with a type-coded avatar, name and type, the assigned trainer, an abbreviated day plus start time and duration, the room, a colour-shifting capacity bar (neon → orange → red as it fills) and a pill status badge for active, draft or cancelled.

Adding a class opens a modal form with name, type, trainer, day, start time, duration, room and capacity fields plus a status segmented control. Inline validation flags any empty or out-of-range field before saving, and a successful save prepends the new row with a brief highlight flash. Editing reuses the same dialog, pre-filled, and writes changes back in place. Deleting swaps the row’s action buttons for an inline Yes / No confirm so nothing is removed by accident.

The search box matches against name, type, trainer, room and day, while the type and trainer selects filter the list live; a Clear control resets everything and an empty state appears when no class matches. Everything runs on a small in-memory store with vanilla JS, an Escape-to-close modal, focus management and toast feedback — no frameworks or build step.

Illustrative UI only — sample classes, trainers and members are fictional.