 
   render : -> 
     flash = fetch('flash')
-    return SPAN(null) if !flash.message
   
     is_error = flash.args?.error 
 
     DIV
       id: "flash-container"
+      style: 
+        animation: if flash.message then "flashfadein 500ms, flashfadeout 500ms #{flash.time - 500}ms"
+        visibility: if flash.message then 'visible' else 'hidden'
+        opacity: if flash.message then 1 else 0 
+        bottom: if flash.message then 50 else 0
 
       DIV
         id: 'flash'


        DIV 
          className: 'flash-message'
          dangerouslySetInnerHTML: {__html: flash.message}

        DIV
          className: 'flash-close'

    border: none;
    padding: 12px 24px;
  }


  @keyframes flashfadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 50px; opacity: 1;}
  }

  @keyframes flashfadeout {
    from {bottom: 50px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
  }


"""


clear_flash = ->
  flash = fetch('flash')
  flash.message = flash.time = flash.args = null 
  save flash

window.show_flash_error = (message, time_in_ms) ->
