Spaces:
Running
Running
Vedika commited on
Update index.html
Browse files- index.html +13 -16
index.html
CHANGED
|
@@ -10,11 +10,10 @@
|
|
| 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: #FF9933;
|
| 18 |
--accent-hover: #e68a2e; --border-light: rgba(0, 0, 0, 0.08);
|
| 19 |
--glass-bg: rgba(255, 255, 255, 0.75); --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);
|
|
@@ -23,13 +22,13 @@
|
|
| 23 |
}
|
| 24 |
html,body{height:100%;overflow:hidden;background:var(--bg-color);color:var(--text-main);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;}
|
| 25 |
|
| 26 |
-
/*
|
| 27 |
-
.bg{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background: linear-gradient(135deg, rgba(255,153,51,0.
|
| 28 |
-
.orb{position:absolute;border-radius:50%;filter:blur(
|
| 29 |
-
/* Saffron Orb */
|
| 30 |
-
.orb1{width:600px;height:600px;background:radial-gradient(circle,rgba(255,153,51,0.
|
| 31 |
-
/* Green Orb */
|
| 32 |
-
.orb2{width:500px;height:500px;background:radial-gradient(circle,rgba(19,136,8,0.
|
| 33 |
|
| 34 |
@keyframes drift{0%{transform:translate(0,0) scale(1);}100%{transform:translate(80px,50px) scale(1.1);}}
|
| 35 |
.shell{position:relative;z-index:1;display:grid;grid-template-columns:280px 1fr;height:100vh;}
|
|
@@ -45,7 +44,6 @@ html,body{height:100%;overflow:hidden;background:var(--bg-color);color:var(--tex
|
|
| 45 |
.settings::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.15);border-radius:10px;}
|
| 46 |
.section-lbl{font-size:11px;font-weight:600;letter-spacing:1px;text-transform:uppercase;color:var(--text-muted);margin-bottom:12px;}
|
| 47 |
|
| 48 |
-
/* Brand Box replacing settings */
|
| 49 |
.brand-box {background: #ffffff;border: 1px solid var(--border-light);border-radius: var(--radius-md);padding: 20px;text-align: center;box-shadow: var(--shadow-sm);margin-bottom:auto;}
|
| 50 |
.brand-box img {width: 80px; height: 80px; border-radius: 16px; object-fit: cover; margin-bottom: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);}
|
| 51 |
.brand-box h3 {font-family: var(--font-sans); font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 6px; letter-spacing: 0.5px;}
|
|
@@ -227,7 +225,6 @@ html,body{height:100%;overflow:hidden;background:var(--bg-color);color:var(--tex
|
|
| 227 |
<script>
|
| 228 |
const S={history:[],pending:null,busy:false};
|
| 229 |
|
| 230 |
-
// मल्टीमोडल फ़ाइल हैंडलिंग
|
| 231 |
function handleFile(input){
|
| 232 |
const f=input.files[0];if(!f)return;
|
| 233 |
const r=new FileReader();
|
|
@@ -257,7 +254,6 @@ function fmtSz(b){return b<1048576?`${(b/1024).toFixed(0)} KB`:`${(b/1048576).to
|
|
| 257 |
function handleKey(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendMsg();}}
|
| 258 |
function autoGrow(el){el.style.height='auto';el.style.height=Math.min(el.scrollHeight,200)+'px';}
|
| 259 |
|
| 260 |
-
// 🌐 नई API कॉलिंग लॉजिक (Flask Backend के लिए)
|
| 261 |
async function sendMsg(){
|
| 262 |
if(S.busy)return;
|
| 263 |
const inp=document.getElementById('chatInput');
|
|
@@ -280,7 +276,6 @@ async function sendMsg(){
|
|
| 280 |
|
| 281 |
const botDiv=appendBot();
|
| 282 |
|
| 283 |
-
// चूंकि सेटिंग्स UI से हटा दी गई हैं, इसलिए बैकएंड के लिए इन्हें यहाँ सुरक्षित रूप से डिफ़ॉल्ट सेट किया गया है ताकि कोई फीचर ब्रेक न हो
|
| 284 |
const sysPrompt = "You are TIRANGA, 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.";
|
| 285 |
const maxTokens = 4096;
|
| 286 |
const temp = 0.60;
|
|
@@ -373,14 +368,16 @@ function renderBot(el, raw) {
|
|
| 373 |
b.innerHTML = thinkHtml + md(ans);
|
| 374 |
}
|
| 375 |
|
|
|
|
| 376 |
(function setupMarked(){
|
| 377 |
if(typeof marked==='undefined')return;
|
| 378 |
const renderer=new marked.Renderer();
|
| 379 |
renderer.code=(code,lang)=>{
|
| 380 |
const language=lang&&hljs.getLanguage(lang)?lang:'plaintext';
|
| 381 |
-
const
|
| 382 |
-
const
|
| 383 |
-
|
|
|
|
| 384 |
};
|
| 385 |
marked.setOptions({renderer,breaks:true});
|
| 386 |
})();
|
|
|
|
| 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 |
*{margin:0;padding:0;box-sizing:border-box;}
|
| 14 |
:root{
|
| 15 |
--bg-color: #ffffff; --bg-secondary: #f5f5f7; --text-main: #1d1d1f; --text-muted: #86868b;
|
| 16 |
+
--accent: #FF9933;
|
| 17 |
--accent-hover: #e68a2e; --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);
|
|
|
|
| 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 |
|
| 25 |
+
/* बेहतरीन तिरंगा बैकग्राउंड शेड (Visibility बढ़ाई गई है) */
|
| 26 |
+
.bg{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background: linear-gradient(135deg, rgba(255,153,51,0.08) 0%, rgba(255,255,255,1) 50%, rgba(19,136,8,0.08) 100%);}
|
| 27 |
+
.orb{position:absolute;border-radius:50%;filter:blur(90px);opacity:0.6;animation:drift 25s ease-in-out infinite alternate;}
|
| 28 |
+
/* केसरिया (Saffron) Orb */
|
| 29 |
+
.orb1{width:600px;height:600px;background:radial-gradient(circle,rgba(255,153,51,0.25),transparent 70%);top:-150px;left:-100px;}
|
| 30 |
+
/* हरा (Green) Orb */
|
| 31 |
+
.orb2{width:500px;height:500px;background:radial-gradient(circle,rgba(19,136,8,0.22),transparent 70%);bottom:-100px;right:-100px;animation-delay:-10s;}
|
| 32 |
|
| 33 |
@keyframes drift{0%{transform:translate(0,0) scale(1);}100%{transform:translate(80px,50px) scale(1.1);}}
|
| 34 |
.shell{position:relative;z-index:1;display:grid;grid-template-columns:280px 1fr;height:100vh;}
|
|
|
|
| 44 |
.settings::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.15);border-radius:10px;}
|
| 45 |
.section-lbl{font-size:11px;font-weight:600;letter-spacing:1px;text-transform:uppercase;color:var(--text-muted);margin-bottom:12px;}
|
| 46 |
|
|
|
|
| 47 |
.brand-box {background: #ffffff;border: 1px solid var(--border-light);border-radius: var(--radius-md);padding: 20px;text-align: center;box-shadow: var(--shadow-sm);margin-bottom:auto;}
|
| 48 |
.brand-box img {width: 80px; height: 80px; border-radius: 16px; object-fit: cover; margin-bottom: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);}
|
| 49 |
.brand-box h3 {font-family: var(--font-sans); font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 6px; letter-spacing: 0.5px;}
|
|
|
|
| 225 |
<script>
|
| 226 |
const S={history:[],pending:null,busy:false};
|
| 227 |
|
|
|
|
| 228 |
function handleFile(input){
|
| 229 |
const f=input.files[0];if(!f)return;
|
| 230 |
const r=new FileReader();
|
|
|
|
| 254 |
function handleKey(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendMsg();}}
|
| 255 |
function autoGrow(el){el.style.height='auto';el.style.height=Math.min(el.scrollHeight,200)+'px';}
|
| 256 |
|
|
|
|
| 257 |
async function sendMsg(){
|
| 258 |
if(S.busy)return;
|
| 259 |
const inp=document.getElementById('chatInput');
|
|
|
|
| 276 |
|
| 277 |
const botDiv=appendBot();
|
| 278 |
|
|
|
|
| 279 |
const sysPrompt = "You are TIRANGA, 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.";
|
| 280 |
const maxTokens = 4096;
|
| 281 |
const temp = 0.60;
|
|
|
|
| 368 |
b.innerHTML = thinkHtml + md(ans);
|
| 369 |
}
|
| 370 |
|
| 371 |
+
/* कॉपी बटन के HTML ब्रेक होने के बग को यहीं फिक्स किया गया है (encodeURIComponent का उपयोग करके) */
|
| 372 |
(function setupMarked(){
|
| 373 |
if(typeof marked==='undefined')return;
|
| 374 |
const renderer=new marked.Renderer();
|
| 375 |
renderer.code=(code,lang)=>{
|
| 376 |
const language=lang&&hljs.getLanguage(lang)?lang:'plaintext';
|
| 377 |
+
const rawCode = code.text||code;
|
| 378 |
+
const highlighted=hljs.highlight(rawCode,{language}).value;
|
| 379 |
+
const encoded = encodeURIComponent(rawCode).replace(/'/g, "%27");
|
| 380 |
+
return `<div class="code-wrap"><div class="code-header"><span class="code-lang-tag">${language}</span><button class="copy-btn" onclick="navigator.clipboard.writeText(decodeURIComponent('${encoded}'))">Copy</button></div><pre><code class="hljs">${highlighted}</code></pre></div>`;
|
| 381 |
};
|
| 382 |
marked.setOptions({renderer,breaks:true});
|
| 383 |
})();
|