Sheelu Katiyar commited on
Commit
0261885
·
verified ·
1 Parent(s): d0796d1

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +391 -249
index.html CHANGED
@@ -1,274 +1,416 @@
1
  <!DOCTYPE html>
2
- <html lang="hi">
3
  <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Creative Aura Gen 2.0</title>
7
- <style>
8
- body {
9
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
10
- background-color: #ffffff;
11
- margin: 0;
12
- padding: 0;
13
- display: flex;
14
- height: 100vh;
15
- color: #222;
16
- }
17
- .chat-container {
18
- flex: 1;
19
- display: flex;
20
- flex-direction: column;
21
- max-width: 850px;
22
- margin: 0 auto;
23
- border-left: 1px solid #eaeaea;
24
- border-right: 1px solid #eaeaea;
25
- background: rgba(255, 255, 255, 0.7);
26
- backdrop-filter: blur(25px);
27
- -webkit-backdrop-filter: blur(25px);
28
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.02);
29
- }
30
- .header {
31
- padding: 22px;
32
- text-align: center;
33
- border-bottom: 1px solid #eaeaea;
34
- background: rgba(255, 255, 255, 0.85);
35
- backdrop-filter: blur(10px);
36
- font-weight: 600;
37
- font-size: 1.25rem;
38
- color: #111;
39
- letter-spacing: -0.3px;
40
- }
41
- .chat-box {
42
- flex: 1;
43
- padding: 25px;
44
- overflow-y: auto;
45
- display: flex;
46
- flex-direction: column;
47
- gap: 24px;
48
- }
49
- .message {
50
- max-width: 82%;
51
- padding: 14px 20px;
52
- border-radius: 22px;
53
- line-height: 1.6;
54
- font-size: 1.05rem;
55
- word-wrap: break-word;
56
- }
57
- .user-message {
58
- align-self: flex-end;
59
- background-color: #f3f3f3;
60
- color: #000;
61
- border-bottom-right-radius: 5px;
62
- }
63
- .bot-message {
64
- align-self: flex-start;
65
- background-color: #ffffff;
66
- border: 1px solid #eaeaea;
67
- color: #232323;
68
- border-bottom-left-radius: 5px;
69
- box-shadow: 0 4px 14px rgba(0,0,0,0.02);
70
- }
71
- .input-area {
72
- padding: 20px;
73
- border-top: 1px solid #eaeaea;
74
- background: rgba(255, 255, 255, 0.95);
75
- display: flex;
76
- gap: 14px;
77
- align-items: center;
78
- }
79
- .file-upload {
80
- position: relative;
81
- overflow: hidden;
82
- display: inline-block;
83
- }
84
- .file-upload input[type=file] {
85
- font-size: 100px;
86
- position: absolute;
87
- left: 0;
88
- top: 0;
89
- opacity: 0;
90
- cursor: pointer;
91
- }
92
- .upload-btn {
93
- background-color: #fafafa;
94
- border: 1px solid #eaeaea;
95
- border-radius: 50%;
96
- width: 48px;
97
- height: 48px;
98
- display: flex;
99
- align-items: center;
100
- justify-content: center;
101
- font-size: 1.3rem;
102
- color: #444;
103
- cursor: pointer;
104
- transition: all 0.2s ease;
105
- }
106
- .upload-btn:hover {
107
- background-color: #f0f0f0;
108
- transform: scale(1.02);
109
- }
110
- input[type="text"] {
111
- flex: 1;
112
- padding: 15px 22px;
113
- border: 1px solid #eaeaea;
114
- border-radius: 26px;
115
- outline: none;
116
- font-size: 1.02rem;
117
- background: #ffffff;
118
- transition: all 0.2s ease;
119
- }
120
- input[type="text"]:focus {
121
- border-color: #b5b5b5;
122
- box-shadow: 0 0 0 4px rgba(0,0,0,0.03);
123
- }
124
- button.send-btn {
125
- background-color: #000000;
126
- color: #ffffff;
127
- border: none;
128
- border-radius: 26px;
129
- padding: 14px 28px;
130
- font-size: 1rem;
131
- font-weight: 500;
132
- cursor: pointer;
133
- transition: all 0.2s ease;
134
- }
135
- button.send-btn:hover {
136
- background-color: #222;
137
- }
138
- button.send-btn:active {
139
- transform: scale(0.97);
140
- }
141
- .attachment-preview {
142
- display: none;
143
- padding: 12px 25px;
144
- background: #fbfbfb;
145
- border-top: 1px solid #eaeaea;
146
- font-size: 0.95rem;
147
- color: #555;
148
- }
149
- .preview-img {
150
- max-height: 220px;
151
- border-radius: 14px;
152
- margin-top: 12px;
153
- border: 1px solid #e2e2e2;
154
- }
155
- </style>
156
  </head>
157
  <body>
