Spaces:
Running
Running
Vedika commited on
Update index.html
Browse files- index.html +36 -24
index.html
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
|
|
| 1 |
<html lang="en">
|
| 2 |
<head>
|
| 3 |
<meta charset="UTF-8">
|
| 4 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 5 |
<title>CODE VED | Engineered by Divy Patel</title>
|
| 6 |
<meta name="description" content="CODE VED - 202 Billion Parameter Enterprise AI System">
|
| 7 |
|
|
@@ -47,9 +48,13 @@
|
|
| 47 |
|
| 48 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
font-family: var(--font-ui); background-color: var(--bg-main); color: var(--text-primary);
|
| 52 |
-
|
| 53 |
}
|
| 54 |
|
| 55 |
button { background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; }
|
|
@@ -65,6 +70,7 @@
|
|
| 65 |
.sidebar {
|
| 66 |
width: 260px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-light);
|
| 67 |
display: flex; flex-direction: column; transition: transform 0.3s ease, width 0.3s ease; z-index: 100;
|
|
|
|
| 68 |
}
|
| 69 |
.sidebar.collapsed { margin-left: -260px; }
|
| 70 |
|
|
@@ -89,17 +95,19 @@
|
|
| 89 |
.user-sub { font-size: 11px; font-weight: 500; color: var(--text-tertiary); margin-top: 2px; }
|
| 90 |
|
| 91 |
/* --- MAIN WORKSPACE --- */
|
| 92 |
-
|
|
|
|
| 93 |
|
| 94 |
-
.top-bar { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
|
| 95 |
.btn-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: 0.2s; }
|
| 96 |
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
|
| 97 |
-
.btn-icon svg { width: 18px; height: 18px; }
|
| 98 |
|
| 99 |
.model-selector { font-size: 14px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
|
| 100 |
|
| 101 |
/* --- CHAT CONTAINER --- */
|
| 102 |
-
|
|
|
|
| 103 |
|
| 104 |
.welcome-center { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; animation: fadeIn 0.5s ease; }
|
| 105 |
.welcome-center img { width: 70px; height: 70px; border-radius: 18px; margin-bottom: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
|
|
@@ -125,8 +133,9 @@
|
|
| 125 |
.chat-img-preview { max-width: 250px; border-radius: var(--radius-md); border: 1px solid var(--border-light); margin-bottom: 10px; }
|
| 126 |
|
| 127 |
/* --- INPUT DOCK --- */
|
| 128 |
-
|
| 129 |
-
.input-
|
|
|
|
| 130 |
.input-container:focus-within { border-color: var(--border-focus); background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
|
| 131 |
|
| 132 |
.file-preview-bar { display: none; padding: 8px 8px 12px; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-light); margin-bottom: 8px; }
|
|
@@ -135,30 +144,31 @@
|
|
| 135 |
.file-preview-name { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
|
| 136 |
.btn-remove-file { width: 24px; height: 24px; border-radius: 50%; background: #ffe6e6; color: #cc0000; display: flex; align-items: center; justify-content: center; }
|
| 137 |
|
| 138 |
-
.input-row { display: flex; align-items: flex-end; gap: 8px; }
|
| 139 |
.tools-left { display: flex; gap: 4px; }
|
| 140 |
-
.tool-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: 0.2s; position: relative; }
|
| 141 |
.tool-btn:hover { background: #e5e5e5; color: var(--text-primary); }
|
| 142 |
.tool-btn svg { width: 18px; height: 18px; }
|
| 143 |
.tool-btn.recording { color: #e60000; animation: pulse 1.5s infinite; }
|
| 144 |
|
| 145 |
-
.chat-input { flex: 1; padding: 7px 4px; font-size: 15px; resize: none; max-height:
|
| 146 |
.chat-input::placeholder { color: var(--text-tertiary); }
|
| 147 |
|
| 148 |
-
.btn-send { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-color); color: #fff; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
|
| 149 |
.btn-send svg { width: 16px; height: 16px; transform: translateX(-1px); }
|
| 150 |
.btn-send:hover { background: #000; transform: translateY(-1px); }
|
| 151 |
.btn-send:disabled { background: #ccc; cursor: not-allowed; transform: none; }
|
| 152 |
|
| 153 |
.hidden-input { display: none; }
|
| 154 |
-
|
|
|
|
| 155 |
.dropdown-menu.active { display: flex; animation: fadeIn 0.2s; }
|
| 156 |
.dropdown-item { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: 0.2s; }
|
| 157 |
.dropdown-item:hover { background: var(--bg-hover); }
|
| 158 |
|
| 159 |
-
/* --- SECURE AUTHENTICATION MODAL
|
| 160 |
.auth-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 2000; }
|
| 161 |
-
.auth-modal { background: #fff; width:
|
| 162 |
.auth-close { position: absolute; top: 16px; right: 16px; color: var(--text-secondary); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: 0.2s; }
|
| 163 |
.auth-close:hover { background: var(--bg-hover); color: var(--text-primary); }
|
| 164 |
|
|
@@ -216,13 +226,14 @@
|
|
| 216 |
.sidebar { position: absolute; left: 0; height: 100%; box-shadow: 5px 0 20px rgba(0,0,0,0.05); }
|
| 217 |
.sidebar.collapsed { left: -260px; margin-left: 0; }
|
| 218 |
.workspace-panel.active { width: 100%; position: absolute; top:0; left:0; height:100%; z-index: 1000; }
|
|
|
|
| 219 |
}
|
| 220 |
</style>
|
| 221 |
</head>
|
| 222 |
<body>
|
| 223 |
|
| 224 |
<!-- SIDEBAR -->
|
| 225 |
-
<aside class="sidebar" id="sidebar">
|
| 226 |
<div class="sidebar-header">
|
| 227 |
<button class="btn-icon" onclick="UI.toggleSidebar()" title="Close Sidebar">
|
| 228 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><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>
|
|
@@ -252,7 +263,7 @@
|
|
| 252 |
<!-- MAIN AREA -->
|
| 253 |
<main class="main-area">
|
| 254 |
<header class="top-bar">
|
| 255 |
-
<button class="btn-icon" onclick="UI.toggleSidebar()" title="Open Menu" id="btnMenuOpen"
|
| 256 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><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>
|
| 257 |
</button>
|
| 258 |
<div class="model-selector">CODE VED 202B</div>
|
|
@@ -384,7 +395,7 @@
|
|
| 384 |
// --- 1. CONFIG & STATE ---
|
| 385 |
const Config = {
|
| 386 |
GAS_URL: "https://script.google.com/macros/s/AKfycbz5vrlB4GrfkfBVYdQ52IQweIXC1cNDwKuTUorxdAiOdSSIrH55mzJlaz9kq1Y94ot5/exec",
|
| 387 |
-
API_ENDPOINT: "/api/chat", //
|
| 388 |
LOGO: "https://i.ibb.co/MyYStcGP/TIRANGA-20260613-131924-0000.png"
|
| 389 |
};
|
| 390 |
|
|
@@ -409,7 +420,7 @@
|
|
| 409 |
btnOpen.style.display = sb.classList.contains('collapsed') ? 'flex' : 'none';
|
| 410 |
},
|
| 411 |
toggleAttachMenu: () => document.getElementById('attachMenu').classList.toggle('active'),
|
| 412 |
-
autoGrow: (el) => { el.style.height = 'auto'; el.style.height = Math.min(el.scrollHeight,
|
| 413 |
scrollToBottom: () => { const c = document.getElementById('chatContainer'); c.scrollTop = c.scrollHeight; },
|
| 414 |
escape: (s) => s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'),
|
| 415 |
showAuthMsg: (msg, isError=true) => {
|
|
@@ -575,7 +586,7 @@
|
|
| 575 |
} else {
|
| 576 |
r.onload = (e) => {
|
| 577 |
let data = e.target.result;
|
| 578 |
-
// Safe HTML sanitization
|
| 579 |
if(file.name.endsWith('.html')) {
|
| 580 |
data = data.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "\n[SCRIPT SANITIZED]\n");
|
| 581 |
}
|
|
@@ -628,7 +639,7 @@
|
|
| 628 |
}
|
| 629 |
};
|
| 630 |
|
| 631 |
-
// --- 6. WORKSPACE PRO MAX
|
| 632 |
const Workspace = {
|
| 633 |
open: (id) => {
|
| 634 |
State.currentWs = id;
|
|
@@ -824,9 +835,10 @@
|
|
| 824 |
|
| 825 |
window.onload = () => {
|
| 826 |
Auth.init();
|
| 827 |
-
|
|
|
|
| 828 |
};
|
| 829 |
|
| 830 |
</script>
|
| 831 |
</body>
|
| 832 |
-
</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, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
| 6 |
<title>CODE VED | Engineered by Divy Patel</title>
|
| 7 |
<meta name="description" content="CODE VED - 202 Billion Parameter Enterprise AI System">
|
| 8 |
|
|
|
|
| 48 |
|
| 49 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 50 |
|
| 51 |
+
/* BUG FIX: Changed from 100vh to 100dvh for mobile/tablet browser compatibility */
|
| 52 |
+
html, body {
|
| 53 |
+
height: 100%;
|
| 54 |
+
height: 100dvh;
|
| 55 |
+
width: 100vw;
|
| 56 |
font-family: var(--font-ui); background-color: var(--bg-main); color: var(--text-primary);
|
| 57 |
+
display: flex; overflow: hidden; -webkit-font-smoothing: antialiased;
|
| 58 |
}
|
| 59 |
|
| 60 |
button { background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; }
|
|
|
|
| 70 |
.sidebar {
|
| 71 |
width: 260px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-light);
|
| 72 |
display: flex; flex-direction: column; transition: transform 0.3s ease, width 0.3s ease; z-index: 100;
|
| 73 |
+
height: 100%;
|
| 74 |
}
|
| 75 |
.sidebar.collapsed { margin-left: -260px; }
|
| 76 |
|
|
|
|
| 95 |
.user-sub { font-size: 11px; font-weight: 500; color: var(--text-tertiary); margin-top: 2px; }
|
| 96 |
|
| 97 |
/* --- MAIN WORKSPACE --- */
|
| 98 |
+
/* BUG FIX: Ensures the main area doesn't push the input dock down */
|
| 99 |
+
.main-area { flex: 1; display: flex; flex-direction: column; position: relative; background: var(--bg-main); transition: 0.3s; height: 100%; overflow: hidden; }
|
| 100 |
|
| 101 |
+
.top-bar { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-light); background: var(--bg-main); z-index: 10; flex-shrink: 0; }
|
| 102 |
.btn-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: 0.2s; }
|
| 103 |
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
|
| 104 |
+
.btn-icon svg { width: 18px; height: 18px; }
|
| 105 |
|
| 106 |
.model-selector { font-size: 14px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
|
| 107 |
|
| 108 |
/* --- CHAT CONTAINER --- */
|
| 109 |
+
/* BUG FIX: Proper flex and padding so it scrolls correctly above the input */
|
| 110 |
+
.chat-container { flex: 1; overflow-y: auto; padding: 40px 20px 20px; display: flex; flex-direction: column; align-items: center; scroll-behavior: smooth; }
|
| 111 |
|
| 112 |
.welcome-center { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; animation: fadeIn 0.5s ease; }
|
| 113 |
.welcome-center img { width: 70px; height: 70px; border-radius: 18px; margin-bottom: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
|
|
|
|
| 133 |
.chat-img-preview { max-width: 250px; border-radius: var(--radius-md); border: 1px solid var(--border-light); margin-bottom: 10px; }
|
| 134 |
|
| 135 |
/* --- INPUT DOCK --- */
|
| 136 |
+
/* BUG FIX: Changed from absolute position to standard flex-shrink so it never overlaps or hides */
|
| 137 |
+
.input-dock { flex-shrink: 0; padding: 15px 20px 25px; background: var(--bg-main); border-top: 1px solid var(--border-light); display: flex; justify-content: center; z-index: 20; width: 100%; }
|
| 138 |
+
.input-container { width: 100%; max-width: 760px; background: var(--bg-input); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 8px 12px; display: flex; flex-direction: column; transition: 0.2s; position: relative; }
|
| 139 |
.input-container:focus-within { border-color: var(--border-focus); background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
|
| 140 |
|
| 141 |
.file-preview-bar { display: none; padding: 8px 8px 12px; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-light); margin-bottom: 8px; }
|
|
|
|
| 144 |
.file-preview-name { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
|
| 145 |
.btn-remove-file { width: 24px; height: 24px; border-radius: 50%; background: #ffe6e6; color: #cc0000; display: flex; align-items: center; justify-content: center; }
|
| 146 |
|
| 147 |
+
.input-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
|
| 148 |
.tools-left { display: flex; gap: 4px; }
|
| 149 |
+
.tool-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: 0.2s; position: relative; flex-shrink: 0; }
|
| 150 |
.tool-btn:hover { background: #e5e5e5; color: var(--text-primary); }
|
| 151 |
.tool-btn svg { width: 18px; height: 18px; }
|
| 152 |
.tool-btn.recording { color: #e60000; animation: pulse 1.5s infinite; }
|
| 153 |
|
| 154 |
+
.chat-input { flex: 1; padding: 7px 4px; font-size: 15px; resize: none; max-height: 120px; min-height: 24px; color: var(--text-primary); line-height: 1.5; }
|
| 155 |
.chat-input::placeholder { color: var(--text-tertiary); }
|
| 156 |
|
| 157 |
+
.btn-send { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-color); color: #fff; display: flex; align-items: center; justify-content: center; transition: 0.2s; flex-shrink: 0; }
|
| 158 |
.btn-send svg { width: 16px; height: 16px; transform: translateX(-1px); }
|
| 159 |
.btn-send:hover { background: #000; transform: translateY(-1px); }
|
| 160 |
.btn-send:disabled { background: #ccc; cursor: not-allowed; transform: none; }
|
| 161 |
|
| 162 |
.hidden-input { display: none; }
|
| 163 |
+
/* Adjusted dropdown position */
|
| 164 |
+
.dropdown-menu { position: absolute; bottom: 100%; left: 0; margin-bottom: 10px; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 6px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: none; flex-direction: column; gap: 2px; min-width: 180px; z-index: 100; }
|
| 165 |
.dropdown-menu.active { display: flex; animation: fadeIn 0.2s; }
|
| 166 |
.dropdown-item { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: 0.2s; }
|
| 167 |
.dropdown-item:hover { background: var(--bg-hover); }
|
| 168 |
|
| 169 |
+
/* --- SECURE AUTHENTICATION MODAL --- */
|
| 170 |
.auth-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 2000; }
|
| 171 |
+
.auth-modal { background: #fff; width: 90%; max-width: 400px; border-radius: var(--radius-md); padding: 32px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); position: relative; }
|
| 172 |
.auth-close { position: absolute; top: 16px; right: 16px; color: var(--text-secondary); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: 0.2s; }
|
| 173 |
.auth-close:hover { background: var(--bg-hover); color: var(--text-primary); }
|
| 174 |
|
|
|
|
| 226 |
.sidebar { position: absolute; left: 0; height: 100%; box-shadow: 5px 0 20px rgba(0,0,0,0.05); }
|
| 227 |
.sidebar.collapsed { left: -260px; margin-left: 0; }
|
| 228 |
.workspace-panel.active { width: 100%; position: absolute; top:0; left:0; height:100%; z-index: 1000; }
|
| 229 |
+
.input-dock { padding: 10px 15px 15px; } /* Slightly tighter padding for phones */
|
| 230 |
}
|
| 231 |
</style>
|
| 232 |
</head>
|
| 233 |
<body>
|
| 234 |
|
| 235 |
<!-- SIDEBAR -->
|
| 236 |
+
<aside class="sidebar collapsed" id="sidebar">
|
| 237 |
<div class="sidebar-header">
|
| 238 |
<button class="btn-icon" onclick="UI.toggleSidebar()" title="Close Sidebar">
|
| 239 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><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>
|
|
|
|
| 263 |
<!-- MAIN AREA -->
|
| 264 |
<main class="main-area">
|
| 265 |
<header class="top-bar">
|
| 266 |
+
<button class="btn-icon" onclick="UI.toggleSidebar()" title="Open Menu" id="btnMenuOpen">
|
| 267 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><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>
|
| 268 |
</button>
|
| 269 |
<div class="model-selector">CODE VED 202B</div>
|
|
|
|
| 395 |
// --- 1. CONFIG & STATE ---
|
| 396 |
const Config = {
|
| 397 |
GAS_URL: "https://script.google.com/macros/s/AKfycbz5vrlB4GrfkfBVYdQ52IQweIXC1cNDwKuTUorxdAiOdSSIrH55mzJlaz9kq1Y94ot5/exec",
|
| 398 |
+
API_ENDPOINT: "/api/chat", // Your backend endpoint
|
| 399 |
LOGO: "https://i.ibb.co/MyYStcGP/TIRANGA-20260613-131924-0000.png"
|
| 400 |
};
|
| 401 |
|
|
|
|
| 420 |
btnOpen.style.display = sb.classList.contains('collapsed') ? 'flex' : 'none';
|
| 421 |
},
|
| 422 |
toggleAttachMenu: () => document.getElementById('attachMenu').classList.toggle('active'),
|
| 423 |
+
autoGrow: (el) => { el.style.height = 'auto'; el.style.height = Math.min(el.scrollHeight, 120) + 'px'; },
|
| 424 |
scrollToBottom: () => { const c = document.getElementById('chatContainer'); c.scrollTop = c.scrollHeight; },
|
| 425 |
escape: (s) => s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'),
|
| 426 |
showAuthMsg: (msg, isError=true) => {
|
|
|
|
| 586 |
} else {
|
| 587 |
r.onload = (e) => {
|
| 588 |
let data = e.target.result;
|
| 589 |
+
// Safe HTML sanitization
|
| 590 |
if(file.name.endsWith('.html')) {
|
| 591 |
data = data.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "\n[SCRIPT SANITIZED]\n");
|
| 592 |
}
|
|
|
|
| 639 |
}
|
| 640 |
};
|
| 641 |
|
| 642 |
+
// --- 6. WORKSPACE PRO MAX ---
|
| 643 |
const Workspace = {
|
| 644 |
open: (id) => {
|
| 645 |
State.currentWs = id;
|
|
|
|
| 835 |
|
| 836 |
window.onload = () => {
|
| 837 |
Auth.init();
|
| 838 |
+
// Ensures sidebar layout doesn't break chat input
|
| 839 |
+
if(window.innerWidth > 900) { document.getElementById('btnMenuOpen').style.display = 'none'; document.getElementById('sidebar').classList.remove('collapsed'); }
|
| 840 |
};
|
| 841 |
|
| 842 |
</script>
|
| 843 |
</body>
|
| 844 |
+
</html>
|