summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2024-12-10 03:14:49 +0100
committerOrangerot <purple@orangerot.dev>2024-12-10 03:14:49 +0100
commita4af4cc514ab80cd3bb221533d51db705248d8e9 (patch)
treea3924bbf59a7a87a6189d46fb2b8adb655b9d2b3 /main.js
parentbd7ae6218033b436fa39771d75d54acceb9de5ca (diff)
feat: button to go back to edit another image
Diffstat (limited to 'main.js')
-rw-r--r--main.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/main.js b/main.js
index b805275..a3617e1 100644
--- a/main.js
+++ b/main.js
@@ -1,6 +1,5 @@
let canvas;
let ctx;
-let imports;
let settings = {
brightness: {},
saturate: {},
@@ -13,7 +12,7 @@ const img = new Image();
document.addEventListener("DOMContentLoaded", function() {
canvas = document.getElementById("myCanvas");
ctx = canvas.getContext("2d");
- imports = document.getElementById("imports");
+ document.getElementById("back").addEventListener("click", () => document.body.classList.remove("editor-enabled"));
// bind listeners
document.getElementById("take-picture").addEventListener("click", take_picture);
@@ -38,14 +37,13 @@ document.addEventListener("DOMContentLoaded", function() {
})
function take_picture() {
- canvas.classList.remove("is-hidden");
- imports.classList.add("is-hidden");
+ document.body.classList.add("editor-enabled");
}
function upload_image() {
- canvas.classList.remove("is-hidden");
- imports.classList.add("is-hidden");
+ document.body.classList.add("editor-enabled");
+
console.log(this.files[0]);
img.src = URL.createObjectURL(this.files[0]);