Skip to content

Commit 79a8259

Browse files
minor fix & changes
1 parent ba09344 commit 79a8259

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ <h2>Nova Transação</h2>
105105
<label class="sr-only" for="date">Data</label>
106106
<input type="date" id="date" name="date">
107107
</div>
108+
<div id="att" class="attention sr-only">
109+
<small>Por favor, preencha todos os campos!</small>
110+
</div>
108111
<div class="input-group actions">
109112
<a onclick="Modal.close()" href="#" class="button cancel">Cancelar</a>
110113
<button>Salvar</button>

scripts.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ const Modal = {
33
// ABRIR MODAL
44
// Adicionar a class active ao modal
55
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+
79
},
810
close() {
911
// FECHAR MODAL
1012
// Remover a class active do modal
1113
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')
1316

1417
},
1518
}
@@ -128,6 +131,7 @@ const Form = {
128131
const { description, amount, date } = Form.getValues()
129132

130133
if (description.trim() === "" || amount.trim() === "" || date.trim() === "") {
134+
document.querySelector('.attention').classList.remove('sr-only')
131135
throw new Error("Por favor, preencha todos os campos!")
132136
}
133137
},

style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ body {
3939
margin: 0 auto;
4040
}
4141

42+
.attention {
43+
margin-top: 0.2rem;
44+
font-weight: 600;
45+
color: var(--red);
46+
}
47+
4248
/* TITLES============================================= */
4349
h2 {
4450
margin-top: 3.2rem;
@@ -223,6 +229,7 @@ td.expense {
223229
.modal-overlay.active-overlay {
224230
opacity: 1;
225231
visibility: visible;
232+
backdrop-filter: blur(5px);
226233
}
227234

228235
.modal {

0 commit comments

Comments
 (0)