cursor-critters

Procedural creatures that walk, turn and chase your mouse pointer.

Zero dependencies · ~10 KB gzipped · MIT · open the live tuner

This demo needs a mouse.
There is no hovering pointer to chase on a touch screen, so the library hides itself instead of showing a dead box. Open this page on a desktop browser.
Browser device-emulation modes report a coarse pointer too, so the demo will stay hidden there as well.

Move the mouse across the box. Leave it alone for a moment and the creature wanders off on its own. The button in the corner swaps between the two creatures, and your choice is remembered.

Use it

<link rel="stylesheet" href="cursor-critters.css">

<div class="cursor-critter-stage">
  <canvas id="cursor-critter" class="cursor-critter-canvas" aria-hidden="true"></canvas>
  <button type="button" id="cursor-critter-swap" class="cursor-critter-swap">Reptile</button>
</div>

<script src="cursor-critters.js" defer></script>

That is the whole integration. The button is optional — drop it and you get a single creature. Nothing is configured in JavaScript unless you want to.

What makes it move

It gets out of the way

Built by rightkik · www.PRESS.in.th