-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
231 lines (231 loc) Β· 13.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChatGL - GLSL shader generator using GPT-4</title>
<meta name="description" content="Generate fragment shaders with AI using gpt-4. Create visuals and generative art using AI-driven prompts and suggestions.">
<meta name="keywords" content="ChatGL, fragment shader, GLSL, webGL, generator, gpt-4, gpt-3.5-turbo, AI, graphics, visuals">
<meta name="author" content="Benji Trosch">
<link rel="canonical" href="https://chatgl.ai/">
<link rel="stylesheet" href="src/styles.css" preload>
</head>
<body>
<header>
<h1 class="hidden">ChatGL - GLSL shader generator using GPT-4</h1>
</header>
<dialog id="modal" class="modal" aria-labelledby="modal-title" aria-describedby="modal-description">
<div class="panel panel-forty" id="modal-panel" style="max-width: 660px;">
<h2 id="modal-title" style="margin-top: 0;">welcome to chatGL.</h2>
<p>welcome to chatgl, an app that uses gpt-4 to generate webgl fragment shaders based on prompts.</p>
<blockquote>
<q id="modal-description">a shader is a program that tells your graphics card how to draw things on a screen using math.</q>
<cite>β chatgpt</cite>
</blockquote>
<p>try describing a feeling, like "eating spaghetti" or "being a hot dog" and the ai will interpret this concept into shader code. keep in mind that the ai has never eaten spaghetti or been a hot dog. probably.</p>
<button class="button" id="modal-button" aria-label="Acknowledge and enter">
<code>[A]</code> acknowledge
</button>
</div>
</dialog>
<div id="container" class="container">
<div class="panel panel-forty panel-hidden" id="prompt-panel" style="display: flex; align-items: center; gap: 1rem; font-size: 24px;">
<button id="openai-logo" class="openai-logo" aria-label="Submit prompt">
<svg viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg">
<title>OpenAI icon</title>
<path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
</svg>
</button>
<span style="color: white;">-></span>
<div style="flex: 1;">
<label for="prompt" class="hidden">Prompt</label>
<input
type="text"
id="prompt"
class="prompt"
maxLength="96"
autocomplete="off"
spellcheck="false"
aria-label="Enter prompt"
>
</div>
</div>
<fieldset class="panel panel-forty panel-hidden" id="config-panel">
<input type="checkbox" id="toggle-panel-c" class="toggle-panel">
<legend class="panel-legend">
<label
id="config-toggle"
for="toggle-panel-c"
class="panel-legend-expand-button"
tabindex="0"
aria-label="Toggle show config"
>
[C] Config
</label>
</legend>
<div class="panel-content" style="opacity: 1; max-height: 100vh;">
<ul id="config-options" class="config-options">
<li>
<label for="api-key"> * OPENAI API KEY</label>
<input
type="text"
id="api-key"
class="api-key"
autocomplete="off"
spellcheck="false"
aria-label="Enter OpenAI API key"
>
</li>
<li>
<label> * WINDOWS LAYOUT</label>
<label
for="window-layout-left"
class="window-layout-option"
tabindex="0"
>
<input
type="radio"
id="window-layout-left"
class="window-layout-left"
name="window-layout"
value="left"
aria-label="Anchor windows to the left"
checked
>
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 4H22V20H2V4ZM8 6H20V18H8V6Z" />
</svg>
</label>
<label
for="window-layout-bottom"
class="window-layout-option"
tabindex="0"
>
<input
type="radio"
id="window-layout-bottom"
class="window-layout-bottom"
name="window-layout"
value="bottom"
aria-label="Anchor windows to the bottom"
>
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 20V4H22V20H2ZM4 6H20V14H4V6Z" />
</svg>
</label>
<label
for="window-layout-right"
class="window-layout-option"
tabindex="0"
>
<input
type="radio"
id="window-layout-right"
class="window-layout-right"
name="window-layout"
value="right"
aria-label="Anchor windows to the right"
>
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 4H22V20H2V4ZM16 18V6H4V18H16Z" />
</svg>
</label>
</li>
<li>
<label for="color-picker"> * OUTLINES COLOR</label>
<label for="color-picker" tabindex="0">
<input
type="color"
id="color-picker"
class="color-picker"
value="#E8AE3B"
aria-label="Set user interface outline and text color"
>
<strong><u><span id="color-hex" class="color-hex"></span></u></strong>
</label>
</li>
</ul>
</div>
</fieldset>
<fieldset class="panel panel-forty panel-hidden" id="history-panel">
<input type="checkbox" id="toggle-panel-h" class="toggle-panel">
<legend class="panel-legend">
<label
id="history-toggle"
for="toggle-panel-h"
class="panel-legend-expand-button"
tabindex="0"
aria-label="Toggle show prompt history"
>
[H] history
</label>
</legend>
<div class="panel-content" style="opacity: 1; max-height: 100vh;">
<ul id="history" class="history"></ul>
</div>
</fieldset>
<fieldset class="panel panel-forty panel-hidden" id="editor-panel">
<input type="checkbox" id="toggle-panel-s" class="toggle-panel">
<legend class="panel-legend">
<label
id="shader-toggle"
for="toggle-panel-s"
class="panel-legend-expand-button"
tabindex="0"
aria-label="Toggle show shader code"
>
[S] shader
</label>
</legend>
<div class="panel-content" style="opacity: 1; max-height: 100vh;">
<label for="editor" class="hidden">Code editor</label>
<pre><code
id="editor"
class="editor"
tabindex="0"
contenteditable="true"
spellcheck="false"
></code></pre>
<button class="button" id="build-button" aria-label="Build shader">
<code>[B]</code> build
</button>
<button class="button" id="share-button" aria-label="Get shareable URL">
<code>[V]</code> share
</button>
</div>
</fieldset>
<fieldset class="panel panel-forty panel-hidden" id="errors-panel">
<input type="checkbox" id="toggle-panel-e" class="toggle-panel">
<legend class="panel-legend">
<label
id="errors-toggle"
for="toggle-panel-e"
class="panel-legend-expand-button"
tabindex="0"
aria-label="Toggle show error messages"
>
[E] Errors
</label>
</legend>
<div class="panel-content" style="opacity: 1; max-height: 100vh;">
<ul id="error-messages" class="error-messages"></ul>
</div>
</fieldset>
</div>
<canvas id="canvas" tabindex="-1" aria-hidden="true"></canvas>
<p class="version">
<a href="https://chatgl.ai" target="_blank">
chatgl.ai
</a>
<span>|</span>
<span>1.0.0</span>
<span>|</span>
<a href="https://github.com/benjitrosch/chatGL" target="_blank" style="display: flex; gap: 0.5rem;">
<span>github</span>
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 24 24"><path fill="white" d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
</a>
</p>
<script type="module" src="src/index.ts" defer></script>
</body>
</html>