158
- <div class="chat-container">
159
- <div class="header">Creative Aura Gen 2.0 ✨</div>
160
- <div class="chat-box" id="chat-box">
161
- <div class="message bot-message">नमस्ते अभय भाई! मैं Creative Aura Gen 2.0 हूँ। यह एक एडवांस मल्टीमोडल सिस्टम है। आप मुझसे कोई भी सवाल पूछ सकते हैं, या इमेज और ऑडियो अपलोड करके उसपर चर्चा कर सकते हैं।</div>
 
 
 
 
 
 
 
 
 
 
162
  </div>
163
- <div class="attachment-preview" id="attachment-preview"></div>
164
- <div class="input-area">
165
- <div class="file-upload">
166
- <button class="upload-btn">📎</button>
167
- <input type="file" id="file-input" accept="image/*,audio/*" onchange="handleFile(event)">
168
- </div>
169
- <input type="text" id="user-input" placeholder="कुछ पूछें या फ़ाइल अपलोड करें..." onkeypress="handleEnter(event)">
170
- <button class="send-btn" onclick="sendMessage()">Send</button>
 
 
 
 
171
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  </div>
 
173
 
174
- <script>
175
- let currentAttachment = null;
 
 
 
 
 
176
 
177
- function handleFile(event) {
178
- const file = event.target.files[0];
179
- if (!file) return;
 
 
 
 
 
180
 
181
- const reader = new FileReader();
182
- reader.onload = function(e) {
183
- const base64Data = e.target.result.split(',')[1];
184
- let type = 'file';
185
- if (file.type.startsWith('image/')) type = 'image';
186
- else if (file.type.startsWith('audio/')) type = 'audio';
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
- currentAttachment = { type: type, data: base64Data };
189
-
190
- const preview = document.getElementById('attachment-preview');
191
- preview.style.display = 'block';
192
- preview.innerHTML = `संलग्न फ़ाइल: <strong>${file.name}</strong> <button onclick="clearAttachment()" style="margin-left:12px; border:none; background:none; color:#ff3b30; cursor:pointer; font-weight:bold;">❌</button>`;
193
- };
194
- reader.readAsDataURL(file);
195
- }
 
 
 
 
 
 
 
 
196
 
197
- function clearAttachment() {
198
- currentAttachment = null;
199
- document.getElementById('attachment-preview').style.display = 'none';
200
- document.getElementById('file-input').value = '';
201
- }
 
 
 
202
 
203
- function handleEnter(event) {
204
- if (event.key === "Enter") sendMessage();
205
- }
206
 
207
- async function sendMessage() {
208
- const inputField = document.getElementById('user-input');
209
- const message = inputField.value.trim();
210
- if (!message && !currentAttachment) return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
- const chatBox = document.getElementById('chat-box');
213
-
214
- let userHTML = `<div class="message user-message">${message}`;
215
- if (currentAttachment && currentAttachment.type === 'image') {
216
- userHTML += `<br><img src="data:image/jpeg;base64,${currentAttachment.data}" class="preview-img">`;
217
- } else if (currentAttachment && currentAttachment.type === 'audio') {
218
- userHTML += `<br><em>🎵 [ऑडियो इनपुट संलग्न]</em>`;
219
- }
220
- userHTML += `</div>`;
221
- chatBox.innerHTML += userHTML;
222
-
223
- let attachments = [];
224
- if (currentAttachment) attachments.push(currentAttachment);
 
225
 
226
- inputField.value = '';
227
- clearAttachment();
228
- chatBox.scrollTop = chatBox.scrollHeight;
 
 
 
 
 
229
 
230
- const botMsgId = "bot-" + Date.now();
231
- chatBox.innerHTML += `<div class="message bot-message" id="${botMsgId}">सोच रहा हूँ...</div>`;
232
- chatBox.scrollTop = chatBox.scrollHeight;
233
 
234
- try {
235
- const response = await fetch('/api/chat', {
236
- method: 'POST',
237
- headers: { 'Content-Type': 'application/json' },
238
- body: JSON.stringify({ message: message, attachments: attachments })
239
- });
240
 
241
- const reader = response.body.getReader();
242
- const decoder = new TextDecoder();
243
- const botDiv = document.getElementById(botMsgId);
244
- botDiv.innerHTML = "";
 
 
 
245
 
246
- while (true) {
247
- const { done, value } = await reader.read();
248
- if (done) break;
249
-
250
- const chunk = decoder.decode(value, {stream: true});
251
- const lines = chunk.split('\n');
252
- for (let line of lines) {
253
- if (line.startsWith('data: ')) {
254
- const dataStr = line.substring(6);
255
- if (dataStr.trim() === '[DONE]') continue;
256
- try {
257
- const dataObj = JSON.parse(dataStr);
258
- if (dataObj.choices && dataObj.choices[0].delta.content) {
259
- let text = dataObj.choices[0].delta.content;
260
- text = text.replace(/\n/g, '<br>');
261
- botDiv.innerHTML += text;
262
- chatBox.scrollTop = chatBox.scrollHeight;
263
- }
264
- } catch (e) { }
265
- }
 
 
 
 
 
 
 
 
266
  }
267
- }
268
- } catch (error) {
269
- document.getElementById(botMsgId).innerHTML = "त्रुटि: सर्वर से प्रतिक्रिया नहीं मिल सकी।";
270
  }
271
  }
