-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
38 lines (32 loc) · 1.13 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
<!DOCTYPE html>
<html>
<!-- Note: Non-production copy. Firebase hosts this file. -->
<body>
<div class="centered">
<h1>Sunblock Alpha</h1>
<br><span id="city"></span> Weather<br>
<code></code>
</div>
<script type="text/javascript">
fetch('https://ipapi.co/json').then(response => response.json()).then(data => {
city = data.city + ", " + data.region_code;
document.getElementById("city").innerHTML = city;
//weatherAPIURL = `https://api.open-meteo.com/v1/forecast?latitude=${data.latitude}&longitude=${data.longitude}¤t=temperature_2m,precipitation,rain,showers,snowfall,weathercode&hourly=temperature_2m,rain&daily=uv_index_clear_sky_max&temperature_unit=fahrenheit&windspeed_unit=mph&precipitation_unit=inch&timezone=auto`;
})
.catch(error => {
console.error("Error fetching IP data:", error);
});
</script>
<style type="text/css">
body { font-family: Helvetica, Geneva, sans-serif; }
a { color: black; }
.centered {
position: fixed;
top: 50%;
left: 50%;
margin-top: -125px;
margin-left: -87px;
}
</style>
</body>
</html>