]> git.cworth.org Git - zombocom-ai/blob - index.html
Add a (half)-functional comment field
[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 Zombcom, 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>
38           </textarea>
39         </div>
40
41         <div class="form-row small left">
42           <label for="code">
43             Numeric code
44           </label>
45           <input id="code" type="text" size="10" autocomplete="off" placeholder="(Chosen randomly)" />
46         </div>
47
48         <div class="form-row small right">
49           <button id="safety" class="right" type="button">Safety prompt</button>
50           <script>
51             const prompt = document.querySelector("#prompt");
52             const safety= document.querySelector("#safety");
53             // TODO: Dynamically generate many different prompts here
54             safety.addEventListener("click", () => {
55                 prompt.value = "Matte painting of a Samurai warrior";
56                 return false;
57             })
58           </script>
59         </div>
60
61         <div class="form-row large">
62           <button id="generate" type="submit">Make the infinite possible</button>
63         </div>
64       </form>
65     </p>
66
67     <p>
68       <form action="" id="comment-form">
69         <input id="comment" type="text" style="width:100%" autocomplete="off" placeholder="Add a comment" />
70       </form>
71     </p>
72
73     <div align="center">
74       <div class="animate-flicker">
75         <p>
76           <img src="/pngwheel.png" class="rotate thefade">
77         </p>
78       </div>
79     </div>
80
81     <audio loop="" src="/zombo_words.mp3" type="audio/mpeg"></audio>
82     <button id="mute" class="fade volume">
83       <div>🔊</div>
84       <script>
85 const mute = document.querySelector("#mute");
86 const icon = document.querySelector("#mute > div");
87 const audio = document.querySelector("audio");
88
89 mute.addEventListener("click", () => {
90   if (audio.paused) {
91       audio.volume = 0.2;
92       audio.play();
93       icon.innerHTML = "🔈";
94   } else {
95       audio.pause();
96       icon.innerHTML = "🔊";
97   }
98   mute.classList.add("fade");
99 });
100       </script>
101
102     </button>
103
104   </div>
105
106   <script src="/socket.io/socket.io.js"></script>
107   <script>
108     var socket = io();
109
110     var form = document.querySelector("#comment-form");
111     var comment = document.querySelector("#comment");
112
113     form.addEventListener('submit', function(e) {
114         e.preventDefault();
115         if (comment.value) {
116             socket.emit('comment', comment.value);
117             comment.value = '';
118         }
119     });
120   </script>
121 </body>
122 </html>