Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/dyed-in-the-wool/llms.txt
Use this file to discover all available pages before exploring further.
Overview
DyeDropCursor replaces the native browser cursor with a motion.div teal circle that follows the mouse using a Framer Motion spring animation. As you move, it continuously spawns small colored circles — “ink drops” — that scale up and fade out over one second, leaving a trail reminiscent of ink dispersing through wet fabric.
DyeDropCursor does not hide the native browser cursor. The component’s container carries only pointer-events-none fixed inset-0 z-[100] overflow-hidden — no cursor: none style is applied. If you want to suppress the system cursor, add cursor-none to the <html> or <body> element in your global CSS.Ink Drop Color Palette
Each ink drop is assigned a random color from the following array on spawn:dye-* palette used throughout the site.
Interactive Element Behavior
When the cursor moves over an<a> or <button> element (or any element nested inside one, detected via .closest()), the cursor circle:
- Expands from
24pxto48pxdiameter - Changes color from teal
#0d9488to magenta#db2777 - Reveals a small inner dot (
w-2 h-2,bg-dye-fabric) that scales in with a spring animation
Technical Implementation
Cursor tracking
Mouse position is tracked withwindow.addEventListener('mousemove'). The cursor motion.div animates to the new position on every frame using a Framer Motion spring:
Trail drops
On eachmousemove event, a random check (Math.random() > 0.6) throttles drop spawning to roughly 40% of frames, preventing the trail from becoming too dense. Each drop is:
- Positioned at the exact cursor coordinates at the moment of spawn
- Sized randomly between
10pxand30px - Colored randomly from the palette above
setInterval running every 100ms shifts the oldest drop off the front of the array, ensuring smooth cleanup.
Each drop animates via AnimatePresence:
mix-blend-multiply blur-[2px] classes — the multiply blend mode means overlapping drops darken each other and interact with the background, while the blur softens their edges for a wet-ink look.
Pointer capture
The entire component ispointer-events-none fixed inset-0 z-[100] overflow-hidden. It never sits in the event-propagation path, so it cannot block clicks, form inputs, or any other interaction.
Usage
DyeDropCursor is already rendered globally inside Layout — you don’t need to add it to individual pages.
Customization
Change the ink drop colors
Edit theP array (the color palette constant) at the top of DyeDropCursor.js:
#db2777) is hardcoded in the animate prop of the cursor motion.div — update that separately if you want the interactive-element highlight to match a new palette.
Adjust spring physics
The spring feel is controlled by three values in the cursor’stransition object:
stiffness: 200, damping: 20, mass: 1. For an instant, pixel-perfect follow try stiffness: 800, damping: 40, mass: 0.3.