Last active
August 29, 2015 14:28
-
-
Save aksrikanth/a6391a98eae54dc2c6eb to your computer and use it in GitHub Desktop.
animated spinner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="holder"> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
<div class="circle"></div> | |
</div> | |
$duration:10s; | |
$ease:ease-in-out; | |
body{ | |
overflow:hidden; | |
} | |
.holder{ | |
width:500px; | |
height: 250px; | |
position: relative; | |
.circle{ | |
border-radius:100% 100% 0 0; | |
position: absolute; | |
bottom: 0; | |
left:50%; | |
transform:translateX(-50%); | |
transform-origin:bottom center; | |
} | |
@for $i from 1 through 16{ | |
.circle:nth-child(#{$i}){ | |
$size:0; | |
@if($i > 1){ | |
$size:31px * ($i - 1); | |
border:13px solid black; | |
}@else{ | |
$size:25px; | |
background:black; | |
} | |
border-bottom:none; | |
border-radius:$size $size 0 0; | |
width:$size; | |
height:$size / 2; | |
z-index: 16 - $i; | |
animation: circle-#{$i} $duration infinite $ease; | |
} | |
@keyframes circle-#{$i}{ | |
0%{transform:translateX(-50%) rotate(0deg);} | |
100%{transform:translateX(-50%) rotate(-($i * 360deg));} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment