JSFiddle - React, Tailwind, and code Playground

by William Green

HTML

<div id="loader">
    <div id="spinner"></div>
</div>

CSS

#loader {
    background-color:#000;
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
}

#spinner {
    margin:auto;
    width:100px;
    height:100px;
    display:block;
    background-color:#fff;
    margin-top:calc(50% - 50px);
    -o-transition:all .5s ease;
    -moz-transition:all .5s ease;
    -webkit-transition:all .5s ease;
    -ms-transition:all .5s ease;
    transition:all .5s ease;
    -webkit-box-shadow:0px 0px 20px #fff;
    box-shadow:0px 0px 20px #fff;
}

.active {
    -moz-border-radius:50%;
    -webkit-border-radius:50%;
    border-radius:50%;
}

JavaScript

setInterval(function(){ 
   // toggle the class every five second
   $('#spinner').toggleClass('active');  
   setTimeout(function(){
     // toggle back after 1 second
     $('#spinner').toggleClass('active');  
   },800)

},1600);