Liquid text
Words made of liquid metal that melt into the next word.
<piix-liquid-text>WebGLNew<piix-liquid-text words="Design|Build|Ship"></piix-liquid-text>
Look
Size
The letters are a liquid field on the GPU: their edges ripple, the pointer sends a wave through them, and with several words each one flows into the next like two drops merging. Shaded as chrome, ink, water or honey.
Installation
<!-- once, anywhere on the page: every component --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>
<!-- just liquid text (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/dist/c/liquid-text.min.js"></script>
npm install piixpal // once, in your entry file import "piixpal";
// npm install piixpal
import "piixpal";
export default function Page() {
return (
<piix-liquid-text words="Design|Build|Ship"></piix-liquid-text>
);
}
Usage
<piix-liquid-text words="Design|Build|Ship"></piix-liquid-text>
Examples
One word
<piix-liquid-text look="water">Fluid</piix-liquid-text>
Honey, slower
<piix-liquid-text look="honey" words="Slow|Sweet|Golden" every="3200"></piix-liquid-text>
API reference
| Attribute | What it does | Default |
|---|---|---|
words | words to cycle, | between | the text inside |
every | ms per word | 2400 |
look | chrome ink water honey: the liquid's material | chrome |
colors | your own material, three colours: floor, horizon, sky (overrides look) | – |
size | font size in px | 96 |
font | a CSS font family | Bricolage Grotesque |
Accessibility
- Screen readers get the current word as plain text, announced politely as it changes.
- With reduced motion it shows the first word, still.