Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit aad5844

Browse files
authored
Create index.js
1 parent 7bc17c7 commit aad5844

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

static/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Get the custom cursor element
2+
const customCursor = document.getElementById('custom-cursor');
3+
4+
// Add an event listener to the document for mousemove event
5+
document.addEventListener('mousemove', (event) => {
6+
// Update the position of the custom cursor element to follow the mouse cursor
7+
customCursor.style.transform = `translate(${event.clientX}px, ${event.clientY}px)`;
8+
});
9+

0 commit comments

Comments
 (0)