Beautiful GPU-accelerated fluid trail that follows your mouse on every website
Magic Cursor is a production-ready browser extension that adds a mesmerizing, physics-based fluid simulation trail to your mouse cursor. Built with React, TypeScript, and WebGL, it provides a stunning visual effect without interfering with your browsing experience.
- 🎨 GPU-Accelerated Fluid Simulation - Smooth, realistic fluid dynamics using WebGL
- 🎯 Non-Intrusive - Overlay with
pointer-events: none- never blocks clicks or interactions - 🌈 Dynamic Colors - Automatically cycling rainbow colors
- 📱 Touch Support - Works with mouse, trackpad, and touch screens
- ⚡ Performance Optimized - Pauses when tab is hidden, handles WebGL context loss
- 🎛️ Fully Customizable - Extensive settings for every aspect of the effect
- ✅ Easy Toggle - Enable/disable with one click from the popup
- ⚙️ Rich Options Page - Fine-tune pressure, curl, colors, and more
- 💾 Settings Sync - Your preferences sync across devices
- 🌐 Cross-Browser - Works on Chrome, Firefox, Opera, Edge, and all Chromium browsers
- Download the latest release from the Releases page
- Unzip the downloaded file
- Open
chrome://extensions(oredge://extensions,opera://extensions) - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
chromefolder from the unzipped files
- Download the latest
.xpifile from the Releases page - Open
about:addons - Click the gear icon and select "Install Add-on From File"
- Select the downloaded
.xpifile
Operating System:
- Windows 10/11
- macOS 10.15+
- Linux (Ubuntu 20.04+, Fedora 35+, or equivalent)
Required Software:
- Node.js: Version 10.0.0 or higher (recommended: 18.x LTS or 20.x LTS)
- Download from: https://nodejs.org/
- Verify installation:
node --version
- Yarn: Version 1.0.0 or higher (recommended: 1.22.x)
- Install via npm:
npm install -g yarn - Verify installation:
yarn --version
- Install via npm:
- Git: Latest version
- Download from: https://git-scm.com/
- Verify installation:
git --version
Build Environment:
- Minimum 2GB RAM available
- 500MB free disk space
- Internet connection (for initial dependency download)
1. Install Node.js
# Windows: Download installer from https://nodejs.org/
# macOS (using Homebrew):
brew install node
# Linux (Ubuntu/Debian):
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify installation
node --version # Should show v10.0.0 or higher
npm --version # Should be included with Node.js2. Install Yarn
# Using npm (cross-platform):
npm install -g yarn
# macOS (using Homebrew):
brew install yarn
# Verify installation
yarn --version # Should show 1.0.0 or higher3. Clone and Setup
# Clone the repository
git clone https://github.com/magic-cursor/magic-cursor.git
cd magic-cursor
# Install all dependencies (this may take 2-5 minutes)
yarn installFor convenience, platform-specific build scripts are provided:
Windows:
build.batDouble-click build.bat or run from Command Prompt. The script will:
- Check Node.js and Yarn installation
- Install dependencies if needed
- Build for all browsers
- Display output locations
macOS/Linux:
chmod +x build.sh
./build.shThe script will:
- Verify system requirements
- Install dependencies if needed
- Build for all browsers
- Show colored output with build status
Development Mode (with hot reload):
# Chrome - builds to extension/chrome/ with auto-reload on changes
yarn dev:chrome
# Firefox - builds to extension/firefox/ with auto-reload on changes
yarn dev:firefox
# Opera - builds to extension/opera/ with auto-reload on changes
yarn dev:operaProduction Build:
# Build for Chrome only
yarn build:chrome
# Output: extension/chrome/ and extension/chrome.zip
# Build for Firefox only
yarn build:firefox
# Output: extension/firefox/ and extension/firefox.xpi
# Build for Opera only
yarn build:opera
# Output: extension/opera/ and extension/opera.crx
# Build for ALL browsers at once
yarn build
# Runs all three builds sequentiallyBuild Process Steps: Each build script automatically performs:
- TypeScript compilation and type checking
- React/JSX transformation via Babel
- SCSS to CSS compilation with autoprefixer
- Code bundling and tree-shaking with Webpack
- Minification (production only)
- Manifest generation for target browser
- Asset copying and optimization
- Archive creation (.zip, .xpi, or .crx)
Loading the Extension:
Chrome/Edge/Brave:
- Open
chrome://extensions - Enable "Developer mode" (top right toggle)
- Click "Load unpacked"
- Select
extension/chrome/folder
Firefox:
- Open
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Select any file in
extension/firefox/folder- Or install the
.xpifile fromabout:addons
- Or install the
Opera:
- Open
opera://extensions - Enable "Developer mode"
- Click "Load unpacked"
- Select
extension/opera/folder
"command not found: yarn"
- Install Yarn:
npm install -g yarn
"Node version too old"
- Update Node.js to version 10+ from https://nodejs.org/
Build fails with memory errors:
- Increase Node.js memory:
export NODE_OPTIONS="--max-old-space-size=4096"
Port 9090 already in use (dev mode):
- Kill the process using port 9090 or change port in
webpack.config.js
Dependencies installation fails:
- Clear cache:
yarn cache clean - Delete
node_modulesandyarn.lock, then runyarn installagain
- Enable/Disable - Turn the effect on or off
- 3D Shading - Add depth with lighting effects
- Transparent Background - Use transparent or colored background
- Simulation Resolution (64-512) - Physics simulation detail
- Dye Resolution (256-2048) - Color rendering quality
- Pressure (0-1) - Fluid pressure intensity
- Curl (0-50) - Swirling vorticity strength
- Density Dissipation (0-10) - How fast colors fade
- Velocity Dissipation (0-10) - How fast motion slows
- Splat Force (1000-15000) - Mouse movement impact
- Splat Radius (0.05-0.5) - Size of trail effect
- Color Change Speed (1-50) - Rainbow cycling speed
- Pressure Iterations (1-50) - Simulation accuracy vs performance
magic-cursor/
├── source/
│ ├── Background/ # Background service worker
│ ├── ContentScript/ # Injected fluid cursor overlay
│ │ ├── index.tsx # Entry point with settings integration
│ │ └── magic-mouse.tsx # WebGL fluid simulation
│ ├── Options/ # Settings page
│ ├── Popup/ # Extension popup
│ ├── utils/ # Shared utilities
│ │ └── storage.ts # Settings storage management
│ ├── styles/ # Global styles
│ └── manifest.json # Extension manifest
├── views/ # HTML templates
├── webpack.config.js # Build configuration
└── package.json # Dependencies and scripts
- React 17 - UI components
- TypeScript - Type safety
- WebGL 2 - GPU-accelerated rendering
- Webpack 5 - Module bundling
- SCSS - Styling
- webextension-polyfill - Cross-browser API
- Content script injects a fixed-position overlay on every page
- React component initializes WebGL context and fluid simulation
- Mouse/touch events create "splats" in the fluid
- Simulation runs at 60fps with curl, pressure, and advection
- Settings are stored in
browser.storage.syncand applied in real-time
- Automatically pauses when tab is hidden
- Handles WebGL context loss and restoration
- Optimized shader programs
- Configurable quality settings for different devices
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by fluid simulation techniques from PavelDoGreat/WebGL-Fluid-Simulation
- Built with web-extension-starter
Made with ❤️ by the Magic Cursor Team