UNPKG

proteuscursor

Version:

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

93 lines (76 loc) โ€ข 2.39 kB
# ๐ŸŒ€ 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**: ```bash 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 ```bash 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! ๐Ÿ’ซ