Wink & the shadow
A fox whose shadow has a mind of its own. One tag brings both of them.
Wink & the shadow
<!-- once, anywhere on the page --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.4/piixpal.min.js"></script> <h2> … <piix-pal pal="wink"></piix-pal> </h2>
<!-- just wink (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.4/dist/c/wink.min.js"></script> <h2> … <piix-pal pal="wink"></piix-pal> </h2>
<!-- attaches itself to the first h2: nothing else to add --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.4/dist/c/wink.min.js" data-pals="wink@h2"></script>
await import("https://cdn.jsdelivr.net/npm/piixpal@0.4/dist/c/wink.min.js");
Piixpal.add("wink", "h2");
// npm install piixpal
import { PiixPal } from "piixpal/react";
<h1>
Hello
<PiixPal pal="wink" />
</h1>
npx shadcn@latest add https://piixpal.dvkk.dev/r/wink.json
import { Wink } from "@/components/piixpal/wink";
<h1>
Hello
<Wink />
</h1>
// main.js: app.use(Piixpal) from "piixpal/vue" <h1> Hello <piix-pal pal="wink" /> </h1>
<script>import Piixpal from "piixpal/svelte";</script> <Piixpal /> <h1>Hello <piix-pal pal="wink"></piix-pal></h1>
Options
at- where Wink sits, 0–1
poke Wink- hearts
poke the shadow- runs back
How it plays
- The shadow leans after your cursor.
- Then it wanders off without Wink.
- Wink notices, chases it and fetches it back.
- Both walk home together.
It loops with a little randomness, never blocks a click, and stands still for people who prefer less motion. Put the tag inside the element they should live on, or point at one with on="selector".