diff options
author | mms <michal@sapka.me> | 2024-06-18 22:36:56 +0200 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-06-18 22:36:56 +0200 |
commit | f19460aa82c7f924ecbdb3552d7f424b32eabd1e (patch) | |
tree | b1eb89fe5f103608212d18d9569aedbeb1063c92 | |
parent | 05ff44147f18c87f5ed29af240e4f4783abc7f77 (diff) |
feat: fade to dark
-rw-r--r-- | layouts/blog/baseof.html | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index 94c2639..7b86dd3 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -376,14 +376,21 @@ if(health < 100) { state = "state1" } if(health < 50) { state = "state2" } - if(health < 1) { state = "state3" } + if(health < 1) { + state = "state3" + } updateFace(getStateFaces().front); - document.body.style.background = "#ff0000"; - setTimeout( - () => { document.body.style.background = null }, - 10) - + + if(state !== "state3") { + document.body.style.background = "#ff0000"; + setTimeout( + () => { document.body.style.background = null }, + 10) + } + else { + document.body.style.background = "#000"; + } console.log(`state: ${state}; health: ${health}`); }) |