Skip to content

Instantly share code, notes, and snippets.

@thealscott
Created March 18, 2014 11:42
Show Gist options
  • Save thealscott/9618452 to your computer and use it in GitHub Desktop.
Save thealscott/9618452 to your computer and use it in GitHub Desktop.
Keyframe sprite animation technique
@include create-keyframe(sprite_animation) {
$frames:20;
$step:100%/$frames;
$pre_step:$step - 0.0001%;
@for $i from 0 through $frames {
$n: ($i * $step);
$n2: ($n + $pre_step);
#{$n}, #{$n2} { @include get-sprite($animations_sprite, sequence_#{$i}) }
}
100% {@include get-sprite($animations_sprite, sequence_#{$frames})}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment