webdevpuneet.com

Blur Focus Pull — Words Sharpen One by One With CSS

Blur Focus Pull · Text Animation · Plain HTML, CSS & JS · Live preview

Copy & paste

Source Code

<main class="stage">
  <p class="eyebrow">Studio reel · Scene 04</p>
  <h1 class="focus" id="focus">Every detail snaps into focus</h1>
  <p class="focus sub" id="sub">Slow words, sharp results. Watch the lens find each one in turn.</p>
  <div class="controls">
    <label class="lens">Lens blur
      <input type="range" id="blur" min="4" max="28" value="14" aria-label="Blur strength in pixels">
      <output id="out">14px</output>
    </label>
    <button type="button" class="replay" id="replay">Pull focus again</button>
  </div>
</main>

Extend with AI

Take This Snippet Further With AI

Ask an AI coding assistant to explain how a single custom property per word, used as transition-delay, replaces a chain of timeouts, and why the replay function reads document.body.offsetWidth before re-adding the class. It's also worth asking where blur filters get expensive and how to limit the cost on mobile.

Prompt to recreate it

Copy this into your AI assistant of choice to build the effect from scratch, or as a jumping-off point for your own variant:

text
Build a "focus pull" text reveal in plain HTML, CSS and JavaScript where a headline and a subtitle come into sharp focus one word at a time.

Requirements:
- JavaScript splits each target element's text into words wrapped in inline-block spans, stores the original sentence in aria-label, and hides the spans from assistive technology.
- Each word starts with filter blur set from a CSS custom property, opacity 0 and a scale of about 1.12, then transitions to no blur, full opacity and no scale when the parent gets an "on" class. Blur and opacity run about 0.9s, the scale a little longer.
- Each word gets a transition delay from a per-word custom property that counts up by about 0.16s continuously across both lines.
- A range slider controls the starting blur (about 4 to 28px) by writing the custom property on the root element and showing the value.
- A "Pull focus again" button removes the on class, forces a reflow by reading a layout property, then adds it back to replay.
- Under prefers-reduced-motion, remove the blur and scale and use only a short opacity fade.

Want to tighten it up first? Run this prompt through the AI Prompt Studio to score it across 8 quality dimensions, catch anti-patterns, and tune the wording for Claude, ChatGPT, or Gemini before you paste it in.

What's included

Features

Lens-pull feel
Blur, opacity and a small scale-down run together, so each word seems to move toward the viewer as it sharpens.
No timers or libraries
A per-word --d variable feeds transition-delay, so the CSS transition handles the whole sequence.
Continuous across lines
The delay counter runs through the headline and subtitle as one sequence, so the second line follows on instead of restarting.
Live blur control
A slider sets the blur radius through a custom property, handy for tuning strength against performance.
Replayable
Removing the class, forcing a reflow and re-adding it replays the reveal on demand.
Readable without the effect
Full text lives in aria-label, and prefers-reduced-motion swaps the blur for a short fade.

About this UI Snippet

Blur Focus Pull — Word-by-Word CSS Filter Blur-to-Sharp Reveal

Screenshot of the Blur Focus Pull snippet rendered live

Film cuts to a shot that starts soft, and the camera pulls focus until the subject sharpens. This snippet gives a headline the same entrance. Every word begins out of focus, slightly enlarged and invisible, and resolves one after another until the full sentence is crisp. It reads as calm and expensive rather than flashy, which is why it suits product films, studios and anything premium.

Three properties move together

Each word span transitions filter: blur(), opacity and transform: scale() at once. The scale starts at 1.12 and eases back to 1, which makes the word feel as if it's pulling away from the lens as it sharpens. Blur and opacity run for 0.9s; the scale runs a little longer at 1.1s, so the movement outlasts the sharpening and the finish feels soft instead of abrupt.

The delay is the animation

JavaScript wraps each word and sets a --d custom property that counts up by 0.16s across the headline and then the subtitle, as one continuous sequence. The transition uses transition-delay: var(--d), so there are no timers and no animation library, and the sequence can be restarted by removing the on class, forcing a reflow, and adding it back.

A blur slider, because strength matters

The range input writes --blur on the root element, so the starting blur can run from a gentle 4px to a heavy 28px without touching the CSS. Blur on large text is the expensive part of this effect, so the slider doubles as a quick way to find the cheapest strength that still looks good. The sentence stays readable to screen readers via aria-label, and reduced-motion visitors get a short fade with no blur.

Step by step

How to Use

  1. 1
    Paste the three blocksA dark stage appears and the two lines come into focus about a quarter second after load, one word every 160ms.
  2. 2
    Replace the copyEdit the text inside #focus and #sub. The script splits it into words automatically, so no manual spans are needed.
  3. 3
    Adjust the paceChange 0.16 in pull() to speed up or slow down the word-to-word delay. Values between 0.08 and 0.25 read well on short headlines.
  4. 4
    Choose the starting blurSet the default in the CSS fallback (var(--blur, 14px)) and in the slider's value. Remove the slider markup if you want a fixed strength.
  5. 5
    Trigger on scroll insteadDelete the setTimeout and call pull() from an IntersectionObserver when the heading enters the viewport.

Real-world uses

Common Use Cases

Studio and film portfolio heroes
A soft-focus opening line suits photographers, video producers and motion designers whose work is about the image.
Premium product launches
Reveal a product tagline slowly above a hero image; the restraint signals confidence compared with bouncy entrances.
Section transitions on long-scroll pages
Trigger the pull as each chapter heading enters view for a calm, filmic pace.
Quotes and testimonials
Let a customer quote resolve word by word so the reader slows down and reads it.
Onboarding and splash screens
A single sentence coming into focus is a gentler welcome than a spinner.

Got questions?

Frequently Asked Questions

Large blur radii on big text cost GPU time while they animate. Keep the radius under about 20px, animate only a few words at once, and avoid it on low-power mobile heroes if you notice dropped frames.

filter and transform need a box to apply to; plain inline text won't scale correctly. inline-block plus a right margin keeps normal word spacing.

Add a separate offset to the counter before the second target, for example start n at 10, or run pull() on each element from its own observer.

The words are real text in the DOM from the start (only styled invisible), and the sentence is also in aria-label. For critical headings, keep the final state in the markup so it still shows without JavaScript.