Created
April 26, 2014 02:06
-
-
Save helenvholmes/11309889 to your computer and use it in GitHub Desktop.
Animation Mixins
This file contains hidden or 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
@mixin keyframe($animation) { | |
@-webkit-keyframes #{$animation} { | |
@content; | |
} | |
@-moz-keyframes #{$animation} { | |
@content; | |
} | |
@keyframes #{$animation} { | |
@content; | |
} | |
} | |
@include keyframe(fadein) { | |
0% { | |
opacity: 0; | |
} | |
100% { | |
opacity: 1; | |
} | |
} | |
@include keyframe(fadein-and-down) { | |
0% { | |
opacity: 0; | |
transform: translateY(0); | |
} | |
100% { | |
opacity: 1; | |
transform: translateY(10px); | |
} | |
} | |
@mixin intro-animation($delay, $duration, $animation) { | |
-webkit-animation-delay: $delay; | |
-webkit-animation-duration: $duration; | |
-webkit-animation-name: $animation; | |
-webkit-animation-fill-mode: forwards; | |
-moz-animation-delay: $delay; | |
-moz-animation-duration: $duration; | |
-moz-animation-name: $animation; | |
-moz-animation-fill-mode: forwards; | |
animation-delay: $delay; | |
animation-duration: $duration; | |
animation-name: $animation; | |
animation-fill-mode: forwards; | |
opacity: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment