diff --git a/static/dream_web/index.css b/static/dream_web/index.css
index ed840a056a..482de93e16 100644
--- a/static/dream_web/index.css
+++ b/static/dream_web/index.css
@@ -48,7 +48,7 @@ img {
line-height:2em;
}
input[type="number"] {
- width: 60px;
+ width: 30px;
}
#seed {
width: 150px;
diff --git a/static/dream_web/index.html b/static/dream_web/index.html
index 388e579330..79b4c9fc67 100644
--- a/static/dream_web/index.html
+++ b/static/dream_web/index.html
@@ -18,12 +18,22 @@
For news and support for this web service, visit our
GitHub site
diff --git a/static/dream_web/index.js b/static/dream_web/index.js
index 3b99deecf4..df5ff82a9d 100644
--- a/static/dream_web/index.js
+++ b/static/dream_web/index.js
@@ -43,6 +43,7 @@ function saveFields(form) {
}
}
}
+
function loadFields(form) {
for (const [k, v] of new FormData(form)) {
const item = localStorage.getItem(k);
@@ -52,6 +53,11 @@ function loadFields(form) {
}
}
+function clearFields(form) {
+ localStorage.clear()
+ form.reset()
+}
+
async function generateSubmit(form) {
const prompt = document.querySelector("#prompt").value;
@@ -97,5 +103,8 @@ window.onload = () => {
document.querySelector("#seed").value = -1;
saveFields(e.target.form);
});
+ document.querySelector("#reset-all").addEventListener('click', (e) => {
+ clearFields(e.target.form);
+ });
loadFields(document.querySelector("#generate-form"));
};