-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbitcoin_price_ticker.html
54 lines (50 loc) · 1.49 KB
/
bitcoin_price_ticker.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
<!--- diky downete! -->
<html class=" jigpbgebnt idc0_331"><head>
<meta charset="utf-8">
<title>Bitcoin Ticker</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
}
body{
background-color: #000;
text-align: center;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
#container {
max-width: 900px;
margin: 0 auto;
text-align: center;
}
#btcprice {
margin: 0 auto;
color: #fff;
font-size: 10vw;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<div id="container">
<div id="btcprice"></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$.getJSON('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd', function(data) {
var price = `${data.bitcoin.usd}`
$("#btcprice").html(price);
});
setInterval(function(){
$.getJSON('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd', function(data) {
var price = `${data.bitcoin.usd}`
$("#btcprice").html(price);
});
}, 60000);
});
</script>
</body></html>