Skip to content

Instantly share code, notes, and snippets.

@ehmorris
Created November 3, 2015 20:22
Show Gist options
  • Save ehmorris/6adec9b73b89b9086e7e to your computer and use it in GitHub Desktop.
Save ehmorris/6adec9b73b89b9086e7e to your computer and use it in GitHub Desktop.
Twitter's new like animation
/* 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
}
@ehmorris
Copy link
Author

ehmorris commented Nov 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment