5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7 <link href="/zombo.css" rel="stylesheet" type="text/css">
8 <meta name="viewport" content="width=device-width,initial-scale=1">
9 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10 <meta name="HandheldFriendly" content="true">
16 <div id="header" align="center">
22 <img src="/zombocom.png" alt="Zombocom" longdesc="http://zombo.com" width="1199" height="217">
27 Welcome to Zombocom. You can do anything at Zombocom, anything at
28 all. The only limit is yourself!
32 <div id="spinner" align="center">
33 <div class="animate-flicker">
35 <img src="/pngwheel.png" class="rotate thefade">
40 <form action="" id="zombo-form">
41 <div class="form-row large">
45 <button id="safety" type="button">Safety prompt</button>
46 <textarea id="prompt" rows="4" width="100%" autocomplete="off" required></textarea>
49 <div class="form-row small left">
50 <div class="labeled-row">
54 <input id="code" type="text" autocomplete="off" placeholder="(Leave blank for random)" />
58 <div class="form-row large">
59 <button id="generate" type="submit">Make the infinite possible</button>
71 <form action="" id="comment-form">
72 <input id="comment" type="text" style="width:100%" autocomplete="off" placeholder="Add a comment" />
76 <audio loop="" src="/zombo_words.mp3" type="audio/mpeg"></audio>
77 <button id="mute" class="fade volume">
80 const mute = document.querySelector("#mute");
81 const icon = document.querySelector("#mute > div");
82 const audio = document.querySelector("audio");
84 mute.addEventListener("click", () => {
88 icon.innerHTML = "🔈";
91 icon.innerHTML = "🔊";
93 mute.classList.add("fade");
101 <script src="/socket.io/socket.io.js"></script>
105 const images = document.querySelector("#images");
107 const comments = document.querySelector("#comments");
108 const comment_form = document.querySelector("#comment-form");
109 const comment = document.querySelector("#comment");
111 const zombo_form = document.querySelector("#zombo-form");
112 const prompt = document.querySelector("#prompt");
113 const code = document.querySelector("#code");
115 const safety= document.querySelector("#safety");
117 const spinner = document.querySelector("#spinner");
120 comment_form.addEventListener('submit', function(e) {
123 socket.emit('comment', comment.value);
128 socket.on('comment', function(msg) {
129 var item = document.createElement('li');
130 item.textContent = msg;
131 comments.appendChild(item);
134 socket.on('image', (image) => {
135 const figure = document.createElement('figure');
136 const img = document.createElement('img');
137 img.src = image.filename;
138 const figcaption = document.createElement('figcaption');
139 const caption_text = document.createTextNode(`${image.prompt} (${image.code})`);
140 figcaption.appendChild(caption_text);
141 figure.appendChild(img);
142 figure.appendChild(figcaption);
143 images.prepend(figure);
146 function hide_spinner() {
147 zombo_form.style.display = "grid";
148 spinner.style.display = "none";
151 zombo_form.addEventListener('submit', function(e) {
153 /* Hide the form and show spinner while generation is happening. */
154 zombo_form.style.display = "none";
155 spinner.style.display = "block";
156 spinner_timeout = setTimeout(hide_spinner, 60000);
157 socket.emit('generate', {"prompt": prompt.value, "code": code.value});
161 socket.on('generation-done', () => {
162 /* Re-display the form and hide spinner now that generation is over. */
163 clearTimeout(spinner_timeout);
167 function random_from(items) {
168 return items[Math.floor(Math.random()*items.length)];
171 safety.addEventListener("click", () => {
174 "A hyperrealistic photograph of",
175 "A matte painting of",
176 "Epic fantasy card art of",
177 "Professional oil painting of",
179 "A pencil sketch of",
185 " a Porsche 911 Carrera",
189 " an elfin princess",
191 " pastel purple clouds",
192 " a Teenage Mutant Ninja Turtle",
195 " in tropical surroundings",
197 " in an ocean storm",
198 " in a snowy forest",
199 " in a cardboard box",
201 " in an epic landscape",
202 " in a haunted forest",
203 " riding a motorbike",
204 " in a futuristic city at night",
205 " in a dystopian landscape, foggy",
206 " in the land of snow",
207 " that looks like a watermelon",
208 " on the streets of London at night with neon lights flashing",
209 " that is part octopus",
210 " melting into a puddle",
216 " by Vincent Van Gogh",
218 " by Johannes Vermeer",
219 ", fantasy art, neon fog",
220 ", epic lighting from above",
221 ", trending on artstation",
224 prompt.value = random_from(art_type) + random_from(subject) +
225 random_from(scenery) + random_from(artist);