]> git.cworth.org Git - zombocom-ai/blobdiff - index.html
Prepend images as they are generated
[zombocom-ai] / index.html
index 334a390ed6cda913ac86a900ebaa1acd0f8aa157..13fc62af92a00c9e5dc6f0f3e7da2848c0ae0b72 100644 (file)
@@ -137,15 +137,22 @@ mute.addEventListener("click", () => {
         figcaption.appendChild(caption_text);
         figure.appendChild(img);
         figure.appendChild(figcaption);
-        images.appendChild(figure);
+        images.prepend(figure);
     });
 
     zombo_form.addEventListener('submit', function(e) {
         e.preventDefault();
+        /* Hide the form while generation is happening. */
+        zombo_form.style.display = "none";
         socket.emit('generate', {"prompt": prompt.value, "code": code.value});
         prompt.value = '';
     });
 
+    socket.on('generation-done', () => {
+        /* Re-display the form now that image-generation is over. */
+        zombo_form.style.display = "grid";
+    });
+
     // TODO: Dynamically generate many different prompts here
     safety.addEventListener("click", () => {
         prompt.value = "Matte painting of a Samurai warrior";