color picker icon
This commit is contained in:
15
js/sudoku.js
15
js/sudoku.js
@ -11,7 +11,6 @@ let history = []
|
||||
let accessKeyModifiers = "AccessKey+"
|
||||
let easyBoxes = []
|
||||
let insertRadios = []
|
||||
let defautColor = ""
|
||||
|
||||
function shuffle(iterable) {
|
||||
array = Array.from(iterable)
|
||||
@ -82,9 +81,6 @@ window.onload = function() {
|
||||
|
||||
loadSavedGame()
|
||||
|
||||
defautColor = getComputedStyle(grid).getPropertyValue("--bs-body-color")
|
||||
colorPicker.value = defautColor
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
navigator.serviceWorker.register(`service-worker.php?location=${location.pathname}`)
|
||||
}
|
||||
@ -176,8 +172,8 @@ function oninput() {
|
||||
this.previousPlaceholder = this.placeholder
|
||||
refreshBox(this)
|
||||
}
|
||||
if (colorPicker.value && colorPicker.value != defautColor) {
|
||||
this.style.setProperty("color", colorPicker.value)
|
||||
if (penColor) {
|
||||
this.style.setProperty("color", penColor)
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,6 +324,13 @@ function insert(radio) {
|
||||
}
|
||||
}
|
||||
|
||||
let penColor
|
||||
|
||||
function changeColor() {
|
||||
penColor = colorPickerInput.value
|
||||
colorPickerLabel.style.color = colorPickerInput.value
|
||||
}
|
||||
|
||||
function undo() {
|
||||
if (history.length) {
|
||||
const previousState = history.pop()
|
||||
|
Reference in New Issue
Block a user