File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ <h2>Nova Transação</h2>
105
105
< label class ="sr-only " for ="date "> Data</ label >
106
106
< input type ="date " id ="date " name ="date ">
107
107
</ div >
108
+ < div id ="att " class ="attention sr-only ">
109
+ < small > Por favor, preencha todos os campos!</ small >
110
+ </ div >
108
111
< div class ="input-group actions ">
109
112
< a onclick ="Modal.close() " href ="# " class ="button cancel "> Cancelar</ a >
110
113
< button > Salvar</ button >
Original file line number Diff line number Diff line change @@ -3,13 +3,16 @@ const Modal = {
3
3
// ABRIR MODAL
4
4
// Adicionar a class active ao modal
5
5
document . querySelector ( '.modal-overlay' ) . classList . add ( 'active-overlay' )
6
- document . querySelector ( '.modal' ) . classList . add ( 'active-modal' )
6
+ document . querySelector ( '.modal' ) . classList . toggle ( 'active-modal' )
7
+ document . querySelector ( '.attention' ) . classList . add ( 'sr-only' )
8
+
7
9
} ,
8
10
close ( ) {
9
11
// FECHAR MODAL
10
12
// Remover a class active do modal
11
13
document . querySelector ( '.modal-overlay' ) . classList . remove ( 'active-overlay' )
12
- document . querySelector ( '.modal' ) . classList . remove ( 'active-modal' )
14
+ document . querySelector ( '.modal' ) . classList . toggle ( 'active-modal' )
15
+ document . querySelector ( '.attention' ) . classList . add ( 'sr-only' )
13
16
14
17
} ,
15
18
}
@@ -128,6 +131,7 @@ const Form = {
128
131
const { description, amount, date } = Form . getValues ( )
129
132
130
133
if ( description . trim ( ) === "" || amount . trim ( ) === "" || date . trim ( ) === "" ) {
134
+ document . querySelector ( '.attention' ) . classList . remove ( 'sr-only' )
131
135
throw new Error ( "Por favor, preencha todos os campos!" )
132
136
}
133
137
} ,
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ body {
39
39
margin : 0 auto;
40
40
}
41
41
42
+ .attention {
43
+ margin-top : 0.2rem ;
44
+ font-weight : 600 ;
45
+ color : var (--red );
46
+ }
47
+
42
48
/* TITLES============================================= */
43
49
h2 {
44
50
margin-top : 3.2rem ;
@@ -223,6 +229,7 @@ td.expense {
223
229
.modal-overlay .active-overlay {
224
230
opacity : 1 ;
225
231
visibility : visible;
232
+ backdrop-filter : blur (5px );
226
233
}
227
234
228
235
.modal {
You can’t perform that action at this time.
0 commit comments