Created
September 12, 2019 12:27
-
-
Save julianfrank/e38867ac1b36eca7992c1e40e41ceae9 to your computer and use it in GitHub Desktop.
Mouse Pointer Tracker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('mousemove', function(e) { | |
var x = (e.clientX / window.innerWidth * 2) - 1; | |
var y = (e.clientY / window.innerHeight * -2) + 1; | |
console.log(x,y) | |
// something awesome | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment