File size: 43,249 Bytes
0c9a437
9e51dcd
 
 
 
 
 
 
0c9a437
9e51dcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c9a437
9e51dcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NeonDream AI - Image Generator</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* Custom styles */
        .window-shadow {
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .neon-shadow {
            box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
        }
        .title-bar {
            -webkit-user-select: none;
            user-select: none;
            background: linear-gradient(90deg, #1e293b, #334155);
        }
        .draggable {
            -webkit-app-region: drag;
        }
        .resizable {
            resize: both;
            overflow: auto;
            min-width: 400px;
            min-height: 500px;
        }
        .scrollbar-hide::-webkit-scrollbar {
            display: none;
        }
        .scrollbar-hide {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        .fade-in {
            animation: fadeIn 0.3s ease-in-out;
        }
        .pulse {
            animation: pulse 2s infinite;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
            100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
        }
        .gradient-border {
            position: relative;
            border-radius: 0.5rem;
        }
        .gradient-border::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899);
            border-radius: 0.5rem;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .gradient-border:hover::before {
            opacity: 1;
        }
        .typewriter {
            overflow: hidden;
            border-right: 2px solid #3b82f6;
            white-space: nowrap;
            margin: 0 auto;
            letter-spacing: 1px;
            animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
        }
        @keyframes typing {
            from { width: 0 }
            to { width: 100% }
        }
        @keyframes blink-caret {
            from, to { border-color: transparent }
            50% { border-color: #3b82f6 }
        }
    </style>
</head>
<body class="bg-gradient-to-br from-gray-900 to-gray-800 h-screen flex items-center justify-center p-4">
    <!-- Main Application Window -->
    <div class="bg-gray-800 rounded-xl window-shadow resizable flex flex-col overflow-hidden w-full max-w-5xl h-[700px] border border-gray-700">
        <!-- Title Bar -->
        <div class="title-bar text-white px-4 py-3 flex justify-between items-center draggable rounded-t-xl">
            <div class="flex items-center space-x-3">
                <div class="relative">
                    <div class="w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center neon-shadow pulse">
                        <i class="fas fa-brain text-white"></i>
                    </div>
                    <div class="absolute -bottom-1 -right-1 w-3 h-3 bg-green-400 rounded-full border-2 border-gray-800"></div>
                </div>
                <div>
                    <h1 class="font-bold text-lg">NeonDream AI</h1>
                    <p class="text-xs text-gray-300">Image Generator v2.4</p>
                </div>
            </div>
            <div class="flex space-x-2">
                <button class="w-7 h-7 flex items-center justify-center hover:bg-gray-700 rounded-full transition">
                    <i class="fas fa-window-minimize text-xs"></i>
                </button>
                <button class="w-7 h-7 flex items-center justify-center hover:bg-gray-700 rounded-full transition">
                    <i class="fas fa-window-maximize text-xs"></i>
                </button>
                <button class="w-7 h-7 flex items-center justify-center hover:bg-red-500 rounded-full transition">
                    <i class="fas fa-times text-xs"></i>
                </button>
            </div>
        </div>
        
        <!-- Menu Bar -->
        <div class="bg-gray-700 border-b border-gray-600 flex px-3 py-1 text-sm">
            <div class="px-3 py-1.5 hover:bg-gray-600 rounded-md cursor-pointer transition flex items-center space-x-1">
                <i class="fas fa-folder text-blue-400 text-xs"></i>
                <span>File</span>
            </div>
            <div class="px-3 py-1.5 hover:bg-gray-600 rounded-md cursor-pointer transition flex items-center space-x-1">
                <i class="fas fa-edit text-blue-400 text-xs"></i>
                <span>Edit</span>
            </div>
            <div class="px-3 py-1.5 hover:bg-gray-600 rounded-md cursor-pointer transition flex items-center space-x-1">
                <i class="fas fa-eye text-blue-400 text-xs"></i>
                <span>View</span>
            </div>
            <div class="px-3 py-1.5 hover:bg-gray-600 rounded-md cursor-pointer transition flex items-center space-x-1">
                <i class="fas fa-cog text-blue-400 text-xs"></i>
                <span>Settings</span>
            </div>
            <div class="px-3 py-1.5 hover:bg-gray-600 rounded-md cursor-pointer transition flex items-center space-x-1">
                <i class="fas fa-question-circle text-blue-400 text-xs"></i>
                <span>Help</span>
            </div>
        </div>
        
        <!-- Toolbar -->
        <div class="bg-gray-750 border-b border-gray-600 flex items-center px-4 py-2 space-x-3">
            <button class="p-2 hover:bg-gray-700 rounded-md transition" title="New Project">
                <i class="fas fa-file text-blue-400"></i>
            </button>
            <button class="p-2 hover:bg-gray-700 rounded-md transition" title="Save">
                <i class="fas fa-save text-blue-400"></i>
            </button>
            <div class="h-6 w-px bg-gray-600 mx-1"></div>
            <button class="p-2 hover:bg-gray-700 rounded-md transition" title="Undo">
                <i class="fas fa-undo text-blue-400"></i>
            </button>
            <button class="p-2 hover:bg-gray-700 rounded-md transition" title="Redo">
                <i class="fas fa-redo text-blue-400"></i>
            </button>
            <div class="h-6 w-px bg-gray-600 mx-1"></div>
            <button id="openPromptBtn" class="flex items-center space-x-2 bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-4 py-2 rounded-md transition shadow-md gradient-border">
                <i class="fas fa-magic"></i>
                <span>Generate Image</span>
            </button>
            <div class="flex-1"></div>
            <div class="text-xs text-gray-400 flex items-center space-x-2">
                <div class="flex items-center space-x-1">
                    <div class="w-2 h-2 bg-green-400 rounded-full"></div>
                    <span>Model Ready</span>
                </div>
                <span></span>
                <span>GPU: RTX 4090</span>
            </div>
        </div>
        
        <!-- Main Content -->
        <div class="flex-1 flex overflow-hidden">
            <!-- Sidebar -->
            <div class="w-56 bg-gray-750 border-r border-gray-600 p-3 overflow-y-auto scrollbar-hide">
                <div class="flex items-center justify-between mb-3">
                    <div class="text-xs font-semibold text-gray-400 uppercase tracking-wider">Recent Prompts</div>
                    <button class="text-xs text-blue-400 hover:text-blue-300 transition">Clear All</button>
                </div>
                <div class="space-y-2">
                    <div class="group relative">
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition flex items-center justify-between bg-gray-700">
                            <span class="truncate">A sunset over mountains</span>
                            <i class="fas fa-redo text-gray-500 group-hover:text-blue-400 transition ml-2"></i>
                        </div>
                    </div>
                    <div class="group relative">
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition flex items-center justify-between">
                            <span class="truncate">Cyberpunk city street</span>
                            <i class="fas fa-redo text-gray-500 group-hover:text-blue-400 transition ml-2"></i>
                        </div>
                    </div>
                    <div class="group relative">
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition flex items-center justify-between">
                            <span class="truncate">Portrait of a wizard</span>
                            <i class="fas fa-redo text-gray-500 group-hover:text-blue-400 transition ml-2"></i>
                        </div>
                    </div>
                    <div class="group relative">
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition flex items-center justify-between">
                            <span class="truncate">Futuristic spaceship</span>
                            <i class="fas fa-redo text-gray-500 group-hover:text-blue-400 transition ml-2"></i>
                        </div>
                    </div>
                    <div class="group relative">
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition flex items-center justify-between">
                            <span class="truncate">Cute cat wearing glasses</span>
                            <i class="fas fa-redo text-gray-500 group-hover:text-blue-400 transition ml-2"></i>
                        </div>
                    </div>
                </div>
                
                <div class="mt-6">
                    <div class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3">Preset Styles</div>
                    <div class="grid grid-cols-2 gap-2">
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition bg-gray-700 text-center">
                            <i class="fas fa-mountain text-blue-400 mb-1"></i>
                            <div class="text-xs">Landscape</div>
                        </div>
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition text-center">
                            <i class="fas fa-user text-blue-400 mb-1"></i>
                            <div class="text-xs">Portrait</div>
                        </div>
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition text-center">
                            <i class="fas fa-dragon text-blue-400 mb-1"></i>
                            <div class="text-xs">Fantasy</div>
                        </div>
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition text-center">
                            <i class="fas fa-robot text-blue-400 mb-1"></i>
                            <div class="text-xs">Sci-Fi</div>
                        </div>
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition text-center">
                            <i class="fas fa-paint-brush text-blue-400 mb-1"></i>
                            <div class="text-xs">Artistic</div>
                        </div>
                        <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition text-center">
                            <i class="fas fa-gamepad text-blue-400 mb-1"></i>
                            <div class="text-xs">Pixel Art</div>
                        </div>
                    </div>
                </div>
                
                <div class="mt-6">
                    <div class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3">Quick Prompts</div>
                    <div class="space-y-2">
                        <div class="p-2 text-xs hover:bg-gray-700 rounded-md cursor-pointer transition bg-gray-700">
                            "A futuristic city at night"
                        </div>
                        <div class="p-2 text-xs hover:bg-gray-700 rounded-md cursor-pointer transition">
                            "Watercolor landscape of mountains"
                        </div>
                        <div class="p-2 text-xs hover:bg-gray-700 rounded-md cursor-pointer transition">
                            "Cyberpunk character portrait"
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Canvas Area -->
            <div class="flex-1 bg-gray-800 flex items-center justify-center overflow-auto p-6">
                <div id="imageContainer" class="bg-gray-900 border-2 border-dashed border-gray-700 rounded-xl w-full h-full flex items-center justify-center relative">
                    <div class="text-center text-gray-500">
                        <i class="fas fa-image text-5xl mb-4 text-gray-600"></i>
                        <p class="text-gray-400 mb-2">No image generated yet</p>
                        <button id="quickGenerateBtn" class="text-blue-400 hover:text-blue-300 text-sm flex items-center justify-center mx-auto space-x-1 transition">
                            <i class="fas fa-bolt"></i>
                            <span>Try a quick generation</span>
                        </button>
                    </div>
                    
                    <div id="imageControls" class="absolute bottom-4 right-4 bg-gray-800 rounded-full p-2 shadow-lg hidden">
                        <button class="w-8 h-8 bg-blue-600 hover:bg-blue-700 rounded-full flex items-center justify-center text-white transition">
                            <i class="fas fa-download text-sm"></i>
                        </button>
                        <button class="w-8 h-8 bg-gray-700 hover:bg-gray-600 rounded-full flex items-center justify-center text-white ml-2 transition">
                            <i class="fas fa-edit text-sm"></i>
                        </button>
                        <button class="w-8 h-8 bg-gray-700 hover:bg-gray-600 rounded-full flex items-center justify-center text-white ml-2 transition">
                            <i class="fas fa-share-alt text-sm"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Status Bar -->
        <div class="bg-gray-750 border-t border-gray-600 text-xs text-gray-400 px-4 py-2 flex justify-between items-center">
            <div class="flex items-center space-x-4">
                <div class="flex items-center space-x-1">
                    <i class="fas fa-microchip text-blue-400"></i>
                    <span>VRAM: <span id="vramUsage">4.2</span>/24 GB</span>
                </div>
                <div class="flex items-center space-x-1">
                    <i class="fas fa-bolt text-yellow-400"></i>
                    <span>GPU: <span id="gpuUsage">68</span>%</span>
                </div>
                <div class="flex items-center space-x-1">
                    <i class="fas fa-memory text-purple-400"></i>
                    <span>RAM: <span id="ramUsage">5.7</span>/32 GB</span>
                </div>
            </div>
            <div class="flex items-center space-x-4">
                <div class="flex items-center space-x-1">
                    <i class="fas fa-database text-green-400"></i>
                    <span>Model: Stable Diffusion XL</span>
                </div>
                <div class="flex items-center space-x-1">
                    <i class="fas fa-clock text-gray-400"></i>
                    <span id="currentTime">00:00:00</span>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Prompt Dialog (Hidden by default) -->
    <div id="promptDialog" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 hidden backdrop-blur-sm">
        <div class="bg-gray-800 rounded-xl window-shadow w-full max-w-xl fade-in border border-gray-700">
            <div class="title-bar text-white px-4 py-3 flex justify-between items-center rounded-t-xl">
                <div class="font-semibold flex items-center space-x-2">
                    <i class="fas fa-magic text-blue-400"></i>
                    <span>Create New Image</span>
                </div>
                <button id="closePromptBtn" class="w-7 h-7 flex items-center justify-center hover:bg-red-500 rounded-full transition">
                    <i class="fas fa-times text-xs"></i>
                </button>
            </div>
            
            <div class="p-5">
                <div class="mb-5">
                    <label class="block text-sm font-medium text-gray-300 mb-2">Describe your image</label>
                    <div class="relative">
                        <textarea id="promptInput" class="w-full bg-gray-700 border border-gray-600 rounded-lg p-3 h-32 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-200 placeholder-gray-500 resize-none" placeholder="A beautiful landscape with mountains and a lake at sunset..."></textarea>
                        <div class="absolute bottom-2 right-2 text-xs text-gray-500">
                            <span id="charCount">0</span>/500
                        </div>
                    </div>
                </div>
                
                <div class="grid grid-cols-2 gap-4 mb-5">
                    <div>
                        <label class="block text-sm font-medium text-gray-300 mb-2">Style</label>
                        <select class="w-full bg-gray-700 border border-gray-600 rounded-lg p-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-200">
                            <option class="bg-gray-800">Realistic</option>
                            <option class="bg-gray-800">Digital Art</option>
                            <option class="bg-gray-800">Watercolor</option>
                            <option class="bg-gray-800">Pixel Art</option>
                            <option class="bg-gray-800">Anime</option>
                            <option class="bg-gray-800">Cyberpunk</option>
                            <option class="bg-gray-800">Steampunk</option>
                        </select>
                    </div>
                    <div>
                        <label class="block text-sm font-medium text-gray-300 mb-2">Aspect Ratio</label>
                        <select class="w-full bg-gray-700 border border-gray-600 rounded-lg p-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-200">
                            <option class="bg-gray-800">Square (1:1)</option>
                            <option class="bg-gray-800">Portrait (4:5)</option>
                            <option class="bg-gray-800">Landscape (16:9)</option>
                            <option class="bg-gray-800">Widescreen (21:9)</option>
                            <option class="bg-gray-800">Mobile (9:16)</option>
                        </select>
                    </div>
                </div>
                
                <div class="mb-5">
                    <label class="block text-sm font-medium text-gray-300 mb-2">Advanced Options</label>
                    <div class="bg-gray-750 rounded-lg p-3">
                        <div class="grid grid-cols-2 gap-4">
                            <div class="flex items-center">
                                <input type="checkbox" id="highQuality" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-600 rounded bg-gray-700">
                                <label for="highQuality" class="ml-2 block text-sm text-gray-300">High Quality</label>
                            </div>
                            <div class="flex items-center">
                                <input type="checkbox" id="nsfwFilter" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-600 rounded bg-gray-700" checked>
                                <label for="nsfwFilter" class="ml-2 block text-sm text-gray-300">NSFW Filter</label>
                            </div>
                            <div class="flex items-center">
                                <input type="checkbox" id="faceEnhance" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-600 rounded bg-gray-700">
                                <label for="faceEnhance" class="ml-2 block text-sm text-gray-300">Face Enhance</label>
                            </div>
                            <div class="flex items-center">
                                <input type="checkbox" id="upscale" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-600 rounded bg-gray-700">
                                <label for="upscale" class="ml-2 block text-sm text-gray-300">2x Upscale</label>
                            </div>
                        </div>
                        
                        <div class="mt-3">
                            <label class="block text-xs text-gray-400 mb-1">Guidance Scale</label>
                            <input type="range" min="1" max="20" value="7" class="w-full h-2 bg-gray-600 rounded-lg appearance-none cursor-pointer">
                            <div class="flex justify-between text-xs text-gray-400 mt-1">
                                <span>More Creative</span>
                                <span>More Precise</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="flex justify-between items-center">
                    <div class="text-xs text-gray-500">
                        <i class="fas fa-info-circle text-blue-400 mr-1"></i>
                        Uses ~<span id="vramEstimate">3.2</span>GB VRAM
                    </div>
                    <div class="flex space-x-3">
                        <button id="cancelPromptBtn" class="px-5 py-2 border border-gray-600 rounded-lg text-sm hover:bg-gray-700 text-gray-300 transition">Cancel</button>
                        <button id="generateBtn" class="px-5 py-2 bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white rounded-lg text-sm flex items-center space-x-2 transition shadow-md">
                            <i class="fas fa-magic"></i>
                            <span>Generate</span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Loading Overlay (Hidden by default) -->
    <div id="loadingOverlay" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 hidden backdrop-blur-sm">
        <div class="bg-gray-800 rounded-xl p-6 max-w-md w-full text-center border border-gray-700">
            <div class="animate-spin rounded-full h-16 w-16 border-b-2 border-blue-500 mx-auto mb-5"></div>
            <h3 class="text-lg font-medium text-white mb-1">Generating Your Image</h3>
            <p id="loadingText" class="text-sm text-gray-300 mb-3">Initializing model...</p>
            
            <div class="w-full bg-gray-700 rounded-full h-2.5 mb-4">
                <div id="progressBar" class="bg-gradient-to-r from-blue-500 to-purple-600 h-2.5 rounded-full" style="width: 0%"></div>
            </div>
            
            <div class="grid grid-cols-3 gap-2 text-xs text-gray-400">
                <div class="flex items-center justify-center space-x-1">
                    <i class="fas fa-microchip text-blue-400"></i>
                    <span id="loadingVram">4.8/24 GB</span>
                </div>
                <div class="flex items-center justify-center space-x-1">
                    <i class="fas fa-bolt text-yellow-400"></i>
                    <span id="loadingGpu">78%</span>
                </div>
                <div class="flex items-center justify-center space-x-1">
                    <i class="fas fa-clock text-gray-400"></i>
                    <span id="loadingTime">~12s</span>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Notification Toast (Hidden by default) -->
    <div id="notificationToast" class="fixed bottom-4 right-4 bg-gray-800 border border-gray-700 rounded-lg p-4 shadow-xl z-50 hidden transform transition-all duration-300 translate-y-2 opacity-0">
        <div class="flex items-start">
            <div id="toastIcon" class="flex-shrink-0">
                <i class="fas fa-check-circle text-green-400 text-xl"></i>
            </div>
            <div class="ml-3">
                <h3 id="toastTitle" class="text-sm font-medium text-white">Success</h3>
                <p id="toastMessage" class="text-sm text-gray-300 mt-1">Image generated successfully!</p>
            </div>
            <button id="closeToastBtn" class="ml-4 flex-shrink-0 text-gray-400 hover:text-gray-300">
                <i class="fas fa-times"></i>
            </button>
        </div>
    </div>

    <script>
        // DOM Elements
        const openPromptBtn = document.getElementById('openPromptBtn');
        const quickGenerateBtn = document.getElementById('quickGenerateBtn');
        const closePromptBtn = document.getElementById('closePromptBtn');
        const cancelPromptBtn = document.getElementById('cancelPromptBtn');
        const generateBtn = document.getElementById('generateBtn');
        const promptDialog = document.getElementById('promptDialog');
        const loadingOverlay = document.getElementById('loadingOverlay');
        const promptInput = document.getElementById('promptInput');
        const imageContainer = document.getElementById('imageContainer');
        const imageControls = document.getElementById('imageControls');
        const charCount = document.getElementById('charCount');
        const notificationToast = document.getElementById('notificationToast');
        const closeToastBtn = document.getElementById('closeToastBtn');
        const progressBar = document.getElementById('progressBar');
        const loadingText = document.getElementById('loadingText');
        const loadingVram = document.getElementById('loadingVram');
        const loadingGpu = document.getElementById('loadingGpu');
        const loadingTime = document.getElementById('loadingTime');
        const vramEstimate = document.getElementById('vramEstimate');
        
        // Update current time
        function updateClock() {
            const now = new Date();
            const timeString = now.toLocaleTimeString();
            document.getElementById('currentTime').textContent = timeString;
            
            // Simulate changing resource usage
            const vramUsage = document.getElementById('vramUsage');
            const gpuUsage = document.getElementById('gpuUsage');
            const ramUsage = document.getElementById('ramUsage');
            
            // Random fluctuations for demo purposes
            const vramValue = (4 + Math.random() * 0.5).toFixed(1);
            const gpuValue = Math.floor(60 + Math.random() * 15);
            const ramValue = (5.5 + Math.random() * 0.5).toFixed(1);
            
            vramUsage.textContent = vramValue;
            gpuUsage.textContent = gpuValue;
            ramUsage.textContent = ramValue;
        }
        
        setInterval(updateClock, 1000);
        updateClock();
        
        // Character counter for prompt input
        promptInput.addEventListener('input', () => {
            const count = promptInput.value.length;
            charCount.textContent = count;
            
            if (count > 500) {
                charCount.classList.add('text-red-400');
            } else {
                charCount.classList.remove('text-red-400');
            }
            
            // Update VRAM estimate based on prompt length
            const vramEst = (2.5 + (count / 500)).toFixed(1);
            vramEstimate.textContent = vramEst;
        });
        
        // Show notification toast
        function showToast(title, message, type = 'success') {
            const toastIcon = document.getElementById('toastIcon');
            const toastTitle = document.getElementById('toastTitle');
            const toastMessage = document.getElementById('toastMessage');
            
            // Set icon and color based on type
            if (type === 'success') {
                toastIcon.innerHTML = '<i class="fas fa-check-circle text-green-400 text-xl"></i>';
                toastTitle.classList.remove('text-red-400', 'text-yellow-400');
                toastTitle.classList.add('text-white');
            } else if (type === 'error') {
                toastIcon.innerHTML = '<i class="fas fa-exclamation-circle text-red-400 text-xl"></i>';
                toastTitle.classList.remove('text-white', 'text-yellow-400');
                toastTitle.classList.add('text-red-400');
            } else if (type === 'warning') {
                toastIcon.innerHTML = '<i class="fas fa-exclamation-triangle text-yellow-400 text-xl"></i>';
                toastTitle.classList.remove('text-white', 'text-red-400');
                toastTitle.classList.add('text-yellow-400');
            }
            
            toastTitle.textContent = title;
            toastMessage.textContent = message;
            
            notificationToast.classList.remove('hidden');
            setTimeout(() => {
                notificationToast.classList.remove('translate-y-2', 'opacity-0');
                notificationToast.classList.add('translate-y-0', 'opacity-100');
            }, 10);
            
            // Auto-hide after 5 seconds
            setTimeout(hideToast, 5000);
        }
        
        // Hide notification toast
        function hideToast() {
            notificationToast.classList.add('translate-y-2', 'opacity-0');
            setTimeout(() => {
                notificationToast.classList.add('hidden');
            }, 300);
        }
        
        closeToastBtn.addEventListener('click', hideToast);
        
        // Open prompt dialog
        openPromptBtn.addEventListener('click', () => {
            promptDialog.classList.remove('hidden');
            setTimeout(() => {
                promptInput.focus();
            }, 100);
        });
        
        // Quick generate button
        quickGenerateBtn.addEventListener('click', () => {
            const quickPrompts = [
                "A futuristic cityscape at night with neon lights and flying cars",
                "Majestic mountain landscape with a crystal clear lake at sunrise",
                "Cyberpunk female warrior with glowing tattoos and high-tech armor",
                "Cute kitten sitting on a stack of books in a cozy library",
                "Surreal dreamscape with floating islands and giant jellyfish"
            ];
            
            const randomPrompt = quickPrompts[Math.floor(Math.random() * quickPrompts.length)];
            promptInput.value = randomPrompt;
            promptDialog.classList.remove('hidden');
        });
        
        // Close prompt dialog
        function closePromptDialog() {
            promptDialog.classList.add('hidden');
        }
        
        closePromptBtn.addEventListener('click', closePromptDialog);
        cancelPromptBtn.addEventListener('click', closePromptDialog);
        
        // Generate image
        generateBtn.addEventListener('click', () => {
            const prompt = promptInput.value.trim();
            if (!prompt) {
                showToast('Error', 'Please enter a prompt', 'error');
                return;
            }
            
            if (prompt.length > 500) {
                showToast('Warning', 'Prompt is too long (max 500 chars)', 'warning');
                return;
            }
            
            closePromptDialog();
            loadingOverlay.classList.remove('hidden');
            
            // Simulate loading progress
            let progress = 0;
            const loadingStages = [
                "Initializing model...",
                "Processing prompt...",
                "Generating latent space...",
                "Upscaling image...",
                "Applying final touches..."
            ];
            
            const interval = setInterval(() => {
                progress += Math.random() * 10;
                if (progress > 100) progress = 100;
                
                progressBar.style.width = `${progress}%`;
                
                // Update loading text based on progress
                if (progress < 20) {
                    loadingText.textContent = loadingStages[0];
                } else if (progress < 40) {
                    loadingText.textContent = loadingStages[1];
                } else if (progress < 60) {
                    loadingText.textContent = loadingStages[2];
                } else if (progress < 80) {
                    loadingText.textContent = loadingStages[3];
                } else {
                    loadingText.textContent = loadingStages[4];
                }
                
                // Update resource stats
                const vramValue = (4.5 + Math.random() * 1.5).toFixed(1);
                const gpuValue = Math.floor(70 + Math.random() * 25);
                const timeLeft = Math.floor((100 - progress) / 10);
                
                loadingVram.textContent = `${vramValue}/24 GB`;
                loadingGpu.textContent = `${gpuValue}%`;
                loadingTime.textContent = `~${timeLeft}s`;
                
                if (progress === 100) {
                    clearInterval(interval);
                    setTimeout(() => {
                        loadingOverlay.classList.add('hidden');
                        showGeneratedImage(prompt);
                    }, 500);
                }
            }, 300);
        });
        
        // Show generated image
        function showGeneratedImage(prompt) {
            // Create a mock generated image with more realistic details
            const mockImage = document.createElement('div');
            mockImage.className = 'w-full h-full flex flex-col items-center justify-center p-6 relative';
            
            // Generate a random color gradient for the mock image
            const colors = [
                'from-purple-500 via-pink-500 to-red-500',
                'from-blue-500 via-indigo-500 to-purple-500',
                'from-green-500 via-teal-500 to-blue-500',
                'from-yellow-500 via-orange-500 to-red-500',
                'from-pink-500 via-purple-500 to-indigo-500'
            ];
            const randomColor = colors[Math.floor(Math.random() * colors.length)];
            
            mockImage.innerHTML = `
                <div class="relative w-full h-full max-w-2xl">
                    <div class="w-full h-full bg-gradient-to-br ${randomColor} rounded-xl shadow-2xl flex items-center justify-center overflow-hidden">
                        <div class="absolute inset-0 flex items-center justify-center">
                            <div class="w-32 h-32 rounded-full bg-white bg-opacity-20 blur-xl"></div>
                        </div>
                        <div class="relative z-10 text-center p-6">
                            <i class="fas fa-image text-white text-6xl opacity-80"></i>
                            <div class="mt-4 bg-black bg-opacity-40 rounded-lg p-3">
                                <p class="text-white font-medium">"${prompt}"</p>
                            </div>
                        </div>
                    </div>
                    <div class="absolute -bottom-2 -right-2 bg-gradient-to-r from-blue-500 to-purple-600 text-white text-xs px-3 py-1 rounded-full shadow-md">
                        AI Generated
                    </div>
                    <div class="absolute top-4 left-4 flex space-x-2">
                        <span class="bg-gray-800 bg-opacity-80 text-white text-xs px-2 py-1 rounded">512×512</span>
                        <span class="bg-gray-800 bg-opacity-80 text-white text-xs px-2 py-1 rounded">30 steps</span>
                    </div>
                </div>
                <div class="mt-6 text-center max-w-md">
                    <p class="text-gray-300 text-sm">${getRandomArtistName()} style, ${getRandomModelName()}</p>
                    <p class="text-gray-400 text-xs mt-2">Generated at ${new Date().toLocaleTimeString()}</p>
                </div>
            `;
            
            // Clear previous content and add new image
            imageContainer.innerHTML = '';
            imageContainer.appendChild(mockImage);
            imageControls.classList.remove('hidden');
            
            // Add to recent prompts (simplified)
            const sidebar = document.querySelector('.bg-gray-750 .space-y-2');
            const recentPrompt = document.createElement('div');
            recentPrompt.className = 'group relative';
            recentPrompt.innerHTML = `
                <div class="p-2 text-sm hover:bg-gray-700 rounded-md cursor-pointer transition flex items-center justify-between">
                    <span class="truncate">${prompt}</span>
                    <i class="fas fa-redo text-gray-500 group-hover:text-blue-400 transition ml-2"></i>
                </div>
            `;
            
            // Add click handler to reuse this prompt
            recentPrompt.querySelector('div').addEventListener('click', () => {
                promptInput.value = prompt;
                promptDialog.classList.remove('hidden');
            });
            
            sidebar.insertBefore(recentPrompt, sidebar.firstChild);
            
            // Limit to 5 recent prompts
            if (sidebar.children.length > 5) {
                sidebar.removeChild(sidebar.lastChild);
            }
            
            // Show success notification
            showToast('Success', 'Image generated successfully!');
        }
        
        // Helper functions for mock data
        function getRandomArtistName() {
            const artists = [
                "in the style of Greg Rutkowski",
                "trending on ArtStation",
                "hyperdetailed digital painting",
                "cinematic lighting",
                "concept art",
                "Studio Ghibli inspired",
                "Blizzard Entertainment style"
            ];
            return artists[Math.floor(Math.random() * artists.length)];
        }
        
        function getRandomModelName() {
            const models = [
                "Stable Diffusion XL",
                "DreamShaper v7",
                "Realistic Vision v5",
                "Deliberate v2",
                "Protogen x5.8",
                "Rev Animated v1.2"
            ];
            return models[Math.floor(Math.random() * models.length)];
        }
        
        // Add click handlers to sidebar items for demo purposes
        document.querySelectorAll('.bg-gray-750 .space-y-2 > div').forEach((item, index) => {
            item.addEventListener('click', () => {
                const samplePrompts = [
                    "A majestic lion in the savanna at sunset",
                    "Futuristic city with flying cars",
                    "Watercolor painting of a forest in autumn",
                    "Cyberpunk street with neon lights",
                    "Portrait of a steampunk inventor"
                ];
                
                promptInput.value = samplePrompts[index] || item.textContent;
                promptDialog.classList.remove('hidden');
            });
        });
        
        // Add click handlers to preset styles
        document.querySelectorAll('.grid.grid-cols-2.gap-2 > div').forEach((item, index) => {
            item.addEventListener('click', () => {
                const stylePrompts = [
                    "A breathtaking mountain landscape with a waterfall and sunset, highly detailed",
                    "Professional portrait of a business person with perfect lighting, 8k resolution",
                    "A powerful wizard casting a spell in a mystical forest, fantasy art",
                    "Futuristic spaceship orbiting an alien planet, sci-fi concept art",
                    "Still life painting of flowers in a vase, impressionist style",
                    "8-bit pixel art scene of a medieval village with charming details"
                ];
                
                if (index < stylePrompts.length) {
                    promptInput.value = stylePrompts[index];
                    promptDialog.classList.remove('hidden');
                }
            });
        });
        
        // Add click handlers to quick prompts
        document.querySelectorAll('.mt-6 .space-y-2 > div').forEach((item, index) => {
            item.addEventListener('click', () => {
                const quickPrompts = [
                    "A futuristic city at night with neon lights and rain-soaked streets, cyberpunk style",
                    "Watercolor landscape of mountains reflected in a calm lake at sunrise",
                    "Cyberpunk character portrait with glowing tattoos and intricate armor design"
                ];
                
                if (index < quickPrompts.length) {
                    promptInput.value = quickPrompts[index];
                    promptDialog.classList.remove('hidden');
                }
            });
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=bennijo/displays-a-contextual-window" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>