JSFiddle - React, Tailwind, and code Playground

HTML

<button type="submit" class="button" id="pay-button">
    <div id="price">Pay 20$</div>
    <br>
    <div id="ok">Complete!</div>
</button>

CSS

html {text-align: center}

.animated {
  -webkit-animation-duration: 1s;
          animation-duration: 1s;
  -webkit-animation-fill-mode: both;
          animation-fill-mode: both;
}

.button {
    -webkit-transition: ease-out 0.15s;
    -moz-transition: ease-out 0.15s;
    -o-transition: ease-out 0.15s;
    transition: ease-out 0.15s;
    padding: .45em .1em .6em;
    padding-left: 15px;
    padding-right: 15px;
    border: 1px solid rgba(81, 203, 238, 1);
    border-radius:50px;
    margin-bottom: 40px;
    position: relative;
    font-family:'lato';
    font-weight: 300;
    font-size: 15px;
    background-color: transparent;
    min-width: 10px;
    height: 36px;
    color: rgba(81, 203, 238, 1);
    margin-top: 40px;
    margin-left:auto;
    margin-right:auto;
    left:0;
    right:0
}
.button:hover {
    color: rgba(4, 169, 207, 1);
    border-color: rgba(4, 169, 207, 1);
    min-width: 10px;
}
#ok {
    opacity: 0;
    position: absolute;
    margin-top: -36px;
    margin-left: 50%;
    left:-33px;
}
#ok, x:-moz-any-link, x:default {
    margin-top: -39px
}
@-webkit-keyframes active {
  0% {
  }
    
                  40% {

      min-width: 107px;

  }
    
      50% {
      min-width: 96px;

  }
    
          60% {
      min-width: 105px;

  }
    
              70% {
      min-width: 100px;

  }
    


  100% {
      border-color: #71DE04;
      color: #71DE04;
      min-width: 100px;
  }
}

@-moz-keyframes active {
  0% {
  }
    
                  40% {

      min-width: 107px;

  }
    
      50% {
      min-width: 98px;

  }
    
          60% {
      min-width: 102px;

  }
    
              70% {
      min-width: 100px;

  }


  100% {
      border-color: #71DE04;
      color: #71DE04;
      min-width: 100px;

  }
}

@keyframes active {
  0% {
  }
    
                  40% {

      min-width: 107px;

  }
    
      50% {
      min-width: 98px;

  }
    
          60% {
      min-width: 102px;

  }
    
              70% {
      min-width:...

JavaScript

$(function() {
$(".button").click(function (e) {
    $(".button").toggleClass("animated active");
    $("#price").toggleClass("animated fadeOut").delay(250).queue(function () {
        $("#ok").toggleClass("animated bounceIn").dequeue();
    });
});
});