Paper text
A headline a pen draws, then fills with cut paper.
<piix-paper-text>DOM + canvasNew<piix-paper-text underline>Hand made</piix-paper-text>
Look
When it scrolls into view a pen traces every letter, then the word fills in as stacked sheets of coloured paper, each a step behind the last, and a scribble underlines it. The pen line keeps a gentle boil. The sketch look keeps only the pen.
Installation
<!-- once, anywhere on the page: every component --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>
<!-- just paper text (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/dist/c/paper-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-paper-text underline>Hand made</piix-paper-text>
);
}
Usage
<piix-paper-text underline>Hand made</piix-paper-text>
Examples
Sketch
<piix-paper-text look="sketch">or just sketched</piix-paper-text>
Colours
Top sheet first.
<piix-paper-text colors="#c9f2d9,#5fbf8f,#2f8a63,#1f4d3a" underline>Fresh</piix-paper-text>
API reference
| Attribute | What it does | Default |
|---|---|---|
look | cut sketch | cut |
colors | top sheet, then the sheets below | #ffd23f,#ff8a5c,#e2477a,#5a3d8a |
ink | pen colour | #1d1a2b |
size | font size in px | 96 |
underline | draw a scribbled underline | – |
font | a CSS font family | – |
Accessibility
- Announced as a heading with its plain text.
- With reduced motion it appears finished.