Created
November 3, 2015 20:22
-
-
Save ehmorris/6adec9b73b89b9086e7e to your computer and use it in GitHub Desktop.
Twitter's new like animation
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
/* Twitter's new like animaton uses a background image sprite and a CSS animation | |
* | |
* They animate through [this sprite](http://i.imgur.com/UjuIJ4C.png) with the following CSS: | |
*/ | |
@keyframes heart-burst { | |
0% { | |
background-position: left | |
} | |
100% { | |
background-position: right | |
} | |
} | |
.ProfileTweet-action--favorite.withHeartIcon.is-animating .HeartAnimation { | |
animation-timing-function: steps(28) | |
} | |
.ProfileTweet-action--favorite.withHeartIcon.is-animating .HeartAnimation { | |
display: inline-block; | |
animation-name: heart-burst; | |
animation-duration: .8s; | |
animation-iteration-count: 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Step easing functions: https://developer.mozilla.org/en-US/docs/Web/CSS/timing-function#The_steps()_class_of_timing-functions