Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
622 lines (577 loc) · 37.2 KB
/
Copy pathindex.html
File metadata and controls
622 lines (577 loc) · 37.2 KB
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
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Puter AI Chat — Multi-Model Studio</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="chat-styles.css">
<script src="https://js.puter.com/v2/"></script>
</head>
<body>
<div id="app" class="app-container">
<!-- Sidebar Navigation & Projects -->
<aside class="sidebar" id="sidebar">
<div class="sidebar-header">
<div class="brand">
<div class="brand-logo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
</svg>
</div>
<div class="brand-text">
<span class="brand-title">Puter AI</span>
<span class="brand-subtitle">Studio v2.0</span>
</div>
</div>
</div>
<!-- New Chat & New Folder Buttons below Brand Header -->
<div class="sidebar-primary-actions">
<button class="btn-sidebar-primary" id="newChatBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
<span>+ New Chat</span>
</button>
<button class="btn-sidebar-secondary" id="newFolderBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
<line x1="12" y1="11" x2="12" y2="17"></line>
<line x1="9" y1="14" x2="15" y2="14"></line>
</svg>
<span>+ New Folder</span>
</button>
</div>
<!-- Search Chats -->
<div class="sidebar-search">
<div class="search-input-wrapper">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" id="searchChats" placeholder="Search chats & folders..." aria-label="Search chats">
</div>
</div>
<div class="sidebar-section">
<div class="section-header">
<h2>Project Folders & Chats</h2>
<span class="chat-count-badge" id="chatCountBadge">24h Session</span>
</div>
<div class="folders-and-chats-container" id="foldersContainer">
<!-- Dynamic rendering via JS -->
</div>
</div>
<!-- Sidebar Footer User Card with Profile Dropdown Menu (Cleaned) -->
<div class="sidebar-footer">
<div class="user-card-wrapper" id="userCardWrapper">
<div class="user-card" id="userCard">
<div class="user-avatar" id="userAvatar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
</div>
<div class="user-details">
<span class="user-name" id="userName">Puter User</span>
<span class="user-status status-online" id="userStatus">Ready</span>
</div>
<svg class="chevron-up" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="18 15 12 9 6 15"></polyline>
</svg>
</div>
<!-- User Profile Glassmorphic Dropdown Menu -->
<div class="user-profile-dropdown" id="userProfileDropdown">
<button class="dropdown-item" id="dropdownModelsBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="3" width="20" height="14" rx="2"></rect>
<line x1="8" y1="21" x2="16" y2="21"></line>
<line x1="12" y1="17" x2="12" y2="21"></line>
</svg>
<span>AI Model Hub</span>
</button>
<button class="dropdown-item" id="dropdownSettingsBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
<span>Studio Settings</span>
</button>
<div class="dropdown-divider"></div>
<button class="dropdown-item danger" id="dropdownAuthBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path>
<line x1="12" y1="2" x2="12" y2="12"></line>
</svg>
<span id="dropdownAuthText">Connect Puter</span>
</button>
</div>
</div>
</div>
</aside>
<!-- Main Workspace Area -->
<main class="main-content">
<!-- Clean Header -->
<header class="chat-header">
<div class="header-left">
<button class="btn-icon sidebar-toggle" id="sidebarToggle" aria-label="Toggle sidebar" title="Toggle Sidebar Menu">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
<div class="header-badges">
<span class="model-badge" id="modelBadge">
<span class="badge-dot"></span>
<span id="modelBadgeText">Claude Fable 5.1</span>
</span>
<span class="status-pill online" id="connectionPill">Puter Connect</span>
</div>
</div>
<div class="header-right">
<!-- Model Selector Dropdown -->
<div class="model-selector" id="modelSelector">
<button class="model-select-btn" id="modelSelectBtn" aria-haspopup="listbox" aria-expanded="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="model-icon">
<rect x="2" y="3" width="20" height="14" rx="2"></rect>
<path d="M8 21h8"></path>
<path d="M12 17v4"></path>
</svg>
<span id="selectedModel">Claude Fable 5.1</span>
<svg class="chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div class="model-dropdown-container" id="modelDropdown">
<div class="model-picker-header">
<div class="model-search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" id="modelSearchInput" placeholder="Filter AI models...">
</div>
<div class="model-category-tabs">
<button class="category-tab active" data-category="all">All</button>
<button class="category-tab" data-category="chat">💬 Chat</button>
<button class="category-tab" data-category="image">🎨 Image</button>
<button class="category-tab" data-category="audio">🔊 Audio</button>
<button class="category-tab" data-category="video">🎬 Video</button>
</div>
</div>
<ul class="model-dropdown-list" id="modelDropdownList" role="listbox">
<!-- Dynamic Models -->
</ul>
</div>
</div>
<!-- Theme Switcher -->
<button class="btn-icon theme-toggle-btn" id="themeToggleBtn" aria-label="Toggle theme" title="Toggle Light/Dark Theme">
<svg class="sun-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
<svg class="moon-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
</button>
</div>
</header>
<!-- Chat Workspace -->
<div class="chat-area" id="chatArea" role="log" aria-live="polite">
<div class="messages" id="messages">
<!-- Welcome Banner -->
<div class="welcome-container" id="welcomeContainer">
<div class="welcome-hero">
<div class="welcome-badge">Multi-Provider AI Intelligence</div>
<h1>How can I help you today?</h1>
<p>Select from over 35+ verified AI models for text, coding, reasoning, image generation, text-to-speech, and video creation.</p>
</div>
</div>
</div>
<!-- Typing Indicator -->
<div class="typing-indicator" id="typingIndicator" aria-live="polite">
<div class="typing-avatar">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
</svg>
</div>
<div class="typing-bubble">
<div class="typing-dots">
<span></span>
<span></span>
<span></span>
</div>
<span class="typing-text">Puter AI is synthesizing response...</span>
</div>
</div>
</div>
<!-- Input Bar -->
<footer class="chat-input-area">
<div class="input-wrapper">
<!-- Attachment Preview Container -->
<div class="attachment-preview-container" id="attachmentPreviewContainer" style="display: none;">
<div class="attachment-preview-card" id="attachmentPreviewCard">
<img id="attachmentImagePreview" src="" alt="Attachment Preview" />
<div class="attachment-info">
<span id="attachmentName" class="attachment-name">image.jpg</span>
<span id="attachmentSize" class="attachment-size">0 KB</span>
</div>
<button id="removeAttachmentBtn" class="remove-attachment-btn" title="Remove attachment">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
</div>
<!-- Curved Input Box with SINGLE '+' button on left -->
<div class="input-container-glass">
<div class="input-tools-left">
<input type="file" id="fileInput" accept="image/*" style="display: none;">
<div class="input-tools-dropdown-wrapper" id="toolsDropdownWrapper">
<button class="tool-btn plus-btn" id="toolsDropdownBtn" aria-label="Open AI capabilities" title="Add attachment or select AI capability">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
<!-- Glassmorphic Floating Tools Menu -->
<div class="tools-dropdown-menu" id="toolsDropdownMenu">
<div class="tools-menu-header">AI Capabilities & Actions</div>
<button class="tools-menu-item" id="menuItemAttach">
<div class="menu-item-icon icon-indigo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.49"></path>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">📁 Upload Image / Document</span>
<span class="item-desc">Vision analysis & file attachment</span>
</div>
</button>
<button class="tools-menu-item" id="menuItemDeepSearch">
<div class="menu-item-icon icon-cyan">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">🔍 Deep Search Mode</span>
<span class="item-desc">Live web search & fact reasoning</span>
</div>
</button>
<button class="tools-menu-item" id="menuItemImageGen">
<div class="menu-item-icon icon-purple">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
<circle cx="8.5" cy="8.5" r="1.5"></circle>
<polyline points="21 15 16 10 5 21"></polyline>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">🎨 Image Generation Mode</span>
<span class="item-desc">Flux 2 Max, Ideogram, GPT Image</span>
</div>
</button>
<button class="tools-menu-item" id="menuItemAudio">
<div class="menu-item-icon icon-emerald">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M11 5L6 9H2v6h4l5 4V5z"></path>
<path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">🔊 Audio & Voice Mode</span>
<span class="item-desc">Text-to-speech synthesis engine</span>
</div>
</button>
<button class="tools-menu-item" id="menuItemVideo">
<div class="menu-item-icon icon-indigo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="23 7 16 12 23 17 23 7"></polygon>
<rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">🎬 Video Generation Mode</span>
<span class="item-desc">Kling 2.1 Master & PixVerse v5</span>
</div>
</button>
<button class="tools-menu-item" id="menuItemReasoning">
<div class="menu-item-icon icon-cyan">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">🧠 Deep Reasoning</span>
<span class="item-desc">DeepSeek R1 / V4 Pro logic</span>
</div>
</button>
<button class="tools-menu-item" id="menuItemVoiceInput">
<div class="menu-item-icon icon-emerald">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path>
<path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
<line x1="12" y1="19" x2="12" y2="22"></line>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">🎙️ Speech-to-Text</span>
<span class="item-desc">Dictate message with voice</span>
</div>
</button>
<div class="menu-divider"></div>
<button class="tools-menu-item" id="menuItemTtsToggle">
<div class="menu-item-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M11 5L6 9H2v6h4l5 4V5z"></path>
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"></path>
</svg>
</div>
<div class="menu-item-text">
<span class="item-title">Auto Read Aloud (TTS)</span>
<span class="item-desc" id="ttsStatusText">Off</span>
</div>
</button>
</div>
</div>
</div>
<div class="input-main">
<textarea
id="messageInput"
placeholder="Message Puter AI..."
aria-label="Message input"
rows="1"
spellcheck="true"
></textarea>
</div>
<div class="input-actions-right">
<div class="active-mode-badge" id="activeModeBadge">
<span class="badge-dot"></span>
<span id="activeModeText">Chat Mode</span>
</div>
<button class="send-btn" id="sendBtn" aria-label="Send message" title="Send message (Enter)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="22" y1="2" x2="11" y2="13"></line>
<polygon points="22 2 15 22 11 13 2 9"></polygon>
</svg>
</button>
</div>
</div>
</div>
</footer>
</main>
<!-- Slide-Out Settings Panel Drawer with Modern Auth Mode Selector UI -->
<aside class="settings-panel" id="settingsPanel" aria-label="Settings">
<div class="settings-header">
<div class="settings-header-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
<h2>Studio Configuration</h2>
</div>
<button class="btn-icon close-settings" id="closeSettings" aria-label="Close settings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="settings-content">
<section class="settings-section">
<h3>Authentication Mode Selector</h3>
<!-- Modern Segmented Pill Switcher UI -->
<div class="auth-segmented-control">
<button class="auth-segmented-btn active" id="authTabConnect">
<span class="auth-icon">🟢</span>
<span>Puter Connect</span>
</button>
<button class="auth-segmented-btn" id="authTabToken">
<span class="auth-icon">🔑</span>
<span>API Token</span>
</button>
</div>
</section>
<section class="settings-section" id="sectionPuterConnect">
<div class="recommended-header">
<h3>PUTER CONNECT AUTHENTICATION</h3>
<span class="badge-recommended">⭐ Recommended</span>
</div>
<div class="setting-card highlight-card">
<div class="setting-row vertical">
<div class="setting-info flex-between">
<span class="setting-label">Puter Account Status</span>
<span id="puterAccountBadge" class="value-badge">Not Connected</span>
</div>
<p class="setting-desc" style="margin-top: 6px; line-height: 1.5;">
Sign in with your Puter Cloud account to unlock all premium AI models seamlessly.
</p>
<div style="margin-top: 12px;" id="connectBtnContainer">
<button class="btn-primary full-width" id="puterConnectBtn">
Connect to Puter Cloud
</button>
</div>
</div>
</div>
</section>
<section class="settings-section" id="sectionApiToken" style="display: none;">
<h3>Custom API Token Configuration</h3>
<div class="setting-card">
<div class="warning-callout">
<div class="warning-header">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>
<line x1="12" y1="9" x2="12" y2="13"></line>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
<span>Subscription Requirement Notice</span>
</div>
<p class="warning-text">
Premium AI models require an active Puter subscription or API token with cloud credits.
</p>
</div>
<div class="setting-row vertical" style="margin-top: 10px;">
<div class="setting-info flex-between">
<span class="setting-label">API Token</span>
<span id="apiKeyBadge" class="value-badge">Not Active</span>
</div>
<input type="password" id="apiKeyInput" class="setting-input" placeholder="Paste Puter Auth Token from puter.com/dashboard...">
<div style="margin-top: 10px;">
<button class="btn-secondary full-width" id="saveApiKeyBtn">Save API Token</button>
</div>
</div>
</div>
</section>
<section class="settings-section">
<h3>AI Parameters & Data</h3>
<div class="setting-card">
<div class="setting-row vertical">
<div class="setting-info flex-between">
<span class="setting-label">Temperature</span>
<span id="temperatureValue" class="value-badge">0.7</span>
</div>
<input type="range" id="temperatureSlider" min="0" max="1" step="0.05" value="0.7" class="setting-range">
</div>
<div class="setting-row" style="margin-top: 10px;">
<button class="btn-danger full-width" id="clearHistoryBtn">Clear History</button>
</div>
<div class="setting-row" style="margin-top: 6px;">
<button class="btn-secondary full-width" id="exportDataBtn">Export Chat Log (JSON)</button>
</div>
</div>
</section>
</div>
</aside>
<!-- Slide-Out Profile Panel Drawer -->
<aside class="settings-panel" id="profilePanel" aria-label="User Profile">
<div class="settings-header">
<div class="settings-header-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
<h2>User Profile</h2>
</div>
<button class="btn-icon close-settings" id="closeProfile" aria-label="Close Profile">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="settings-content">
<div class="profile-hero" style="flex-direction: column; text-align: center; gap: 12px;">
<div class="profile-avatar-xl">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
</div>
<div class="profile-meta">
<h2 id="profileDrawerUsername">Puter User</h2>
<span class="profile-badge-tier">Puter Cloud Session</span>
<p class="profile-bio" style="margin-top: 6px;">Active 24-Hour Browser Session</p>
</div>
</div>
<div class="profile-stats-grid" style="grid-template-columns: repeat(2, 1fr); margin-top: 16px;">
<div class="stat-card">
<span class="stat-num" id="drawerStatChats">1</span>
<span class="stat-label">Chats</span>
</div>
<div class="stat-card">
<span class="stat-num" id="drawerStatFolders">1</span>
<span class="stat-label">Folders</span>
</div>
</div>
</div>
</aside>
<!-- Model Catalog Modal -->
<div class="models-modal-overlay" id="modelsModal">
<div class="models-modal-content">
<div class="models-modal-header">
<h2>🧩 AI Model Catalog</h2>
<button class="btn-icon" id="closeModelsModal">×</button>
</div>
<div class="hub-filter-bar" style="margin: 16px 0;">
<input type="text" id="hubSearchInput" class="hub-search-input" placeholder="Search 35+ AI models...">
<div class="hub-tags-list" style="margin-top: 10px;">
<button class="hub-tag-btn active" data-hub-cat="all">All Models</button>
<button class="hub-tag-btn" data-hub-cat="chat">💬 Chat</button>
<button class="hub-tag-btn" data-hub-cat="image">🎨 Image</button>
<button class="hub-tag-btn" data-hub-cat="audio">🔊 Audio</button>
<button class="hub-tag-btn" data-hub-cat="video">🎬 Video</button>
</div>
</div>
<div class="models-grid-container" id="hubModelsGrid">
<!-- Dynamic rendering -->
</div>
</div>
</div>
<!-- Backdrop Overlay -->
<div class="overlay" id="overlay" aria-hidden="true"></div>
</div>
<!-- Image Modal -->
<div class="image-modal" id="imageModal">
<div class="image-modal-content">
<button class="image-modal-close" id="closeImageModal">×</button>
<img id="modalImage" src="" alt="Full view">
<div class="image-modal-actions">
<a id="downloadImageBtn" href="#" download="puter-ai-image.png" class="btn-primary">Download Image</a>
</div>
</div>
</div>
<!-- Move Chat to Folder Modal -->
<div class="modal-dialog" id="moveFolderModal" style="display: none;">
<div class="modal-content-glass">
<div class="modal-header">
<h3>Move Conversation to Folder</h3>
<button class="modal-close-btn" id="closeMoveModal">×</button>
</div>
<div class="modal-body">
<p>Select target project folder:</p>
<select id="folderSelectDropdown" class="setting-select full-width" style="margin-top: 10px;"></select>
</div>
<div class="modal-footer">
<button class="btn-secondary" id="cancelMoveBtn">Cancel</button>
<button class="btn-primary" id="confirmMoveBtn">Move Chat</button>
</div>
</div>
</div>
<script src="chat-main.js"></script>
</body>
</html>