improve color picker

This commit is contained in:
2023-10-23 16:43:19 +02:00
parent 4a0d03f445
commit 24806a289f
4 changed files with 25 additions and 25 deletions

View File

@ -80,6 +80,8 @@ window.onload = function() {
}
loadSavedGame()
colorPicker.value = getComputedStyle(document.body).getPropertyValue("--bs-body-color")
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register(`service-worker.php?location=${location.pathname}`)
@ -172,8 +174,8 @@ function oninput() {
this.previousPlaceholder = this.placeholder
refreshBox(this)
}
if (penColor) {
this.style.setProperty("color", penColor)
if (colorPicker.value) {
this.style.setProperty("color", colorPicker.value)
}
}
@ -324,12 +326,6 @@ function insert(radio) {
}
}
let penColor
function changeColor() {
penColor = colorPicker.value
}
function undo() {
if (history.length) {
const previousState = history.pop()