-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (40 loc) · 1.47 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="./styles.css" />
<title>Calculadora de Bitcoin</title>
<script>
fetch('https://api.binance.com/api/v3/ticker/price?symbol=BTCBRL')
.then(response => response.json())
.then(data => {
document.getElementById("value-to").value = parseFloat(
1 * parseFloat(data.price)).toFixed(2)
})
</script>
</head>
<body>
<div class="container mt-5">
<div class="form-group">
<input type="number" class="form-control inp" id="value-from" value="1" placeholder="0">
<select class="form-control menu-dropdown" id="menu-dropdown-from">
<option value="btc">BTC</option>
<option value="sats">SATS</option>
</select>
</div>
<div class="form-group">
<input type="number" class="form-control inp" id="value-to" value="0" placeholder="$ 0,00">
<select class="form-control menu-dropdown" id="menu-dropdown-to">
<option value="brl">BRL</option>
<option value="usd">USD</option>
<option value="btc">BTC</option>
<option value="sats">SATS</option
</select>
</div>
</div>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="script.js"></script>
</body>
</html>