Components/Duos/Wink & the shadow

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>
Options
at
where Wink sits, 0–1
poke Wink
hearts
poke the shadow
runs back

How it plays

  1. The shadow leans after your cursor.
  2. Then it wanders off without Wink.
  3. Wink notices, chases it and fetches it back.
  4. 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".