JSFiddle - React, Tailwind, and code Playground
CSS
body{
background-color:#333;
}
.fall{
cursor:default;
font-size:10px;
z-index:999999999999;
color:#f00;
position:fixed;
}
JavaScript
jQuery(document).ready(function($){
var timer;
$(document).on('mousemove', function(e){
clearInterval(timer);
timer = setTimeout(function() {
$('.fall').stop(true).animate({opacity:0, marginTop: '+=50px'},600, function() {
$(this).remove();
});
}, 1000);
var t = (e.pageY - 10).toString() + 'px',
l = (e.pageX - 10).toString() + 'px',
el = $('<div />', {'class':'fall', style: 'margin-left:' + l + ';margin-top:' + t, text:'+'});
$('body').prepend(el);
$('.fall').animate({
marginTop: '+=50px',
},1000);
});
});