JSFiddle - React, Tailwind, and code Playground

by orjan

HTML

<div>
</div>

SCSS

div {
  position: relative;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 60px;
  height: 60px;

  &:before {
    content: '';
    position: relative;
    display: block;
    width: 60px;
    height: 60px;
    margin-left: -50%;
    margin-top: -50%;
    box-sizing: border-box;
    border-radius: 100%;
    background-color: #eee;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  }
  &:after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 30px;
    height: 30px;
    background-color: #ccc;
    border-radius: 100%;
    animation: pulse-dot 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) -.4s infinite;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(.33);
  }
  80%,
  100% {
    opacity: 0;
  }
}

@keyframes pulse-dot {
  0% {
    transform: scale(.8);
  }
  50% {
    transform: scale(.95);
  }
  100% {
    transform: scale(.8);
  }
}