<div id="loading">
  <p>Loading...</p>
  <div></div>
</div>
@import url(https://fonts.googleapis.com/css?family=Alegreya+Sans+SC:500);

html {
  background: #FFFFFF;
}

#loading {
  margin: 50px auto 0;
  width: 125px;
  height: 118px;
}

#loading p {
  position: absolute;
  z-index: 99;
  padding: 34px;
  color: black;
  font-size: 16px;
  font-family: 'Alegreya Sans SC', sans-serif;
  width: 22px;
  overflow: hidden;
  animation: dots 2s steps(2) linear infinite;
  -webkit-animation: dots 2s steps(2) infinite;
  -moz-animation: dots 2s steps(2) linear infinite;
  -o-animation: dots 2s steps(2) linear infinite;
}

@keyframes dots {
  0%  {width: 22px;}
  50% {width: 30px;}
  100% {width: 40px;}
}
@-webkit-keyframes dots {
  0%  {width: 22px;}
  50% {width: 30px;}
  100% {width: 40px;}
}
@-moz-keyframes dots {
  0%  {width: 22px;}
  50% {width: 30px;}
  100% {width: 40px;}
}
@-o-keyframes dots {
  0%  {width: 22px;}
  50% {width: 30px;}
  100% {width: 40px;}
}

#loading div {
  height: 100%;
  margin: 10% auto;
	border-right: 5px solid #D20000;
  border-bottom: 5px solid transparent;
	border-radius: 100%;
  animation: spin 0.9s linear infinite;
  -webkit-animation: spin 0.9s linear infinite;
  -moz-animation: spin 0.9s linear infinite;
  -o-animation: spin 0.9s linear infinite;
}

@keyframes spin {
 0% {
    transform: rotate(0deg);
    border-right-color: #D22020;
  }
  50% {
    transform: rotate(180deg);
    border-right-color: #A27AD7;
  } 
  100% {
    transform: rotate(359deg);
    border-right-color: #D22020;
  }
}
@-webkit-keyframes spin {
 0% {
    -webkit-transform: rotate(0deg);
    border-right-color: #D22020;
  }
  50% {
    -webkit-transform: rotate(180deg);
    border-right-color: #A27AD7;
  } 
  100% {
    -webkit-transform: rotate(359deg);
    border-right-color: #D22020;
  }
}
@-moz-keyframes spin {
 0% {
    -moz-transform: rotate(0deg);
    border-right-color: #D22020;
  }
  50% {
    -moz-transform: rotate(180deg);
    border-right-color: #A27AD7;
  } 
  100% {
    -moz-transform: rotate(359deg);
    border-right-color: #D22020;
  }
}
@-o-keyframes spin {
 0% {
    -o-transform: rotate(0deg);
    border-right-color: #D22020;
  }
  50% {
    -o-transform: rotate(180deg);
    border-right-color: #A27AD7;
  } 
  100% {
    -o-transform: rotate(359deg);
    border-right-color: #D22020;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js