]> git.cworth.org Git - zombocom-ai/blob - index.html
Add generate_image.py script
[zombocom-ai] / index.html
1 <!DOCTYPE html>
2 <html>
3
4 <head>
5   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6   <title>ZOMBO</title>
7   <link href="/zombo.css" rel="stylesheet" type="text/css">
8   <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
9   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10   <meta name="HandheldFriendly" content="true">
11 </head>
12
13 <body>
14   <div id="content">
15
16     <div id="header" align="center">
17       <p>
18         <br>
19       </p>
20
21       <p>
22         <img src="/zombocom.png" alt="Zombocom" longdesc="http://zombo.com" width="1199" height="217">
23       </p>
24     </div>
25
26     <p>
27       Welcome to Zombocom. You can do anything at Zombocom, anything at
28       all. The only limit is yourself!
29     </p>
30
31     <p>
32       <form action="" id="zombo-form">
33         <div class="form-row large">
34           <label for="prompt">
35             What do you imagine?
36           </label>
37           <textarea id="prompt" rows="4" width="100%" autocomplete="off" required></textarea>
38         </div>
39
40         <div class="form-row small left">
41           <div class="labeled-row">
42             <label for="code">
43               Numeric code:
44             </label>
45             <input id="code" type="text" autocomplete="off" placeholder="(Leave blank for random)" />
46           </div>
47         </div>
48
49         <div class="form-row small right">
50           <button id="safety" class="right" type="button">Safety prompt</button>
51         </div>
52
53         <div class="form-row large">
54           <button id="generate" type="submit">Make the infinite possible</button>
55         </div>
56       </form>
57     </p>
58
59     <ul id="comments">
60     </ul>
61
62     <p>
63       <form action="" id="comment-form">
64         <input id="comment" type="text" style="width:100%" autocomplete="off" placeholder="Add a comment" />
65       </form>
66     </p>
67
68     <div align="center">
69       <div class="animate-flicker">
70         <p>
71           <img src="/pngwheel.png" class="rotate thefade">
72         </p>
73       </div>
74     </div>
75
76     <audio loop="" src="/zombo_words.mp3" type="audio/mpeg"></audio>
77     <button id="mute" class="fade volume">
78       <div>🔊</div>
79       <script>
80 const mute = document.querySelector("#mute");
81 const icon = document.querySelector("#mute > div");
82 const audio = document.querySelector("audio");
83
84 mute.addEventListener("click", () => {
85   if (audio.paused) {
86       audio.volume = 0.2;
87       audio.play();
88       icon.innerHTML = "🔈";
89   } else {
90       audio.pause();
91       icon.innerHTML = "🔊";
92   }
93   mute.classList.add("fade");
94 });
95       </script>
96
97     </button>
98
99   </div>
100
101   <script src="/socket.io/socket.io.js"></script>
102   <script>
103     var socket = io();
104
105     const comments = document.querySelector("#comments");
106     const comment_form = document.querySelector("#comment-form");
107     const comment = document.querySelector("#comment");
108
109     const zombo_form = document.querySelector("#zombo-form");
110     const prompt = document.querySelector("#prompt");
111     const code = document.querySelector("#code");
112
113     const safety= document.querySelector("#safety");
114
115     comment_form.addEventListener('submit', function(e) {
116         e.preventDefault();
117         if (comment.value) {
118             socket.emit('comment', comment.value);
119             comment.value = '';
120         }
121     });
122
123     socket.on('comment', function(msg) {
124         var item = document.createElement('li');
125         item.textContent = msg;
126         comments.appendChild(item);
127     });
128
129     zombo_form.addEventListener('submit', function(e) {
130         e.preventDefault();
131         socket.emit('generate', {"prompt": prompt.value, "code": code.value});
132         prompt.value = '';
133     });
134
135     // TODO: Dynamically generate many different prompts here
136     safety.addEventListener("click", () => {
137         prompt.value = "Matte painting of a Samurai warrior";
138         return false;
139     });
140
141   </script>
142 </body>
143 </html>