Skip to content

Profile Card with Animated Photo Border

Dark pure CSS profile card whose round portrait sits in a spinning conic-gradient ring with a soft glow, plus stats and a follow toggle.

Also known as: profile card with gradient ring, avatar with glowing border, user card with follow button, author profile card, spinning border avatar

Profile Card with Animated Photo Border live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

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-1 to --apb-ring-4 on .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 to 8px for a bolder ring.
  • --apb-speed: one full rotation of the ring, e.g. 10s for a slow drift or 2s for an energetic spin.
  • --apb-photo-size: the diameter of the portrait; the ring grows with it.
  • --apb-card and --apb-bg: the card and backdrop colors; the photo border uses --apb-card, so the ring stays clean.
  • Remove .apb-status if you do not show availability, or change its background to amber for "away".
  • The photo comes from Unsplash; replace the src and alt of .apb-photo with 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.

Profile Card with Animated Photo Border at a glance

Framework
Pure CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
None
Layout
Responsive, works on mobile, dark design
Category
Profile Cards
License
Free for personal and commercial use

Questions about this template

Can I use the Profile Card with Animated Photo Border code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

There is nothing to install. Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Profile Card with Animated Photo Border – free Pure CSS profile card template
Profile Card with Animated Photo Border · free Pure CSS profile card template

More Profile Cards

Neon Glow Profile Card – free Pure CSS profile card template

Neon Glow Profile Card

Dark profile card with an animated neon conic-gradient border, soft glow, stats, skill tags and a Follow toggle, built with pure CSS and vanilla JS.

Business Card Style Contact Card – free Bootstrap 5 profile card template

Business Card Style Contact Card

Bootstrap 5 digital business card with portrait, role, tap-to-call contact links, copy buttons, a QR code and a downloadable vCard.

Profile Card with Stats – free Bootstrap 5 profile card template

Profile Card with Stats

Bootstrap 5 user profile card with gradient cover, initials avatar, animated stat counters, follow toggle, message and copy-link buttons.

Profile Card with Cover – free Tailwind CSS profile card template

Profile Card with Cover

Tailwind CSS profile card with a gradient cover, overlapping avatar, verified badge, bio, skill chips, stats and an accessible follow toggle.