overleaf/services/web/public/coffee/utils/Effects.coffee

23 lines
565 B
CoffeeScript
Raw Normal View History

2014-02-12 05:23:40 -05:00
define () ->
Effects =
highlight: (element, color, length, callback = () ->)->
element.animate
backgroundColor: color
, length, -> callback()
fadeElementIn: (element, callback = () -> )->
element.hide()
element.slideDown "slow"
element.fadeIn "slow"
@highlight element, "#BDDFB3", 1500, =>
setTimeout ( () -> element.removeAttr('style') ), 0
callback()
fadeElementOut: (element, callback = () -> )->
@highlight element, "#FF8E8A", 800, ->
element.slideUp "slow"
element.fadeOut "slow", ->
callback()