<div class="container">
  <h3>❤️ Sweet Search Input ❤️</h3>
  <div class="form">
    <input type="text">
    <span class="fas ico"></span>
  </div>
  <div class="footer">
    <a href="https://dribbble.com/Volorf
">Design by Volorf</a>
  </div>
</div>

body {
    background-color: #e1deff;
}

.container {
  display: flex;
  flex-direction:column;
  justify-content: center;
  align-items: center;
  height: 95vh;
}

h3{
  font-family:"Dosis",sans-serif;
  font-size: 28px;
  color : #5f27cd;
}

.footer{
  margin: auto;
  text-align: center;
  position: absolute;
  line-height: 1.8;
  width: 150px;
  height: 30px;
  border: 2px solid #5f27cd;
  border-radius: 10px;
  bottom: 50px;
}

.footer a{
  color : #5f27cd;
  font-family:"Dosis",sans-serif;
  text-decoration: none;
}

.form {
    position: relative;
}

input {
    width: 350px;
    height: 60px;
    padding: 10x;
    padding-left: 60px;
    border-radius: 10px;
    background-color: #5f27cd;
    border: none;
    color: white;
    font-size: 24px;
    font-family: "Dosis", sans-serif;
  outline:none
}

.ico {
    position: absolute;
    top: 15px;
    left: 15px;
    color: white;
    font-size: 28px;
}

.blink {
    transform: rotate(90deg);
    animation: outFocus 1s infinite ease-in-out;
}

.search {
    transition: 1s;
    animation: onFocus 1s 1 ease-in-out;
}

@keyframes outFocus {
    to {
        opacity: 0;
    }
    from {
        opacity: 1;
    }
}

@keyframes onFocus {
    to {
        transform: rotateY(0deg);
    }
    from {
        transform: rotateY(90deg);
    }
}
$(document).ready(function(){
$(".ico").addClass("fa-minus blink rotate");
  $("input").focus(function () {
    $(".ico").addClass("fa-search search");
    $(".ico").removeClass("fa-minus blink");
  });
  $("input").focusout(function () {
    $(".ico").addClass("fa-minus blink");
    $(".ico").removeClass("search");
  });
});
 

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://use.fontawesome.com/releases/v5.0.13/js/all.js
  2. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js