Skip to content

Commit 3fd15dc

Browse files
committed
Cria Botão Limpar Tela
1 parent 8ece8a0 commit 3fd15dc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

trybe-projetos/pixels-art/refatorando.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const buttonGenerateBoard = document.getElementById('generate-board');
55
let paletteColor = document.getElementById('palette-color');
66
let colorStore = 'background-color: rgb(0, 0, 0)';
77
const buttonSelectColor = document.getElementById('select-color');
8+
const clearBoard = document.getElementById('clear-board');
89

910
//MUNDA QUANTIDADE DE PIXEL PARA PINTAR.
1011
function sizeBoard() {
@@ -54,4 +55,9 @@ function colorize2(paint) {
5455

5556
pixelBoard.addEventListener('click', function (event) {
5657
colorize2(event.target);
57-
})
58+
})
59+
60+
//LIMPAR TELA.
61+
clearBoard.addEventListener('click', function () {
62+
location.reload();
63+
});

0 commit comments

Comments
 (0)