JSFiddle - React, Tailwind, and code Playground

by elvinci

HTML

<div id="test"></div>

CSS

body {
  height: 10000px;
}

#test {
  position: fixed;
  background-color: red;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  animation: .5s pulse ease-out infinite;
  @keyframes pulse {
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
    }
  }
}

JavaScript

$(document).on('mousemove', function(e) {
  $('#test').css({
    left: e.clientX,
    top: e.clientY,
  });
});

$(window).on('scroll', function(e) {

});