JSFiddle - React, Tailwind, and code Playground

by Alexandru Gatea

HTML

<div class="blobs">
  <div class="blob">A</div>
  <div class="blob">B</div>
</div>

CSS

body {
	background: red;
}

.blobs {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: red;
  width: 400px;
  height: 200px;
  margin: auto;
  filter: blur(20px) contrast(30);
}

.blob {
  background: black;
  width: 100px;
  height: 100px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -50px;
  margin-left: -50px;
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
}



.blob:first-child {
  -webkit-animation: blob-anim-left ease-in-out 0.8s infinite alternate;
  animation: blob-anim-left ease-in-out 0.8s infinite alternate;
}


.blob:last-child {
  -webkit-animation: blob-anim-right ease-in-out 0.8s infinite alternate;
  animation: blob-anim-right ease-in-out 0.8s infinite alternate;
}





@keyframes blob-anim-right {
  0% {
    transform: translateX(10px);
  }

  100% {
    transform: translateX(55px);
  }
}

@keyframes blob-anim-left {
  0% {
    transform: translateX(-10px);
  }

  100% {
    transform: translateX(-55px);
  }
}