mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-14 17:22:17 +00:00
19 lines
700 B
HTML
19 lines
700 B
HTML
<div class="notification has-text-centered" id="hackspace-open">
|
|
Leigh Hackspace is currently <span id="hackspace-status">Closed</span>
|
|
</div>
|
|
<script>
|
|
$.getJSON("{{ .Site.Params.space_api_endpoint }}", function (data) {
|
|
var date = new Date(data.state.lastchange * 1000);
|
|
|
|
if (data.state.open) {
|
|
message = '<b>Open<b>'
|
|
if ('message' in data.state) {
|
|
message = message + ': ' + data.state.message;
|
|
}
|
|
$('span#hackspace-status').html(message);
|
|
$('div#hackspace-open').addClass('is-success');
|
|
} else {
|
|
$('span#hackspace_status').html('<b>Closed</b>');
|
|
}
|
|
});
|
|
</script> |