Skip to content

Instantly share code, notes, and snippets.

@ahmednuaman
Created November 30, 2011 19:12
Show Gist options
  • Save ahmednuaman/1410363 to your computer and use it in GitHub Desktop.
Save ahmednuaman/1410363 to your computer and use it in GitHub Desktop.
A little utility to take the pain out of writing vendor prefixed CSS3 animations
a = [ 'webkit', 'moz', 'ms', 'o', '' ]
n = 'enter'
f = {
'from' : [
'opacity: 0',
'.transform( e(\'rotate(360deg)\')'
],
'to' : [
'opacity: 1',
'.transform( e(\'rotate(0deg)\')'
]
}
for p in a:
print '@' + ( '-' + p + '-' if p else '' ) + 'keyframes ' + n
print '{'
for k, v in f.items():
print "\t" + k + ( '%' if k.isdigit() else '' ) + ' { ' + '; '.join( v ) + ' }'
print '}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment