Spike & Tumble
A cactus cowboy and the tumbleweed he will never quite catch. One tag brings both of them.
Spike & Tumble
<!-- once, anywhere on the page --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.4/piixpal.min.js"></script> <h2> … <piix-pal pal="spike"></piix-pal> </h2>
<!-- just spike (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.4/dist/c/spike.min.js"></script> <h2> … <piix-pal pal="spike"></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/spike.min.js" data-pals="spike@h2"></script>
await import("https://cdn.jsdelivr.net/npm/piixpal@0.4/dist/c/spike.min.js");
Piixpal.add("spike", "h2");
// npm install piixpal
import { PiixPal } from "piixpal/react";
<h1>
Hello
<PiixPal pal="spike" />
</h1>
npx shadcn@latest add https://piixpal.dvkk.dev/r/spike.json
import { Spike } from "@/components/piixpal/spike";
<h1>
Hello
<Spike />
</h1>
// main.js: app.use(Piixpal) from "piixpal/vue" <h1> Hello <piix-pal pal="spike" /> </h1>
<script>import Piixpal from "piixpal/svelte";</script> <Piixpal /> <h1>Hello <piix-pal pal="spike"></piix-pal></h1>
Options
at- where Spike stands, 0–1
poke Spike- yee-haws
poke Tumble- squeaks
How it plays
- A tumbleweed rolls by.
- Spike lassos it.
- It drags him off his pot and across the element.
- He cheers anyway, walks home, and waits for the next one.
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".