Highlight and type type
Websites that are quick to build.
Selects the old words, replaces them, then types the new ones.
SFX
A phrase inside a line of text that swaps for others, in seven styles. The words around it never move: the swapped phrase always takes the room of the longest one. It's for the "Do X in Y" headline, where Y keeps changing.
Websites that are quick to build.
The subtitle is never animated. It sits below and stays put, because the headline reserves its tallest case.
The panel at the bottom right changes the effect, timing and phrases of this headline. Copy markup gives you the element.
The same markup with a different data-reanimator-effect.
typeWebsites that are quick to build.
Selects the old words, replaces them, then types the new ones.
backspaceWebsites that are quick to build.
Deletes letter by letter, then types.
slideWebsites that are quick to build.
The old words slide up and out while the new ones rise into the same slot.
riseWebsites that are quick to build.
The same, one letter at a time with a short stagger.
blurWebsites that are quick to build.
Cross-fades through a soft blur. The quietest of the set.
flipWebsites that are quick to build.
Rotates like a departures board.
scrambleWebsites that are quick to build.
Random letters settle into the new words.
Put class="reanimator" and data-reanimator on a
<span> inside the line. Its own text is the first phrase. Keep the full stop inside the
phrases so it travels with them.
<h1>Websites that are
<em><span class="reanimator" data-reanimator data-reanimator-loops="forever" data-reanimator-effect="slide"
data-reanimator-words="easy to change.|yours to keep.">quick to build.</span></em>
</h1>
<script defer src="scripts/reanimator.00f4d05f.js"></script> <!-- only on pages that use it -->
| Attribute | Values | Default |
|---|---|---|
data-reanimator-words | the other phrases, separated by | | required |
data-reanimator-effect | type · backspace · slide · rise · blur · flip · scramble | slide |
data-reanimator-hold | milliseconds each phrase stays | 2400 |
data-reanimator-pace | speed multiplier for the transitions | 1 |
data-reanimator-loops | stop after this many passes through all the phrases, resting on the first; forever never stops | 3 |
The look is a token, set in the client's theme.css.
| Token | Default | What it does |
|---|---|---|
--reanimator-duration | 560ms | One phrase leaving and the next arriving (the word effects and scramble) |
--reanimator-ease | cubic-bezier(.2,.8,.2,1) | The easing of those transitions |
--reanimator-select | var(--color-brand) | The selection sweep in type |
--reanimator-select-text | var(--color-bg) | Text colour on the selection. Keep the contrast. |
.reanimator gets none of its CSS or JavaScript. The script is not part of the shared bundle.data-reanimator-loops) and rests on the first one. The examples on this page use forever so you can keep watching them; real pages shouldn't.