From f19460aa82c7f924ecbdb3552d7f424b32eabd1e Mon Sep 17 00:00:00 2001 From: mms Date: Tue, 18 Jun 2024 22:36:56 +0200 Subject: feat: fade to dark --- layouts/blog/baseof.html | 19 +++++++++++++------ 1 file 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}`); }) -- cgit v1.2.3