Blur text
Words, or letters, come into focus out of a soft blur, one after another.
- enhancer
- entrance
- scroll
- blur
- focus
- since 0.1
Background Studio: tune it below, then copy the code
Your system asks for reduced motion: the demo shows its final state and nothing moves.
Live demo
Blur text example
Each word comes into focus.
Each word comes into focus.
Code
It follows the controls above: change an option and the code changes with it.
<link rel="stylesheet" href="/axi0/motion/motion.css?v=6">
<script src="/axi0/motion/motion.js?v=10" defer></script>
<p class="demo-big" data-motion="blur-text">Each word comes into focus.</p>
import { BlurText } from "./motion/react/BlurText";
<BlurText>Your content</BlurText>
<script setup lang="ts">
import BlurText from "./motion/vue/BlurText.vue";
</script>
<template>
<BlurText>Your content</BlurText>
</template>
const el = document.querySelector("#title");
el.dataset.motion = "blur-text";
// run the entrance again: axi0Motion.play(el, "blur-text")
The wrappers: BlurText.tsx (React, TypeScript) and BlurText.vue (Vue). Both render the same attributes as the HTML; the loader does the rest.
Options
| Attribute | Default | What it does |
|---|---|---|
data-motion-split | words | words or chars (letters) |
data-motion-stagger | 90 | milliseconds between pieces |
data-motion-duration | 800 | milliseconds per piece |
data-motion-delay | 0 | milliseconds before the first piece |
Accessibility
The same rules as split text, whose script and styles it loads first (a few hundred bytes of its own).
Size
blur-text.js is 0.1 KB gzip, with split-text.js 1.3 KB it needs. A page loads the loader (2.7 KB) and core.js (1.4 KB) once, whatever it uses.