Created
March 4, 2015 03:47
-
-
Save hongkheng/019e5515161a56327bfa 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.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin keyframe ($animation_name) { | |
@-webkit-keyframes #{$animation_name} { | |
@content; | |
} | |
@-moz-keyframes #{$animation_name} { | |
@content; | |
} | |
@-o-keyframes #{$animation_name} { | |
@content; | |
} | |
@keyframes #{$animation_name} { | |
@content; | |
} | |
} | |
@include keyframe(play) { | |
from { background-position: 0px; } | |
to { background-position: -1500px; } | |
} | |
@mixin animation($animate...) { | |
$max: length($animate); | |
$animations: ''; | |
@for $i from 1 through $max { | |
$animations: #{$animations + nth($animate, $i)}; | |
@if $i < $max { | |
$animations: #{$animations + ", "}; | |
} | |
} | |
-webkit-animation: $animations; | |
-moz-animation: $animations; | |
-o-animation: $animations; | |
animation: $animations; | |
} | |
.object-to-animate { | |
@include animation('move-the-object .5s 1', 'move-the-object-again .5s 1 .5s'); | |
} |
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
@-webkit-keyframes play { | |
from { | |
background-position: 0px; | |
} | |
to { | |
background-position: -1500px; | |
} | |
} | |
@-moz-keyframes play { | |
from { | |
background-position: 0px; | |
} | |
to { | |
background-position: -1500px; | |
} | |
} | |
@-o-keyframes play { | |
from { | |
background-position: 0px; | |
} | |
to { | |
background-position: -1500px; | |
} | |
} | |
@keyframes play { | |
from { | |
background-position: 0px; | |
} | |
to { | |
background-position: -1500px; | |
} | |
} | |
.object-to-animate { | |
-webkit-animation: move-the-object .5s 1, move-the-object-again .5s 1 .5s; | |
-moz-animation: move-the-object .5s 1, move-the-object-again .5s 1 .5s; | |
-o-animation: move-the-object .5s 1, move-the-object-again .5s 1 .5s; | |
animation: move-the-object .5s 1, move-the-object-again .5s 1 .5s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment