summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2024-12-10 04:33:17 +0100
committerOrangerot <purple@orangerot.dev>2024-12-10 04:33:17 +0100
commit76872c7bdec8ba2c681ebb752899f43cdd74941a (patch)
treed1dedd5976ca57794c50b0885d98eb1eb4e473b6 /main.js
parenta4af4cc514ab80cd3bb221533d51db705248d8e9 (diff)
feat: buttons to reset sliders
Diffstat (limited to 'main.js')
-rw-r--r--main.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/main.js b/main.js
index a3617e1..0960448 100644
--- a/main.js
+++ b/main.js
@@ -32,9 +32,21 @@ document.addEventListener("DOMContentLoaded", function() {
for (let element of elements) {
element.addEventListener("input", settings_apply);
}
+
+ const reset_elements = document.getElementsByClassName(setting + "-reset");
+ for (let reset_element of reset_elements) {
+ reset_element.addEventListener("click", () => reset_all(setting));
+ }
}
+});
-})
+function reset_all(setting) {
+ console.log("reseting " + setting);
+ for (let element of settings[setting].elements) {
+ element.value = element.defaultValue;
+ }
+ draw(true);
+}
function take_picture() {
document.body.classList.add("editor-enabled");