JSFiddle - React, Tailwind, and code Playground
by Brian Houlihan
HTML
<h1>I’m some content</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus luctus urna sed.</p>
<div style="display: none;" class="loading style-2"><div class="loading-wheel"></div></div>
CSS
.loading {
width: 100%;
height: 100%;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0,0,0,.5);
}
.loading-wheel {
width: 20px;
height: 20px;
margin-top: -40px;
margin-left: -40px;
position: absolute;
top: 50%;
left: 50%;
border-width: 30px;
border-radius: 50%;
-webkit-animation: spin 1s linear infinite;
}
.style-2 .loading-wheel {
border-style: double;
border-color: #ccc transparent;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0);
}
100% {
-webkit-transform: rotate(-360deg);
}
}