← All elements

Spotlight Text Reveal

by @admin · 1 views

<h2 class="stx" data-t="LOOK CLOSER">LOOK CLOSER</h2>

About this animation

Dim headline text that lights up through a moving circle sweeping across it, made with an animated clip path.

How it works

The headline is printed twice: a dim version, and a bright copy in a pseudo-element taken from a data attribute. A circular clip-path reveals only part of the bright copy and animates from one end to the other. Hovering stops the sweep and opens the circle over the whole phrase.

Ways to customise it

  • Change the 26px radius for a wider beam.
  • Change #fde047 and its glow.
  • Edit both the text and the data-t attribute together.

Good to know

The dim base text has low contrast by design, so use this for decorative headlines only. With reduced motion set, the full bright text is shown with no animation.

Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.

More in Css Animation

View all →