made flash messages awesome this time

This commit is contained in:
danielgrippi 2011-10-24 17:33:01 -07:00
parent d5e3033308
commit 0033237b4e
3 changed files with 27 additions and 20 deletions

View file

@ -92,9 +92,10 @@
⇧ ⇧
#notifications #notifications
- flash.each do |name, msg| - flash.each do |name, msg|
%div{:id => "flash_#{name}"}= msg %div{:id => "flash_#{name}"}
.message
= msg
%header{:class=>('landing' unless current_user)} %header{:class=>('landing' unless current_user)}
= render 'layouts/header' = render 'layouts/header'

View file

@ -10,7 +10,7 @@
var flashMessages = $("#flash_notice, #flash_error, #flash_alert"); var flashMessages = $("#flash_notice, #flash_error, #flash_alert");
flashMessages.animate({ flashMessages.animate({
top: 0 top: 0
}).delay(2000).animate({ }).delay(4000).animate({
top: -100 top: -100
}, flashMessages.remove); }, flashMessages.remove);
}; };

View file

@ -73,36 +73,42 @@ form
#flash_notice, #flash_notice,
#flash_error, #flash_error,
#flash_alert #flash_alert
@include box-shadow(0, 1px, 2px, #333) :z-index 999
:z-index 100
:position fixed :position fixed
:color #fff :color #666
:top -100px :top -100px
:left 0 :left 0
:width 100% :width 100%
:padding 1em
:font :font
:weight bold :weight bold
:text
:align center
.message
@include border-radius(6px)
@include box-shadow(0, 1px, 5px, rgba(0,0,0,0.4))
:display inline-block
:width 400px
:padding
:top 45px
:bottom 8px
#flash_notice #flash_notice
:background .message
:color rgb(126,240,77) :background
:color rgba(126,240,77,0.98) :color #F4F899
:text :border 1px solid darken(#F4F899, 40%)
:shadow 0 1px #6C6
#flash_error, #flash_error,
#flash_alert #flash_alert
:background .message
:color rgb(208,49,43) :color #fff
:color rgba(208,49,43,0.98) :background
:border :color #CA410B
:bottom solid 1px #C66 :border 1px solid darken(#CA410B, 10%)
:text
:shadow 0 1px #C66
.login_error, .login_error,
.login_alert .login_alert