JSFiddle - React, Tailwind, and code Playground

by Mahadevan Sivasubramanian

HTML

<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<form name="email" action="https://formspree.io/f/{form_data}" method="post">
  <label for="email">Your Email</label>
  <input name="Email" id="email" type="email">
  <input type="submit" value="submit">
</form><br /><br />
<h2>
  Testing Form
</h2>
<form name="sample_data">
  <label for="fname">First Name</label> 
  <input name="fname" id="fname_id" type="text"><br />
  <label for="lname">Last Name</label>
  <input name="lname" id="lname_id" type="text">
    <input type="submit" value="submit">
</form>
<div class="loadingio-spinner-spinner-cm0pdtzvpde">
  <div class="ldio-rfcqdr7w4x">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>

CSS

@keyframes ldio-rfcqdr7w4x {
  0% { opacity: 1 }
  100% { opacity: 0 }
}
.ldio-rfcqdr7w4x div {
  left: 47px;
  top: 24px;
  position: absolute;
  animation: ldio-rfcqdr7w4x linear 1s infinite;
  background: #fe718d;
  width: 6px;
  height: 12px;
  border-radius: 3px / 4.32px;
  transform-origin: 3px 26px;
}.ldio-rfcqdr7w4x div:nth-child(1) {
  transform: rotate(0deg);
  animation-delay: -0.9166666666666666s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(2) {
  transform: rotate(30deg);
  animation-delay: -0.8333333333333334s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(3) {
  transform: rotate(60deg);
  animation-delay: -0.75s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(4) {
  transform: rotate(90deg);
  animation-delay: -0.6666666666666666s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(5) {
  transform: rotate(120deg);
  animation-delay: -0.5833333333333334s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(6) {
  transform: rotate(150deg);
  animation-delay: -0.5s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(7) {
  transform: rotate(180deg);
  animation-delay: -0.4166666666666667s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(8) {
  transform: rotate(210deg);
  animation-delay: -0.3333333333333333s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(9) {
  transform: rotate(240deg);
  animation-delay: -0.25s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(10) {
  transform: rotate(270deg);
  animation-delay: -0.16666666666666666s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(11) {
  transform: rotate(300deg);
  animation-delay: -0.08333333333333333s;
  background: #fe718d;
}.ldio-rfcqdr7w4x div:nth-child(12) {
  transform: rotate(330deg);
  animation-delay: 0s;
  background: #fe718d;
}
.loadingio-spinner-spinner-cm0pdtzvpde {
  width: 98px;
  height: 98px;
  display: inline-block;
  overflow: hidden;
  background: #ffffff;
}
.ldio-rfcqdr7w4x {
  width: 100%;
  height:...

JavaScript

$(function() {
  $("form").submit(function(e) {
    e.preventDefault(); 
    if ($("form[name='email'").validate().checkForm()) {
      $(this).find('input[type=submit]').prop('disabled', true);
      $(this).find('input[type=submit]').prop('value', 'Please wait...');
    } else if ($("form[name='sample_data'").validate().checkForm()) {
      $(this).find('input[type=submit]').prop('disabled', true);
      $(this).find('input[type=submit]').prop();
      //How to add gif image here
    }
  });
});