6
0
Fork 0

make banner color change by door status

master
Dirk Heilig 2024-01-27 10:13:23 +01:00
parent 62d67832a9
commit 9201d9fd69
4 changed files with 11 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -258,6 +258,9 @@ a.external:after {
background-position-x: center ; background-position-x: center ;
background-position-y: top ; background-position-y: top ;
} }
.header.door_open{
background-image: url("/img/banner_open.jpg");
}
.header-wrapper, .header-wrapper,
.footer { .footer {
width: 90vw; width: 90vw;

View File

@ -5,6 +5,14 @@ document.addEventListener("DOMContentLoaded", function () {
return response.json(); return response.json();
}) })
.then(function (data) { .then(function (data) {
let body=document.getElementsByTagName("body")[0];
if (data.state.open) {
body.classList.remove("door_closed");
body.classList.add("door_open");
} else {
body.classList.remove("door_open");
body.classList.add("door_closed");
}
document document
.getElementById("ds-img") .getElementById("ds-img")
.setAttribute( .setAttribute(