mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-14 06:52:17 +00:00
Add open/closed notification
This commit is contained in:
15
themes/lhs/layouts/shortcodes/open.html
Normal file
15
themes/lhs/layouts/shortcodes/open.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="notification has-text-centered" id="hackspace-open">
|
||||
Leigh Hackspace is currently <span id="hackspace_status">Closed</span>
|
||||
</div>
|
||||
<script>
|
||||
$.getJSON("https://api.leighhack.org/space.json", function (data) {
|
||||
var date = new Date(data.state.lastchange * 1000);
|
||||
|
||||
if (data.state.open) {
|
||||
$('span#hackspace_status').html('<b>Open</b>');
|
||||
$('div#hackspace-open').addClass('is-success');
|
||||
} else {
|
||||
$('span#hackspace_status').html('<b>Closed</b>');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user