</form>
</p>
+ <div id="images">
+ </div>
+
<ul id="comments">
</ul>
<script>
var socket = io();
+ const images = document.querySelector("#images");
+
const comments = document.querySelector("#comments");
const comment_form = document.querySelector("#comment-form");
const comment = document.querySelector("#comment");
comments.appendChild(item);
});
+ socket.on('image', (image) => {
+ const img = document.createElement('img');
+ img.src = image.filename;
+ const p_prompt = document.createElement('p');
+ const prompt_text = document.createTextNode(`Prompt: ${image.prompt}`);
+ p_prompt.appendChild(prompt_text);
+ const p_code = document.createElement('p');
+ const code_text = document.createTextNode(`Code: ${image.code}`);
+ p_code.appendChild(code_text);
+ images.appendChild(img);
+ images.appendChild(p_prompt);
+ images.appendChild(p_code);
+ });
+
zombo_form.addEventListener('submit', function(e) {
e.preventDefault();
socket.emit('generate', {"prompt": prompt.value, "code": code.value});