Holo card
A holographic trading card that tilts under your hand.
<piix-holo-card>DOM + canvasNew
Nova
Legendary · #042
<piix-holo-card style="width:250px"> <img src="showcase/nova.jpg" alt=""> <h3>Nova</h3> <p>Legendary · #042</p> </piix-holo-card>
Hue
Like a rare foil card: it tilts toward the pointer in 3D while a rainbow foil slides across it at the angle of the light, sparkles glint in the foil, a glare follows you and faint scanlines remind you it's projected. On a phone, tap to wobble it.
Installation
<!-- once, anywhere on the page: every component --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>
<!-- just holo card (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/dist/c/holo-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-holo-card style="width:250px">
<img src="showcase/nova.jpg" alt="">
<h3>Nova</h3>
<p>Legendary · #042</p>
</piix-holo-card>
);
}
Usage
<piix-holo-card style="width:250px"> <img src="showcase/nova.jpg" alt=""> <h3>Nova</h3> <p>Legendary · #042</p> </piix-holo-card>
Examples
Any content, any hue
Ember
Rare · #117. Put anything inside.
<piix-holo-card hue="320" style="width:250px"> <h3>Ember</h3> <p>Rare · #117. Put anything inside.</p> </piix-holo-card>
API reference
| Attribute | What it does | Default |
|---|---|---|
hue | tint of the card's glass, 0 to 360 | 250 |
intensity | how strong the foil is, 0 to 1 | .7 |
static | no tilt | – |
Accessibility
- The content is plain HTML; foil, glare and sparkles are decoration.
- With reduced motion it doesn't tilt.