JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<div id="circle"></div>
CSS
body {
height: 1000px;
}
#circle {
position: absolute;
width: 20px;
height: 20px;
background: #000;
border-radius: 100%;
opacity: 0.5;
top: -10px;
left: -10px;
webkit-transition: all 0.1s ease;
-moz-transition: all 0.1s ease;
-ms-transition: all 0.1s ease;
-o-transition: all 0.1s ease;
transition: all 0.1s ease;
}
JavaScript
setTimeout(function() {
$('body').mousemove(function(e){
$('#circle').css({'top': e.clientY+$(window).scrollTop(), 'left': e.clientX});
});
});