Chase

Magic Cursor effect library / Magnetic

Pull elements matching a CSS selector toward the cursor with adjustable strength and preview item color.

magnetic
1
2
3
Code
import { createEffect } from "magic-cursor-effect";

const root = document.querySelector("#your-root") as HTMLElement;

const instance = createEffect("magnetic", root, {
  "strength": 0.35,
  "selector": "[data-magnetic]"
});

// later
// instance.destroy();