File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -51,5 +51,6 @@ <h1> {{page.title}} </h1>
5151 </ div >
5252
5353</ div >
54+ < script src ="{{ "/assets/js/script.js" | relative_url }}"> </ script >
5455</ body >
5556</ html >
Original file line number Diff line number Diff line change 1+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
2+ fetch ( "https://spaceapi.osaa.dk/status/json" )
3+ . then ( response => response . json ( ) )
4+ . then ( data => {
5+ if ( data . state && data . state . open === true ) {
6+ document . getElementById ( "statusBox" ) . style . display = "block" ;
7+ }
8+ } )
9+ . catch ( error => console . error ( "Error fetching space status:" , error ) ) ;
10+ } ) ;
Original file line number Diff line number Diff line change 5151 < div id ="statusBox " style ="display: none; background-color: green; color: white; padding: 10px; margin-bottom: 10px; ">
5252 Lige nu er spacet åbent.
5353 </ 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 >
6654 </ div >
6755 </ div >
6856</ div >
You can’t perform that action at this time.
0 commit comments