format
This commit is contained in:
parent
3a243c38f0
commit
743f7fa72d
@ -149,6 +149,10 @@ table input:enabled {
|
|||||||
padding: .375rem;
|
padding: .375rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#colorPickerLabel {
|
||||||
|
color: var(--bs-body-color);
|
||||||
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme:dark) {
|
@media (prefers-color-scheme:dark) {
|
||||||
.pencil {
|
.pencil {
|
||||||
color: #5a5a5a !important;
|
color: #5a5a5a !important;
|
||||||
|
45
js/sudoku.js
45
js/sudoku.js
@ -1,16 +1,15 @@
|
|||||||
const VALUES = "123456789"
|
const VALUES = "123456789"
|
||||||
const UNKNOWN = '.'
|
const UNKNOWN = '.'
|
||||||
const SUGESTION_DELAY = 60000 //ms
|
|
||||||
|
|
||||||
let boxes = []
|
let boxes = []
|
||||||
let rows = Array.from(Array(9), x => [])
|
let rows = Array.from(Array(9), x => [])
|
||||||
let columns = Array.from(Array(9), x => [])
|
let columns = Array.from(Array(9), x => [])
|
||||||
let regions = Array.from(Array(9), x => [])
|
let regions = Array.from(Array(9), x => [])
|
||||||
let valueToInsert = ""
|
let valueToInsert = ""
|
||||||
let history = []
|
let history = []
|
||||||
let accessKeyModifiers = "AccessKey+"
|
let accessKeyModifiers = "AccessKey+"
|
||||||
let easyBoxes = []
|
let easyBoxes = []
|
||||||
let insertRadios = []
|
let insertRadios = []
|
||||||
|
|
||||||
function shuffle(iterable) {
|
function shuffle(iterable) {
|
||||||
array = Array.from(iterable)
|
array = Array.from(iterable)
|
||||||
@ -33,19 +32,19 @@ window.onload = function() {
|
|||||||
for (let box of row.getElementsByTagName('input')) {
|
for (let box of row.getElementsByTagName('input')) {
|
||||||
let regionId = rowId - rowId % 3 + Math.floor(columnId / 3)
|
let regionId = rowId - rowId % 3 + Math.floor(columnId / 3)
|
||||||
if (!box.disabled) {
|
if (!box.disabled) {
|
||||||
box.onfocus = onfocus
|
box.onfocus = onfocus
|
||||||
box.oninput = oninput
|
box.oninput = oninput
|
||||||
box.onblur = onblur
|
box.onblur = onblur
|
||||||
box.onclick = onclick
|
box.onclick = onclick
|
||||||
box.onmouseenter = onmouseenter
|
box.onmouseenter = onmouseenter
|
||||||
box.onmouseleave = onmouseleave
|
box.onmouseleave = onmouseleave
|
||||||
box.previousValue = ""
|
box.previousValue = ""
|
||||||
box.previousPlaceholder = ""
|
box.previousPlaceholder = ""
|
||||||
}
|
}
|
||||||
box.oncontextmenu = oncontextmenu
|
box.oncontextmenu = oncontextmenu
|
||||||
box.rowId = rowId
|
box.rowId = rowId
|
||||||
box.columnId = columnId
|
box.columnId = columnId
|
||||||
box.regionId = regionId
|
box.regionId = regionId
|
||||||
boxes.push(box)
|
boxes.push(box)
|
||||||
rows[rowId].push(box)
|
rows[rowId].push(box)
|
||||||
columns[columnId].push(box)
|
columns[columnId].push(box)
|
||||||
@ -81,6 +80,8 @@ window.onload = function() {
|
|||||||
|
|
||||||
loadSavedGame()
|
loadSavedGame()
|
||||||
|
|
||||||
|
colorPickerInput.value = window.getComputedStyle(grid).getPropertyValue("--bs-body-color")
|
||||||
|
|
||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
navigator.serviceWorker.register(`service-worker.php?location=${location.pathname}`)
|
navigator.serviceWorker.register(`service-worker.php?location=${location.pathname}`)
|
||||||
}
|
}
|
||||||
@ -114,10 +115,10 @@ function searchCandidatesOf(box) {
|
|||||||
switch (box.candidates.size) {
|
switch (box.candidates.size) {
|
||||||
case 0:
|
case 0:
|
||||||
box.title = "Aucune possibilité !"
|
box.title = "Aucune possibilité !"
|
||||||
break
|
break
|
||||||
case 1:
|
case 1:
|
||||||
box.title = "Une seule possibilité [Clic-droit]"
|
box.title = "Une seule possibilité [Clic-droit]"
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
box.title = box.candidates.size + " possibilités [Clic-droit]"
|
box.title = box.candidates.size + " possibilités [Clic-droit]"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user