Flair
English
code
youmakeai commited on
Commit
98e85f1
·
verified ·
1 Parent(s): 2fb3a0b

Upload future-html-revision-40.txt

Browse files

![GIF_20250526_142543_895.gif](https://cdn-uploads.huggingface.co/production/uploads/68349d5c9575cb89d6c6915e/cVqYre-6oXATfcnrd-eXt.gif)

Files changed (1) hide show
  1. future-html-revision-40.txt +712 -0
future-html-revision-40.txt ADDED
@@ -0,0 +1,712 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <<<<< this file contains your perchance lists first, and your HTML code underneath it >>>>>
2
+
3
+
4
+
5
+ generateText = {import:ai-text-plugin}
6
+ generateImage = {import:text-to-image-plugin}
7
+
8
+ $meta
9
+ title = Future HTML
10
+ description = 💻 Coder Helper standalone code assistant 👩‍💻
11
+ image = https://user.uploads.dev/file/a08d899d09d55507326bbf40cc0e9c60.gif
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+ <html lang="en-US">
35
+ <meta charset="utf-16">
36
+ <center>
37
+ <p>
38
+ <a href="https://perchance.org/advanced-ai-web-dev">
39
+ 🧑‍🔬<br>
40
+ » AIdev Tutorial «
41
+ </a>
42
+ </p>
43
+ <style>
44
+ @import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');
45
+
46
+ body {
47
+ width: 100%;
48
+ max-width: 720px;
49
+ margin: 0px;
50
+ padding: 10px;
51
+ background-color: #000;
52
+ color: #0F0;
53
+ font-family: 'Share Tech Mono', 'Courier New', monospace;
54
+ position: relative;
55
+ overflow-x: hidden;
56
+ }
57
+
58
+ body::before {
59
+ content: "";
60
+ position: fixed;
61
+ top: 0;
62
+ left: 0;
63
+ width: 100%;
64
+ height: 100%;
65
+ background: linear-gradient(rgba(0,0,0,0.9), rgba(0,0,0,0.9)),
66
+ url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='matrix' width='120' height='180' patternUnits='userSpaceOnUse'%3E%3Ctext fill='%2300FF00' font-family='monospace' font-size='14' x='0' y='15'%3E01010111001010101110%3C/text%3E%3Ctext fill='%2300CC00' font-family='monospace' font-size='14' x='10' y='30'%3E10101001010101110010%3C/text%3E%3Ctext fill='%2300FF00' font-family='monospace' font-size='14' x='5' y='45'%3E01010111001010101110%3C/text%3E%3Ctext fill='%2300DD00' font-family='monospace' font-size='14' x='15' y='60'%3E10010101001010100101%3C/text%3E%3Ctext fill='%2300FF00' font-family='monospace' font-size='14' x='0' y='75'%3E01010111001010101110%3C/text%3E%3Ctext fill='%2300CC00' font-family='monospace' font-size='14' x='10' y='90'%3E10101001010101110010%3C/text%3E%3Ctext fill='%2300FF00' font-family='monospace' font-size='14' x='5' y='105'%3E01010111001010101110%3C/text%3E%3Ctext fill='%2300DD00' font-family='monospace' font-size='14' x='15' y='120'%3E10010101001010100101%3C/text%3E%3Ctext fill='%2300FF00' font-family='monospace' font-size='14' x='0' y='135'%3E01010111001010101110%3C/text%3E%3Ctext fill='%2300CC00' font-family='monospace' font-size='14' x='10' y='150'%3E10101001010101110010%3C/text%3E%3Ctext fill='%2300FF00' font-family='monospace' font-size='14' x='5' y='165'%3E01010111001010101110%3C/text%3E%3Ctext fill='%2300DD00' font-family='monospace' font-size='14' x='15' y='180'%3E10010101001010100101%3C/text%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23matrix)' opacity='0.1'/%3E%3C/svg%3E");
67
+ z-index: -1;
68
+ opacity: 0.2;
69
+ }
70
+
71
+ h1 {
72
+ margin-bottom: 10px;
73
+ color: #0F0;
74
+ font-size: 1.8rem;
75
+ text-align: center;
76
+ text-shadow: 0 0 5px #0F0;
77
+ font-family: 'VT323', monospace;
78
+ letter-spacing: 1px;
79
+ }
80
+
81
+ .chat-container {
82
+ width: 100%;
83
+ max-width: 800px;
84
+ margin: 0 auto;
85
+ padding: 10px;
86
+ }
87
+
88
+ .content-area {
89
+ display: flex;
90
+ flex-direction: column;
91
+ width: 100%;
92
+ }
93
+
94
+ #outputCtn {
95
+ width: 100%;
96
+ margin-bottom: 15px;
97
+ padding: 15px;
98
+ background: #000800;
99
+ border-radius: 10px;
100
+ border: 3px solid #0F0;
101
+ box-shadow: 0 0 15px rgba(0,255,0,0.2);
102
+ min-height: 150px;
103
+ position: relative;
104
+ overflow: hidden;
105
+ }
106
+
107
+ #outputCtn::after {
108
+ content: "";
109
+ position: absolute;
110
+ top: 0;
111
+ left: 0;
112
+ width: 100%;
113
+ height: 100%;
114
+ background: repeating-linear-gradient(
115
+ 0deg,
116
+ rgba(0, 255, 0, 0.03),
117
+ rgba(0, 255, 0, 0.03) 2px,
118
+ transparent 2px,
119
+ transparent 4px
120
+ );
121
+ pointer-events: none;
122
+ }
123
+
124
+ .input-container {
125
+ width: 100%;
126
+ }
127
+
128
+ #topicInput {
129
+ width: 100%;
130
+ padding: 12px;
131
+ border: 2px solid #0F0;
132
+ border-radius: 8px;
133
+ margin-bottom: 15px;
134
+ font-size: 1rem;
135
+ resize: vertical;
136
+ background-color: rgba(0, 20, 0, 0.9);
137
+ color: #0F0;
138
+ font-family: 'Share Tech Mono', monospace;
139
+ box-shadow: 0 0 10px rgba(0,255,0,0.2);
140
+ }
141
+
142
+ .button-group {
143
+ display: flex;
144
+ flex-wrap: wrap;
145
+ gap: 10px;
146
+ }
147
+
148
+ .button-group button {
149
+ padding: 10px 15px;
150
+ border: 1px solid #0F0;
151
+ border-radius: 5px;
152
+ background-color: rgba(0, 40, 0, 0.8);
153
+ color: #0F0;
154
+ cursor: pointer;
155
+ font-weight: bold;
156
+ transition: all 0.3s;
157
+ flex: 1;
158
+ min-width: 120px;
159
+ font-family: 'Share Tech Mono', monospace;
160
+ text-shadow: 0 0 5px #0F0;
161
+ box-shadow: 0 0 10px rgba(0,255,0,0.2);
162
+ }
163
+
164
+ .button-group button:hover {
165
+ background-color: rgba(0, 80, 0, 0.8);
166
+ box-shadow: 0 0 15px rgba(0,255,0,0.4);
167
+ }
168
+
169
+ /* Mobile adjustments */
170
+ @media (max-width: 600px) {
171
+ h1 {
172
+ font-size: 1.5rem;
173
+ }
174
+
175
+ #outputCtn {
176
+ padding: 10px;
177
+ }
178
+
179
+ .button-group button {
180
+ min-width: 100%;
181
+ }
182
+ }
183
+ </style>
184
+ <div class="main-container">
185
+ <a href="https://poe.com/Future-HTML" title="Future-HTML Assistant">
186
+ <img src="https://user.uploads.dev/file/a08d899d09d55507326bbf40cc0e9c60.gif" width="222px">
187
+ </a>
188
+ <hr style="border-color: #0F0; box-shadow: 0 0 5px #0F0;">
189
+ <h1>↓ Future HTML Code Helper ↓</h1>
190
+ <div class="chat-container">
191
+ <div class="content-area">
192
+ <div id="outputCtn">
193
+ <div id="textOutputEl" style="white-space: pre-wrap; font-size: 1.1rem; line-height: 1.5; color: #0F0; font-family: 'Share Tech Mono', monospace;"></div>
194
+ </div>
195
+ <div class="input-container">
196
+ <textarea id="topicInput" placeholder="Enter your HTML, CSS, JavaScript, or coding question:"></textarea>
197
+ <div class="button-group">
198
+ <button id="generateTextBtn" onclick="generateTextOutput()">ANALYZE CODE</button>
199
+ <button id="askGptBtn" onclick="askGPT()">ASK HTML GPT™️</button>
200
+ <button id="copyPromptBtn" onclick="copyPrompt()" style="display: none;">COPY CODE</button>
201
+ <button id="generateImageBtn" onclick="generateImageFromText()" style="display: none;">GENERATE IMAGE</button>
202
+ <button id="stopBtn" hidden onclick="currentPromise?.stop()">Stop Generation</button>
203
+ </div>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ <div class="main-container">
209
+ <h1>AI Text to Image Generator</h1>
210
+ <p class="subtitle" style="color: #0F0; text-shadow: 0 0 3px #0F0;">Create amazing images with AI</p>
211
+ <div class="gallery-container">
212
+ <div class="image-display">
213
+ <img id="generatedImageEl" alt="Generated AI Image" src="https://placehold.co/600x400/000/0F0?text=Your+Image+Will+Appear+Here" style="border: 2px solid #0F0; box-shadow: 0 0 15px rgba(0,255,0,0.3);">
214
+ <div class="prompt-info" id="promptInfoEl"></div>
215
+ </div>
216
+ <div class="prompt-input-container">
217
+ <input type="text" id="customPromptInput" class="prompt-input" placeholder="Enter your image prompt here...">
218
+ <div class="button-container">
219
+ <button id="generateCustomBtn" class="action-button generate-custom-btn">Generate From Prompt</button>
220
+ <button id="generateRandomBtn" class="action-button generate-random-btn">Generate Random</button>
221
+ </div>
222
+ <div id="errorMessageEl" class="error-message" hidden></div>
223
+ </div>
224
+ </div>
225
+ <footer>
226
+ <p style="color: #0F0;">Made with <a href="https://poe.com/Ai-Coder-Thingy" target="_blank" style="color: #0F0; text-decoration: underline;">Ai-Coder-Thingy Assistant</a> | Created 2025</p>
227
+ </footer>
228
+ </div>
229
+ <style>
230
+ * { box-sizing: border-box; margin: 0; padding: 0; }
231
+ body { font-family: 'Share Tech Mono', 'Courier New', monospace; line-height: 1.6; color: #0F0; background-color: #000; text-align: left; }
232
+
233
+ .main-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
234
+
235
+ header { text-align: center; margin-bottom: 30px; }
236
+ header h1 { color: #0F0; margin-bottom: 5px; text-shadow: 0 0 5px #0F0; }
237
+ header .subtitle { color: #0F0; font-size: 1.2rem; }
238
+
239
+ .gallery-container { display: flex; flex-direction: column; gap: 20px; margin-bottom: 30px; }
240
+
241
+ .image-display { background-color: rgba(0, 10, 0, 0.8); border-radius: 10px; box-shadow: 0 0 15px rgba(0,255,0,0.2); overflow: hidden; position: relative; border: 1px solid #0F0; }
242
+ .image-display img { width: 100%; height: auto; display: block; max-height: 60vh; object-fit: contain; }
243
+
244
+ .prompt-info { padding: 15px; background-color: rgba(0, 20, 0, 0.9); color: #0F0; font-size: 0.9rem; border-top: 1px solid #0F0; }
245
+
246
+ .prompt-input-container { background-color: rgba(0, 10, 0, 0.8); border-radius: 10px; padding: 20px; box-shadow: 0 0 15px rgba(0,255,0,0.2); border: 1px solid #0F0; }
247
+
248
+ .prompt-input { width: 100%; padding: 12px 15px; border: 2px solid #0F0; border-radius: 5px; font-size: 1rem; margin-bottom: 15px; transition: all 0.3s; background-color: rgba(0, 20, 0, 0.9); color: #0F0; font-family: 'Share Tech Mono', monospace; }
249
+ .prompt-input:focus { border-color: #0F0; outline: none; box-shadow: 0 0 10px rgba(0,255,0,0.4); }
250
+
251
+ .button-container { display: flex; gap: 10px; flex-wrap: wrap; }
252
+
253
+ .action-button { padding: 12px 20px; border: 1px solid #0F0; border-radius: 5px; font-size: 1rem; cursor: pointer; transition: all 0.3s; flex: 1; min-width: 180px; background-color: rgba(0, 40, 0, 0.8); color: #0F0; font-family: 'Share Tech Mono', monospace; text-shadow: 0 0 5px #0F0; }
254
+ .action-button:hover { transform: translateY(-2px); background-color: rgba(0, 80, 0, 0.8); box-shadow: 0 0 10px rgba(0,255,0,0.4); }
255
+ .action-button:active { transform: translateY(0); }
256
+ .action-button:disabled { background-color: rgba(0, 20, 0, 0.5); cursor: not-allowed; transform: none; color: rgba(0, 255, 0, 0.5); }
257
+
258
+ .generate-custom-btn { background-color: rgba(0, 40, 0, 0.8); color: #0F0; }
259
+ .generate-custom-btn:hover:not(:disabled) { background-color: rgba(0, 80, 0, 0.8); }
260
+
261
+ .generate-random-btn { background-color: rgba(0, 60, 0, 0.8); color: #0F0; }
262
+ .generate-random-btn:hover:not(:disabled) { background-color: rgba(0, 100, 0, 0.8); }
263
+
264
+ .error-message { background-color: rgba(60, 0, 0, 0.8); color: #0F0; padding: 12px; border-radius: 5px; margin-top: 15px; border: 1px solid #F00; }
265
+
266
+ footer { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #0F0; color: #0F0; }
267
+ footer a { color: #0F0; text-decoration: none; text-shadow: 0 0 3px #0F0; }
268
+ footer a:hover { text-decoration: underline; }
269
+
270
+ .loading-indicator { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 10, 0, 0.8); display: flex; justify-content: center; align-items: center; font-size: 1.5rem; color: #0F0; text-shadow: 0 0 5px #0F0; }
271
+
272
+ @media (min-width: 768px) {
273
+ .gallery-container { flex-direction: row; }
274
+ .image-display { flex: 3; }
275
+ .prompt-input-container { flex: 2; }
276
+ }
277
+
278
+ @media (max-width: 767px) {
279
+ .button-container { flex-direction: column; }
280
+ .action-button { width: 100%; }
281
+ }
282
+
283
+ a { color: #0F0; text-shadow: 0 0 3px #0F0; }
284
+ hr { border-color: #0F0; box-shadow: 0 0 5px #0F0; }
285
+
286
+ /* Matrix code rain effect */
287
+ @keyframes matrixRain {
288
+ 0% { transform: translateY(-100%); }
289
+ 100% { transform: translateY(1000%); }
290
+ }
291
+
292
+ .matrix-code {
293
+ position: fixed;
294
+ top: 0;
295
+ left: 0;
296
+ right: 0;
297
+ bottom: 0;
298
+ pointer-events: none;
299
+ z-index: -1;
300
+ }
301
+
302
+ .matrix-code span {
303
+ color: #0F0;
304
+ font-size: 1.2rem;
305
+ position: absolute;
306
+ opacity: 0.8;
307
+ animation: matrixRain 15s linear infinite;
308
+ text-shadow: 0 0 5px #0F0;
309
+ }
310
+
311
+ .green-button {
312
+ background-color: rgba(0, 40, 0, 0.8);
313
+ color: #0F0;
314
+ padding: 10px 20px;
315
+ border: 1px solid #0F0;
316
+ border-radius: 5px;
317
+ cursor: pointer;
318
+ font-size: 16px;
319
+ font-family: 'Share Tech Mono', monospace;
320
+ text-shadow: 0 0 5px #0F0;
321
+ transition: all 0.3s;
322
+ box-shadow: 0 0 10px rgba(0,255,0,0.2);
323
+ }
324
+
325
+ .green-button a {
326
+ color: #0F0;
327
+ text-decoration: none;
328
+ text-shadow: 0 0 3px #0F0;
329
+ }
330
+
331
+ .green-button:hover {
332
+ background-color: rgba(0, 80, 0, 0.8);
333
+ box-shadow: 0 0 15px rgba(0,255,0,0.4);
334
+ }
335
+ </style>
336
+
337
+ <div class="matrix-code" id="matrixCodeContainer"></div>
338
+
339
+ <script>
340
+ // Matrix code rain effect
341
+ function createMatrixRain() {
342
+ const container = document.getElementById('matrixCodeContainer');
343
+ const characters = "01アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン";
344
+ const columns = Math.floor(window.innerWidth / 20);
345
+
346
+ for (let i = 0; i < columns; i++) {
347
+ const span = document.createElement('span');
348
+ span.innerText = characters.charAt(Math.floor(Math.random() * characters.length));
349
+ span.style.left = (i * 20) + 'px';
350
+ span.style.animationDelay = Math.random() * 10 + 's';
351
+ span.style.animationDuration = Math.random() * 10 + 10 + 's';
352
+ span.style.opacity = Math.random() * 0.5 + 0.25;
353
+ container.appendChild(span);
354
+
355
+ setInterval(() => {
356
+ span.innerText = characters.charAt(Math.floor(Math.random() * characters.length));
357
+ }, 100 + Math.random() * 2000);
358
+ }
359
+ }
360
+
361
+ // Rest of the original script
362
+ const aitext = {
363
+ generatePrompt: async () => {
364
+ console.log("AI text prompt generator called");
365
+ await new Promise(resolve => setTimeout(resolve, 800));
366
+
367
+ const prompts = [
368
+ "A crystalline cave illuminated by bioluminescent insects",
369
+ "A steampunk airship harbor floating among the clouds",
370
+ "An ancient temple overgrown with flowering vines",
371
+ "A cyberpunk marketplace with neon-lit food stalls",
372
+ "A desert oasis under a triple moon sky",
373
+ "A forgotten library with books that whisper their stories",
374
+ "A volcanic island with rivers of glowing magma",
375
+ "A celestial observatory perched on the edge of a cosmic void",
376
+ "A bamboo forest where time flows backwards",
377
+ "A subterranean city built inside a massive geode",
378
+ "A floating garden with gravity-defying waterfalls",
379
+ "A post-apocalyptic amusement park reclaimed by nature",
380
+ "A dimension where shadows cast light instead of darkness",
381
+ "A crystal palace reflecting a thousand different sunsets",
382
+ "An arctic research station during the aurora borealis",
383
+ "A hidden valley where mythical creatures roam freely",
384
+ "A clockwork metropolis powered by impossible mathematics",
385
+ "A coastal village built on the back of a sleeping sea monster",
386
+ "A jungle treehouse network connected by rainbow bridges",
387
+ "A mirrored canyon that shows alternate realities in its reflections",
388
+ "A magical forest with glowing mushrooms",
389
+ "A futuristic city with flying cars",
390
+ "A peaceful mountain lake at sunset",
391
+ "An underwater scene with colorful coral reef",
392
+ "A spaceship approaching an alien planet",
393
+ "A medieval castle on a hill during thunderstorm",
394
+ "A cozy cabin in the snow with northern lights",
395
+ "A surreal dreamscape with floating islands"
396
+ ];
397
+
398
+ return prompts[Math.floor(Math.random() * prompts.length)];
399
+ }
400
+ };
401
+
402
+ const imageCache = new Map();
403
+
404
+ function showLoading() {
405
+ const loadingEl = document.createElement('div');
406
+ loadingEl.className = 'loading-indicator';
407
+ loadingEl.id = 'loadingIndicatorEl';
408
+ loadingEl.innerHTML = '<div>⏳ Generating image...</div>';
409
+
410
+ const imageDisplay = document.querySelector('.image-display');
411
+ imageDisplay.appendChild(loadingEl);
412
+ }
413
+
414
+ function hideLoading() {
415
+ const loadingEl = document.getElementById('loadingIndicatorEl');
416
+ if (loadingEl) {
417
+ loadingEl.remove();
418
+ }
419
+ }
420
+
421
+ function showError(message) {
422
+ const errorMessageEl = document.getElementById('errorMessageEl');
423
+ errorMessageEl.textContent = message;
424
+ errorMessageEl.hidden = false;
425
+
426
+ setTimeout(() => {
427
+ errorMessageEl.hidden = true;
428
+ }, 5000);
429
+ }
430
+
431
+ async function generateImageFromPrompt(prompt) {
432
+ if (imageCache.has(prompt)) {
433
+ console.log("Using cached image for prompt:", prompt);
434
+ return imageCache.get(prompt);
435
+ }
436
+
437
+ try {
438
+ let imageUrl = await generateImage(prompt);
439
+
440
+ imageCache.set(prompt, imageUrl);
441
+
442
+ return imageUrl;
443
+ } catch (error) {
444
+ console.error("Error generating image:", error);
445
+ throw new Error("Failed to generate image. Please try again.");
446
+ }
447
+ }
448
+
449
+ async function generateNewImage() {
450
+ try {
451
+ const generateRandomBtn = document.getElementById('generateRandomBtn');
452
+ const generateCustomBtn = document.getElementById('generateCustomBtn');
453
+ const generatedImageEl = document.getElementById('generatedImageEl');
454
+ const promptInfoEl = document.getElementById('promptInfoEl');
455
+
456
+ generateRandomBtn.disabled = true;
457
+ generateCustomBtn.disabled = true;
458
+
459
+ generateRandomBtn.textContent = "⏳ Generating...";
460
+
461
+ showLoading();
462
+
463
+ const prompt = await aitext.generatePrompt();
464
+
465
+ const imageUrl = await generateImageFromPrompt(prompt);
466
+
467
+ generatedImageEl.src = imageUrl;
468
+ promptInfoEl.textContent = `Prompt: "${prompt}"`;
469
+
470
+ hideLoading();
471
+
472
+ generateRandomBtn.disabled = false;
473
+ generateCustomBtn.disabled = false;
474
+
475
+ generateRandomBtn.textContent = "Generate Random";
476
+ } catch (error) {
477
+ hideLoading();
478
+ showError(error.message);
479
+
480
+ const generateRandomBtn = document.getElementById('generateRandomBtn');
481
+ const generateCustomBtn = document.getElementById('generateCustomBtn');
482
+ generateRandomBtn.disabled = false;
483
+ generateCustomBtn.disabled = false;
484
+
485
+ generateRandomBtn.textContent = "Generate Random";
486
+ }
487
+ }
488
+
489
+ async function generateFromCustomPrompt() {
490
+ const customPromptInput = document.getElementById('customPromptInput');
491
+ const generateRandomBtn = document.getElementById('generateRandomBtn');
492
+ const generateCustomBtn = document.getElementById('generateCustomBtn');
493
+ const generatedImageEl = document.getElementById('generatedImageEl');
494
+ const promptInfoEl = document.getElementById('promptInfoEl');
495
+
496
+ const prompt = customPromptInput.value.trim();
497
+
498
+ if (!prompt) {
499
+ showError("Please enter a prompt before generating.");
500
+ return;
501
+ }
502
+
503
+ try {
504
+ generateRandomBtn.disabled = true;
505
+ generateCustomBtn.disabled = true;
506
+
507
+ generateCustomBtn.textContent = "⏳ Generating...";
508
+
509
+ showLoading();
510
+
511
+ const imageUrl = await generateImageFromPrompt(prompt);
512
+
513
+ generatedImageEl.src = imageUrl;
514
+ promptInfoEl.textContent = `Prompt: "${prompt}"`;
515
+
516
+ hideLoading();
517
+
518
+ generateRandomBtn.disabled = false;
519
+ generateCustomBtn.disabled = false;
520
+
521
+ generateCustomBtn.textContent = "Generate From Prompt";
522
+ } catch (error) {
523
+ hideLoading();
524
+ showError(error.message);
525
+
526
+ generateRandomBtn.disabled = false;
527
+ generateCustomBtn.disabled = false;
528
+
529
+ generateCustomBtn.textContent = "Generate From Prompt";
530
+ }
531
+ }
532
+
533
+ async function generateImageFromText() {
534
+ const textOutputEl = document.getElementById('textOutputEl');
535
+ const customPromptInput = document.getElementById('customPromptInput');
536
+ const prompt = textOutputEl.innerText.trim();
537
+
538
+ if (!prompt) {
539
+ showError("No text generated yet. Please generate text first.");
540
+ return;
541
+ }
542
+
543
+ customPromptInput.value = prompt;
544
+
545
+ await generateFromCustomPrompt();
546
+ }
547
+
548
+ let currentPromise;
549
+ let hasGeneratedPrompt = false;
550
+
551
+ function constructPrompt() {
552
+ const topicInput = document.getElementById('topicInput');
553
+ let topic = topicInput.value;
554
+ return `You are a professional HTML/CSS/JavaScript coding assistant specializing in web development best practices and modern coding standards. Analyze this code or answer this coding question: ${topic}. Provide clear, specific solutions focusing on: 1) Syntax corrections, 2) Best practices, 3) Browser compatibility, 4) Modern standards, 5) Performance optimization. Give detailed explanations and working code examples.`;
555
+ }
556
+
557
+ async function generateTextOutput() {
558
+ const topicInput = document.getElementById('topicInput');
559
+ const generateTextBtn = document.getElementById('generateTextBtn');
560
+ const stopBtn = document.getElementById('stopBtn');
561
+ const textOutputEl = document.getElementById('textOutputEl');
562
+ const copyPromptBtn = document.getElementById('copyPromptBtn');
563
+ const generateImageBtn = document.getElementById('generateImageBtn');
564
+
565
+ if (!topicInput.value.trim()) return alert("Please enter your code or coding question");
566
+
567
+ generateTextBtn.disabled = true;
568
+ generateTextBtn.textContent = "⏳ Analyzing Code...";
569
+ stopBtn.hidden = false;
570
+ textOutputEl.innerHTML = "";
571
+
572
+ try {
573
+ currentPromise = generateText({
574
+ instruction: constructPrompt(),
575
+ onChunk: (data) => {
576
+ textOutputEl.innerHTML += data.textChunk;
577
+ },
578
+ });
579
+
580
+ await currentPromise;
581
+
582
+ copyPromptBtn.style.display = "inline-block";
583
+ generateImageBtn.style.display = "inline-block";
584
+
585
+ hasGeneratedPrompt = true;
586
+ } catch (error) {
587
+ console.error("Error generating text:", error);
588
+ alert("Error generating text: " + error.message);
589
+ } finally {
590
+ generateTextBtn.disabled = false;
591
+ generateTextBtn.textContent = "ANALYZE CODE";
592
+ stopBtn.hidden = true;
593
+ }
594
+ }
595
+
596
+ function copyPrompt() {
597
+ const textOutputEl = document.getElementById('textOutputEl');
598
+ let promptText = textOutputEl.innerText;
599
+ navigator.clipboard.writeText(promptText).then(() => {
600
+ alert("Code analysis copied to clipboard successfully!");
601
+ }, (err) => {
602
+ console.error('Could not copy text: ', err);
603
+ alert("Failed to copy analysis. Please try again.");
604
+ });
605
+ }
606
+
607
+ async function askGPT() {
608
+ const topicInput = document.getElementById('topicInput');
609
+ const askGptBtn = document.getElementById('askGptBtn');
610
+ const stopBtn = document.getElementById('stopBtn');
611
+ const textOutputEl = document.getElementById('textOutputEl');
612
+
613
+ if (!topicInput.value.trim()) return alert("Please enter your HTML/coding question");
614
+
615
+ askGptBtn.disabled = true;
616
+ askGptBtn.textContent = "⏳ Asking HTML GPT...";
617
+ stopBtn.hidden = false;
618
+ textOutputEl.innerHTML = "";
619
+
620
+ try {
621
+ currentPromise = generateText({
622
+ instruction: `You are an expert HTML/CSS/JavaScript developer and coding tutor. Answer this web development question with detailed explanations and working code examples: ${topicInput.value}`,
623
+ onChunk: (data) => {
624
+ textOutputEl.innerHTML += data.textChunk;
625
+ },
626
+ });
627
+
628
+ await currentPromise;
629
+ } catch (error) {
630
+ console.error("Error asking GPT:", error);
631
+ alert("Error asking GPT: " + error.message);
632
+ } finally {
633
+ askGptBtn.disabled = false;
634
+ askGptBtn.textContent = "ASK HTML GPT";
635
+ stopBtn.hidden = true;
636
+ }
637
+ }
638
+
639
+ window.onload = function() {
640
+ createMatrixRain();
641
+ generateNewImage();
642
+
643
+ const generateRandomBtn = document.getElementById('generateRandomBtn');
644
+ const generateCustomBtn = document.getElementById('generateCustomBtn');
645
+ const customPromptInput = document.getElementById('customPromptInput');
646
+
647
+ generateRandomBtn.addEventListener('click', generateNewImage);
648
+ generateCustomBtn.addEventListener('click', generateFromCustomPrompt);
649
+
650
+ customPromptInput.addEventListener('keypress', function(event) {
651
+ if (event.key === 'Enter') {
652
+ generateFromCustomPrompt();
653
+ }
654
+ });
655
+ };
656
+ </script>
657
+
658
+ <!-- TOS -->
659
+ <center>
660
+ <hr><br><button style="background-color: #4CAF50; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 16px;">
661
+ <a href="https://poe.com/Future-HTML" style="color: white; text-decoration: none;">Future-HTML Coder Assistant</a>
662
+ </button>
663
+ <br><br>
664
+ <div style="text-align:center;">
665
+ <div>⚖️ <a href="https://poe.com/s/FCFHKtkp9Cn67SNTQEFf">AI Imagery Rules</a> 👮‍♂️</div>
666
+ <br><sup><i><strong>Affiliate:</strong></i></sup><br><a href="https://candy.ai/ai-anime?via=youmakeai-friend">
667
+ <img src="https://user-uploads.perchance.org/file/5c04e64b4a86d317b9a78613d6467259.jpg" height="100px" alt="AI FRIEND">
668
+ </a>
669
+ <br>
670
+ <strong>Not Getting The AI Art You Wanted?</strong><br>
671
+ Try the Prompt support on our <a href="https://poe.com/youmakeai"><strong><u>POE</u></strong></a>
672
+ <br>
673
+ <br>
674
+ <sub>This is an AI fan site; we are NOT endorsed by,<br>NOR affiliated with any of the following companies:</sub>
675
+ </div>
676
+ <h4>
677
+ <div style="text-align:center;">
678
+ <a href="https://perchance.org/privacy-policy">Perchance Privacy</a> |
679
+ <a href="https://poe.com/pages/privacy-center">Poe Privacy</a><br>
680
+ <a href="https://youmakeaiart.blogspot.com/p/privacy-policy.html?m=1">Our Privacy</a> |
681
+ <a href="https://nightcafe.studio/policies/terms-of-service">NightCafe TOS</a> |
682
+ <a href="https://youmakeaiart.blogspot.com/p/terms-of-use.html">Our TOS</a><br>
683
+ <a href="https://openai.com/policies/terms-of-use/">OpenAI TOS</a> |
684
+ <a href="https://stability.ai/tos-api-ds">Stability AI TOS</a><br>
685
+ <a href="https://bfl.ai/legal/terms-of-service">BFL/Flux TOS</a>
686
+ </div>
687
+ </h4>
688
+ <hr>
689
+ <p>©️ Copyright 2025 YouMake.Ai</p>
690
+ </center>
691
+ </html>
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+