-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
65 lines (53 loc) · 2.14 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
<!DOCTYPE html>
<html>
<head>
<title>IQ Snapshot Check</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-57561457-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-57561457-5');
</script>
</head>
<body class="container">
<div class="text-center">
<img src="https://epcdn-vz.azureedge.net/static/images/everipedia_logo_medium.png">
</div>
<h1 class="text-center">Check Your IQ Balance</h1>
<div class="form-group mt-5">
<label>EOS Public Key:</label>
<input class="form-control" id="EOSpubkey">
</div>
<div class="form-group">
<button id="view-balance-btn" class="btn btn-primary" onclick="queryBalance()">View Balance</button>
</div>
<hr>
<p id="snapshot-response" class="lead"></p>
<script>
function queryBalance () {
document.getElementById('view-balance-btn').disabled = true;
var EOSpubkey = document.getElementById('EOSpubkey').value.trim();
fetch(`https://balanceserver.liberteos.com:5000/balance/${EOSpubkey}`)
.then(function (response) {
if (!response.ok) {
throw Error(response.statusText);
}
return response.text()
})
.then(function (balance) {
var text = `You will receive <span class="text-info">${balance}</span> IQ in the airdrop`;
document.getElementById('snapshot-response').innerHTML = text;
document.getElementById('view-balance-btn').disabled = false;
})
.catch(function (error) {
var text = `<span class="text-danger">Whoops! Something's wrong. (Contact @Romiezzo on Telegram.)</span>`;
document.getElementById('snapshot-response').innerHTML = text;
document.getElementById('view-balance-btn').disabled = false;
});
}
</script>
</body>
</html>