Skip to content

Commit

Permalink
Update cursor2.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhine-Ho committed Nov 20, 2022
1 parent 248b82c commit 600053b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cursor/cursor2.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,21 @@
<div class="cursor pointed">
<span>Hello<br>World.</span>
</div>


<script>
const cursorPointed = document.querySelector('.pointed');

const moveCursor = (e)=> {
const mouseY = e.clientY;
const mouseX = e.clientX;


cursorPointed.style.transform = `translate3d(${mouseX}px, ${mouseY}px, 0)`;

}

window.addEventListener('mousemove', moveCursor)
</script>

</body>
Expand Down

0 comments on commit 600053b

Please sign in to comment.