aurora/index.html
2020-09-23 20:58:21 +02:00

55 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html lang='en'>
<head>
<title>Aurora</title>
<META HTTP-EQUIV="Refresh" CONTENT="60">
<meta charset="UTF-8">
<meta name="author" content="Arnau Busom i Vidal">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
</head>
<body>
<div style="text-align: center;">
<h1><span style='color: purple;'>D</span><span style='color: #FF47EB;'>a</span><span style='color: red;'>t</span><span style='color: #FF6600;'>a</span> <span style='color: orange;'>f</span><span style='color: #FFE200;'>r</span><span style='color: lightgreen;'>o</span><span style='color: darkgreen;'>m</span> <span style='color: turquoise;'>I</span><span style='color: #1ac6ff;'>R</span><span style='color: blue;'>F</span> <span style='color: grey;'>K</span><span style='color: #914724;'>i</span>r<span style='color: #9933ff;'>u</span><span style='color: #ff99cc;'>n</span><span style='color: #811a36;'>a</span></h1>
<div style="display: inline-block; padding: 10px;">
<h3>Latest image from the All Sky camera</h3>
<img style='width: 90%;' src='https://www.irf.se/alis/allsky/krn/latest_small.jpeg'>
</div>
<div style="display: inline-block; padding: 10px;">
<h3>Latest movie from the All Sky camera</h3>
<video style='width: 90%;' autoplay loop src='https://www.irf.se/alis/allsky/krn/latest_movie.mp4'></video>
</div>
</div>
<div style="text-align: center;">
<h1>Aurora Forecast</h1>
<div style="display: inline-block; padding: 10px;">
<h3>Kp index now</h3>
<span id="kp_now"></span>
</div>
<div style="display: inline-block; padding: 10px;">
<h3>Kp index in 3 hours</h3>
<span id="kp_3"></span>
</div>
<h2>Advanced data</h2>
<img style='width: 70%;' src='https://www.spaceweather.se/content/irf-kp.png'>
</div>
<footer style="text-align: center;">
All data has been obtained from <a href="https://www.irf.se/">IRF</a>, any use or distribution of the data has to comply with <a href="https://www.irf.se/wp-content/uploads/2020/02/License-agreement.pdf">this</a> license.
<br>
This site has been created by Arnau Busom Vidal. The source code and the license for the site can be found <a href="https://git.xaloc.space/xaloc/aurora">here</a>.
</footer>
</body>
<script>
async function api(){
const res = await fetch('https://www.spaceweather.se/forecast/kp/latest.json');
const data = await res.json();
var kp_now = data.kp[6];
var kp_3 = data.kp[7];
document.getElementById('kp_now').textContent = Number(kp_now.toFixed(2));
document.getElementById('kp_3').textContent = Number(kp_3.toFixed(2));
}
window.onload = api;
</script>
</html>