Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jabes
Last active August 29, 2015 14:19
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 jabes/27c1f189c48d899d493e to your computer and use it in GitHub Desktop.
Save jabes/27c1f189c48d899d493e to your computer and use it in GitHub Desktop.
Sass + Compass Facebook spinner
.facebook-spinner {
@include facebook-spinner;
}
@include keyframes(facebookSpinner) {
0% { @include scale(1); @include opacity(1); }
100% { @include scale(.7); @include opacity(.1); }
}
@mixin facebook-spinner($total: 3) {
$block-width: 7px;
$block-height: 28px;
$block-margin: 2px;
width: ($block-width * $total) + ($block-margin * ($total - 1));
height: $block-height;
.spinner-block {
float: left;
width: $block-width;
height: $block-height;
background-color: #8b9dc3;
border: 1px solid #3b5998;
@include box-sizing(border-box);
@include animation-name(facebookSpinner);
@include animation-duration(1s);
@include animation-iteration-count(infinite);
&:not(:last-child) {
margin-right: $block-margin;
}
}
@for $i from 1 through $total {
$delay: #{$i * 100}ms;
.block-#{$i} { @include animation-delay($delay); }
}
}
@jabes
Copy link
Author

jabes commented Apr 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment