Created
October 28, 2013 19:27
-
-
Save lunelson/7203024 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
$animation-data: ( | |
fadeIn: ( | |
from: ( | |
opacity: 0 | |
), | |
to: ( | |
opacity: 1 | |
) | |
), | |
fadeOut: ( | |
from: ( | |
opacity: 1 | |
), | |
to: ( | |
opacity: 0, | |
transform: (translateX(5rem), translateY(2rem)), | |
) | |
), | |
zoomOut: ( | |
0%: ( | |
transform: (scaleX(100%), scaleY(100%)) | |
), | |
100%: ( | |
transform: (scaleX(0%), scaleY(0%)) | |
) | |
) | |
); | |
@mixin animation-setup($names...) { | |
@each $name in $names { | |
$spec: map-get($animation-data, $name); | |
@keyframes #{$name} { | |
@each $keyframe, $declaration in $spec { | |
#{$keyframe} { | |
@each $property, $value in $declaration { | |
#{$property}: $value; | |
} | |
} | |
} | |
} | |
.animated.#{$name} { | |
animation-name: $name; | |
} | |
} | |
} | |
@include animation-setup(fadeIn, fadeOut, zoomOut); |
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
@keyframes fadeIn { from { opacity: 0; } | |
to { opacity: 1; } } | |
.animated.fadeIn { animation-name: fadeIn; } | |
@keyframes fadeOut { from { opacity: 1; } | |
to { opacity: 0; transform: translateX(5rem), translateY(2rem); } } | |
.animated.fadeOut { animation-name: fadeOut; } | |
@keyframes zoomOut { 0% { transform: scaleX(100%), scaleY(100%); } | |
100% { transform: scaleX(0%), scaleY(0%); } } | |
.animated.zoomOut { animation-name: zoomOut; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment