From 7b5e5e1d61f276164a9ce6678320db743c6931c2 Mon Sep 17 00:00:00 2001 From: spessasus Date: Wed, 1 Jan 2025 19:55:57 +0100 Subject: [PATCH] fix CSS error on keyboard --- src/website/js/midi_keyboard/midi_keyboard.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/website/js/midi_keyboard/midi_keyboard.js b/src/website/js/midi_keyboard/midi_keyboard.js index ec8136a..1691471 100644 --- a/src/website/js/midi_keyboard/midi_keyboard.js +++ b/src/website/js/midi_keyboard/midi_keyboard.js @@ -488,10 +488,11 @@ class MidiKeyboard return; } pressedColors.splice(colorIndex, 1); - key.style.background = pressedColors[pressedColors.length - 1] || ""; - if (this.mode === "dark") + const color = pressedColors[pressedColors.length - 1] || ""; + key.style.background = color; + if (this.mode === "dark" && color !== "") { - key.style.boxShadow = `0px 0px ${GLOW_PX}px ${pressedColors[pressedColors.length - 1]}`; + key.style.boxShadow = `0px 0px ${GLOW_PX}px ${color}`; } if (pressedColors.length < 1) {