Paper card
A card topped with a cut-paper diorama, or framed in pen.
<piix-paper-card>DOM + canvasNewWeekend retreat
Three days in the hills.
<piix-paper-card style="width:300px"> <h3>Weekend retreat</h3> <p>Three days in the hills.</p> </piix-paper-card>
Scene
Look
The cut look puts a little paper diorama on top (hills, sea or city), each layer casting a shadow on the one behind and sliding at its own depth as the pointer moves. The sketch look is a boiling pen frame with a cross-hatched shadow and a strip of tape.
Installation
<!-- once, anywhere on the page: every component --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>
<!-- just paper card (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/dist/c/paper-card.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-card style="width:300px">
<h3>Weekend retreat</h3>
<p>Three days in the hills.</p>
</piix-paper-card>
);
}
Usage
<piix-paper-card style="width:300px"> <h3>Weekend retreat</h3> <p>Three days in the hills.</p> </piix-paper-card>
Examples
Sea, your colours
Sky, sun, then three layers far to near.
Coastline
Paper waves, layered.
<piix-paper-card scene="sea" colors="#d8f0ff,#ffe08a,#7cc4e8,#3f8fc2,#1f4d7a" style="width:300px"> <h3>Coastline</h3> <p>Paper waves, layered.</p> </piix-paper-card>
Sketch
Notes
A pen-drawn frame that never sits still.
<piix-paper-card look="sketch" style="width:300px"> <h3>Notes</h3> <p>A pen-drawn frame that never sits still.</p> </piix-paper-card>
API reference
| Attribute | What it does | Default |
|---|---|---|
look | cut sketch | cut |
scene | hills sea city (cut) | hills |
colors | sky, sun, then three layers far to near | a warm dusk |
ink | line colour (sketch) | #1d1a2b |
Accessibility
- The scene is decoration and hidden from screen readers.
- With reduced motion nothing slides or boils.