A visually appealing custom cursor implementation with smooth animations using GSAP and dynamic hover effects. This project features a cursor that smoothly follows the mouse, rotates dynamically, and displays text inside it.
- Smooth Cursor Movement: The cursor smoothly follows the mouse pointer with a natural animation.
- Dynamic Rotation: The cursor dynamically rotates based on the movement direction.
- Hover Effect: Cursor scales up when hovering over specific elements like buttons.
- Custom Text: A customizable text is displayed inside the cursor.
- HTML: For the structure of the page.
- CSS: For styling the cursor and button.
- JavaScript: For cursor animation logic.
- GSAP: For smooth animations and quick property updates.
-
Clone the repository:
git clone https://github.com/xvsanuj/cuberto-cursor.git
-
Navigate to the project directory:
cd cuberto-cursor
-
Open the
index.html
file in your browser.
- The cursor follows the mouse pointer with a smooth animation.
- The cursor scales up when hovering over the "Hire me" button.
- The text inside the cursor is customizable (default: "Hello").
To change the text inside the cursor:
-
Edit the
div
with themf-cursor-text
class in theindex.html
file:<div class="cursorText"> Your Text Here </div>
Modify the lerp
function parameter in script.js
:
smoothPosition.x = lerp(smoothPosition.x, mousePosition.x, 0.15);
smoothPosition.y = lerp(smoothPosition.y, mousePosition.y, 0.15);
Increase or decrease the 0.15
value to adjust the animation speed.
.
├── index.html # Main HTML file
├── style.css # CSS for styling the cursor and button
├── script.js # JavaScript for cursor animations
└── README.md # Project documentation
This project is open-source and available under the MIT License.
- GSAP: For powering the animations.
- Inspiration: Custom cursor designs from modern UI/UX trends.
Feel free to fork this project, customize it, and share your own creative ideas!