Logik Farbwechsel Tageszeiten
This commit is contained in:
parent
fb5dff68a9
commit
d0ea461b98
1 changed files with 12 additions and 1 deletions
13
js/script.js
13
js/script.js
|
|
@ -117,4 +117,15 @@ if (stunde < 10) {
|
||||||
text = "Guten Abend!";
|
text = "Guten Abend!";
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("begruessung").textContent = text;
|
document.getElementById("begruessung").textContent = text;
|
||||||
|
|
||||||
|
const el = document.getElementById("begruessung");
|
||||||
|
el.textContent = text;
|
||||||
|
|
||||||
|
if (stunde < 10) {
|
||||||
|
el.classList.add("morgen");
|
||||||
|
} else if (stunde < 18) {
|
||||||
|
el.classList.add("tag");
|
||||||
|
} else {
|
||||||
|
el.classList.add("abend");
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue