Spaces:
Running
Running
Vedika commited on
Update index.html
Browse files- index.html +54 -33
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
-
<title>Arjun
|
| 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">
|
|
@@ -19,11 +19,12 @@
|
|
| 19 |
--glass-bg: rgba(255, 255, 255, 0.85); --glass-border: rgba(255, 255, 255, 0.4);
|
| 20 |
--shadow-sm: 0 2px 8px rgba(0,0,0,0.04); --shadow-md: 0 8px 32px rgba(0,0,0,0.08);
|
| 21 |
--shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
|
| 22 |
-
--font-sans: 'Inter', -apple-system, sans-serif;
|
| 23 |
--font-mono: 'Geist Mono', monospace;
|
| 24 |
--radius-lg: 24px; --radius-md: 16px; --radius-sm: 8px;
|
| 25 |
}
|
| 26 |
-
|
|
|
|
| 27 |
|
| 28 |
/* --- BACKGROUND --- */
|
| 29 |
.bg{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background: linear-gradient(135deg, rgba(255,153,51,0.05) 0%, rgba(255,255,255,1) 50%, rgba(19,136,8,0.05) 100%);}
|
|
@@ -46,11 +47,11 @@ html,body{height:100%;overflow:hidden;background:var(--bg-color);color:var(--tex
|
|
| 46 |
.start-btn { padding: 16px 40px; background: var(--text-main); color: #fff; border: none; border-radius: 16px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
|
| 47 |
.start-btn:hover { background: #333; transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
|
| 48 |
|
| 49 |
-
/* --- MAIN LAYOUT
|
| 50 |
-
.shell{position:relative;z-index:1;display:flex;height:
|
| 51 |
.sidebar{width:280px;display:flex;flex-direction:column;background:var(--bg-secondary);border-right:1px solid var(--border-light);flex-shrink:0;z-index:100; transition: left 0.3s ease;}
|
| 52 |
.main-wrapper{flex:1;display:flex;position:relative;overflow:hidden;}
|
| 53 |
-
.chat-main{flex:1;display:flex;flex-direction:column;background:transparent;position:relative;min-width:300px;transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);}
|
| 54 |
.workspace{width:0;background:#fafafa;border-left:1px solid var(--border-light);display:flex;flex-direction:column;transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;box-shadow:-10px 0 30px rgba(0,0,0,0.02);z-index:25;}
|
| 55 |
.workspace.open{width:50%;}
|
| 56 |
|
|
@@ -95,11 +96,13 @@ input:checked + .slider:before {transform: translateX(20px);}
|
|
| 95 |
.clear-btn:hover{background:#fff0f0;color:#ff3b30;border-color:#ff3b30;}
|
| 96 |
|
| 97 |
/* --- CHAT AREA --- */
|
| 98 |
-
.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;z-index:10;}
|
| 99 |
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; color: var(--text-main); cursor: pointer; margin-right: 16px; }
|
| 100 |
.model-badge{font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px;}
|
| 101 |
.status-dot{width:8px;height:8px;border-radius:50%;background:#34c759;box-shadow:0 0 0 2px rgba(52,199,89,0.2);}
|
| 102 |
-
|
|
|
|
|
|
|
| 103 |
.messages::-webkit-scrollbar{width:6px;}
|
| 104 |
.messages::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.1);border-radius:10px;}
|
| 105 |
|
|
@@ -133,7 +136,7 @@ input:checked + .slider:before {transform: translateX(20px);}
|
|
| 133 |
.msg.user .bubble{background:var(--text-main);color:#ffffff;border-radius:20px 20px 4px 20px;box-shadow:var(--shadow-sm);}
|
| 134 |
.msg.bot .bubble{background:#ffffff;border:1px solid var(--border-light);border-radius:4px 20px 20px 20px;box-shadow:var(--shadow-sm);width:100%;}
|
| 135 |
|
| 136 |
-
/* BOT ACTIONS
|
| 137 |
.msg-actions{display:flex;gap:8px;margin-top:4px;padding-left:12px;opacity:0.7;transition:opacity 0.2s;}
|
| 138 |
.msg.bot:hover .msg-actions{opacity:1;}
|
| 139 |
.action-btn{background:var(--bg-secondary);border:1px solid var(--border-light);color:var(--text-main);font-size:12px;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:8px;transition:all 0.2s;}
|
|
@@ -175,8 +178,8 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 175 |
.scroll-bottom-btn.show {opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}
|
| 176 |
.scroll-bottom-btn:hover {background:#fff;transform:translateX(-50%) translateY(-3px);box-shadow:var(--shadow-lg);}
|
| 177 |
|
| 178 |
-
/* --- INPUT AREA --- */
|
| 179 |
-
.input-container{
|
| 180 |
.input-wrap{display:flex;flex-direction:column;background:var(--glass-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--border-light);border-radius:24px;box-shadow:var(--shadow-md);transition:box-shadow 0.3s, border-color 0.3s;}
|
| 181 |
.input-wrap:focus-within{border-color:var(--border-focus);box-shadow:0 12px 40px rgba(0,0,0,0.1), 0 0 0 3px rgba(255,153,51,0.1);}
|
| 182 |
|
|
@@ -189,7 +192,7 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 189 |
.inline-rm:hover{background:#ff3b30;color:#fff;}
|
| 190 |
|
| 191 |
.input-row{display:flex;align-items:flex-end;gap:12px;padding:12px 16px 12px 20px;}
|
| 192 |
-
.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:
|
| 193 |
.chat-ta::placeholder{color:var(--text-muted);}
|
| 194 |
|
| 195 |
.attach-btn{width:38px;height:38px;border-radius:12px;background:transparent;border:1px solid transparent;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text-muted);transition:all 0.2s;position:relative;overflow:hidden;padding-bottom:4px;}
|
|
@@ -237,7 +240,7 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 237 |
.secondary-btn { width: 100%; padding: 12px; background: transparent; color: var(--text-muted); border: none; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px; }
|
| 238 |
.secondary-btn:hover { color: var(--text-main); }
|
| 239 |
|
| 240 |
-
/* --- RESPONSIVE MOBILE ADAPTIVE --- */
|
| 241 |
@media(max-width:850px){
|
| 242 |
.sidebar{position:absolute;left:-280px;z-index:100;height:100%;transition:left 0.3s ease;}
|
| 243 |
.sidebar.show{left:0;box-shadow:var(--shadow-lg);}
|
|
@@ -245,7 +248,7 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 245 |
.close-sidebar-btn { display: block; }
|
| 246 |
.workspace.open{position:absolute;top:0;left:0;width:100%;height:100%;z-index:50;}
|
| 247 |
.messages{padding:20px;}
|
| 248 |
-
.input-container{padding:
|
| 249 |
.msg{max-width:95%;}
|
| 250 |
.scroll-bottom-btn{bottom:110px;}
|
| 251 |
}
|
|
@@ -259,7 +262,7 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 259 |
<!-- GET STARTED WELCOME OVERLAY -->
|
| 260 |
<div class="welcome-overlay" id="welcomeOverlay">
|
| 261 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Logo">
|
| 262 |
-
<h1>Welcome to Arjun
|
| 263 |
<p>Developed by Abhay Kumar. Experience advanced reasoning, secure workspace coding, and high-quality image generation in one place.</p>
|
| 264 |
<button class="start-btn" onclick="startArjunApp()">Get Started</button>
|
| 265 |
</div>
|
|
@@ -276,7 +279,7 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 276 |
<div class="logo-row">
|
| 277 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Logo" class="logo-img">
|
| 278 |
<div class="logo-text">
|
| 279 |
-
<div class="logo-name">ARJUN
|
| 280 |
<div class="logo-sub">Advanced Edition</div>
|
| 281 |
</div>
|
| 282 |
</div>
|
|
@@ -304,7 +307,7 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 304 |
|
| 305 |
<div class="brand-box">
|
| 306 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Identity">
|
| 307 |
-
<h3>Arjun
|
| 308 |
<p>DEVELOPED BY ABHAY KUMAR</p>
|
| 309 |
</div>
|
| 310 |
<button class="clear-btn" onclick="clearMemory()">🗑️ Clear Chat Memory</button>
|
|
@@ -328,7 +331,7 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 328 |
<div class="welcome" id="welcome">
|
| 329 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Logo" class="welcome-logo">
|
| 330 |
<div class="welcome-title">Welcome, User!</div>
|
| 331 |
-
<div class="welcome-sub">I am Arjun
|
| 332 |
|
| 333 |
<div id="guestBadge" class="guest-badge">Guest Mode: <span id="guestCountDisplay">0</span>/3 Queries Used.</div>
|
| 334 |
|
|
@@ -368,19 +371,19 @@ body:not(.show-thinking) .think-box {display: none;}
|
|
| 368 |
<input type="file" accept="*/*" onchange="handleFile(this)" id="fileInput">
|
| 369 |
</button>
|
| 370 |
|
| 371 |
-
<!-- Voice Input Mic -->
|
| 372 |
<button class="attach-btn voice-btn" id="voiceBtn" onclick="toggleVoice()" title="Voice Input">
|
| 373 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" x2="12" y1="19" y2="22"></line></svg>
|
| 374 |
</button>
|
| 375 |
|
| 376 |
-
<textarea class="chat-ta" id="chatInput" placeholder="Message Arjun
|
| 377 |
|
| 378 |
<button class="send-btn" id="sendBtn" onclick="sendMsg()">
|
| 379 |
<svg viewBox="0 0 24 24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>
|
| 380 |
</button>
|
| 381 |
</div>
|
| 382 |
</div>
|
| 383 |
-
<div class="input-hint">Arjun
|
| 384 |
</div>
|
| 385 |
</main>
|
| 386 |
|
|
@@ -482,9 +485,7 @@ function startArjunApp() {
|
|
| 482 |
setTimeout(() => { overlay.style.display = 'none'; }, 400);
|
| 483 |
}
|
| 484 |
|
| 485 |
-
function toggleSidebar() {
|
| 486 |
-
document.getElementById('sidebar').classList.toggle('show');
|
| 487 |
-
}
|
| 488 |
|
| 489 |
function showToast(msg) {
|
| 490 |
const container = document.getElementById('toast-container');
|
|
@@ -499,20 +500,35 @@ function toggleThinking(el) {
|
|
| 499 |
else document.body.classList.remove('show-thinking');
|
| 500 |
}
|
| 501 |
|
| 502 |
-
// --- VOICE RECOGNITION (
|
| 503 |
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
| 504 |
let recognition = null;
|
| 505 |
let isRecording = false;
|
| 506 |
|
| 507 |
if (SpeechRecognition) {
|
| 508 |
recognition = new SpeechRecognition();
|
| 509 |
-
recognition.continuous = false;
|
|
|
|
|
|
|
| 510 |
|
| 511 |
recognition.onstart = () => { isRecording = true; document.getElementById('voiceBtn').classList.add('recording'); };
|
| 512 |
recognition.onresult = (event) => {
|
| 513 |
let transcript = '';
|
| 514 |
-
for (let i = event.resultIndex; i < event.results.length; ++i) {
|
| 515 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
};
|
| 517 |
recognition.onend = () => { isRecording = false; document.getElementById('voiceBtn').classList.remove('recording'); };
|
| 518 |
recognition.onerror = () => { showToast("Voice recognition failed."); };
|
|
@@ -617,7 +633,7 @@ async function fetchHistoryFromGAS() {
|
|
| 617 |
S.history.forEach(msg => {
|
| 618 |
if(msg.role === 'user') appendUserDOM(msg.content, msg.badge);
|
| 619 |
else {
|
| 620 |
-
window.isStreamingGlobalFlag = false;
|
| 621 |
appendBotDOM(msg.content, true);
|
| 622 |
}
|
| 623 |
});
|
|
@@ -816,22 +832,27 @@ async function sendMsg(){
|
|
| 816 |
document.getElementById('msgs').appendChild(botDiv);
|
| 817 |
forceScrollDown();
|
| 818 |
|
| 819 |
-
const sysPrompt = `You are Arjun
|
| 820 |
Always communicate respectfully.
|
| 821 |
|
| 822 |
CRITICAL IMAGE GENERATION PROTOCOL:
|
| 823 |
If the user asks to generate, create, or draw an image/photo, you MUST generate the image by responding with a markdown image tag using Pollinations AI.
|
| 824 |
-
Format to use: ![Arjun
|
| 825 |
Available models for {MODEL}: flux, flux-realism, flux-anime, flux-3d.
|
| 826 |
Choose the best model based on the prompt. Example: if user says anime, use flux-anime.
|
| 827 |
Always include this markdown tag when image generation is requested.`;
|
| 828 |
|
| 829 |
-
// FIXED:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 830 |
const payload = {
|
| 831 |
message: backendPayloadMsg,
|
| 832 |
attachments: attachments,
|
| 833 |
system_prompt: sysPrompt,
|
| 834 |
-
history:
|
| 835 |
max_tokens: 4096,
|
| 836 |
temperature: 0.7
|
| 837 |
};
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
+
<title>Arjun 2.O - Advanced AI</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">
|
|
|
|
| 19 |
--glass-bg: rgba(255, 255, 255, 0.85); --glass-border: rgba(255, 255, 255, 0.4);
|
| 20 |
--shadow-sm: 0 2px 8px rgba(0,0,0,0.04); --shadow-md: 0 8px 32px rgba(0,0,0,0.08);
|
| 21 |
--shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
|
| 22 |
+
--font-serif: 'Instrument Serif', serif; --font-sans: 'Inter', -apple-system, sans-serif;
|
| 23 |
--font-mono: 'Geist Mono', monospace;
|
| 24 |
--radius-lg: 24px; --radius-md: 16px; --radius-sm: 8px;
|
| 25 |
}
|
| 26 |
+
/* Fixed UI layout hiding issue using 100dvh */
|
| 27 |
+
html,body{height:100dvh;overflow:hidden;background:var(--bg-color);color:var(--text-main);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;}
|
| 28 |
|
| 29 |
/* --- BACKGROUND --- */
|
| 30 |
.bg{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background: linear-gradient(135deg, rgba(255,153,51,0.05) 0%, rgba(255,255,255,1) 50%, rgba(19,136,8,0.05) 100%);}
|
|
|
|
| 47 |
.start-btn { padding: 16px 40px; background: var(--text-main); color: #fff; border: none; border-radius: 16px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
|
| 48 |
.start-btn:hover { background: #333; transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
|
| 49 |
|
| 50 |
+
/* --- MAIN LAYOUT --- */
|
| 51 |
+
.shell{position:relative;z-index:1;display:flex;height:100dvh;width:100vw;overflow:hidden;}
|
| 52 |
.sidebar{width:280px;display:flex;flex-direction:column;background:var(--bg-secondary);border-right:1px solid var(--border-light);flex-shrink:0;z-index:100; transition: left 0.3s ease;}
|
| 53 |
.main-wrapper{flex:1;display:flex;position:relative;overflow:hidden;}
|
| 54 |
+
.chat-main{flex:1;display:flex;flex-direction:column;background:transparent;position:relative;min-width:300px;transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1); height: 100%;}
|
| 55 |
.workspace{width:0;background:#fafafa;border-left:1px solid var(--border-light);display:flex;flex-direction:column;transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;box-shadow:-10px 0 30px rgba(0,0,0,0.02);z-index:25;}
|
| 56 |
.workspace.open{width:50%;}
|
| 57 |
|
|
|
|
| 96 |
.clear-btn:hover{background:#fff0f0;color:#ff3b30;border-color:#ff3b30;}
|
| 97 |
|
| 98 |
/* --- CHAT AREA --- */
|
| 99 |
+
.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;z-index:10;flex-shrink:0;}
|
| 100 |
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; color: var(--text-main); cursor: pointer; margin-right: 16px; }
|
| 101 |
.model-badge{font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px;}
|
| 102 |
.status-dot{width:8px;height:8px;border-radius:50%;background:#34c759;box-shadow:0 0 0 2px rgba(52,199,89,0.2);}
|
| 103 |
+
|
| 104 |
+
/* Added min-height: 0 to ensure flexbox scrolling works properly */
|
| 105 |
+
.messages{flex:1;overflow-y:auto;padding:30px 40px;display:flex;flex-direction:column;gap:24px;scroll-behavior:smooth;position:relative; min-height:0;}
|
| 106 |
.messages::-webkit-scrollbar{width:6px;}
|
| 107 |
.messages::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.1);border-radius:10px;}
|
| 108 |
|
|
|
|
| 136 |
.msg.user .bubble{background:var(--text-main);color:#ffffff;border-radius:20px 20px 4px 20px;box-shadow:var(--shadow-sm);}
|
| 137 |
.msg.bot .bubble{background:#ffffff;border:1px solid var(--border-light);border-radius:4px 20px 20px 20px;box-shadow:var(--shadow-sm);width:100%;}
|
| 138 |
|
| 139 |
+
/* BOT ACTIONS */
|
| 140 |
.msg-actions{display:flex;gap:8px;margin-top:4px;padding-left:12px;opacity:0.7;transition:opacity 0.2s;}
|
| 141 |
.msg.bot:hover .msg-actions{opacity:1;}
|
| 142 |
.action-btn{background:var(--bg-secondary);border:1px solid var(--border-light);color:var(--text-main);font-size:12px;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:8px;transition:all 0.2s;}
|
|
|
|
| 178 |
.scroll-bottom-btn.show {opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}
|
| 179 |
.scroll-bottom-btn:hover {background:#fff;transform:translateX(-50%) translateY(-3px);box-shadow:var(--shadow-lg);}
|
| 180 |
|
| 181 |
+
/* --- INPUT AREA (Fixed Position to Avoid Overlap) --- */
|
| 182 |
+
.input-container{flex-shrink:0; padding:10px 40px 24px; background:var(--bg-color); border-top:1px solid var(--border-light); position:relative; z-index:20;}
|
| 183 |
.input-wrap{display:flex;flex-direction:column;background:var(--glass-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--border-light);border-radius:24px;box-shadow:var(--shadow-md);transition:box-shadow 0.3s, border-color 0.3s;}
|
| 184 |
.input-wrap:focus-within{border-color:var(--border-focus);box-shadow:0 12px 40px rgba(0,0,0,0.1), 0 0 0 3px rgba(255,153,51,0.1);}
|
| 185 |
|
|
|
|
| 192 |
.inline-rm:hover{background:#ff3b30;color:#fff;}
|
| 193 |
|
| 194 |
.input-row{display:flex;align-items:flex-end;gap:12px;padding:12px 16px 12px 20px;}
|
| 195 |
+
.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:150px;min-height:24px;padding:8px 0;}
|
| 196 |
.chat-ta::placeholder{color:var(--text-muted);}
|
| 197 |
|
| 198 |
.attach-btn{width:38px;height:38px;border-radius:12px;background:transparent;border:1px solid transparent;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text-muted);transition:all 0.2s;position:relative;overflow:hidden;padding-bottom:4px;}
|
|
|
|
| 240 |
.secondary-btn { width: 100%; padding: 12px; background: transparent; color: var(--text-muted); border: none; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px; }
|
| 241 |
.secondary-btn:hover { color: var(--text-main); }
|
| 242 |
|
| 243 |
+
/* --- RESPONSIVE MOBILE ADAPTIVE (Perfect fit fix) --- */
|
| 244 |
@media(max-width:850px){
|
| 245 |
.sidebar{position:absolute;left:-280px;z-index:100;height:100%;transition:left 0.3s ease;}
|
| 246 |
.sidebar.show{left:0;box-shadow:var(--shadow-lg);}
|
|
|
|
| 248 |
.close-sidebar-btn { display: block; }
|
| 249 |
.workspace.open{position:absolute;top:0;left:0;width:100%;height:100%;z-index:50;}
|
| 250 |
.messages{padding:20px;}
|
| 251 |
+
.input-container{padding:10px 15px 15px;}
|
| 252 |
.msg{max-width:95%;}
|
| 253 |
.scroll-bottom-btn{bottom:110px;}
|
| 254 |
}
|
|
|
|
| 262 |
<!-- GET STARTED WELCOME OVERLAY -->
|
| 263 |
<div class="welcome-overlay" id="welcomeOverlay">
|
| 264 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Logo">
|
| 265 |
+
<h1>Welcome to Arjun 2.O</h1>
|
| 266 |
<p>Developed by Abhay Kumar. Experience advanced reasoning, secure workspace coding, and high-quality image generation in one place.</p>
|
| 267 |
<button class="start-btn" onclick="startArjunApp()">Get Started</button>
|
| 268 |
</div>
|
|
|
|
| 279 |
<div class="logo-row">
|
| 280 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Logo" class="logo-img">
|
| 281 |
<div class="logo-text">
|
| 282 |
+
<div class="logo-name">ARJUN 2.O</div>
|
| 283 |
<div class="logo-sub">Advanced Edition</div>
|
| 284 |
</div>
|
| 285 |
</div>
|
|
|
|
| 307 |
|
| 308 |
<div class="brand-box">
|
| 309 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Identity">
|
| 310 |
+
<h3>Arjun 2.O</h3>
|
| 311 |
<p>DEVELOPED BY ABHAY KUMAR</p>
|
| 312 |
</div>
|
| 313 |
<button class="clear-btn" onclick="clearMemory()">🗑️ Clear Chat Memory</button>
|
|
|
|
| 331 |
<div class="welcome" id="welcome">
|
| 332 |
<img src="https://i.ibb.co/0y2sdbq6/PT-20260523-133251-0000.png" alt="Arjun Logo" class="welcome-logo">
|
| 333 |
<div class="welcome-title">Welcome, User!</div>
|
| 334 |
+
<div class="welcome-sub">I am Arjun 2.O, developed by Abhay Kumar. I am equipped with advanced reasoning, workspace coding, and image generation.</div>
|
| 335 |
|
| 336 |
<div id="guestBadge" class="guest-badge">Guest Mode: <span id="guestCountDisplay">0</span>/3 Queries Used.</div>
|
| 337 |
|
|
|
|
| 371 |
<input type="file" accept="*/*" onchange="handleFile(this)" id="fileInput">
|
| 372 |
</button>
|
| 373 |
|
| 374 |
+
<!-- Voice Input Mic (Fixed Punctuation) -->
|
| 375 |
<button class="attach-btn voice-btn" id="voiceBtn" onclick="toggleVoice()" title="Voice Input">
|
| 376 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" x2="12" y1="19" y2="22"></line></svg>
|
| 377 |
</button>
|
| 378 |
|
| 379 |
+
<textarea class="chat-ta" id="chatInput" placeholder="Message Arjun 2.O..." rows="1" onkeydown="handleKey(event)" oninput="autoGrow(this)"></textarea>
|
| 380 |
|
| 381 |
<button class="send-btn" id="sendBtn" onclick="sendMsg()">
|
| 382 |
<svg viewBox="0 0 24 24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>
|
| 383 |
</button>
|
| 384 |
</div>
|
| 385 |
</div>
|
| 386 |
+
<div class="input-hint">Arjun 2.O is engineered for extreme performance. Developed by Abhay Kumar.</div>
|
| 387 |
</div>
|
| 388 |
</main>
|
| 389 |
|
|
|
|
| 485 |
setTimeout(() => { overlay.style.display = 'none'; }, 400);
|
| 486 |
}
|
| 487 |
|
| 488 |
+
function toggleSidebar() { document.getElementById('sidebar').classList.toggle('show'); }
|
|
|
|
|
|
|
| 489 |
|
| 490 |
function showToast(msg) {
|
| 491 |
const container = document.getElementById('toast-container');
|
|
|
|
| 500 |
else document.body.classList.remove('show-thinking');
|
| 501 |
}
|
| 502 |
|
| 503 |
+
// --- VOICE RECOGNITION (SMART PUNCTUATION LOGIC) ---
|
| 504 |
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
| 505 |
let recognition = null;
|
| 506 |
let isRecording = false;
|
| 507 |
|
| 508 |
if (SpeechRecognition) {
|
| 509 |
recognition = new SpeechRecognition();
|
| 510 |
+
recognition.continuous = false; // Auto stops when paused
|
| 511 |
+
recognition.interimResults = false;
|
| 512 |
+
recognition.lang = 'hi-IN'; // Set to Hindi/English mix support usually
|
| 513 |
|
| 514 |
recognition.onstart = () => { isRecording = true; document.getElementById('voiceBtn').classList.add('recording'); };
|
| 515 |
recognition.onresult = (event) => {
|
| 516 |
let transcript = '';
|
| 517 |
+
for (let i = event.resultIndex; i < event.results.length; ++i) {
|
| 518 |
+
transcript += event.results[i][0].transcript;
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
// Smart Punctuation & Capitalization Fix
|
| 522 |
+
transcript = transcript.trim();
|
| 523 |
+
if(transcript.length > 0) {
|
| 524 |
+
transcript = transcript.charAt(0).toUpperCase() + transcript.slice(1);
|
| 525 |
+
if (!/[.!?।]$/.test(transcript)) transcript += '.';
|
| 526 |
+
transcript += ' ';
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
const inp = document.getElementById('chatInput');
|
| 530 |
+
inp.value = (inp.value + ' ' + transcript).trim();
|
| 531 |
+
autoGrow(inp);
|
| 532 |
};
|
| 533 |
recognition.onend = () => { isRecording = false; document.getElementById('voiceBtn').classList.remove('recording'); };
|
| 534 |
recognition.onerror = () => { showToast("Voice recognition failed."); };
|
|
|
|
| 633 |
S.history.forEach(msg => {
|
| 634 |
if(msg.role === 'user') appendUserDOM(msg.content, msg.badge);
|
| 635 |
else {
|
| 636 |
+
window.isStreamingGlobalFlag = false;
|
| 637 |
appendBotDOM(msg.content, true);
|
| 638 |
}
|
| 639 |
});
|
|
|
|
| 832 |
document.getElementById('msgs').appendChild(botDiv);
|
| 833 |
forceScrollDown();
|
| 834 |
|
| 835 |
+
const sysPrompt = `You are Arjun 2.O, a state-of-the-art AI assistant developed by Abhay Kumar.
|
| 836 |
Always communicate respectfully.
|
| 837 |
|
| 838 |
CRITICAL IMAGE GENERATION PROTOCOL:
|
| 839 |
If the user asks to generate, create, or draw an image/photo, you MUST generate the image by responding with a markdown image tag using Pollinations AI.
|
| 840 |
+
Format to use: 
|
| 841 |
Available models for {MODEL}: flux, flux-realism, flux-anime, flux-3d.
|
| 842 |
Choose the best model based on the prompt. Example: if user says anime, use flux-anime.
|
| 843 |
Always include this markdown tag when image generation is requested.`;
|
| 844 |
|
| 845 |
+
// FIXED MEMORY BUG: Creating a clean history map that removes custom properties like 'badge' which breaks the HuggingFace API.
|
| 846 |
+
const cleanHistory = S.history.slice(0, -1).map(item => ({
|
| 847 |
+
role: item.role,
|
| 848 |
+
content: item.content
|
| 849 |
+
}));
|
| 850 |
+
|
| 851 |
const payload = {
|
| 852 |
message: backendPayloadMsg,
|
| 853 |
attachments: attachments,
|
| 854 |
system_prompt: sysPrompt,
|
| 855 |
+
history: cleanHistory,
|
| 856 |
max_tokens: 4096,
|
| 857 |
temperature: 0.7
|
| 858 |
};
|