Headline text reveal on scroll
Word-by-word headline reveals are the signature effect of an agency landing page, and the accessibility trap is that splitting text into spans normally destroys it for screen readers. This keeps one visually hidden copy of the whole text and marks the fragments aria-hidden, so the headline is still read once, as one sentence — and destroy() puts the original HTML back.
The code
An architecture studio's home page. The statement rises word by word, its second line on a later window in the accent; the studio's facts trickle in a character at a time; each project title rises as it arrives.
import { scrollText } from 'svg-scroll-draw/text';
const rise = { opacity: 0, y: 40 };
scrollText('.line-1', { split: 'words', stagger: 0.08, from: rise, once: true,
trigger: { start: 'top 87%', end: 'top 54%' } });
scrollText('.line-2', { split: 'words', stagger: 0.08, from: rise, once: true,
trigger: { start: 'top 82%', end: 'top 49%' } }); // a later window
scrollText('.facts', { split: 'chars', stagger: 0.012,
from: { opacity: 0 }, easing: 'linear', once: true });
document.querySelectorAll('.project h3').forEach((h) =>
scrollText(h, { split: 'words', stagger: 0.1, from: { opacity: 0, y: 30 }, once: true }));
An architecture studio in Oslo and Bergen
Atelier Nord
Related examples
Make your own in the text animation generator or the typewriter effect generator: set it up, watch it run, copy the code.
MIT licensed, zero runtime dependencies. Every API is a separate entry point, so you only ship what you import. Full API reference →