Implementation Overview
This project demonstrates how thoughtful UI interactions can improve both user experience and accessibility, while adding a touch of delight to everyday interactions.
Custom Hooks Explained
useMousePosition
This hook:
- Tracks cursor position relative to a referenced element
- Uses requestAnimationFrame for performance optimization
- Returns real-time x/y coordinates
useElementDistance
This hook:
- Calculates distances between two DOM elements
- Updates on window resize
- Provides dimensional information for precise animations
Remember to provide refs to both hooks for proper functionality. The hooks are designed to work together but can be used independently if needed.
Technical Implementation Details
The project combines several technical approaches:
- SVG Filters: Used for creating the gooey effect
- Framer Motion: Handles smooth animations
- Tailwind CSS: Provides responsive styling
- Next.js: Powers the overall application
Getting Started
Check out the source code