Skip to content

Commit

Permalink
create modal structure, improve responsibility and acessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
felipefrm committed Feb 8, 2022
1 parent 636b01e commit a6b98c1
Show file tree
Hide file tree
Showing 8 changed files with 305 additions and 18 deletions.
5 changes: 5 additions & 0 deletions assets/expense.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/income.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/total.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 90 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,149 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>dev.finance$</title>
<link rel="stylesheet" href="./styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,400;0,700;1,100;1,400;1,700&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,400;0,700;1,100;1,400;1,700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<header>
<h1 id="logo">dev.finance$</h1>
<img src="./assets/logo.svg" alt="Logo Dev Finance" />
</header>

<main class="container">
<section id="balance">
<h2>Balanço</h2>
<h2 class="sr-only">Balanço</h2>

<div class="card">
<h3>Entradas</h3>
<h3>
<span>Entradas</span>
<img src="./assets/income.svg" alt="Imagem de entradas" />
</h3>
<p>R$ 5.000,00</p>
</div>

<div class="card">
<h3>Saídas</h3>
<h3>
<span>Saídas</span>
<img src="./assets/expense.svg" alt="Imagem de saídas" />
</h3>
<p>R$ 3.000,00</p>
</div>

<div class="card total">
<h3>Total</h3>
<h3>
<span>Total</span>
<img src="./assets/total.svg" alt="Imagem de total" />
</h3>
<p>R$ 2.000,00</p>
</div>
</section>

<section id="transaction">
<h2>Transações</h2>
<h2 class="sr-only">Transações</h2>

<a href="#" class="button new" onclick="Modal.open()"
>+ Nova Transação</a
>

<table id="data-table">
<thead>
<tr>
<th>Descrição</th>
<th>Valor</th>
<th>Data</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td class="description">Luz</td>
<td class="expense">- R$ 500,00</td>
<td class="date">23/01/2021</td>
<td><img src="./assets/minus.svg" alt="Remover transação" /></td>
</tr>
<tr>
<td class="description">Criação Site</td>
<td class="income">R$ 1500,00</td>
<td class="date">23/01/2021</td>
<td><img src="./assets/minus.svg" alt="Remover transação" /></td>
</tr>
<tr>
<td class="description">Aluguel</td>
<td class="expense">- R$ 1000,00</td>
<td class="date">23/01/2021</td>
<td><img src="./assets/minus.svg" alt="Remover transação" /></td>
</tr>
</tbody>
</table>
</section>
</main>

<div class="modal-overlay">
<div class="modal">
<div id="form">
<h2>Nova Transação</h2>
<form action="">
<div class="input-group">
<label class="sr-only" for="description"> Descrição </label>
<input
type="text"
id="description"
name="description"
placeholder="Descrição"
/>
</div>
<div class="input-group">
<label class="sr-only" for="amount"> Valor </label>
<input
type="number"
step="0.01"
id="amount"
name="amount"
placeholder="0,00"
/>
<small class="help"
>Use o sinal - (negativo) para despesas e , (vírgula) para casas
decimais</small
>
</div>
<div class="input-group">
<label class="sr-only" for="date"> Data </label>
<input
type="date"
id="date"
name="date"
placeholder="01/01/2021"
/>
</div>

<div class="input-group actions">
<a href="#" class="button cancel" onclick="Modal.close()"
>Cancelar</a
>
<button>Salvar</button>
</div>
</form>
</div>
</div>
</div>

<footer>
<p>dev.finance$</p>
</footer>

<script>
const Modal = {
open() {
document.querySelector(".modal-overlay").classList.add("active");
},
close() {
document.querySelector(".modal-overlay").classList.remove("active");
},
};
</script>
</body>
</html>
Loading

0 comments on commit a6b98c1

Please sign in to comment.