Skip to content

Instantly share code, notes, and snippets.

@cimmanon
Forked from SimplGy/animationPlay
Last active December 18, 2015 08:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cimmanon/5751513 to your computer and use it in GitHub Desktop.
Save cimmanon/5751513 to your computer and use it in GitHub Desktop.
@function foo-shadow($color, $size, $layers: 1) {
$transparency: (10 - $layers) * .1;
$opts: ();
@for $i from 1 to $layers {
$opts: append($opts, 0 0 0 ($size * $i) transparentize($color, $transparency + (.1 * $i)), comma);
}
@return $opts;
}
$colorGood: lawngreen;
$size: 10px;
.circle {
background: $colorGood
}
.circle.yay {
@include animation( blammo .5s )
}
@mixin keyframes(blammo) {
0%, 100%
+transform( scale(1) )
box-shadow: 0 0 0 0 transparent
10%, 80%
box-shadow: foo-shadow($colorGood, $size, 1);
20%, 60%
box-shadow: foo-shadow($colorGood, $size, 2);
30%
+transform( scale(1.05) )
box-shadow: foo-shadow($colorGood, $size, 3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment