-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (60 loc) · 2.2 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
<!DOCTYPE html>
<html>
<body>
<title>Mobiz-Advanced-Natural-Disaster-Alarm-For-Indonesia</title>
<link href="https://fonts.cdnfonts.com/css/vcr-eas" rel="stylesheet">
<style>
* {
font-family: 'VCR EAS', sans-serif;
color: white;
margin: 0;
padding: 0;
box-sizing: border-box;
} body {
background: black;
height: 100vh;
display: flex;
place-items: center;
justify-content: center;
padding: 25px;
} img {
width: 20vw;
}
</style>
<center>
<div>
<img id="shakemap">
<br><br>
<span><span id="tanggal"></span> <span id="jam"></span></span>
<br><br>
<h2 id="wilayah"></h2><br>
<h3 id="potensi"></h3>
<br>
<span>Coordinate: <span id="coordinates"></span></span><br>
<span>Latitude: <span id="lintang"></span></span><br>
<span>Longitude: <span id="bujur"></span></span><br>
<span>Depth: <span id="kedalaman"></span></span><br>
<span>Magnitude: <span id="magnitude"></span></span><br><br>
<span>Affected areas: <span id="dirasakan"></span></span>
</div>
</center>
<script>
async function fetchQuakes() {
let fetchedData = await fetch('https://cuaca-gempa-rest-api.vercel.app/quake')
let data = await fetchedData.json()
document.getElementById('wilayah').innerText = data.data.wilayah;
document.getElementById('potensi').innerText = data.data.potensi;
document.getElementById('tanggal').innerText = data.data.tanggal;
document.getElementById('jam').innerText = data.data.jam;
document.getElementById('coordinates').innerText = data.data.coordinates;
document.getElementById('lintang').innerText = data.data.lintang;
document.getElementById('bujur').innerText = data.data.bujur;
document.getElementById('kedalaman').innerText = data.data.kedalaman;
document.getElementById('magnitude').innerText = data.data.magnitude;
document.getElementById('dirasakan').innerText = data.data.dirasakan;
document.getElementById('shakemap').src = data.data.shakemap;
}
fetchQuakes()
</script>
</body>
</html>