Skip to content

Component 055Effects

Page Mascot

A character for the top of your page that turns its head toward the reader's cursor and reacts when poked, with the fox drawn in six styles.

  • Next.js
  • Tailwind CSS
  • TypeScript
Move your pointer and every mascot turns its head to follow it.
Loading preview…
Live interactive preview

Quick start

Make it yours.

Save page-mascot.tsx in your components folder, then import it below. Use it in a Next.js project with Tailwind CSS.

TSXapp/page.tsx
import { Mascot } from "@/components/ui/page-mascot";

export default function Page() {
  return (
    <Mascot
      directions="/mascots/fox-directions.webp"
      reactions="/mascots/fox-reactions.webp"
    />
  );
}

// Put both sheets in public/mascots.
// The default export renders the full demo page.

Behind the interaction

The details that make it work.

Designed to explore, ready to adapt.

Nine directions, one glance

The pointer's angle picks one of nine drawn head poses. A 70px dead zone and a little hysteresis let the head settle instead of flickering between poses.

A reaction for every poke

A poke blinks, then pays off with a heart, a sparkle, or a delighted face, with a squash-and-stretch bounce. Four quick pokes make it dizzy. Reduced motion skips the bounce.

Two sheets per character

Each character is a 3×3 directions sheet and a 3×3 reactions sheet, served from public/mascots. Original component and fox artwork by Kamran Ahmed under the MIT license.

Keep exploring

View all components