Skip to content

Instantly share code, notes, and snippets.

@javierarques
Created November 20, 2014 08:57
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 javierarques/e2fa4bc3eec8904c4757 to your computer and use it in GitHub Desktop.
Save javierarques/e2fa4bc3eec8904c4757 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
@import "compass";
@mixin animation-loading-two-colors ( $color-a, $color-b, $number-of-items: 5) {
$delay: 100ms;
$max-items: $number-of-items - 1;
$step-progress: 100 / $number-of-items;
%animation-loading-basic {
display: inline-block;
vertical-align: middle;
width: 1em;
height: 1em;
margin: .2em;
@include border-radius(100%);
}
span {
@extend %animation-loading-basic;
-webkit-animation:loading $number-of-items*$delay infinite alternate;
animation: loading $number-of-items*$delay infinite alternate;
@for $i from 1 through ($number-of-items){
&:nth-of-type(#{$i}) {
@include animation-delay($delay*($i - 1));
background: mix( $color-a, $color-b, 100-$step-progress*($i - 1));
}
}
}
}
@include keyframes (loading) {
0% {
@include transform( scale(1.3) );
opacity: 1;
}
100% {
@include transform( scale(1) );
opacity: 0.5;
}
}
@-moz-keyframes loading {
0% {
-moz-transform: scale(1.3);
transform: scale(1.3);
opacity: 1;
}
100% {
-moz-transform: scale(1);
transform: scale(1);
opacity: 0.5;
}
}
@-webkit-keyframes loading {
0% {
-webkit-transform: scale(1.3);
transform: scale(1.3);
opacity: 1;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0.5;
}
}
@keyframes loading {
0% {
-moz-transform: scale(1.3);
-ms-transform: scale(1.3);
-webkit-transform: scale(1.3);
transform: scale(1.3);
opacity: 1;
}
100% {
-moz-transform: scale(1);
-ms-transform: scale(1);
-webkit-transform: scale(1);
transform: scale(1);
opacity: 0.5;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment