ctdo-wp-customs/ctdo-wp-raumstatus-widget-c...

20 lines
840 B
HTML

<h2 class="widgettitle">Raumstatus</h2>
<div style="display: flex; flex-direction: row; justify-content: center;">
<a href="https://status.ctdo.de/" style="display: block;">
<img src="https://status.ctdo.de/api/simple/image" width="60px; float:left" >
</a>
<span id="roomstate" style="display: block; margin-top: auto; margin-bottom:auto; padding-left:10px; font-size:180%">Unbekannt</span>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
var jsHost = ("https:" == document.location.protocol) ? "https://" : "http://";
jQuery.getJSON(jsHost + "status.ctdo.de/api/simple/v2", function(data) {
if(data.state === true) {
jQuery("#roomstate").text("Geöffnet");
} else {
jQuery("#roomstate").text("Geschlossen");
}
});
});
</script>