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
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.Download ghost-walker.zip and unzip it.
- 2.Copy the
.tsxfile intocomponents/pickui/(Tailwind CSS required). - 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
| Prop | Type | Default | Description |
|---|---|---|---|
| behavior | "shy" | "prankster" | "shy" | Flee & hide, or stay and prank. |
| interact | boolean | false | Ghosts play with page content ([data-ghost] first). |
| count | number | 3 | Ghosts. |
| size | number | 56 | Ghost size in px. |
| opacity | number | 0.6 | See-through-ness. |
| fleeRadius | number | 150 | How close the cursor gets before they react. |
| speed | number | 1 | Speed multiplier. |
| shape | string | — | Custom SVG markup, emoji or image URL. |
| clickable | boolean | true | Click to poof. |
| fullscreen | boolean | false | Haunt the whole page. |
| animated | boolean | true | false = 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.