JSFiddle - React, Tailwind, and code Playground
by CyberAP
HTML
<span class="spinner"></span>
CSS
html {
height: 100%;
width: 100%;
display: table;
background: hsl(200, 50%, 90%);
}
body {
width: 100%;
display: table-cell;
vertical-align: middle;
}
.spinner {
display: block;
width: 35px;
height: 35px;
margin: auto;
position: relative;
border: 2px solid rgba(0,0,0,0.5);
border-top-color: transparent;
border-radius: 100%;
-webkit-animation: spin 1s infinite linear;
-moz-animation: spin 1s infinite linear;
-ms-animation: spin 1s infinite linear;
-o-animation: spin 1s infinite linear;
animation: spin 1s infinite linear;
}
.spinner:after {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
top: -6px;
left: 3px;
border: 6px solid transparent;
border-bottom-color: rgba(0,0,0,0.5);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
@-webkit-keyframes spin {
to { -webkit-transform: rotate(360deg); }
}
@-moz-keyframes spin {
to { -moz-transform: rotate(360deg); }
}
@-ms-keyframes spin {
to { -ms-transform: rotate(360deg); }
}
@-o-keyframes spin {
to { -o-transform: rotate(360deg); }
}
@keyframes spin {
to { transform: rotate(360deg); }
}