A dark profile card built with pure CSS in which the portrait sits inside a spinning multicolor gradient ring, with a soft glow that brightens on hover. It suits team pages, creator profiles, author boxes and community member cards where the photo should be the focal point.
How it works
The root section.apb-stage provides the dark backdrop and holds one article.apb-card. At the top, .apb-ring is a square grid container that centers the round .apb-photo. Its two pseudo-elements draw the ring: both use the same conic-gradient built from four color tokens and run the apb-spin keyframes, which rotate them a full turn. ::before is the crisp ring, while ::after is a blurred copy behind it that acts as a glow. The photo has a thick border in the card color, so only a thin band of the rotating gradient shows around it. Because the gradient is circular, rotating it makes the colors appear to travel around the photo.
Below the ring sit .apb-name, .apb-role (gradient text clipped with background-clip: text), .apb-bio, a three-column .apb-stats list and the .apb-actions row. A green .apb-status dot marks availability. The small script finds every .apb-card, listens for click on its .apb-follow button and toggles aria-pressed between false and true, switching the label between Follow and Following. Without JavaScript, the ring still spins and the card looks the same.
Customization
--apb-ring-1to--apb-ring-4on.apb-stage: the four gradient stops of the ring; use two brand colors for a calmer look.--apb-ring-width: how much of the gradient shows around the photo; raise it to8pxfor a bolder ring.--apb-speed: one full rotation of the ring, e.g.10sfor a slow drift or2sfor an energetic spin.--apb-photo-size: the diameter of the portrait; the ring grows with it.--apb-cardand--apb-bg: the card and backdrop colors; the photo border uses--apb-card, so the ring stays clean.- Remove
.apb-statusif you do not show availability, or change itsbackgroundto amber for "away". - The photo comes from Unsplash; replace the
srcandaltof.apb-photowith your own square portrait.
Use cases
- Team pages: a portrait inside a spinning gradient ring makes each member stand out
- Creator profiles: stats and a Follow toggle sit below the photo, name and role
- Author boxes: a short bio and a green availability dot show who is online
- Community directories: several cards can share a page with independent follow buttons
Accessibility
The card is an article labelled by its heading via aria-labelledby. The portrait has a descriptive alt, and the status dot carries visually hidden text in .apb-sr. The Follow button is a real button with aria-pressed, so screen readers announce it as a toggle. Both actions have a visible focus outline in --apb-ring-3 and a 44 px touch height. With prefers-reduced-motion: reduce the ring stops spinning and the button hover lift is removed.
Usage notes
Several cards can share a page; the script binds each .apb-card separately. Keep the stats short (three items) so the grid stays balanced on narrow phones.