Ghost Walker

Translucent ghosts haunt your page. Chase them and they flee off-screen, then peek at you from behind the edge until they feel safe.

  • Zero dependencies
  • React + Tailwind
  • Accessible
  • Reduced-motion aware
Download ZIP

ghost-walker.zip · source file + README with usage and props

Preview

Shy · Flee when chased, hide behind the edges, come back when safe. behavior="shy"

Shy ghosts drift with rippling hems and eyes that follow your cursor. Chase one and it escapes through the nearest edge, hides there with only its head peeking in, ducks when you come close and floats back once you leave it alone. Turn on interact and they mess with the page — tug a heading, blow on a card, possess a button, nudge a word — always restoring it. Prankster ghosts don't run: chase one and it does one of 10 weird things (3 versions each) — calls friends to laugh at you, sings, dances, does magic, plays dead, throws a pie, takes a selfie, juggles or fakes a BOO.

Installation

  1. 1.Download ghost-walker.zip and unzip it.
  2. 2.Copy the .tsx file into components/pickui/ (Tailwind CSS required).
  3. 3.Follow the README inside for usage.

Under the hood

The details that make it feel right, and that a one-line prompt usually misses:

  • 01Edge-hiding: off-screen ghosts are clipped to a peek that tracks the cursor and retreats when approached.
  • 02Page interaction never writes permanent styles; everything is undone on finish, chase or destroy().

Props

PropTypeDefaultDescription
behavior"shy" | "prankster""shy"Flee & hide, or stay and prank.
interactbooleanfalseGhosts play with page content ([data-ghost] first).
countnumber3Ghosts.
sizenumber56Ghost size in px.
opacitynumber0.6See-through-ness.
fleeRadiusnumber150How close the cursor gets before they react.
speednumber1Speed multiplier.
shapestring—Custom SVG markup, emoji or image URL.
clickablebooleantrueClick to poof.
fullscreenbooleanfalseHaunt the whole page.
animatedbooleantruefalse = the calm “Regular” version (no idle or ambient motion).

Accessibility

  • Ghosts are decorative (aria-hidden) and only they take clicks.
  • Reduced motion: still ghosts, no page interaction.