272
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  </body>
274
  </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>🧬 Aura Gen 2.0</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap" rel="stylesheet">
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css">
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
11
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.1/marked.min.js"></script>
12
+ <style>
13
+ /* आपका पूरा CSS यहाँ है (बिना किसी बदलाव के) */
14
+ *{margin:0;padding:0;box-sizing:border-box;}
15
+ :root{
16
+ --bg-color: #ffffff; --bg-secondary: #f5f5f7; --text-main: #1d1d1f; --text-muted: #86868b;
17
+ --accent: #0071e3; --accent-hover: #0077ed; --border-light: rgba(0, 0, 0, 0.08);
18
+ --glass-bg: rgba(255, 255, 255, 0.75); --glass-border: rgba(255, 255, 255, 0.4);
19
+ --shadow-sm: 0 2px 8px rgba(0,0,0,0.04); --shadow-md: 0 8px 32px rgba(0,0,0,0.08);
20
+ --font-serif: 'Instrument Serif', serif; --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
21
+ --font-mono: 'Geist Mono', monospace; --radius-lg: 24px; --radius-md: 16px; --radius-sm: 8px;
22
+ }
23
+ html,body{height:100%;overflow:hidden;background:var(--bg-color);color:var(--text-main);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;}
24
+ .bg{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background: #fafafa;}
25
+ .orb{position:absolute;border-radius:50%;filter:blur(100px);opacity:0.4;animation:drift 25s ease-in-out infinite alternate;}
26
+ .orb1{width:600px;height:600px;background:radial-gradient(circle,rgba(0,113,227,0.15),transparent 70%);top:-150px;left:-100px;}
27
+ .orb2{width:500px;height:500px;background:radial-gradient(circle,rgba(52,199,89,0.12),transparent 70%);bottom:-100px;right:-100px;animation-delay:-10s;}
28
+ @keyframes drift{0%{transform:translate(0,0) scale(1);}100%{transform:translate(80px,50px) scale(1.1);}}
29
+ .shell{position:relative;z-index:1;display:grid;grid-template-columns:280px 1fr;height:100vh;}
30
+ .sidebar{display:flex;flex-direction:column;background:var(--bg-secondary);border-right:1px solid var(--border-light);overflow:hidden;}
31
+ .logo-area{padding:24px 20px;border-bottom:1px solid var(--border-light);}
32
+ .logo-row{display:flex;align-items:center;gap:12px;margin-bottom:12px;}
33
+ .logo-img{width:48px;height:48px;border-radius:12px;object-fit:cover;box-shadow:var(--shadow-sm);border:1px solid var(--border-light);}
34
+ .logo-text{line-height:1.2;}
35
+ .logo-name{font-family:var(--font-sans);font-weight:700;font-size:18px;color:var(--text-main);letter-spacing:-0.5px;}
36
+ .logo-sub{font-size:10px;font-weight:600;letter-spacing:1px;text-transform:uppercase;color:var(--text-muted);}
37
+ .settings{padding:20px;flex:1;overflow-y:auto;}
38
+ .settings::-webkit-scrollbar{width:4px;}
39
+ .settings::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.15);border-radius:10px;}
40
+ .section-lbl{font-size:11px;font-weight:600;letter-spacing:1px;text-transform:uppercase;color:var(--text-muted);margin-bottom:12px;}
41
+ .field{margin-bottom:20px;}
42
+ .field-lbl{font-size:12px;font-weight:500;color:var(--text-main);margin-bottom:8px;display:block;}
43
+ .field textarea{width:100%;background:#ffffff;border:1px solid var(--border-light);border-radius:var(--radius-sm);color:var(--text-main);font-family:var(--font-sans);font-size:13px;line-height:1.5;padding:12px;resize:none;outline:none;transition:border-color 0.2s, box-shadow 0.2s;height:80px;box-shadow:inset 0 1px 2px rgba(0,0,0,0.02);}
44
+ .field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,113,227,0.15);}
45
+ .sl-wrap{margin-bottom:16px;}
46
+ .sl-meta{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
47
+ .sl-title{font-size:12px;font-weight:500;color:var(--text-main);}
48
+ .sl-val{font-size:11px;font-weight:500;font-family:var(--font-mono);background:#ffffff;color:var(--text-muted);padding:2px 8px;border-radius:6px;border:1px solid var(--border-light);}
49
+ input[type=range]{width:100%;height:4px;appearance:none;background:rgba(0,0,0,0.1);border-radius:2px;outline:none;}
50
+ input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:#ffffff;box-shadow:0 1px 4px rgba(0,0,0,0.2);border:1px solid var(--border-light);cursor:pointer;transition:transform 0.1s;}
51
+ input[type=range]::-webkit-slider-thumb:active{transform:scale(1.1);}
52
+ .presets{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px;}
53
+ .chip{font-size:11px;font-weight:500;padding:4px 10px;border-radius:14px;background:#ffffff;border:1px solid var(--border-light);color:var(--text-muted);cursor:pointer;transition:all 0.2s;}
54
+ .chip:hover{background:var(--accent);color:#ffffff;border-color:var(--accent);}
55
+ .clear-btn{width:100%;padding:10px;border-radius:var(--radius-sm);background:#ffffff;border:1px solid var(--border-light);color:var(--text-main);font-family:var(--font-sans);font-size:13px;font-weight:500;cursor:pointer;transition:all 0.2s;margin-top:10px;}
56
+ .clear-btn:hover{background:#fff0f0;color:#ff3b30;border-color:#ff3b30;}
57
+ .chat-main{display:flex;flex-direction:column;background:transparent;overflow:hidden;position:relative;}
58
+ .chat-hdr{padding:14px 24px;border-bottom:1px solid var(--border-light);background:var(--glass-bg);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);display:flex;align-items:center;justify-content:space-between;flex-shrink:0;z-index:10;}
59
+ .model-badge{font-size:13px;font-weight:600;color:var(--text-main);display:flex;align-items:center;gap:8px;}
60
+ .status-dot{width:8px;height:8px;border-radius:50%;background:#34c759;box-shadow:0 0 0 2px rgba(52,199,89,0.2);}
61
+ .messages{flex:1;overflow-y:auto;padding:30px 40px;display:flex;flex-direction:column;gap:24px;scroll-behavior:smooth;}
62
+ .messages::-webkit-scrollbar{width:6px;}
63
+ .messages::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.1);border-radius:10px;}
64
+ .welcome{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:40px;flex:1;min-height:400px;animation:fadeIn 0.5s ease-out;}
65
+ @keyframes fadeIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}
66
+ .welcome-logo{width:80px;height:80px;border-radius:20px;object-fit:cover;box-shadow:var(--shadow-md);margin-bottom:24px;}
67
+ .welcome-title{font-family:var(--font-sans);font-size:32px;font-weight:700;color:var(--text-main);letter-spacing:-1px;margin-bottom:12px;}
68
+ .welcome-sub{font-size:15px;color:var(--text-muted);max-width:500px;line-height:1.5;margin-bottom:32px;}
69
+ .ex-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;width:100%;max-width:600px;}
70
+ .ex-card{background:var(--glass-bg);backdrop-filter:blur(10px);border:1px solid var(--border-light);border-radius:var(--radius-md);padding:16px;cursor:pointer;text-align:left;transition:all 0.2s;box-shadow:var(--shadow-sm);}
71
+ .ex-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md);border-color:rgba(0,113,227,0.3);}
72
+ .ex-title{font-size:13px;font-weight:600;color:var(--text-main);margin-bottom:4px;}
73
+ .ex-desc{font-size:12px;color:var(--text-muted);line-height:1.4;}
74
+ .msg{display:flex;gap:16px;animation:msgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;max-width:85%;}
75
+ @keyframes msgIn{from{opacity:0;transform:translateY(12px) scale(0.98);}to{opacity:1;transform:none;}}
76
+ .msg.user{flex-direction:row-reverse;align-self:flex-end;}
77
+ .msg.bot{align-self:flex-start;}
78
+ .avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;}
79
+ .msg.user .avatar{background:var(--bg-secondary);color:var(--text-main);border:1px solid var(--border-light);}
80
+ .msg.bot .avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover;border:1px solid var(--border-light);}
81
+ .body{display:flex;flex-direction:column;gap:4px;}
82
+ .msg.user .body{align-items:flex-end;}
83
+ .bubble{padding:14px 18px;font-size:14.5px;line-height:1.6;color:var(--text-main);}
84
+ .msg.user .bubble{background:var(--accent);color:#ffffff;border-radius:20px 20px 4px 20px;box-shadow:0 4px 12px rgba(0,113,227,0.2);}
85
+ .msg.bot .bubble{background:#ffffff;border:1px solid var(--border-light);border-radius:4px 20px 20px 20px;box-shadow:var(--shadow-sm);width:100%;}
86
+ .bubble p{margin-bottom:10px;}
87
+ .bubble p:last-child{margin-bottom:0;}
88
+ .bubble pre{background:#f5f5f7;border:1px solid rgba(0,0,0,0.05);border-radius:12px;padding:12px;margin:10px 0;overflow-x:auto;font-family:var(--font-mono);font-size:13px;}
89
+ .msg.user .bubble pre{background:rgba(255,255,255,0.1);border:none;color:#fff;}
90
+ .bubble code{font-family:var(--font-mono);background:rgba(0,0,0,0.05);padding:2px 6px;border-radius:6px;font-size:0.9em;}
91
+ .msg.user .bubble code{background:rgba(255,255,255,0.2);}
92
+ .bubble pre code{background:transparent;padding:0;}
93
+ .code-wrap{position:relative;margin:12px 0;}
94
+ .code-header{display:flex;justify-content:space-between;align-items:center;padding:8px 16px;background:#e5e5ea;border-radius:12px 12px 0 0;border:1px solid rgba(0,0,0,0.05);border-bottom:none;}
95
+ .code-lang-tag{font-size:12px;font-weight:600;color:var(--text-muted);font-family:var(--font-mono);}
96
+ .copy-btn{padding:4px 12px;border-radius:8px;background:#ffffff;border:1px solid rgba(0,0,0,0.1);color:var(--text-main);font-size:11px;font-weight:500;cursor:pointer;transition:all 0.2s;}
97
+ .copy-btn:hover{background:#f5f5f7;}
98
+ .code-wrap pre{border-radius:0 0 12px 12px;margin:0;}
99
+ .think-blk {background: rgba(0, 0, 0, 0.02);border: 1px solid rgba(0, 0, 0, 0.08);border-radius: 12px;padding: 12px 16px;margin-bottom: 14px;box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);transition: all 0.3s ease;}
100
+ .think-blk:hover {background: rgba(0, 0, 0, 0.04);}
101
+ .think-hdr {display: flex;align-items: center;font-size: 13px;font-weight: 600;color: var(--text-muted);cursor: pointer;user-select: none;}
102
+ .think-hdr::before {content: '►';font-size: 10px;margin-right: 10px;transition: transform 0.2s ease;color: #a1a1a6;}
103
+ .think-blk.open .think-hdr::before {transform: rotate(90deg);}
104
+ .think-body {margin-top: 12px;display: none;border-top: 1px dashed rgba(0,0,0,0.1);padding-top: 12px;font-size: 13.5px;color: var(--text-muted);line-height: 1.6;font-family: var(--font-mono);white-space: pre-wrap;}
105
+ .think-blk.open .think-body {display: block;animation: fadeInDown 0.3s ease;}
106
+ @keyframes fadeInDown {from { opacity: 0; transform: translateY(-5px); }to { opacity: 1; transform: translateY(0); }}
107
+ .typing{display:flex;align-items:center;gap:6px;padding:8px 4px;}
108
+ .typing span{width:8px;height:8px;border-radius:50%;background:var(--text-muted);opacity:0.4;animation:bounce 1s ease-in-out infinite;}
109
+ .typing span:nth-child(2){animation-delay:0.2s;}
110
+ .typing span:nth-child(3){animation-delay:0.4s;}
111
+ @keyframes bounce{0%,100%{transform:translateY(0);opacity:0.4;}50%{transform:translateY(-6px);opacity:1;}}
112
+ .input-container{padding:0 40px 30px;background:linear-gradient(to top, var(--bg-color) 70%, transparent);position:relative;z-index:10;}
113
+ .input-wrap{display:flex;align-items:flex-end;gap:12px;background:var(--glass-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--border-light);border-radius:24px;padding:10px 14px 10px 20px;box-shadow:var(--shadow-md);transition:box-shadow 0.3s;}
114
+ .input-wrap:focus-within{box-shadow:0 12px 40px rgba(0,0,0,0.12), 0 0 0 3px rgba(0,113,227,0.1);}
115
+ .chat-ta{flex:1;border:none;outline:none;background:transparent;font-family:var(--font-sans);font-size:15px;color:var(--text-main);line-height:1.5;resize:none;max-height:200px;min-height:24px;padding:10px 0;}
116
+ .chat-ta::placeholder{color:var(--text-muted);}
117
+ .input-acts{display:flex;align-items:center;gap:8px;padding-bottom:6px;}
118
+ .icon-btn{width:36px;height:36px;border-radius:50%;background:#f5f5f7;border:1px solid transparent;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text-muted);font-size:16px;transition:all 0.2s;flex-shrink:0;}
119
+ .icon-btn:hover{background:#e5e5ea;color:var(--text-main);}
120
+ .file-btn{position:relative;}
121
+ .file-btn input{position:absolute;inset:0;opacity:0;cursor:pointer;}
122
+ .send-btn{width:40px;height:40px;border-radius:50%;border:none;background:var(--text-main);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform 0.2s, opacity 0.2s;}
123
+ .send-btn svg{width:18px;height:18px;fill:currentColor;}
124
+ .send-btn:hover{transform:scale(1.05);}
125
+ .send-btn:disabled{opacity:0.3;cursor:not-allowed;transform:none;}
126
+ .input-hint{text-align:center;font-size:11px;color:var(--text-muted);margin-top:12px;font-weight:500;}
127
+ .img-prev{display:none;padding:12px 20px;background:#f5f5f7;border-radius:16px;margin:0 40px 12px;border:1px solid var(--border-light);}
128
+ .img-prev.show{display:flex;align-items:center;gap:12px;}
129
+ .img-th{width:48px;height:48px;object-fit:cover;border-radius:10px;box-shadow:var(--shadow-sm);}
130
+ .img-nm{font-size:13px;font-weight:600;color:var(--text-main);}
131
+ .img-sz{font-size:11px;color:var(--text-muted);}
132
+ .img-rm{margin-left:auto;width:28px;height:28px;border-radius:50%;background:#e5e5ea;border:none;cursor:pointer;color:var(--text-muted);transition:background 0.2s;}
133
+ .img-rm:hover{background:#ff3b30;color:#fff;}
134
+ @media(max-width:768px){
135
+ .shell{grid-template-columns:1fr;}
136
+ .sidebar{display:none;}
137
+ .messages{padding:20px;}
138
+ .input-container{padding:0 20px 20px;}
139
+ .msg{max-width:95%;}
140
+ }
141
+ </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  </head>
143
  <body>
144
+
145
+ <div class="bg">
146
+ <div class="orb orb1"></div>
147
+ <div class="orb orb2"></div>
148
+ </div>
149
+
150
+ <div class="shell">
151
+ <aside class="sidebar">
152
+ <div class="logo-area">
153
+ <div class="logo-row">
154
+ <img src="https://i.ibb.co/5hkfdYHz/Clean-Elegant-Typography-Brand-Logo-20260519-212839-0000.png" alt="Aura Logo" class="logo-img">
155
+ <div class="logo-text">
156
+ <div class="logo-name">Aura Gen 2.0</div>
157
+ <div class="logo-sub">Advanced AI System</div>
158
  </div>
159
+ </div>
160
+ </div>
161
+
162
+ <div class="settings">
163
+ <div class="section-lbl">Preferences</div>
164
+
165
+ <div class="field">
166
+ <span class="field-lbl">System Prompt (Instructions)</span>
167
+ <div class="presets">
168
+ <span class="chip" onclick="setPreset('general')">General</span>
169
+ <span class="chip" onclick="setPreset('code')">Code</span>
170
+ <span class="chip" onclick="setPreset('math')">Math</span>
171
  </div>
172
+ <textarea id="sysPrompt">You are Aura Gen 2.0, a state-of-the-art AI assistant developed by Divy Bhai. You possess world-class expertise in software engineering, advanced algorithmic logic, and complex problem-solving. Always provide highly optimized, secure, and precise solutions.</textarea>
173
+ </div>
174
+
175
+ <div class="sl-wrap">
176
+ <div class="sl-meta"><span class="sl-title">Max Tokens</span><span class="sl-val" id="tokVal">4096</span></div>
177
+ <input type="range" id="tokSl" min="64" max="16384" value="4096" step="64" oninput="document.getElementById('tokVal').textContent=this.value">
178
+ </div>
179
+
180
+ <div class="sl-wrap">
181
+ <div class="sl-meta"><span class="sl-title">Temperature</span><span class="sl-val" id="tempVal">0.60</span></div>
182
+ <input type="range" id="tempSl" min="0" max="1.5" value="0.6" step="0.05" oninput="document.getElementById('tempVal').textContent=parseFloat(this.value).toFixed(2)">
183
+ </div>
184
+
185
+ <button class="clear-btn" onclick="clearChat()">Clear Conversation</button>
186
  </div>
187
+ </aside>
188
 
189
+ <main class="chat-main">
190
+ <header class="chat-hdr">
191
+ <div class="model-badge">
192
+ <div class="status-dot"></div>
193
+ Aura Gen 2.0 Ready
194
+ </div>
195
+ </header>
196
 
197
+ <div class="img-prev" id="imgPrev">
198
+ <img class="img-th" id="imgThumb" src="">
199
+ <div>
200
+ <div class="img-nm" id="imgName">document.pdf</div>
201
+ <div class="img-sz" id="imgSize">0 KB</div>
202
+ </div>
203
+ <button class="img-rm" onclick="removeImg()">✕</button>
204
+ </div>
205
 
206
+ <div class="messages" id="msgs">
207
+ <div class="welcome" id="welcome">
208
+ <img src="https://i.ibb.co/5hkfdYHz/Clean-Elegant-Typography-Brand-Logo-20260519-212839-0000.png" alt="Aura Logo" class="welcome-logo">
209
+ <div class="welcome-title">How can I help you today?</div>
210
+ <div class="welcome-sub">I am Aura Gen 2.0. I specialize in coding, deep reasoning, and complex logic. Upload images or ask anything!</div>
211
+
212
+ <div class="ex-grid">
213
+ <div class="ex-card" onclick="sendEx('Write a modern React component with Tailwind CSS that displays a glass-morphism pricing card.')">
214
+ <div class="ex-title">Code Generation</div>
215
+ <div class="ex-desc">Write optimized, secure code</div>
216
+ </div>
217
+ <div class="ex-card" onclick="sendEx('Explain the Model Context Protocol (MCP) and how it improves AI latency compared to standard REST APIs.')">
218
+ <div class="ex-title">Deep Reasoning</div>
219
+ <div class="ex-desc">Step-by-step technical analysis</div>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ </div>
224
 
225
+ <div class="input-container">
226
+ <div class="input-wrap">
227
+ <textarea class="chat-ta" id="chatInput" placeholder="Message Aura Gen 2.0..." rows="1" onkeydown="handleKey(event)" oninput="autoGrow(this)"></textarea>
228
+ <div class="input-acts">
229
+ <label class="icon-btn file-btn" title="Upload Image or File">
230
+ 📎<input type="file" accept="image/*,audio/*,.txt,.pdf" onchange="handleFile(this)" id="fileInput">
231
+ </label>
232
+ <button class="send-btn" id="sendBtn" onclick="sendMsg()">
233
+ <svg viewBox="0 0 24 24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>
234
+ </button>
235
+ </div>
236
+ </div>
237
+ <div class="input-hint">Aura Gen 2.0 can make mistakes. Consider verifying critical information.</div>
238
+ </div>
239
+ </main>
240
+ </div>
241
 
242
+ <script>
243
+ const S={history:[],pending:null,busy:false,
244
+ presets:{
245
+ general:'You are Aura Gen 2.0, a state-of-the-art AI assistant developed by Divy Bhai. You possess world-class expertise in software engineering, advanced algorithmic logic, and complex problem-solving. Always provide highly optimized, secure, and precise solutions in English by default.',
246
+ code:'You are an expert software engineer. Write clean, efficient, well-commented code. Explain your approach before writing. Use modern best practices.',
247
+ math:'You are a world-class mathematician. Break problems step-by-step. Show full working. Use LaTeX where helpful.'
248
+ }
249
+ };
250
 
251
+ function setPreset(k){document.getElementById('sysPrompt').value=S.presets[k];}
 
 
252
 
253
+ // मल्टीमोडल फ़ाइल हैंडलिंग
254
+ function handleFile(input){
255
+ const f=input.files[0];if(!f)return;
256
+ const r=new FileReader();
257
+ r.onload=e=>{
258
+ const base64Data = e.target.result.split(',')[1];
259
+ let type = 'file';
260
+ if(f.type.startsWith('image/')) type = 'image';
261
+ else if(f.type.startsWith('audio/')) type = 'audio';
262
+
263
+ S.pending={type: type, data: base64Data, name: f.name, size: fmtSz(f.size)};
264
+
265
+ if(type === 'image') {
266
+ document.getElementById('imgThumb').src = e.target.result;
267
+ document.getElementById('imgThumb').style.display='block';
268
+ } else {
269
+ document.getElementById('imgThumb').style.display='none';
270
+ }
271
+ document.getElementById('imgName').textContent=f.name;
272
+ document.getElementById('imgSize').textContent=fmtSz(f.size);
273
+ document.getElementById('imgPrev').classList.add('show');
274
+ };
275
+ r.readAsDataURL(f);
276
+ }
277
+ function removeImg(){S.pending=null;document.getElementById('imgPrev').classList.remove('show');document.getElementById('fileInput').value='';}
278
+ function fmtSz(b){return b<1048576?`${(b/1024).toFixed(0)} KB`:`${(b/1048576).toFixed(1)} MB`;}
279
 
280
+ function handleKey(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendMsg();}}
281
+ function autoGrow(el){el.style.height='auto';el.style.height=Math.min(el.scrollHeight,200)+'px';}
282
+
283
+ // 🌐 नई API कॉलिंग लॉजिक (Flask Backend के लिए)
284
+ async function sendMsg(){
285
+ if(S.busy)return;
286
+ const inp=document.getElementById('chatInput');
287
+ const msg=inp.value.trim();if(!msg && !S.pending)return;
288
+ inp.value='';inp.style.height='auto';
289
+ document.getElementById('sendBtn').disabled=true;
290
+ S.busy=true;
291
+
292
+ const w=document.getElementById('welcome');
293
+ if(w)w.style.display='none';
294
 
295
+ let attachments = [];
296
+ if(S.pending) {
297
+ attachments.push(S.pending);
298
+ appendUser(msg || '[फ़ाइल संलग्न की गई]', '📎 '+S.pending.name);
299
+ } else {
300
+ appendUser(msg);
301
+ }
302
+ removeImg();
303
 
304
+ const botDiv=appendBot();
 
 
305
 
306
+ // साइडबार से वैल्यूज़ लेना
307
+ const sysPrompt = document.getElementById('sysPrompt').value.trim();
308
+ const maxTokens = parseInt(document.getElementById('tokSl').value);
309
+ const temp = parseFloat(document.getElementById('tempSl').value);
 
 
310
 
311
+ const payload = {
312
+ message: msg,
313
+ attachments: attachments,
314
+ system_prompt: sysPrompt,
315
+ max_tokens: maxTokens,
316
+ temperature: temp
317
+ };
318
 
319
+ try{
320
+ const res = await fetch('/api/chat', {
321
+ method: 'POST',
322
+ headers: {'Content-Type': 'application/json'},
323
+ body: JSON.stringify(payload)
324
+ });
325
+
326
+ const reader = res.body.getReader();
327
+ const decoder = new TextDecoder();
328
+ let accumulatedText = "";
329
+
330
+ while (true) {
331
+ const { done, value } = await reader.read();
332
+ if (done) break;
333
+
334
+ const chunk = decoder.decode(value, {stream: true});
335
+ const lines = chunk.split('\n');
336
+
337
+ for (let line of lines) {
338
+ if (line.startsWith('data: ')) {
339
+ const dataStr = line.substring(6);
340
+ if (dataStr.trim() === '[DONE]') continue;
341
+ try {
342
+ const dataObj = JSON.parse(dataStr);
343
+ if (dataObj.choices && dataObj.choices[0].delta.content) {
344
+ accumulatedText += dataObj.choices[0].delta.content;
345
+ renderBot(botDiv, accumulatedText);
346
+ scrollDown();
347
  }
348
+ } catch (e) { }
 
 
349
  }
350
  }
351
+ }
352
+ }catch(err){
353
+ renderBot(botDiv,`**Error:** सर्वर से संपर्क नहीं हो पाया। कृपया दोबारा प्रयास करें।`);
354
+ }
355
+
356
+ S.busy=false;
357
+ document.getElementById('sendBtn').disabled=false;
358
+ scrollDown();
359
+ }
360
+
361
+ function sendEx(t){document.getElementById('chatInput').value=t;sendMsg();}
362
+
363
+ function appendUser(text, badgeText){
364
+ let bHtml = badgeText ? `<div class="pdf-badge">${esc(badgeText)}</div>` : '';
365
+ const el=document.createElement('div');el.className='msg user';
366
+ el.innerHTML=`<div class="avatar">U</div><div class="body">${bHtml}<div class="bubble">${esc(text)}</div></div>`;
367
+ document.getElementById('msgs').appendChild(el);scrollDown();
368
+ }
369
+ function appendBot(){
370
+ const el=document.createElement('div');el.className='msg bot';
371
+ el.innerHTML=`<div class="avatar"><img src="https://i.ibb.co/5hkfdYHz/Clean-Elegant-Typography-Brand-Logo-20260519-212839-0000.png" class="avatar-img"></div><div class="body"><div class="bubble"><div class="typing"><span></span><span></span><span></span></div></div></div>`;
372
+ document.getElementById('msgs').appendChild(el);scrollDown();return el;
373
+ }
374
+
375
+ function renderBot(el, raw) {
376
+ const b = el.querySelector('.bubble');
377
+ let thinkHtml = '';
378
+ let ans = raw;
379
+
380
+ const thinkRegex = /<think>([\s\S]*?)(<\/think>|$)/i;
381
+ let match = raw.match(thinkRegex);
382
+
383
+ if (match) {
384
+ const fullTag = match[0];
385
+ let chain = match[1].replace(/<[^>]+>/g, '').trim();
386
+ ans = raw.replace(fullTag, '').trim();
387
+
388
+ if (match[2] === '') {
389
+ thinkHtml = `<div class="think-blk open" style="border-color:var(--accent)"><div class="think-hdr">Reasoning <span class="typing" style="display:inline-flex;padding:0 4px"><span></span><span></span><span></span></span></div><div class="think-body">${esc(chain)}</div></div>`;
390
+ ans = '';
391
+ } else {
392
+ thinkHtml = `<div class="think-blk" onclick="this.classList.toggle('open')"><div class="think-hdr">Reasoning Process</div><div class="think-body">${esc(chain)}</div></div>`;
393
+ }
394
+ }
395
+
396
+ b.innerHTML = thinkHtml + md(ans);
397
+ }
398
+
399
+ (function setupMarked(){
400
+ if(typeof marked==='undefined')return;
401
+ const renderer=new marked.Renderer();
402
+ renderer.code=(code,lang)=>{
403
+ const language=lang&&hljs.getLanguage(lang)?lang:'plaintext';
404
+ const highlighted=hljs.highlight(code.text||code,{language}).value;
405
+ const escaped=(code.text||code).replace(/'/g,"\\'").replace(/\\n/g,"\\\\n");
406
+ return `<div class="code-wrap"><div class="code-header"><span class="code-lang-tag">${language}</span><button class="copy-btn" onclick="navigator.clipboard.writeText('${escaped}')">Copy</button></div><pre><code class="hljs">${highlighted}</code></pre></div>`;
407
+ };
408
+ marked.setOptions({renderer,breaks:true});
409
+ })();
410
+ function md(t){return marked?marked.parse(t):t;}
411
+ function esc(t){return t.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}
412
+ function scrollDown(){const m=document.getElementById('msgs');m.scrollTop=m.scrollHeight;}
413
+ function clearChat(){S.history=[];document.getElementById('msgs').innerHTML='';location.reload();}
414
+ </script>
415
  </body>
416
  </html>