Compare commits
No commits in common. "0f83b8de42a444cd3c0ef4b0de3c00106e977e2e" and "9191b6836c359fcdfb654c98cc23053827fe6ec1" have entirely different histories.
0f83b8de42
...
9191b6836c
@ -95,10 +95,6 @@ td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.table-active {
|
.table-active {
|
||||||
cursor: inherit !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-danger {
|
|
||||||
cursor: not-allowed !important;
|
cursor: not-allowed !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +104,6 @@ table {
|
|||||||
|
|
||||||
button,
|
button,
|
||||||
label {
|
label {
|
||||||
padding: .375rem .6rem !important;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
35
js/sudoku.js
35
js/sudoku.js
@ -37,8 +37,6 @@ window.onload = function() {
|
|||||||
box.oninput = oninput
|
box.oninput = oninput
|
||||||
box.onblur = onblur
|
box.onblur = onblur
|
||||||
box.onclick = onclick
|
box.onclick = onclick
|
||||||
box.onmouseenter = onmouseenter
|
|
||||||
box.onmouseleave = onmouseleave
|
|
||||||
box.previousValue = ""
|
box.previousValue = ""
|
||||||
box.previousPlaceholder = ""
|
box.previousPlaceholder = ""
|
||||||
}
|
}
|
||||||
@ -55,8 +53,9 @@ window.onload = function() {
|
|||||||
rowId++
|
rowId++
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localStorage["sightCheckbox.checked"] == "true") sightCheckbox.checked = true
|
if (localStorage["highlighterCheckbox.checked"]) {
|
||||||
if (localStorage["highlighterCheckbox.checked"] == "true") highlighterCheckbox.checked = true
|
highlighterCheckbox.checked = true
|
||||||
|
}
|
||||||
loadSavedGame()
|
loadSavedGame()
|
||||||
|
|
||||||
boxes.forEach(box => {
|
boxes.forEach(box => {
|
||||||
@ -272,33 +271,6 @@ function onblur() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onmouseenter(event) {
|
|
||||||
if (sightCheckbox.checked){
|
|
||||||
box = event.target
|
|
||||||
box.neighbourhood.concat([box]).forEach(neighbour => {
|
|
||||||
neighbour.parentElement.classList.add("table-active")
|
|
||||||
})
|
|
||||||
|
|
||||||
box.neighbourhood.forEach(neighbour => {
|
|
||||||
if (valueToInsert && neighbour.value == valueToInsert) {
|
|
||||||
for (neighbour of[box, neighbour]) {
|
|
||||||
neighbour.parentElement.classList.add("table-danger")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onmouseleave(event) {
|
|
||||||
if (sightCheckbox.checked){
|
|
||||||
box = event.target
|
|
||||||
box.neighbourhood.concat([box]).forEach(neighbour => {
|
|
||||||
neighbour.parentElement.classList.remove("table-active")
|
|
||||||
neighbour.parentElement.classList.remove("table-danger")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function insert(radio) {
|
function insert(radio) {
|
||||||
if (radio.value == valueToInsert) {
|
if (radio.value == valueToInsert) {
|
||||||
valueToInsert = ""
|
valueToInsert = ""
|
||||||
@ -349,7 +321,6 @@ function save() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.onbeforeunload = function(event) {
|
window.onbeforeunload = function(event) {
|
||||||
localStorage["sightCheckbox.checked"] = sightCheckbox.checked
|
|
||||||
localStorage["highlighterCheckbox.checked"] = highlighterCheckbox.checked
|
localStorage["highlighterCheckbox.checked"] = highlighterCheckbox.checked
|
||||||
if (!saveButton.disabled) {
|
if (!saveButton.disabled) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
16
sudoku.php
16
sudoku.php
@ -10,30 +10,24 @@
|
|||||||
<h1 class="display-4 mb-3">Sudoku</h1>
|
<h1 class="display-4 mb-3">Sudoku</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class='d-flex justify-content-between mb-2'>
|
<div class='d-flex justify-content-between mb-2'>
|
||||||
<div class='btn-group'>
|
<div class='radioGroup btn-group'>
|
||||||
<input type='radio' id='inkPenRadio' class='btn-check' name='penRadioGroup' checked />
|
<input type='radio' id='inkPenRadio' class='btn-check' name='tool' checked />
|
||||||
<label for='inkPenRadio' class='btn btn-primary' title='Écrire un chiffre'>
|
<label for='inkPenRadio' class='btn btn-primary' title='Écrire un chiffre'>
|
||||||
<i class="bi bi-pen-fill"></i>
|
<i class="bi bi-pen-fill"></i>
|
||||||
</label>
|
</label>
|
||||||
<input type='radio' id='pencilRadio' class='btn-check' name='penRadioGroup' />
|
<input type='radio' id='pencilRadio' class='btn-check' name='tool' />
|
||||||
<label for='pencilRadio' class='btn btn-primary' title='Prendre des notes'>
|
<label for='pencilRadio' class='btn btn-primary' title='Prendre des notes'>
|
||||||
<i class="bi bi-pencil-fill"></i>
|
<i class="bi bi-pencil-fill"></i>
|
||||||
</label>
|
</label>
|
||||||
<input type='radio' id='eraserRadio' class='btn-check' name='penRadioGroup' />
|
<input type='radio' id='eraserRadio' class='btn-check' name='tool' '/>
|
||||||
<label for='eraserRadio' class='btn btn-primary' title='Effacer une case'>
|
<label for='eraserRadio' class='btn btn-primary' title='Effacer une case'>
|
||||||
<i class="bi bi-eraser-fill"></i>
|
<i class="bi bi-eraser-fill"></i>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class='btn-group'>
|
<input id='highlighterCheckbox' type="checkbox" class='btn-check' onclick='highlight()' />
|
||||||
<input type='checkbox' id='sightCheckbox' class='btn-check' onclick='highlighterCheckbox.checked = false; refreshUI()' />
|
|
||||||
<label for='sightCheckbox' class='btn btn-primary' title='Surligner la ligne, la colonne et la région de la case survolée'>
|
|
||||||
<i class="bi bi-plus-circle-fill"></i>
|
|
||||||
</label>
|
|
||||||
<input type='checkbox' id='highlighterCheckbox' class='btn-check' onclick='sightCheckbox.checked = false; refreshUI()' />
|
|
||||||
<label for='highlighterCheckbox' class='btn btn-primary' title='Surligner les lignes, colonnes et régions contenant déjà le chiffre sélectionné'>
|
<label for='highlighterCheckbox' class='btn btn-primary' title='Surligner les lignes, colonnes et régions contenant déjà le chiffre sélectionné'>
|
||||||
<i class="bi bi-magic"></i>
|
<i class="bi bi-magic"></i>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
|
||||||
<button id="hintButton" type="button" class='btn btn-primary' onclick="showHint()" title="Montrer une case avec une seule possibilité" accesskey="H" disabled="">
|
<button id="hintButton" type="button" class='btn btn-primary' onclick="showHint()" title="Montrer une case avec une seule possibilité" accesskey="H" disabled="">
|
||||||
<i class="bi bi-lightbulb-fill"></i>
|
<i class="bi bi-lightbulb-fill"></i>
|
||||||
</button>
|
</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user