Spaces:
Sleeping
Sleeping
Upload chat.html
Browse files- frontend/chat.html +47 -5
frontend/chat.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 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>NeuroCheck — AI Clinical Assistant</title>
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
|
| 8 |
<style>
|
|
@@ -130,7 +130,36 @@
|
|
| 130 |
.session-loading.visible{display:flex;}
|
| 131 |
.spin{width:18px;height:18px;border:2px solid var(--border);border-top-color:var(--teal);border-radius:50%;animation:spin 0.7s linear infinite;}
|
| 132 |
@keyframes spin{to{transform:rotate(360deg);}}
|
| 133 |
-
@media(max-width:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
.tier-color-LOW{color:#065F46;}
|
| 135 |
.tier-color-WATCH{color:#5B21B6;}
|
| 136 |
.tier-color-MODERATE{color:#1E40AF;}
|
|
@@ -239,7 +268,7 @@
|
|
| 239 |
</svg>
|
| 240 |
</button>
|
| 241 |
</div>
|
| 242 |
-
<
|
| 243 |
</div>
|
| 244 |
</div>
|
| 245 |
</div>
|
|
@@ -299,8 +328,21 @@ async function submitAuth() {
|
|
| 299 |
});
|
| 300 |
}
|
| 301 |
let data;
|
| 302 |
-
try { data = await res.json(); } catch { throw new Error(`Server error ${res.status}
|
| 303 |
-
if (!res.ok)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 304 |
authToken = data.access_token;
|
| 305 |
currentUser = { id: data.user_id, username: data.username };
|
| 306 |
localStorage.setItem('nc_token', authToken);
|
|
|
|
| 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">
|
| 6 |
<title>NeuroCheck — AI Clinical Assistant</title>
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
|
| 8 |
<style>
|
|
|
|
| 130 |
.session-loading.visible{display:flex;}
|
| 131 |
.spin{width:18px;height:18px;border:2px solid var(--border);border-top-color:var(--teal);border-radius:50%;animation:spin 0.7s linear infinite;}
|
| 132 |
@keyframes spin{to{transform:rotate(360deg);}}
|
| 133 |
+
@media(max-width:768px){
|
| 134 |
+
header{padding:10px 12px;gap:8px;}
|
| 135 |
+
.header-text h1{font-size:15px;}
|
| 136 |
+
.header-text p{display:none;}
|
| 137 |
+
.model-badge{display:none;}
|
| 138 |
+
.nav-link{display:none;}
|
| 139 |
+
.user-name{display:none;}
|
| 140 |
+
.bubble{max-width:88%;font-size:13px;}
|
| 141 |
+
.chat-container{padding:0 8px;}
|
| 142 |
+
#sidebar{position:absolute;height:calc(100% - 59px);z-index:20;box-shadow:4px 0 16px rgba(0,0,0,.15);}
|
| 143 |
+
.input-area{padding:10px 0 14px;}
|
| 144 |
+
.msg-input{font-size:14px;padding:10px 14px;}
|
| 145 |
+
.send-btn{width:44px;height:44px;}
|
| 146 |
+
.input-hint{display:none;}
|
| 147 |
+
.disclaimer-bar{font-size:10px;padding:3px 10px;}
|
| 148 |
+
}
|
| 149 |
+
@media(max-width:420px){
|
| 150 |
+
.bubble{max-width:95%;}
|
| 151 |
+
.avatar{width:28px;height:28px;font-size:12px;}
|
| 152 |
+
header{padding:8px 10px;}
|
| 153 |
+
}
|
| 154 |
+
/* Mobile input fixes — prevent iOS zoom on focus */
|
| 155 |
+
@media(max-width:768px){
|
| 156 |
+
.msg-input{font-size:16px !important;}
|
| 157 |
+
.send-btn{width:44px;height:44px;}
|
| 158 |
+
.header-text p{display:none;}
|
| 159 |
+
.model-badge{display:none;}
|
| 160 |
+
.nav-link{display:none;}
|
| 161 |
+
body{-webkit-text-size-adjust:100%;}
|
| 162 |
+
}
|
| 163 |
.tier-color-LOW{color:#065F46;}
|
| 164 |
.tier-color-WATCH{color:#5B21B6;}
|
| 165 |
.tier-color-MODERATE{color:#1E40AF;}
|
|
|
|
| 268 |
</svg>
|
| 269 |
</button>
|
| 270 |
</div>
|
| 271 |
+
<div class="input-hint">Domain Expert: Dr. Avasarala, MD PhD, UKY · Lead AI Architect: Raghu Gangolu, NITW · PI: Dr. Kadambari, PhD, NITW</div>
|
| 272 |
</div>
|
| 273 |
</div>
|
| 274 |
</div>
|
|
|
|
| 328 |
});
|
| 329 |
}
|
| 330 |
let data;
|
| 331 |
+
try { data = await res.json(); } catch { throw new Error(`Server error ${res.status}`); }
|
| 332 |
+
if (!res.ok) {
|
| 333 |
+
// data.detail can be a string OR a list of validation error objects
|
| 334 |
+
let errMsg = 'Authentication failed';
|
| 335 |
+
if (data.detail) {
|
| 336 |
+
if (typeof data.detail === 'string') {
|
| 337 |
+
errMsg = data.detail;
|
| 338 |
+
} else if (Array.isArray(data.detail)) {
|
| 339 |
+
errMsg = data.detail.map(e => e.msg || JSON.stringify(e)).join(', ');
|
| 340 |
+
} else {
|
| 341 |
+
errMsg = JSON.stringify(data.detail);
|
| 342 |
+
}
|
| 343 |
+
}
|
| 344 |
+
throw new Error(errMsg);
|
| 345 |
+
}
|
| 346 |
authToken = data.access_token;
|
| 347 |
currentUser = { id: data.user_id, username: data.username };
|
| 348 |
localStorage.setItem('nc_token', authToken);
|