<div class="search"></div>

<!-- dribbble -->
<a class="dribbble" href="https://dribbble.com/shots/5721408-Search-loading-animation" target="_blank"><img src="https://dribbble.com/assets/logo-small-2x-9fe74d2ad7b25fba0f50168523c15fda4c35534f9ea0b1011179275383035439.png" alt=""></a>
.search {
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  position: relative;
  margin: 1px 3px 3px 1px;
  cursor: pointer;
}
.search:before, .search:after {
  content: '';
  display: block;
  position: absolute;
  transform-origin: calc(100% - 1px) 50%;
  height: 2px;
  border-radius: 1px;
  background: #fff;
  bottom: calc(50% - 1px);
  right: calc(50% - 1px);
  -webkit-backface-visibility: hidden;
}
.search:before {
  width: 8px;
  transition: transform .4s ease;
  transform: rotate(45deg) translateX(16px);
  animation: none;
}
.search:after {
  width: 6px;
  opacity: 0;
  transform: rotate(45deg);
}
.search.loading:before {
   animation: rotate 2.1s linear forwards .45s, move .3s linear forwards 2.7s;
   transform: rotate(45deg) translateX(0);
}
.search.loading:after {
  opacity: 1;
  transition: opacity 0s ease .4s;
  animation: remove 0s linear forwards 2.6s;
}

@keyframes rotate {
  100% {
     transform: rotate(405deg) translateX(0);
  }
}

@keyframes remove {
  100% {
    opacity: 0;
  }
}
@keyframes move {
  100% {
    transform: rotate(45deg) translateX(16px);
  }
}
html {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: inherit;
}
*:before, *:after {
  box-sizing: inherit;
}

body {
  min-height: 100vh;
  font-family: Roboto, Arial;
  background: #5628EE;
  display: flex;
  justify-content: center;
  align-items: center;
}
body .dribbble {
  position: fixed;
  display: block;
  right: 24px;
  bottom: 24px;
}
body .dribbble img {
  display: block;
  width: 76px;
}
$('.search').on('click touch', function(e) {

    var self = $(this);

    self.addClass('loading');
    setTimeout(function() {
        self.removeClass('loading');
    }, 3000)

});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js