HTML
<h1 data-a11y-text-split
data-split-type="words"
data-split-mode="visual">
Every idea has gravity...
</h1>
Pointer field / words in orbit
Let the sentence drift around your pointer.
Basic recipe
<h1 data-a11y-text-split
data-split-type="words"
data-split-mode="visual">
Every idea has gravity...
</h1>
import { splitAll } from
'../dist/index.js';
splitAll();
const tokens = document.querySelectorAll(
'[data-split-word], [data-split-punctuation]'
);
tokens.forEach((token, index) => {
token.style.setProperty('--orbit-index', index);
});
Visual mode exposes the original sentence once, then lets the decorative split words take on a completely different composition.