Pure CSS tumbleweed

by joplomacedo

HTML

<div class="desert">
  <div class="tumbleweed"></div>
</div>

CSS

.desert {
  position: relative;
  height: 8rem;
  overflow: hidden;
}

.desert .tumbleweed {
  position: absolute;
  top: 0;
  right: 0;
  background: url(https://www.vhv.rs/dpng/d/421-4212581_tumbleweed-png-picture-library-tumbleweed-png-transparent-png.png) no-repeat center;
  background-size: cover;
  width: 5rem;
  height: 5rem;
  animation: jumping 1.5s infinite, rolling 5s linear infinite, rotating 2s linear infinite;

}

.tumbleweed:nth-child(2) {
  animation-delay: 2.5s;
}

.tumbleweed:nth-child(3) {
  animation-delay: 4s;
}

@keyframes jumping {
  0% {
    top: 0rem;
    animation-timing-function: ease-in;
  }

  25% {
    top: 3rem;
    animation-timing-function: ease-out;
  }

  50% {
    top: 1rem;
    animation-timing-function: ease-in;
  }

  75% {
    top: 3rem;
    animation-timing-function: ease-out;
  }

  100% {
    top: 0rem;
    animation-timing-function: ease-in;
  }
}

@keyframes rolling {
  0% {
    right: 100%;
  }

  100% {
    right: 0%;
  }
}

@keyframes rotating {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}