Created
April 22, 2011 04:18
-
-
Save VoQn/936007 to your computer and use it in GitHub Desktop.
Generate CSS3 Transition Properties
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
animateCSS = (css, duration = '1s', timing_function = 'linear', delay = 0) -> | |
obj = {} | |
if css? | |
animate = '' | |
for property, value of css | |
obj[property] = value | |
animate += ', ' unless animate is '' | |
animate += "#{property} #{duration} #{timing_function} #{delay}" | |
if animate isnt '' | |
for browser in ['', '-o-', '-moz-', '-webkit-'] | |
obj["#{browser}transition"] = animate | |
return obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment