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";