Wave text
Letters that ripple like a flag.
<piix-text>WebGLPixel perfect
<h1> <piix-text effect="wave" palette="ocean">Pixel perfect</piix-text> </h1>
Palette
The words ride a travelling wave, pixel column by pixel column, and the colour follows the crest. Hover and the wave grows.
Installation
<!-- once, anywhere on the page: every component --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>
<!-- just wave text (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/dist/c/text.min.js"></script>
npm install piixpal // once, in your entry file import "piixpal";
// npm install piixpal
import "piixpal";
export default function Page() {
return (
<h1>
<piix-text effect="wave" palette="ocean">Pixel perfect</piix-text>
</h1>
);
}
Usage
<h1> <piix-text effect="wave" palette="ocean">Pixel perfect</piix-text> </h1>
Examples
One word in a headline
It takes the font, size and weight of wherever you put it, so it drops straight into your own heading.
Build something loud
<h2 class="ex-h2">Build something <piix-text effect="wave" palette="sunset">loud</piix-text></h2>
Chunkier pixels
Big pixels
<h2 class="ex-h2"><piix-text effect="wave" pixel="4" palette="candy">Big pixels</piix-text></h2>
API reference
| Attribute | What it does | Default |
|---|---|---|
effect | shine reveal glitch wave melt scan | shine |
palette | the colours: lime aurora sunset ocean candy violet fire gameboy paper mono, or your own, dark to light: "#000,#6b4cff,#fff" | lime |
pixel | size of one pixel, in px | 2 |
Accessibility
- The real words stay in the page, so screen readers, search engines and copy-paste all see normal text.
- With reduced motion the effect holds on a readable frame.
- One line of text: it doesn't wrap.