HI7RAI commited on
Commit
433899c
·
verified ·
1 Parent(s): b1741dd

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +857 -19
index.html CHANGED
@@ -1,19 +1,857 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Nexus AI Studio | Stable Diffusion v2.4</title>
7
+
8
+ <!-- Google Fonts: Inter for UI, Monospace for Code -->
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
12
+
13
+ <!-- FontAwesome for Icons -->
14
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
15
+
16
+ <style>
17
+ :root {
18
+ /* Color Palette - Dark Theme with Neon Accents */
19
+ --bg-dark: #0a0a0f;
20
+ --bg-panel: #15151d;
21
+ --bg-input: #0f0f16;
22
+ --primary: #6366f1; /* Indigo */
23
+ --primary-hover: #4f46e5;
24
+ --accent: #ec4899; /* Pink */
25
+ --accent-hover: #db2777;
26
+ --text-main: #f3f4f6;
27
+ --text-muted: #9ca3af;
28
+ --border: #2d2d3a;
29
+ --success: #10b981;
30
+ --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
31
+ --font-ui: 'Inter', sans-serif;
32
+ --font-mono: 'JetBrains Mono', monospace;
33
+ }
34
+
35
+ * {
36
+ box-sizing: border-box;
37
+ margin: 0;
38
+ padding: 0;
39
+ }
40
+
41
+ body {
42
+ font-family: var(--font-ui);
43
+ background-color: var(--bg-dark);
44
+ color: var(--text-main);
45
+ height: 100vh;
46
+ display: flex;
47
+ overflow: hidden;
48
+ background-image:
49
+ radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
50
+ radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 20%);
51
+ }
52
+
53
+ /* --- Sidebar Navigation --- */
54
+ .sidebar {
55
+ width: 260px;
56
+ background-color: var(--bg-panel);
57
+ border-right: 1px solid var(--border);
58
+ display: flex;
59
+ flex-direction: column;
60
+ padding: 20px;
61
+ transition: transform 0.3s ease;
62
+ z-index: 100;
63
+ }
64
+
65
+ .brand {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 12px;
69
+ margin-bottom: 40px;
70
+ }
71
+
72
+ .logo-icon {
73
+ width: 36px;
74
+ height: 36px;
75
+ background: linear-gradient(135deg, var(--primary), var(--accent));
76
+ border-radius: 8px;
77
+ display: flex;
78
+ align-items: center;
79
+ justify-content: center;
80
+ font-size: 18px;
81
+ box-shadow: var(--shadow-glow);
82
+ }
83
+
84
+ .brand-text {
85
+ font-weight: 800;
86
+ font-size: 1.2rem;
87
+ letter-spacing: -0.5px;
88
+ }
89
+
90
+ .nav-links {
91
+ display: flex;
92
+ flex-direction: column;
93
+ gap: 8px;
94
+ }
95
+
96
+ .nav-item {
97
+ padding: 12px 16px;
98
+ border-radius: 8px;
99
+ color: var(--text-muted);
100
+ text-decoration: none;
101
+ font-weight: 500;
102
+ transition: all 0.2s;
103
+ display: flex;
104
+ align-items: center;
105
+ gap: 12px;
106
+ cursor: pointer;
107
+ }
108
+
109
+ .nav-item:hover, .nav-item.active {
110
+ background-color: rgba(99, 102, 241, 0.1);
111
+ color: var(--primary);
112
+ }
113
+
114
+ .nav-item i {
115
+ width: 20px;
116
+ text-align: center;
117
+ }
118
+
119
+ .sidebar-footer {
120
+ margin-top: auto;
121
+ padding-top: 20px;
122
+ border-top: 1px solid var(--border);
123
+ }
124
+
125
+ .status-badge {
126
+ font-size: 0.75rem;
127
+ background: rgba(16, 185, 129, 0.15);
128
+ color: var(--success);
129
+ padding: 4px 8px;
130
+ border-radius: 4px;
131
+ display: inline-flex;
132
+ align-items: center;
133
+ gap: 6px;
134
+ font-family: var(--font-mono);
135
+ }
136
+
137
+ /* --- Main Content Area --- */
138
+ .main-content {
139
+ flex: 1;
140
+ display: flex;
141
+ flex-direction: column;
142
+ overflow-y: auto;
143
+ position: relative;
144
+ }
145
+
146
+ /* Header */
147
+ .top-bar {
148
+ padding: 25px 40px;
149
+ display: flex;
150
+ justify-content: space-between;
151
+ align-items: center;
152
+ }
153
+
154
+ .page-title h1 {
155
+ font-size: 2rem;
156
+ font-weight: 700;
157
+ margin-bottom: 4px;
158
+ }
159
+
160
+ .page-title p {
161
+ color: var(--text-muted);
162
+ font-size: 0.9rem;
163
+ }
164
+
165
+ .user-actions {
166
+ display: flex;
167
+ gap: 15px;
168
+ align-items: center;
169
+ }
170
+
171
+ .theme-toggle {
172
+ background: none;
173
+ border: none;
174
+ color: var(--text-muted);
175
+ font-size: 1.2rem;
176
+ cursor: pointer;
177
+ transition: color 0.2s;
178
+ }
179
+
180
+ .theme-toggle:hover {
181
+ color: var(--text-main);
182
+ }
183
+
184
+ .profile-circle {
185
+ width: 36px;
186
+ height: 36px;
187
+ border-radius: 50%;
188
+ background-color: var(--border);
189
+ display: flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ font-size: 0.9rem;
193
+ }
194
+
195
+ /* Generator Workspace */
196
+ .workspace {
197
+ padding: 0 40px 40px 40px;
198
+ display: grid;
199
+ grid-template-columns: 1.2fr 0.8fr;
200
+ gap: 30px;
201
+ height: 100%;
202
+ }
203
+
204
+ /* Left Panel: Input */
205
+ .input-panel {
206
+ display: flex;
207
+ flex-direction: column;
208
+ gap: 25px;
209
+ }
210
+
211
+ .card {
212
+ background-color: var(--bg-panel);
213
+ border: 1px solid var(--border);
214
+ border-radius: 16px;
215
+ padding: 25px;
216
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
217
+ }
218
+
219
+ .control-group {
220
+ display: flex;
221
+ flex-direction: column;
222
+ gap: 10px;
223
+ }
224
+
225
+ label {
226
+ font-size: 0.85rem;
227
+ font-weight: 600;
228
+ color: var(--text-muted);
229
+ text-transform: uppercase;
230
+ letter-spacing: 0.5px;
231
+ }
232
+
233
+ textarea {
234
+ background-color: var(--bg-input);
235
+ border: 1px solid var(--border);
236
+ color: var(--text-main);
237
+ padding: 15px;
238
+ border-radius: 10px;
239
+ font-family: var(--font-ui);
240
+ font-size: 1rem;
241
+ resize: vertical;
242
+ min-height: 120px;
243
+ transition: border-color 0.3s, box-shadow 0.3s;
244
+ }
245
+
246
+ textarea:focus {
247
+ outline: none;
248
+ border-color: var(--primary);
249
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
250
+ }
251
+
252
+ .settings-grid {
253
+ display: grid;
254
+ grid-template-columns: 1fr 1fr;
255
+ gap: 20px;
256
+ }
257
+
258
+ .slider-container {
259
+ display: flex;
260
+ flex-direction: column;
261
+ gap: 8px;
262
+ }
263
+
264
+ .slider-value {
265
+ font-family: var(--font-mono);
266
+ font-size: 0.9rem;
267
+ color: var(--accent);
268
+ text-align: right;
269
+ }
270
+
271
+ input[type="range"] {
272
+ width: 100%;
273
+ height: 6px;
274
+ background: var(--border);
275
+ border-radius: 5px;
276
+ appearance: none;
277
+ cursor: pointer;
278
+ }
279
+
280
+ input[type="range"]::-webkit-slider-thumb {
281
+ appearance: none;
282
+ width: 18px;
283
+ height: 18px;
284
+ border-radius: 50%;
285
+ background: var(--accent);
286
+ cursor: pointer;
287
+ transition: transform 0.1s;
288
+ }
289
+
290
+ input[type="range"]::-webkit-slider-thumb:hover {
291
+ transform: scale(1.2);
292
+ }
293
+
294
+ .btn-generate {
295
+ margin-top: auto;
296
+ background: linear-gradient(90deg, var(--primary), var(--accent));
297
+ color: white;
298
+ border: none;
299
+ padding: 18px;
300
+ font-size: 1.1rem;
301
+ font-weight: 700;
302
+ border-radius: 12px;
303
+ cursor: pointer;
304
+ transition: transform 0.2s, box-shadow 0.3s;
305
+ display: flex;
306
+ align-items: center;
307
+ justify-content: center;
308
+ gap: 10px;
309
+ position: relative;
310
+ overflow: hidden;
311
+ }
312
+
313
+ .btn-generate:hover {
314
+ transform: translateY(-2px);
315
+ box-shadow: 0 10px 25px -5px rgba(236, 72, 153, 0.4);
316
+ }
317
+
318
+ .btn-generate:active {
319
+ transform: translateY(0);
320
+ }
321
+
322
+ .btn-generate i {
323
+ animation: pulse 2s infinite;
324
+ }
325
+
326
+ @keyframes pulse {
327
+ 0% { opacity: 1; }
328
+ 50% { opacity: 0.5; }
329
+ 100% { opacity: 1; }
330
+ }
331
+
332
+ /* Right Panel: Output & History */
333
+ .output-panel {
334
+ display: flex;
335
+ flex-direction: column;
336
+ gap: 25px;
337
+ }
338
+
339
+ .image-container {
340
+ height: 450px;
341
+ background-color: var(--bg-dark);
342
+ border-radius: 16px;
343
+ border: 1px dashed var(--border);
344
+ display: flex;
345
+ align-items: center;
346
+ justify-content: center;
347
+ overflow: hidden;
348
+ position: relative;
349
+ transition: all 0.3s;
350
+ }
351
+
352
+ .image-container.active {
353
+ border: 1px solid var(--border);
354
+ }
355
+
356
+ .placeholder-content {
357
+ text-align: center;
358
+ color: var(--text-muted);
359
+ display: flex;
360
+ flex-direction: column;
361
+ align-items: center;
362
+ gap: 15px;
363
+ }
364
+
365
+ .placeholder-content i {
366
+ font-size: 3rem;
367
+ margin-bottom: 10px;
368
+ opacity: 0.5;
369
+ }
370
+
371
+ #generatedImage {
372
+ width: 100%;
373
+ height: 100%;
374
+ object-fit: contain;
375
+ display: none;
376
+ animation: fadeIn 0.5s ease;
377
+ }
378
+
379
+ @keyframes fadeIn {
380
+ from { opacity: 0; transform: scale(0.95); }
381
+ to { opacity: 1; transform: scale(1); }
382
+ }
383
+
384
+ .image-actions {
385
+ display: flex;
386
+ gap: 10px;
387
+ }
388
+
389
+ .icon-btn {
390
+ flex: 1;
391
+ background-color: var(--bg-panel);
392
+ border: 1px solid var(--border);
393
+ color: var(--text-main);
394
+ padding: 10px;
395
+ border-radius: 8px;
396
+ cursor: pointer;
397
+ transition: all 0.2s;
398
+ font-size: 0.9rem;
399
+ display: flex;
400
+ align-items: center;
401
+ justify-content: center;
402
+ gap: 8px;
403
+ }
404
+
405
+ .icon-btn:hover {
406
+ background-color: var(--border);
407
+ }
408
+
409
+ .history-list {
410
+ flex: 1;
411
+ background-color: var(--bg-panel);
412
+ border-radius: 16px;
413
+ padding: 20px;
414
+ overflow-y: auto;
415
+ max-height: 500px;
416
+ }
417
+
418
+ .history-header {
419
+ display: flex;
420
+ justify-content: space-between;
421
+ align-items: center;
422
+ margin-bottom: 20px;
423
+ padding-bottom: 10px;
424
+ border-bottom: 1px solid var(--border);
425
+ }
426
+
427
+ .history-grid {
428
+ display: grid;
429
+ grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
430
+ gap: 15px;
431
+ }
432
+
433
+ .history-item {
434
+ aspect-ratio: 1;
435
+ border-radius: 10px;
436
+ overflow: hidden;
437
+ cursor: pointer;
438
+ transition: transform 0.2s;
439
+ position: relative;
440
+ background-color: var(--bg-dark);
441
+ }
442
+
443
+ .history-item:hover {
444
+ transform: scale(1.05);
445
+ z-index: 10;
446
+ box-shadow: 0 5px 15px rgba(0,0,0,0.5);
447
+ }
448
+
449
+ .history-item img {
450
+ width: 100%;
451
+ height: 100%;
452
+ object-fit: cover;
453
+ }
454
+
455
+ .history-overlay {
456
+ position: absolute;
457
+ bottom: 0;
458
+ left: 0;
459
+ right: 0;
460
+ background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
461
+ padding: 10px;
462
+ font-size: 0.75rem;
463
+ color: white;
464
+ white-space: nowrap;
465
+ overflow: hidden;
466
+ text-overflow: ellipsis;
467
+ }
468
+
469
+ /* Responsive Design */
470
+ @media (max-width: 900px) {
471
+ .workspace {
472
+ grid-template-columns: 1fr;
473
+ overflow-y: auto;
474
+ }
475
+
476
+ .input-panel {
477
+ order: 2;
478
+ }
479
+
480
+ .output-panel {
481
+ order: 1;
482
+ }
483
+
484
+ .sidebar {
485
+ width: 70px;
486
+ padding: 20px 10px;
487
+ }
488
+
489
+ .brand-text, .nav-item span {
490
+ display: none;
491
+ }
492
+
493
+ .nav-item {
494
+ justify-content: center;
495
+ padding: 15px;
496
+ }
497
+
498
+ .brand {
499
+ justify-content: center;
500
+ }
501
+
502
+ .sidebar-footer {
503
+ display: none; /* Hide footer on mobile to save space */
504
+ }
505
+ }
506
+
507
+ @media (max-width: 600px) {
508
+ .top-bar {
509
+ padding: 20px;
510
+ flex-direction: column;
511
+ gap: 20px;
512
+ text-align: center;
513
+ }
514
+
515
+ .user-actions {
516
+ width: 100%;
517
+ justify-content: center;
518
+ }
519
+
520
+ .settings-grid {
521
+ grid-template-columns: 1fr;
522
+ }
523
+ }
524
+
525
+ /* Loader Animation */
526
+ .loader {
527
+ border: 4px solid rgba(255,255,255,0.1);
528
+ border-left-color: var(--accent);
529
+ border-radius: 50%;
530
+ width: 40px;
531
+ height: 40px;
532
+ animation: spin 1s linear infinite;
533
+ display: none;
534
+ margin: 0 auto;
535
+ }
536
+
537
+ @keyframes spin { 100% { transform: rotate(360deg); } }
538
+
539
+ </style>
540
+ </head>
541
+ <body>
542
+
543
+ <!-- Sidebar -->
544
+ <nav class="sidebar">
545
+ <div class="brand">
546
+ <div class="logo-icon">
547
+ <i class="fa-solid fa-wand-magic-sparkles"></i>
548
+ </div>
549
+ <span class="brand-text">Nexus AI</span>
550
+ </div>
551
+
552
+ <div class="nav-links">
553
+ <a class="nav-item active" onclick="switchTab(this)">
554
+ <i class="fa-solid fa-image"></i>
555
+ <span>Generator</span>
556
+ </a>
557
+ <a class="nav-item" onclick="switchTab(this)">
558
+ <i class="fa-solid fa-clock-rotate-left"></i>
559
+ <span>History</span>
560
+ </a>
561
+ <a class="nav-item" onclick="switchTab(this)">
562
+ <i class="fa-solid fa-gear"></i>
563
+ <span>Settings</span>
564
+ </a>
565
+ <a class="nav-item" onclick="switchTab(this)">
566
+ <i class="fa-solid fa-code"></i>
567
+ <span>API</span>
568
+ </a>
569
+ </div>
570
+
571
+ <div class="sidebar-footer">
572
+ <div class="status-badge">
573
+ <i class="fa-solid fa-circle" style="font-size: 6px;"></i>
574
+ Stable Diffusion v2.4
575
+ </div>
576
+ </div>
577
+ </nav>
578
+
579
+ <!-- Main Content -->
580
+ <main class="main-content">
581
+ <!-- Top Bar -->
582
+ <header class="top-bar">
583
+ <div class="page-title">
584
+ <h1>Create Masterpiece</h1>
585
+ <p>Stable Diffusion XL • 1024x1024 Resolution</p>
586
+ </div>
587
+ <div class="user-actions">
588
+ <button class="theme-toggle" title="Toggle Theme">
589
+ <i class="fa-solid fa-moon"></i>
590
+ </button>
591
+ <button class="theme-toggle" title="Help">
592
+ <i class="fa-solid fa-question-circle"></i>
593
+ </button>
594
+ <div class="profile-circle">
595
+ <i class="fa-solid fa-user"></i>
596
+ </div>
597
+ </div>
598
+ </header>
599
+
600
+ <!-- Workspace -->
601
+ <div class="workspace">
602
+
603
+ <!-- Left Side: Inputs -->
604
+ <div class="input-panel">
605
+ <div class="card">
606
+ <div class="control-group">
607
+ <label for="prompt">Prompt (Describe your image)</label>
608
+ <textarea id="prompt" placeholder="e.g., A futuristic cyberpunk city with neon lights in the rain, cinematic lighting, 8k resolution...">A futuristic cyberpunk city with neon lights in the rain, cinematic lighting, 8k resolution, highly detailed</textarea>
609
+ </div>
610
+ </div>
611
+
612
+ <div class="card">
613
+ <div class="control-group">
614
+ <label for="negative">Negative Prompt</label>
615
+ <textarea id="negative" placeholder="e.g., blurry, bad anatomy, cartoon, 3D render...">blurry, bad anatomy, cartoon, 3D render, low quality, text, watermark</textarea>
616
+ </div>
617
+ </div>
618
+
619
+ <div class="card">
620
+ <div class="settings-grid">
621
+ <div class="control-group">
622
+ <label>Steps: <span id="stepValue" class="slider-value">30</span></label>
623
+ <input type="range" id="steps" min="10" max="150" value="30" oninput="updateSlider('stepValue', this.value)">
624
+ </div>
625
+ <div class="control-group">
626
+ <label>Guidance Scale: <span id="scaleValue" class="slider-value">7.5</span></label>
627
+ <input type="range" id="scale" min="1" max="20" step="0.5" value="7.5" oninput="updateSlider('scaleValue', this.value)">
628
+ </div>
629
+ <div class="control-group">
630
+ <label>Width</label>
631
+ <select id="width" style="background: var(--bg-input); color: var(--text-main); padding: 10px; border-radius: 8px; border: 1px solid var(--border);">
632
+ <option value="1024">1024 px</option>
633
+ <option value="768">768 px</option>
634
+ <option value="512">512 px</option>
635
+ </select>
636
+ </div>
637
+ <div class="control-group">
638
+ <label>Height</label>
639
+ <select id="height" style="background: var(--bg-input); color: var(--text-main); padding: 10px; border-radius: 8px; border: 1px solid var(--border);">
640
+ <option value="1024">1024 px</option>
641
+ <option value="768">768 px</option>
642
+ <option value="512">512 px</option>
643
+ </select>
644
+ </div>
645
+ </div>
646
+ </div>
647
+
648
+ <button class="btn-generate" onclick="generateImage()">
649
+ <i class="fa-solid fa-wand-magic-sparkles"></i>
650
+ Generate Image
651
+ </button>
652
+
653
+ <div id="loader" class="loader"></div>
654
+ <p id="statusText" style="text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 10px; height: 20px;">Ready to create</p>
655
+ </div>
656
+
657
+ <!-- Right Side: Output -->
658
+ <div class="output-panel">
659
+ <div class="card" style="display: flex; flex-direction: column; height: 100%;">
660
+ <div class="image-container" id="imageContainer">
661
+ <div class="placeholder-content" id="placeholder">
662
+ <i class="fa-solid fa-image"></i>
663
+ <p>Image Preview</p>
664
+ <p style="font-size: 0.8rem; opacity: 0.7;">Generated results will appear here</p>
665
+ </div>
666
+ <div id="loaderSmall" style="display:none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
667
+ <div class="loader" style="width: 30px; height: 30px; border-width: 3px;"></div>
668
+ </div>
669
+ <img id="generatedImage" src="" alt="Generated Result">
670
+ </div>
671
+
672
+ <div class="image-actions">
673
+ <button class="icon-btn" onclick="downloadImage()">
674
+ <i class="fa-solid fa-download"></i> Download
675
+ </button>
676
+ <button class="icon-btn" onclick="copyPrompt()">
677
+ <i class="fa-solid fa-copy"></i> Copy Prompt
678
+ </button>
679
+ <button class="icon-btn" onclick="shareImage()">
680
+ <i class="fa-solid fa-share-nodes"></i> Share
681
+ </button>
682
+ </div>
683
+ </div>
684
+
685
+ <div class="history-list">
686
+ <div class="history-header">
687
+ <h3>Recent Generations</h3>
688
+ <button style="background:none; border:none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem;">
689
+ Clear All <i class="fa-solid fa-trash"></i>
690
+ </button>
691
+ </div>
692
+ <div class="history-grid" id="historyGrid">
693
+ <!-- History items will be injected here via JS -->
694
+ <div class="history-item">
695
+ <img src="https://picsum.photos/id/237/300/300" alt="Demo History">
696
+ <div class="history-overlay">Cyberpunk Street Dog</div>
697
+ </div>
698
+ <div class="history-item">
699
+ <img src="https://picsum.photos/id/182/300/300" alt="Demo History">
700
+ <div class="history-overlay">Fantasy Landscape</div>
701
+ </div>
702
+ <div class="history-item">
703
+ <img src="https://picsum.photos/id/533/300/300" alt="Demo History">
704
+ <div class="history-overlay">Neon Portrait</div>
705
+ </div>
706
+ </div>
707
+ </div>
708
+ </div>
709
+ </div>
710
+ </main>
711
+
712
+ <script>
713
+ // --- Logic for the Application ---
714
+
715
+ // 1. Tab Switching Logic
716
+ function switchTab(activeItem) {
717
+ const navItems = document.querySelectorAll('.nav-item');
718
+ navItems.forEach(item => item.classList.remove('active'));
719
+ activeItem.classList.add('active');
720
+
721
+ // Simple visual feedback
722
+ const statusText = document.getElementById('statusText');
723
+ const text = activeItem.innerText.trim();
724
+ statusText.textContent = `Switched to ${text} mode`;
725
+ }
726
+
727
+ // 2. Slider Updates
728
+ function updateSlider(elementId, value) {
729
+ document.getElementById(elementId).innerText = value;
730
+ }
731
+
732
+ // 3. Image Generation Logic (Mocked)
733
+ let isGenerating = false;
734
+
735
+ function generateImage() {
736
+ if (isGenerating) return;
737
+
738
+ const prompt = document.getElementById('prompt').value;
739
+ if (prompt.length < 5) {
740
+ alert("Please enter a more detailed prompt.");
741
+ return;
742
+ }
743
+
744
+ isGenerating = true;
745
+ const loader = document.getElementById('loader');
746
+ const statusText = document.getElementById('statusText');
747
+ const placeholder = document.getElementById('placeholder');
748
+ const generatedImg = document.getElementById('generatedImage');
749
+ const loaderSmall = document.getElementById('loaderSmall');
750
+
751
+ // UI Updates
752
+ loader.style.display = 'block';
753
+ statusText.textContent = `Processing: "${prompt.substring(0, 20)}..."`;
754
+ statusText.style.color = 'var(--primary)';
755
+ placeholder.style.display = 'none';
756
+ generatedImg.style.display = 'none';
757
+ loaderSmall.style.display = 'block';
758
+
759
+ // Simulate API Delay (2.5 seconds)
760
+ setTimeout(() => {
761
+ // Generate a random image URL to simulate different results
762
+ const randomId = Math.floor(Math.random() * 800) + 100;
763
+ const mockImageSrc = `https://picsum.photos/id/${randomId}/1024/1024?random=${Date.now()}`;
764
+
765
+ // Update UI
766
+ generatedImg.src = mockImageSrc;
767
+ generatedImg.onload = () => {
768
+ loader.style.display = 'none';
769
+ loaderSmall.style.display = 'none';
770
+ generatedImg.style.display = 'block';
771
+ statusText.textContent = "Generation Complete!";
772
+ statusText.style.color = 'var(--success)';
773
+
774
+ addToHistory(prompt, mockImageSrc);
775
+ };
776
+
777
+ isGenerating = false;
778
+ }, 2500);
779
+ }
780
+
781
+ // 4. History Management
782
+ function addToHistory(prompt, imgSrc) {
783
+ const historyGrid = document.getElementById('historyGrid');
784
+ const newItem = document.createElement('div');
785
+ newItem.className = 'history-item';
786
+
787
+ // Truncate prompt for display
788
+ const displayPrompt = prompt.length > 15 ? prompt.substring(0, 15) + "..." : prompt;
789
+
790
+ newItem.innerHTML = `
791
+ <img src="${imgSrc}" alt="Generated Image">
792
+ <div class="history-overlay" title="${prompt}">${displayPrompt}</div>
793
+ `;
794
+
795
+ // Add click event to view full image
796
+ newItem.addEventListener('click', () => {
797
+ const generatedImg = document.getElementById('generatedImage');
798
+ const placeholder = document.getElementById('placeholder');
799
+
800
+ generatedImg.src = imgSrc;
801
+ generatedImg.style.display = 'block';
802
+ placeholder.style.display = 'none';
803
+
804
+ // Scroll to top
805
+ document.querySelector('.workspace').scrollTop = 0;
806
+ });
807
+
808
+ // Insert at the beginning
809
+ historyGrid.insertBefore(newItem, historyGrid.firstChild);
810
+ }
811
+
812
+ // 5. Utilities
813
+ function downloadImage() {
814
+ const img = document.getElementById('generatedImage');
815
+ if (img.style.display === 'none') {
816
+ alert("No image to download. Generate one first!");
817
+ return;
818
+ }
819
+
820
+ const link = document.createElement('a');
821
+ link.href = img.src;
822
+ link.download = `nexus-art-${Date.now()}.jpg`;
823
+ document.body.appendChild(link);
824
+ link.click();
825
+ document.body.removeChild(link);
826
+ }
827
+
828
+ function copyPrompt() {
829
+ const promptText = document.getElementById('prompt').value;
830
+ navigator.clipboard.writeText(promptText).then(() => {
831
+ const btn = document.querySelector('.icon-btn i.fa-copy');
832
+ const originalTitle = btn.parentElement.title;
833
+ btn.parentElement.title = "Copied!";
834
+ alert("Prompt copied to clipboard!");
835
+ btn.parentElement.title = originalTitle;
836
+ }).catch(err => {
837
+ console.error('Failed to copy: ', err);
838
+ });
839
+ }
840
+
841
+ function shareImage() {
842
+ const img = document.getElementById('generatedImage');
843
+ if (img.style.display === 'none') {
844
+ alert("No image to share.");
845
+ return;
846
+ }
847
+ alert("Share feature: In a real app, this would open a modal or generate a link.");
848
+ }
849
+
850
+ // Initialize
851
+ document.addEventListener('DOMContentLoaded', () => {
852
+ console.log("Nexus AI Studio v2.4 Loaded");
853
+ });
854
+
855
+ </script>
856
+ </body>
857
+ </html>