JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css">
<a href="#modal">
Launch A Modal
</a>
<div id="modal">
<div class="modal-content">
<div class="header">
<h2>Working...</h2>
</div>
<div class="copy">
<p><i class="fas fa-spinner"></i></p>
</div>
</div>
<div class="overlay"></div>
</div>
CSS
#modal {
left: 50%;
margin: -250px 0 0 -32%;
opacity: 0;
position: absolute;
top: -50%;
visibility: hidden;
width: 65%;
box-shadow: 0 3px 7px rgba(0,0,0,.25);
box-sizing: border-box;
transition: all .4s ease-in-out;
-moz-transition: all .4s ease-in-out;
-webkit-transition: all .4s ease-in-out
}
#modal:target {
opacity: 1;
top: 50%;
visibility: visible
}
/* custom modal css */
#modal .header {
border-bottom: 1px solid #1ABC9C;
border-radius: 5px 5px 0 0
}
#modal h2 {
margin: 0;
}
#modal .copy, #modal .header {
padding: 10px;
}
.modal-content {
position: relative;
z-index: 20;
border-radius: 5px;
color: #fff
}
#modal .overlay {
background-color: #000;
background: rgba(0,0,0,.8);
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 10
}
/* spinner */
.copy i {
-webkit-animation:spin 2s linear infinite;
-moz-animation:spin 2s linear infinite;
animation:spin 2s linear infinite;
}
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }