-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
189 lines (148 loc) · 7.75 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="https://88mph.app/fm/">
<meta name="description" content="Refreshing Synthwave and outrun mixtapes to listen while refreshing 88mph UI.">
<meta name="author" content="Bacon Labs">
<link rel="canonical" href="https://88mph.app/fm/">
<link rel="icon" type="image/png" href="https://88mph.app/fm/assets/icon-default.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://88mph.app/fm/assets/logo.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://88mph.app/fm/assets/icon-default.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://88mph.app/fm/assets/icon-default.png">
<title>88.0 FM by 88mph</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="https://88mph.app/fm/assets/style.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://public.radio.co/playerapi/jquery.radiocoplayer.min.js"></script>
</head>
<body>
<!-- PRELOADER -->
<div class="preloader" style="width:100vw;
height:100vh;
padding-top:10vh;
background-color: #000;
text-align: center;
z-index: 500;
position: absolute;">
<h3 class="txt1">Loading...</h3>
<div id="sun_container">
<div class="sun"></div>
<div class="band" style="animation-delay: -0s"></div>
<div class="band" style="animation-delay: -1s"></div>
<div class="band" style="animation-delay: -2s"></div>
<div class="band" style="animation-delay: -3s"></div>
<div class="band" style="animation-delay: -4s"></div>
<div class="band" style="animation-delay: -5s"></div>
<div class="band" style="animation-delay: -6s"></div>
<div class="band" style="animation-delay: -7s"></div>
<div class="band" style="animation-delay: -8s"></div>
<div class="band" style="animation-delay: -9s"></div>
</div>
</div>
<!-- //PRELOADER -->
<div id="landscapewarning">
<!-- LANDSCAPE ONLY -->
<div style="width:100vw;
height:100vh;
background-color: #000;
text-align: center;
z-index: 500;
position: absolute;">
<h2 style="color:#fff; margin-top:45vh" class="txt1">This page only viewed on landscape mode. Turn your device.</h2>
</div>
<!-- //LANDSCAPE ONLY -->
</div>
<div id="container">
<div id="scene">
<video id="video" muted autoplay loop>
<source src="https://88mph.app/fm/assets/scene_webm2.webm" type="video/webm">
<source src="https://88mph.app/fm/assets/scene.mp4" type="video/mp4">
</video>
</div>
<a id="logo" href="https://88mph.app"><img src="https://88mph.app/fm/assets/logo-glowing.png" width="64"></a>
<div id="data" class="txt1">
TVL: <span id="d_tvl"></span> <br>
<!-- Liquidity: <span id="d_liq"></span><br> -->
MPH: <span id="d_mpg"></span>
</div>
<div id="speed">
<span id="speed_meter" class="txt1">0</span>
<img class="speed_marker" src="https://88mph.app/fm/assets/speed_marker.png">
</div>
<div id="radio">
<!-- <script src="https://embed.radio.co/player/4755948.js"></script> -->
<span class="radioplayer"
data-src="https://s3.radio.co/s4358eb178/listen"
data-playbutton="true"
data-volumeslider="false"
data-elapsedtime="false"
data-nowplaying="true"
data-showplayer="false"></span>
</div>
<a href="https://app.rarible.com/token/0xd07dc4262bcdbf85190c01c996b4c06a461d2430:111850:0x5200b3fc7e9b48ae7fbec468ea0c18fcec694242" target="_blank" class="nftlink txt1">💜 NFT</a>
</div>
<script>
//preloader
window.onload = function(){
document.querySelector(".preloader").style.display = "none";
}
function load_data() {
//MPH price
const fetchPRICE = 'https://api.coingecko.com/api/v3/simple/price?ids=88mph&vs_currencies=usd';
fetch(fetchPRICE)
.then(function(response){
response.json().then(function(data){
document.getElementById("d_mpg").innerHTML = '$' + data['88mph']['usd'];
});
})
.catch(function(err){
console.error('Failed retrieving information', err);
});
//TVL NEW
Promise.all([
fetch('https://api.88mph.app/v2/pools').then(resp => resp.json()),
fetch('https://api.88mph.app/v3/pools').then(resp => resp.json()),
fetch('https://api.88mph.app/v3/polygon/pools').then(resp => resp.json()),
fetch('https://api.88mph.app/v3/avalanche/pools').then(resp => resp.json()),
fetch('https://api.88mph.app/v3/fantom/pools').then(resp => resp.json())
]).then(results => {
var total_tvl = 0;
results.forEach(function(item){
total_tvl += item.map(bill => parseFloat(bill.totalValueLockedInUSD)).reduce((acc, bill) => bill + acc);
})
var total_tvl_formated = parseFloat(total_tvl).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
document.getElementById("d_tvl").innerHTML = '$' + total_tvl_formated;
//Rotate Speed Marker
var rotation = (total_tvl/1000000) * 1.72;
document.querySelector(".speed_marker").style.transform = "rotate("+rotation+"deg)";
//Set Speed Meter
var speed = Math.round(total_tvl/1000000);
var i = 0;
var inv = setInterval(function() {
if(i <= speed) {
document.getElementById("speed_meter").innerHTML = i++;
} else {
clearInterval(inv);
}
}, 2000 / speed);
//Video Playback Rate
var video = document.getElementById("video");
video.playbackRate = speed * 0.035;
console.log(total_tvl_formated);
})
.catch(function(err){
console.error('Failed retrieving information', err);
});
} //end load_data
load_data();
</script>
</body>
<script>
//initialise the plugin with the element
$('.radioplayer').radiocoPlayer();
</script>
</html>