Adding question comportament
This commit is contained in:
10
src/App.js
10
src/App.js
@@ -72,7 +72,10 @@ function App() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const cell = document.getElementById(`cell_${row}_${col}`);
|
const cell = document.getElementById(`cell_${row}_${col}`);
|
||||||
if (cell.classList.contains('flagged')) {
|
if (
|
||||||
|
cell.classList.contains('flagged') ||
|
||||||
|
cell.classList.contains('question')
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,9 +112,12 @@ function App() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cell.classList.contains('flagged')) {
|
if (cell.classList.contains('question')) {
|
||||||
|
cell.classList.remove('question');
|
||||||
|
} else if (cell.classList.contains('flagged')) {
|
||||||
cell.classList.remove('flagged');
|
cell.classList.remove('flagged');
|
||||||
setFlags(flags + 1);
|
setFlags(flags + 1);
|
||||||
|
cell.classList.add('question');
|
||||||
} else if (flags > 0) {
|
} else if (flags > 0) {
|
||||||
cell.classList.add('flagged');
|
cell.classList.add('flagged');
|
||||||
setFlags(flags - 1);
|
setFlags(flags - 1);
|
||||||
|
|||||||
BIN
src/assets/images/question.png
Normal file
BIN
src/assets/images/question.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -14,6 +14,13 @@
|
|||||||
background-position: center center;
|
background-position: center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-cell.question {
|
||||||
|
background-image: url(../../assets/images/question.png);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center center;
|
||||||
|
background-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
&-cell.revealed {
|
&-cell.revealed {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
border: 1px solid $gray-border;
|
border: 1px solid $gray-border;
|
||||||
|
|||||||
Reference in New Issue
Block a user