Last active
August 29, 2015 13:56
-
-
Save gruppjo/8804606 to your computer and use it in GitHub Desktop.
css: loading animation - basic
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
// inspired by http://codepen.io/anon/pen/fGatk | |
// don't use on :before in older Webkits (e.g iOS6) - http://css-tricks.com/pseudo-element-animationstransitions-bug-fixed-in-webkit/ | |
@mixin loading($radius, $width, $bgColor, $fgColor) { | |
display:inline-block; | |
width: $radius; | |
height: $radius; | |
@include border-radius(50%); | |
background-color: transparent; | |
animation: rotate .75s infinite linear; | |
-webkit-animation: rotate .75s infinite linear; | |
border-left: $width solid $bgColor; | |
border-bottom: $width solid $bgColor; | |
border-right: $width solid $bgColor; | |
border-top: $width solid $fgColor; | |
} | |
@keyframes rotate { | |
from{ | |
transform: rotate(0deg); | |
} | |
to{ | |
transform: rotate(360deg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment