Skip to content

Instantly share code, notes, and snippets.

@rlfrahm
Last active August 29, 2015 14:09
Show Gist options
  • Save rlfrahm/2ea6d70df4edae7069b6 to your computer and use it in GitHub Desktop.
Save rlfrahm/2ea6d70df4edae7069b6 to your computer and use it in GitHub Desktop.
CSS3 Windows 8 Activity Spinner

This activity spinner is an adaptation from this Codepen, and is commonly seen in Windows 8.

<div class="loader">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
<style>
.loader {
position: relative;
padding-top: 100px;
width: 40px;
margin: auto;
}
.loader .circle {
position: absolute;
width: 38px;
height: 38px;
-webkit-transform: rotate(225deg);
transform: rotate(225deg);
-webkit-animation: orbit 2s infinite;
animation: orbit 5.5s infinite;
}
.loader .circle:after {
content: '';
position: absolute;
width: 5px;
height: 5px;
border-radius: 5px;
background: #286090; /* Pick a color */
}
.loader .circle:nth-child(2) { -webkit-animation-delay: 240ms; }
.loader .circle:nth-child(3) { -webkit-animation-delay: 480ms; }
.loader .circle:nth-child(4) { -webkit-animation-delay: 720ms; }
.loader .circle:nth-child(5) { -webkit-animation-delay: 960ms; }
@-webkit-keyframes orbit {
0% { -webkit-transform:rotate(225deg);
-webkit-animation-timing-function: ease-in-out; }
15% { -webkit-transform:rotate(345deg);
-webkit-animation-timing-function: linear; }
85% { -webkit-transform:rotate(455deg);
-webkit-animation-timing-function: ease-in-out; }
100% { -webkit-transform:rotate(585deg); }
}
@keyframes orbit {
0% { transform:rotate(225deg);
animation-timing-function: ease-in-out; }
15% { transform:rotate(345deg);
animation-timing-function: linear; }
85% { transform:rotate(455deg);
animation-timing-function: ease-in-out; }
100% { transform:rotate(585deg); opacity: 0; }
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment