Most websites are polite and a little bit dull. I wanted something that rewards the people who look closely, so I made joypacket: small React components that hide on a page like easter eggs.
Pixel Pet peeks over the edge of the window. It falls asleep when you ignore it, wakes when you click its head, and talks back. There are five pets (cat, dog, bunny, fox, bear) in 18 hand-drawn variants.
Wish Star is a tiny star in the corner. Click it and it charges up, flies across the screen leaving a trail, and lands a wish. A wish can be plain text, a link, or a code that copies to your clipboard. About one launch in ten is a rare golden one.
import { WishStar } from "joypacket/wish-star"; import { PixelCat } from "joypacket/pets"; <PixelCat position="bottom-left" /> <WishStar position="right-center" sound /> A few things I enjoyed building
- The star is just a DOM button. The full-screen canvas only exists during the flight, so there is no cost while it waits.
- No sound files. The whoosh and chime are synthesized with the Web Audio API.
- The pet and the star never import each other. The star fires a window event when it launches and lands, and the pet listens for it. If both are on the page, the cat looks up and says "Did you see that?!"
- Landing spots avoid your content. The wish picks a spot away from links, buttons, headings and images.
It works with Next.js (the components are "use client" and safe to render on the server), respects prefers-reduced-motion, and the star is a real keyboard-focusable button.
Try it: Live Demo · GitHub · npm ·
npm i joypacket I'd love your feedback. This is my first published npm package, so I'm especially curious about:
- Does it feel delightful or distracting on a real site?
- Is the API easy to use? Is anything confusing or missing?
- Anything that breaks in your framework, browser or screen reader?
And what tiny delight should come next?
Issues and ideas are welcome on GitHub.
