diff --git a/index.php b/index.php
index dab31d9..1d4c244 100644
--- a/index.php
+++ b/index.php
@@ -45,7 +45,6 @@
color: white;
font-weight: 600;
border: none;
- cursor: pointer;
}
button {
@@ -150,6 +149,7 @@
Signature (optional):
+
@@ -161,6 +161,8 @@
const bits = document.getElementById("image-bits");
const ctx = canvas.getContext("2d");
+ const penButton = document.getElementById("pen-button");
+ const eraserButton = document.getElementById("eraser-button");
const submit = document.getElementById("submit-input");
// tools
@@ -170,19 +172,20 @@
for (let i = 0; i < pen.data.length; i += 4) {
pen.data[i+3] = 255;
}
- const penButton = document.getElementById("pen-button");
const eraser = ctx.createImageData(2, 2);
for (let i = 0; i < eraser.data.length; i += 4) {
eraser.data[i+3] = 0;
}
- const eraserButton = document.getElementById("eraser-button");
+ //
var isDrawing = false;
+
canvas.onmousedown = function() {
submit.disabled = false;
isDrawing = true;
}
+
document.onmouseup = function() {
isDrawing = false;
// write image-bits for posting