Style & Level2 status

Changed the layout a little bit
Added the current status of the Hackerspace
master
Thierry Degeling 2014-07-20 22:49:00 +02:00
parent a91d145d04
commit 38d2a4b017
3 changed files with 61 additions and 16 deletions

View File

@ -65,13 +65,29 @@ h1, h2, h3, h4, h5, h6 {
} }
.weather { .weather {
margin-top: 25px; margin-top: 35px;
opacity: 0.8; opacity: 0.8;
} }
.logo { .logo {
text-align: center; text-align: center;
font-size: 8em; font-size: 8em;
margin-top: 25px; margin-top: 35px;
opacity: 0.8; opacity: 0.8;
}
.open {
background: #5cb85c;
color: #fff;
}
.closed {
background: #d9534f;
color: #fff;
}
.status {
text-align: center;
font-size: 7em;
padding: 0;
} }

View File

@ -14,22 +14,22 @@
</head> </head>
<body> <body>
<div class="container"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-4 logo"> <div class="col-md-4 logo">
Level2 Level2
</div> </div>
<div class="col-sm-4 datetime"> <div class="col-md-4 datetime">
<h1 class="time"></h1> <h1 class="time"></h1>
<h3 class="date"></h3> <h3 class="date"></h3>
</div> </div>
<div class="col-sm-4 weather"> <div class="col-md-4 weather">
<div class="row"> <div class="row">
<div class="col-xs-6"> <div class="col-xs-6">
@ -46,14 +46,13 @@
<div class="row"> <div class="row">
<div class="col-md-4 panel busses"></div> <div class="col-md-4">
<div class="panel status"></div>
</div> </div>
<div class="col-md-4">
<div class="row"> <div class="panel busses"></div>
</div>
<div class="col-sm-10"> <div class="col-md-4">
</div> </div>
</div> </div>

View File

@ -18,6 +18,12 @@
loadWeather(); loadWeather();
}, 900000); }, 900000);
l2status();
setInterval( function() {
l2status();
}, 60000);
}); });
@ -27,7 +33,7 @@
function refreshTime() { function refreshTime() {
$('.time').text( moment().format('HH:mm') ); $('.time').text( moment().format('HH:mm') );
$('.date').text( moment().format('MMMM Do YYYY') ); $('.date').text( moment().format('dddd, Do \of MMMM') );
} }
@ -182,4 +188,28 @@ function OWMIcon( imageCode ) {
'50n': [ "fog moon" ] '50n': [ "fog moon" ]
}; };
return b[ imageCode ] return b[ imageCode ]
} }
function l2status() {
$('.status').removeClass('open').removeClass('closed');
var request = $.ajax({
type: 'get',
url: 'https://www.hackerspace.lu/od/',
complete: function( response ) {
var status = JSON.parse( response.responseText );
if ( status.open ) {
$('.status').addClass('open').text('Open');
} else {
$('.status').addClass('closed').text('Closed');
}
}
});
console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated Level2 status' );
}