Agregue la funcion de borrado - Hector
This commit is contained in:
parent
fca6c9a0cf
commit
b17d5ce2f4
11
index.html
11
index.html
|
@ -31,8 +31,11 @@
|
||||||
<option value="&">&</option>
|
<option value="&">&</option>
|
||||||
<option value="%">%</option>
|
<option value="%">%</option>
|
||||||
</select>
|
</select>
|
||||||
|
<button id="botonLimpiar">Limpiar</button>
|
||||||
<input type="color" value="#000000" id="colorPicker">
|
<input type="color" value="#000000" id="colorPicker">
|
||||||
<canvas id="lienzoCuadriculado" width="500" height="500"></canvas>
|
<canvas id="lienzoCuadriculado" width="500" height="500">
|
||||||
|
Tu navegador no admite el elemento <canvas>.
|
||||||
|
</canvas>
|
||||||
<script>
|
<script>
|
||||||
const colorPicker = document.getElementById("colorPicker");
|
const colorPicker = document.getElementById("colorPicker");
|
||||||
const lienzo = document.getElementById("lienzoCuadriculado");
|
const lienzo = document.getElementById("lienzoCuadriculado");
|
||||||
|
@ -87,6 +90,12 @@
|
||||||
caracteresEnPosiciones.set(posicionClave, { ascii, color });
|
caracteresEnPosiciones.set(posicionClave, { ascii, color });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
botonLimpiar.addEventListener("click", () => {
|
||||||
|
contexto.clearRect(0, 0, lienzo.width, lienzo.height);
|
||||||
|
caracteresEnPosiciones.clear();
|
||||||
|
dibujarCuadricula();
|
||||||
|
});
|
||||||
|
|
||||||
lienzo.addEventListener("mousedown", (evento) => {
|
lienzo.addEventListener("mousedown", (evento) => {
|
||||||
dibujando = true;
|
dibujando = true;
|
||||||
|
|
Loading…
Reference in New Issue