Skip to content

Instantly share code, notes, and snippets.

@adamcrampton
Created August 11, 2020 22:32
Show Gist options
  • Save adamcrampton/ed45c6f2a4fb8e25f1e0dacb539847bf to your computer and use it in GitHub Desktop.
Save adamcrampton/ed45c6f2a4fb8e25f1e0dacb539847bf to your computer and use it in GitHub Desktop.
Loading overlay with spinner
<style>
#overlay {
background: #000;
color: #fff;
position: fixed;
height: 100%;
width: 100%;
z-index: 5000;
top: 0;
left: 0;
float: left;
text-align: center;
padding-top: 25%;
opacity: .80;
}
.spinner {
margin: 0 auto;
height: 64px;
width: 64px;
animation: rotate 0.8s infinite linear;
border: 5px solid #b5985a;
border-right-color: transparent;
border-radius: 50%;
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
}
</style>
<script>
$(document).ready(function() {
$('#overlay').fadeIn().delay(2000).fadeOut();
});
</script>
<div id="overlay">
<div class="spinner"></div>
<br/>
One moment please...
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment