JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q79361F
  • License MIT

Proteus Cursor is a dynamic JavaScript library that revolutionizes web user interaction by transforming the mouse cursor based on HTML element interactions. Inspired by the shape-shifting god Proteus, this library allows the cursor to change into various shapes and behaviors, such as a dot, circle, or text, depending on the element it hovers over

Package Exports

  • proteuscursor
  • proteuscursor/style

Readme

๐ŸŒ€ Proteus Cursor

Proteus Cursor is a dynamic JavaScript library that revolutionizes web user interaction by transforming the mouse cursor based on HTML element interactions.

Inspired by the shape-shifting god Proteus, this library allows the cursor to morph into various forms โ€” dot, circle, fluid, or text โ€” depending on the element it's hovering over.


1) ๐Ÿš€ Installation

Install via npm:

npm i proteuscursor

2) ๐Ÿ“ฆ Import Files

There are two different import style

  • ๐Ÿงช Without bundler

    Ideal for simple projects

    <!-- Add minified CSS -->
    <link rel="stylesheet" href="dist/proteus-cursor.min.css" />
    
    <!-- Add UMD script -->
    <script src="dist/proteus-cursor.umd.js"></script>
    
    <script>
        // Global initialization
        const cursor = new ProteusCursor({
        // proteus options
    });
    </script>
  • ๐Ÿงช With bundler

    Ideal for modular projects with Vite, Webpack, Nuxt, ecc.

    ๐Ÿ“ 1. install with npm

    npm install proteuscursor

    โœ๏ธ 2. Import in your JS modules

    import ProteusCursor from 'proteuscursor';
    import 'proteuscursor/style'; // importa lo stile CSS minificato
    
    const cursor = new ProteusCursor({
      // proteus options
    });

3) Proteus options

There are a lot of options โœจ for Proteus. First of all you can set a cursor type:

  • circle
  • fluid
๐Ÿ”ต Circle Cursor
currentCursor = new ProteusCursor({
               shape: 'circle',
               shape_size: '10px',
               shape_color: '#ffffff',
               hasShadow: true,
               shadow_delay: '0.3s',
               shadow_size: '40px',
               shadow_color: 'rgba(255, 255, 255, 0.5)',
               magnetic: false,
               text: '',
            });
๐ŸŒŠ Fluid Cursor
currentCursor = new ProteusCursor({
               shape: 'circle',
               shape_size: '10px',
               shape_color: '#ffffff',
               hasShadow: true,
               shadow_delay: '0.3s',
               shadow_size: '40px',
               shadow_color: 'rgba(255, 255, 255, 0.5)',
               magnetic: false,
               text: '',
            });

๐Ÿ“œ License

This project is licensed under the MIT License. Feel free to use, modify, and share! ๐Ÿ’ซ