]> git.cworth.org Git - zombocom-ai/blobdiff - index.html
Reword Coda's final message
[zombocom-ai] / index.html
index ea4f0abc41913047ac138c883ee3ed50649040ff..8db8b695b93b68c2187af45978e1fe4e8a07e6c0 100644 (file)
@@ -139,6 +139,12 @@ mute.addEventListener("click", () => {
         comments.appendChild(dd);
     }
 
+    // When we enter the endgame, we disable the art-generation form,
+    // (just hide it)
+    socket.on('endgame', () => {
+       zombo_form.style.display = "none";
+    });
+
     socket.on('comment', function(comment) {
         const comments = document.querySelector("#comments_" + comment.image_id);
         add_comment(comments, comment);
@@ -176,22 +182,40 @@ mute.addEventListener("click", () => {
 
         const img = document.createElement('img');
         img.src = image.filename;
-        figure.appendChild(img);
 
-        const figcaption = document.createElement('figcaption');
-        const caption_text = document.createTextNode(`${image.prompt} (${image.code}) `);
-        figcaption.appendChild(caption_text);
+        if (image.link) {
+            const a = document.createElement('a');
+            a.href = image.link;
+            a.appendChild(img);
+            figure.appendChild(a);
+        } else {
+            figure.appendChild(img);
+        }
 
-        const reuse_button = document.createElement('button');
-        reuse_button.appendChild(document.createTextNode("Reuse"));
-        figcaption.appendChild(reuse_button);
+        if (image.censored) {
+            img.style.display = "none";
+        }
 
-        reuse_button.addEventListener('click', () => {
-            prompt.value = image.prompt;
-            window.scrollTo(0,0);
-        });
+        if (image.prompt && image.code) {
+            const figcaption = document.createElement('figcaption');
+            const caption_text = document.createTextNode(`${image.prompt} (${image.code}) `);
+            figcaption.appendChild(caption_text);
 
-        figure.appendChild(figcaption);
+            const reuse_button = document.createElement('button');
+            reuse_button.appendChild(document.createTextNode("Reuse"));
+            figcaption.appendChild(reuse_button);
+
+            reuse_button.addEventListener('click', () => {
+                prompt.value = image.prompt;
+                window.scrollTo(0,0);
+            });
+
+            if (image.censored) {
+                figcaption.style.display = "none";
+            }
+
+            figure.appendChild(figcaption);
+        }
 
         const dl_comments = document.createElement('dl');
         dl_comments.className = "comments";