Skip to content

Commit e17386f

Browse files
committed
Add SpaceAPI Status to front page
Only becomes visible when SpaceAPI JSON path state.open asserts True.
1 parent 83370b6 commit e17386f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,29 @@
4444
</div>
4545
</div>
4646

47+
48+
<div class="container">
49+
<div class="row">
50+
<div class="col col-md-12">
51+
<div id="statusBox" style="display: none; background-color: green; color: white; padding: 10px; margin-bottom: 10px;">
52+
Lige nu er spacet åbent.
53+
</div>
54+
<script>
55+
document.addEventListener("DOMContentLoaded", function () {
56+
fetch("https://spaceapi.osaa.dk/status/json")
57+
.then(response => response.json())
58+
.then(data => {
59+
if (data.state && data.state.open === true) {
60+
document.getElementById("statusBox").style.display = "block";
61+
}
62+
})
63+
.catch(error => console.error("Error fetching space status:", error));
64+
});
65+
</script>
66+
</div>
67+
</div>
68+
</div>
69+
4770
<div class="container">
4871
<div class="row">
4972
<div class="col col-md-12 news">

0 commit comments

Comments
 (0)