Advanced Text Motion
Accessible text animation for Bricks. Reveal words, characters or lines as they enter view, light text up as you scroll, highlight marked phrases, count numbers up, type text out, or rotate through a list of statements. It works as two native elements and as an extra control group on the Heading, Basic Text and Rich Text elements. It uses plain JavaScript with no animation library, and the text is in the page before any script runs.
Version: 1.1.0 · Requires: PHP 7.4+ and Bricks · Live demo
Installation
- Upload and activate the plugin. Bricks must be active for the elements to appear.
- Add an Advanced Text Reveal or Advanced Text Sequence element, or open a Heading, Basic Text or Rich Text element and tick Enable Text Motion in the Text Motion group.
- Pick a preset, or set the mode and effect yourself. Reload the page to see it play.
Where it works
- Advanced Text Reveal: one piece of text with a semantic tag (H1 to H4, paragraph or div). Every mode below is available.
- Advanced Text Sequence: a list of statements shown one at a time, with autoplay and previous and next buttons.
- Heading, Basic Text and Rich Text: tick Enable Text Motion and the same controls appear. Bricks keeps its own markup and styling; the plugin only adds a class and a data attribute to the existing element.
Modes
| Mode | What it does | Trigger |
|---|---|---|
| Reveal on view | Each word, character or line animates in with a stagger. | Enter viewport, page load or scroll scrub |
| Light up on scroll | Text moves from the unrevealed colour to the revealed colour as you scroll past it. | Always scroll |
| Highlight marked phrases | Wrap words in a <mark> tag, or type a phrase into Highlighted words. Four styles: underline, marker, colour sweep and outline. |
Enter viewport or scroll scrub |
| Move with scroll | Words rise into place as you scroll. Strength sets how far they travel. | Always scroll |
| Count-up number | Counts from one number to another with locale formatting, a prefix and a suffix. | Enter viewport or page load |
| Typewriter | Characters appear one after another. | Enter viewport or page load |
Settings
| Control | Notes | Default |
|---|---|---|
| Split | Words, characters or lines. Lines are measured after layout, so they follow the real wrapping and are re-measured on resize. | Words |
| Entrance effect | Fade up, fade down, slide left, slide right, blur in, scale in or curtain. | Fade up |
| Trigger | Enter viewport, page load or scroll scrub. | Enter viewport |
| Duration and stagger | In milliseconds. Duration is held between 50 and 10,000; stagger between 0 and 2,000. | 750 and 65 |
| Easing | Ease, ease out, ease in/out, linear or expressive. | Ease out |
| Replay when re-entering viewport | Plays again each time the text scrolls back into view. | Off |
| Motion strength | Scales the travel distance in Move with scroll. Held between 0.2 and 3. | 1 |
| Start and end in viewport | Where the scroll-driven modes begin and finish, as a percentage of the viewport height. | 85 and 25 |
| Unrevealed and revealed colour | The two colours Light up on scroll moves between. | #999999 and the current text colour |
| Highlighted words and style | Phrase to mark when the text has no <mark> tags, and the marker style. |
Underline |
| Counter fields | Count from, count to (overrides the text), decimal places, prefix, suffix and locale. | 0, blank, 0, blank, blank, en-GB |
Presets
Six built-in presets set several fields at once:
- Editorial reveal: words fade up with a slow stagger.
- Subtle fade: whole lines fade up, a little faster.
- Cinematic blur: words blur into focus over just over a second.
- Spotlight: light up on scroll.
- Marker emphasis: a highlighter that draws as you scroll.
- Kinetic rise: words rise into place as you scroll.
Your own presets
Open Settings, Text Motion to save a preset of your own. Give it a name and a JSON object, for example:
{"mode":"reveal","split":"words","effect":"blur","duration":1000,"stagger":100}
Allowed keys are mode, split, effect, trigger, duration, stagger, easing, repeat, strength, start, end, fromColor, toColor, highlight, marker, countFrom, countTo, decimals, prefix, suffix and locale. Preset IDs start with user-. Editing a preset updates every element that uses it. Refresh the Bricks editor after adding or renaming one so the list updates.
Text Sequence
Add statements in the repeater. The first statement is in the page as real text, so it shows even before JavaScript runs.
- Autoplay (on), time per statement (3,200 ms, held between 500 and 60,000), loop (on).
- Pause on hover and focus (on). Autoplay also pauses while the browser tab is hidden.
- Previous and next buttons (on), each with an accessible label.
- Transition: fade, slide up (default) or blur.
Builder preview
Each element has a Builder preview control: show the original text, play the animation, or hold it at 50% for styling. It affects the Bricks editor only. Visitors always see the animation.
Accessibility
- The original text stays in the page and keeps its semantic tag. Nothing is hidden before JavaScript is ready.
- If the visitor asks for reduced motion, text is shown in full straight away, counters jump to the final number and sequences do not autoplay. The buttons still move between statements.
- Sequence text is not announced on every autoplay change. After a visitor presses a button it becomes a polite live region.
JavaScript
ATM.refresh(root)sets up any new text insideroot. Content added after load is also picked up automatically.ATM.reset(element)rebuilds one element, useful after a web font loads late and changes the line breaks.ATM.preview(element, mode)switches betweenstatic,playandscrub.
Known limits
- Presets are edited as JSON. There is no visual preset designer yet.
- Line splitting inside complex nested inline markup should be checked at each breakpoint you care about.
- Dynamic data and repeater statements follow Bricks’ own rendering, so check them on your build.
- Light up on scroll and Move with scroll are driven by scroll position, so they ignore the Trigger setting.
Related plugins
For whole sections rather than text, see Gradual Appearance. For a simple scroll reveal on one block of text, see Section Reveal Text. For a rotating word inside a sentence, see Rotating List.