Skip to content

HautlyS/MagicCursor

Repository files navigation

✨ Magic Cursor - Fluid Mouse Trail

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.

Version License

✨ Features

Core Features

  • 🎨 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

User Features

  • βœ… 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

πŸš€ Installation

For Users

Chrome / Edge / Brave / Opera

  1. Download the latest release from the Releases page
  2. Unzip the downloaded file
  3. Open chrome://extensions (or edge://extensions, opera://extensions)
  4. Enable "Developer mode" (toggle in top right)
  5. Click "Load unpacked"
  6. Select the chrome folder from the unzipped files

Firefox

  1. Download the latest .xpi file from the Releases page
  2. Open about:addons
  3. Click the gear icon and select "Install Add-on From File"
  4. Select the downloaded .xpi file

For Developers

Prerequisites

  • Node.js 10+ and npm or yarn
  • Git

Setup

# Clone the repository
git clone https://github.com/magic-cursor/magic-cursor.git
cd magic-cursor

# Install dependencies
npm install
# or
yarn

Development

# Chrome (with hot reload)
npm run dev:chrome

# Firefox (with hot reload)
npm run dev:firefox

# Opera (with hot reload)
npm run dev:opera

Then load the extension from extension/<browser>/ directory.

Production Build

# Build for specific browser
npm run build:chrome
npm run build:firefox
npm run build:opera

# Build for all browsers
npm run build

Output will be in extension/<browser>/ and packaged as extension/<browser>.zip

πŸŽ›οΈ Customization

Available Settings

General

  • Enable/Disable - Turn the effect on or off
  • 3D Shading - Add depth with lighting effects
  • Transparent Background - Use transparent or colored background

Visual Quality

  • Simulation Resolution (64-512) - Physics simulation detail
  • Dye Resolution (256-2048) - Color rendering quality

Fluid Behavior

  • 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

Mouse Interaction

  • 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

Advanced

  • Pressure Iterations (1-50) - Simulation accuracy vs performance

πŸ“ Project Structure

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

πŸ”§ Technical Details

Technologies

  • React 17 - UI components
  • TypeScript - Type safety
  • WebGL 2 - GPU-accelerated rendering
  • Webpack 5 - Module bundling
  • SCSS - Styling
  • webextension-polyfill - Cross-browser API

How It Works

  1. Content script injects a fixed-position overlay on every page
  2. React component initializes WebGL context and fluid simulation
  3. Mouse/touch events create "splats" in the fluid
  4. Simulation runs at 60fps with curl, pressure, and advection
  5. Settings are stored in browser.storage.sync and applied in real-time

Performance

  • Automatically pauses when tab is hidden
  • Handles WebGL context loss and restoration
  • Optimized shader programs
  • Configurable quality settings for different devices

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“§ Support


Made with ❀️ by the Magic Cursor Team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors