Skip to content

Instantly share code, notes, and snippets.

@Sebb767
Created April 14, 2016 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sebb767/e2b94836bd3055370b49cf951b72d43c to your computer and use it in GitHub Desktop.
Save Sebb767/e2b94836bd3055370b49cf951b72d43c to your computer and use it in GitHub Desktop.
CSS3 Loading Screen
<!DOCTYPE html>
<html lang="en">
<!--
This is a demo for a CSS 3 animated loading page with dots.
You're free to use this however you want, but I'd be happy if you add a link to sebb767.de ;)
-->
<head>
<meta charset="UTF-8">
<title></title>
<style>
/* centering the dots */
#outer-container {
text-align: center;
display: table;
position: absolute;
height: 100%;
width: 100%;
}
#middle-container {
display: table-cell;
vertical-align: middle;
}
/* dots */
.dot-container {
margin: 0 auto;
}
.dot-container .header {
font-size: 3em;
color: #1a1a1a;
display: block;
}
.dot-container .dot {
width: 20px;
height: 20px;
border-radius: 4px;
background-color: #1a1a1a;
display: inline-block;
margin: 20px;
animation:fade 3s infinite;
}
.dot-2 {
animation-delay: 1s !important;
}
.dot-3 {
animation-delay: 2s !important;
}
@keyframes fade {
0% {opacity:1;}
5% {opacity:1;}
50% {opacity:0.2;}
95% {opacity:1;}
100% {opacity:1;}
}
</style>
</head>
<body>
<div id="outer-container">
<div id="middle-container">
<div class="dot-container">
<span class="header">Loading</span>
<div class="dots">
<div class="dot"></div>
<div class="dot dot-2"></div>
<div class="dot dot-3"></div>
</div>
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment