Creative Custom Cursor Library – MagicMouse.js

Category: Javascript | February 19, 2020
Author: dshongphuc
Views Total: 2,939 views
Official Page: Go to website
Last Update: February 19, 2020
License: MIT

Preview:

Creative Custom Cursor Library – MagicMouse.js

Description:

MagicMouse.js is a custom cursor library to create a cool, interactive cursor with a circle that follows the mouse pointer.

How to use it:

1. Insert the magic-mouse.css and magic_mouse.js from the dist folder.

<link href="dist/magic-mouse.css" rel="stylesheet" />
<script src="dist/magic_mouse.js"></script>

2. Initialize the MagicMouse.js with default options.

magicMouse();

3. Hide the system cursor if needed.

html,* { cursor: none; }

4. Apply a hover effect to the custom cursor.

<button class="magic-hover magic-hover__square">
  Hover Me
</button>

5. Customize the cursor effect.

magicMouse({
  "hoverEffect": "circle-move"
});

6. Disable the outer circle.

magicMouse({
  "cursorOuter": "disable",
});

7. Use default cursor instead.

magicMouse({
  "defaultCursor": true
});

8. Set the size of the outer circle.

magicMouse({
  "outerWidth": 30,
  "outerHeight": 30
});

Changelog:

02/19/2021

  • Added Modernizr to detect touch screen device

08/19/2020

  • Disabled on mobile

You Might Be Interested In:


Leave a Reply