-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
87 lines (74 loc) · 2.11 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
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title>Conversor de Moedas</title>
<style>
body {
font-family: Arial, sans-serif;
}
.converter-container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="number"] {
width: 100%;
padding: 5px;
border: 1px solid #ccc;
border-radius: 3px;
}
button {
margin-top: 10px;
padding: 8px 16px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
}
#result {
margin-top: 10px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="converter-container">
<h2>Conversor de Moedas</h2>
<label for="amount">Valor:</label>
<input type="number" id="amount" placeholder="Digite o valor">
<label for="from">De:</label>
<select id="from">
<option value="USD">Dólar Americano (USD)</option>
<option value="EUR">Euro (EUR)</option>
<option value="GBP">Libra Esterlina (GBP)</option>
<!-- Adicione mais opções de moedas conforme necessário -->
</select>
<label for="to">Para:</label>
<select id="to">
<option value="USD">Dólar Americano (USD)</option>
<option value="EUR">Euro (EUR)</option>
<option value="GBP">Libra Esterlina (GBP)</option>
<!-- Adicione mais opções de moedas conforme necessário -->
</select>
<button onclick="convertCurrency()">Converter</button>
<div id="result"></div>
</div>
<script>
function convertCurrency() {
var amount = document.getElementById('amount').value;
var from = document.getElementById('from').value;
var to = document.getElementById('to').value;
// API ????
var result = amount + ' ' + from + ' equivale a ' + (amount * 1.2) + ' ' + to; // Exemplo de conversão (multiplicação por 1.2)
document.getElementById('result').innerText = result;
}
</script>
</body>
</html>