File tree Expand file tree Collapse file tree 4 files changed +25
-15
lines changed
Expand file tree Collapse file tree 4 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,17 @@ input[type=number]::-webkit-outer-spin-button {
8484 animation : heartbeat 2s infinite;
8585}
8686
87+ @keyframes fade-out {
88+ from { opacity : 1 ; }
89+ to { opacity : 0 ; }
90+ }
91+
92+ .animate-fadeout {
93+ animation : fade-out 2s ;
94+ animation-delay : 5s ;
95+ animation-fill-mode : forwards;
96+ }
97+
8798button .dropdown-button : has ( + div > ul : empty ) {
8899 display : none;
89100}
Original file line number Diff line number Diff line change @@ -2,10 +2,7 @@ import { Controller } from "@hotwired/stimulus"
22
33// Connects to data-controller="flash"
44export default class extends Controller {
5- connect ( ) {
6- }
7-
8- hide ( ) {
5+ destroy ( ) {
96 this . element . remove ( )
107 }
118}
Original file line number Diff line number Diff line change 2222
2323 / data-controller="#{'debug-turbo' if Rails.env.development?}"
2424 body
25- = render( " shared/flash" )
25+ = render " shared/flash"
2626
2727 / TODO: this is here because Devise is using this layout, not public
2828 - if request.path.include?(" /lookbook/" )
Original file line number Diff line number Diff line change 1- - flash.each do |type , message |
1+ .absolute .right-10 .pt-4
2+ - flash.each do |type , message |
23 - if type.to_sym == :notice
3- - color_classes = " bg-blue-100 border-blue-500"
4+ - color_classes = " bg-blue-200"
5+ - icon_symbol = :bell
46 - elsif type.to_sym.in?([ :error , :alert ])
5- - color_classes = " bg-red-100 border-red-500"
7+ - color_classes = " bg-red-500 text-xl"
8+ - icon_symbol = :warning_circle
69 - else
7- - color_classes = " bg-white"
10+ - color_classes = " bg-white"
11+ - icon_symbol = :bell
812
9- div class =" absolute border-t-4 rounded-b px-4 py-3 shadow-md #{color_classes} right-10" role =" alert" data-controller =" flash" data-action =" click->flash#hide"
10- div class =" flex"
11- div class =" py-1"
12- = icon(:bell )
13- div
14- p = message
13+ div class =" rounded-md mb-2 px-4 py-3 shadow-md #{color_classes} animate-fadeout" role =" alert" data-controller =" flash" data-action =" click->flash#destroy animationend->flash#destroy"
14+ .flex .align-middle
15+ div = icon(icon_symbol)
16+ div = message
You can’t perform that action at this time.
0 commit comments