Skip to content

Instantly share code, notes, and snippets.

@6174
Created August 29, 2014 16:29
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 6174/f3c478a013037f97c2d0 to your computer and use it in GitHub Desktop.
Save 6174/f3c478a013037f97c2d0 to your computer and use it in GitHub Desktop.
circle spinner in css3
<div class="spinner">
<div class="top"></div>
<div class="bottom"></div>
</div>
<h4>Loader #4</h4>
<style>
.spinner {
width: 70px;
height: 70px;
position: relative;
left: 100px;
top: 100px;
color: white;
}
.spinner .top, .spinner .bottom{
width: 70px;
height: 35px;
position: relative;
overflow: hidden;
}
.spinner .top::before, .spinner .bottom::before{
content: '';
width: 70px;
height: 70px;
display: inline-block;
border-style: solid;
border-top-color: #FFF;
border-right-color: #FFF;
border-left-color: transparent;
border-bottom-color: transparent;
border-radius: 50%;
box-sizing: border-box;
}
.spinner .top::before {
transform: rotate(-225deg);
-webkit-animation: rotate-top 3s ease-in infinite;
}
.spinner .bottom::before {
border-bottom-color: #fff;
border-top-color: transparent;
position: relative;
bottom: 35px;
transform: rotate(-135deg);
-webkit-animation: rotate-bottom 3s ease-out infinite;
}
@-webkit-keyframes rotate-top {
0% { border-width: 3px; }
25% { border-width: 3px; }
50% {
transform: rotate(-45deg);
}
75% { border-width: 3px;}
100% { border-width: 3px;
transform: rotate(-45deg);
}
}
@-webkit-keyframes rotate-bottom {
0% { border-width: 3px; }
25% { border-width: 3px; }
50% {
transform: rotate(-135deg);
}
75% { border-width: 3px;}
100% {
transform: rotate(45deg);
}
}
body {
background: rgb(235, 205, 86);
}
h4 {
position: absolute;
bottom: 20px;
left: 20px;
margin: 0;
font-weight: 200;
opacity: .5;
font-family: sans-serif;
color: #fff;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment