-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
82 lines (70 loc) · 2.55 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<title>Números, sinais e botão Finalizar</title>
<style>
.container {
font-size: 40px;
font-family: Arial, sans-serif;
position: relative;
}
.number {
display: inline-block;
margin-right: 10px; /* Espaço entre o número e o sinal de "+" */
}
.plus {
display: inline-block;
margin-right: 10px; /* Espaço entre o sinal de "+" e o sinal de "=" */
}
.equals {
display: inline-block;
font-size: 20px; /* Tamanho da fonte do sinal de "=" */
}
.input-box {
width: 40px;
height: 40px;
border: 2px solid red; /* Adiciona uma borda vermelha */
box-sizing: border-box; /* Inclui a borda na largura e altura total */
text-align: center; /* Centraliza o texto na caixa de texto */
font-size: 20px; /* Tamanho da fonte da caixa de texto */
position: relative;
top: -4px; /* Suba a caixa de texto em 4 pixels */
}
.finalizar {
display: block;
margin-top: 10px; /* Espaço acima do botão Finalizar */
}
</style>
</head>
<body>
<div class="container">
<span class="number">5</span>
<span class="plus">+</span>
<input class="input-box" type="text" maxlength="1">
<span class="equals">=</span>
</div>
<div class="container">
<span class="number">8</span>
<span class="plus">-</span>
<input class="input-box" type="text" maxlength="1">
<span class="equals">=</span>
</div>
<button class="finalizar">Finalizar</button>
<script>
document.querySelector('.finalizar').addEventListener('click', function() {
var respostas = document.querySelectorAll('.input-box');
var valores = Array.from(respostas).map(function(element) {
return element.value;
});
var log = valores.join('\n');
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(log));
element.setAttribute('download', 'log.txt');
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
});
</script>
</body>
</html>