Shouvik599 commited on
Commit Β·
0848bca
1
Parent(s): 603a7ff
Generalized url for frontend fetching
Browse files- frontend/index.html +206 -75
frontend/index.html
CHANGED
|
@@ -1,34 +1,48 @@
|
|
| 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>Sacred Texts β Divine Knowledge</title>
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 9 |
-
<link
|
|
|
|
|
|
|
| 10 |
|
| 11 |
<style>
|
| 12 |
/* ββ Reset & Base βββββββββββββββββββββββββββββββββββββββββββ */
|
| 13 |
-
*,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
:root {
|
| 16 |
-
--bg:
|
| 17 |
-
--surface:
|
| 18 |
-
--surface-2:
|
| 19 |
-
--border:
|
| 20 |
-
--gold:
|
| 21 |
-
--gold-light:
|
| 22 |
-
--gold-pale:
|
| 23 |
-
--cream:
|
| 24 |
-
--muted:
|
| 25 |
-
--gita:
|
| 26 |
-
|
| 27 |
-
--
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
height: 100%;
|
| 33 |
background: var(--bg);
|
| 34 |
color: var(--cream);
|
|
@@ -41,11 +55,12 @@
|
|
| 41 |
/* ββ Background texture βββββββββββββββββββββββββββββββββββββ */
|
| 42 |
body::before {
|
| 43 |
content: '';
|
| 44 |
-
position: fixed;
|
|
|
|
| 45 |
background:
|
| 46 |
-
radial-gradient(ellipse 80% 60% at 20% 10%, rgba(201,153,58,.07) 0%, transparent 60%),
|
| 47 |
-
radial-gradient(ellipse 60% 80% at 80% 90%, rgba(91,140,224,.05) 0%, transparent 60%),
|
| 48 |
-
radial-gradient(ellipse 50% 50% at 50% 50%, rgba(176,124,224,.04) 0%, transparent 60%),
|
| 49 |
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
|
| 50 |
pointer-events: none;
|
| 51 |
z-index: 0;
|
|
@@ -79,7 +94,12 @@
|
|
| 79 |
animation: spin 60s linear infinite;
|
| 80 |
display: inline-block;
|
| 81 |
}
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
h1 {
|
| 85 |
font-family: 'Cinzel Decorative', serif;
|
|
@@ -87,7 +107,7 @@
|
|
| 87 |
font-weight: 400;
|
| 88 |
color: var(--gold-pale);
|
| 89 |
letter-spacing: .12em;
|
| 90 |
-
text-shadow: 0 0 40px rgba(201,153,58,.3);
|
| 91 |
}
|
| 92 |
|
| 93 |
.subtitle {
|
|
@@ -116,10 +136,30 @@
|
|
| 116 |
font-family: 'Cormorant Garamond', serif;
|
| 117 |
font-weight: 600;
|
| 118 |
}
|
| 119 |
-
|
| 120 |
-
.badge-
|
| 121 |
-
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
/* ββ Chat Window ββββββββββββββββββββββββββββββββββββββββββββ */
|
| 125 |
.chat-window {
|
|
@@ -131,8 +171,15 @@
|
|
| 131 |
scrollbar-width: thin;
|
| 132 |
scrollbar-color: var(--border) transparent;
|
| 133 |
}
|
| 134 |
-
|
| 135 |
-
.chat-window::-webkit-scrollbar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
/* ββ Welcome State ββββββββββββββββββββββββββββββββββββββββββ */
|
| 138 |
.welcome {
|
|
@@ -145,7 +192,7 @@
|
|
| 145 |
.welcome-icon {
|
| 146 |
font-size: 3.5rem;
|
| 147 |
margin-bottom: 16px;
|
| 148 |
-
filter: drop-shadow(0 0 20px rgba(201,153,58,.4));
|
| 149 |
}
|
| 150 |
|
| 151 |
.welcome h2 {
|
|
@@ -182,6 +229,7 @@
|
|
| 182 |
transition: all .2s;
|
| 183 |
text-align: left;
|
| 184 |
}
|
|
|
|
| 185 |
.suggested-queries button:hover {
|
| 186 |
border-color: var(--gold);
|
| 187 |
color: var(--gold-pale);
|
|
@@ -195,14 +243,23 @@
|
|
| 195 |
gap: 8px;
|
| 196 |
animation: fadeUp .4s ease both;
|
| 197 |
}
|
|
|
|
| 198 |
@keyframes fadeUp {
|
| 199 |
-
from {
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
}
|
| 202 |
|
| 203 |
.message-user {
|
| 204 |
align-items: flex-end;
|
| 205 |
}
|
|
|
|
| 206 |
.message-assistant {
|
| 207 |
align-items: flex-start;
|
| 208 |
}
|
|
@@ -233,17 +290,26 @@
|
|
| 233 |
}
|
| 234 |
|
| 235 |
.message-assistant .msg-bubble {
|
| 236 |
-
background: linear-gradient(135deg, var(--surface) 0%, rgba(30,26,17,.95) 100%);
|
| 237 |
-
border: 1px solid rgba(201,153,58,.2);
|
| 238 |
color: var(--cream);
|
| 239 |
font-size: 1rem;
|
| 240 |
border-bottom-left-radius: 4px;
|
| 241 |
-
box-shadow: 0 4px 24px rgba(0,0,0,.4), inset 0 1px 0 rgba(201,153,58,.1);
|
| 242 |
}
|
| 243 |
|
| 244 |
-
.msg-bubble p {
|
| 245 |
-
|
| 246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 247 |
|
| 248 |
/* ββ Sources Panel ββββββββββββββββββββββββββββββββββββββββββ */
|
| 249 |
.sources {
|
|
@@ -261,13 +327,18 @@
|
|
| 261 |
align-items: center;
|
| 262 |
gap: 6px;
|
| 263 |
}
|
| 264 |
-
|
|
|
|
|
|
|
| 265 |
content: '';
|
| 266 |
flex: 1;
|
| 267 |
height: 1px;
|
| 268 |
background: var(--border);
|
| 269 |
}
|
| 270 |
-
|
|
|
|
|
|
|
|
|
|
| 271 |
|
| 272 |
.source-tags {
|
| 273 |
display: flex;
|
|
@@ -284,12 +355,41 @@
|
|
| 284 |
cursor: default;
|
| 285 |
transition: all .2s;
|
| 286 |
}
|
| 287 |
-
|
| 288 |
-
.source-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
|
| 294 |
/* ββ Loading ββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 295 |
.loading {
|
|
@@ -297,7 +397,7 @@
|
|
| 297 |
align-items: center;
|
| 298 |
gap: 12px;
|
| 299 |
padding: 14px 18px;
|
| 300 |
-
border: 1px solid rgba(201,153,58,.15);
|
| 301 |
border-radius: 12px;
|
| 302 |
background: var(--surface);
|
| 303 |
width: fit-content;
|
|
@@ -308,17 +408,36 @@
|
|
| 308 |
display: flex;
|
| 309 |
gap: 5px;
|
| 310 |
}
|
|
|
|
| 311 |
.loading-dots span {
|
| 312 |
-
width: 6px;
|
|
|
|
| 313 |
border-radius: 50%;
|
| 314 |
background: var(--gold);
|
| 315 |
animation: dot-pulse 1.4s ease-in-out infinite;
|
| 316 |
}
|
| 317 |
-
|
| 318 |
-
.loading-dots span:nth-child(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
@keyframes dot-pulse {
|
| 320 |
-
|
| 321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
}
|
| 323 |
|
| 324 |
.loading-text {
|
|
@@ -366,17 +485,23 @@
|
|
| 366 |
outline: none;
|
| 367 |
transition: border-color .2s, box-shadow .2s;
|
| 368 |
}
|
| 369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
textarea:focus {
|
| 371 |
-
border-color: rgba(201,153,58,.5);
|
| 372 |
-
box-shadow: 0 0 0 3px rgba(201,153,58,.08);
|
| 373 |
}
|
| 374 |
|
| 375 |
.send-btn {
|
| 376 |
-
width: 52px;
|
|
|
|
| 377 |
border-radius: 12px;
|
| 378 |
-
border: 1px solid rgba(201,153,58,.4);
|
| 379 |
-
background: linear-gradient(135deg, rgba(201,153,58,.2), rgba(201,153,58,.05));
|
| 380 |
color: var(--gold);
|
| 381 |
font-size: 1.3rem;
|
| 382 |
cursor: pointer;
|
|
@@ -386,13 +511,19 @@
|
|
| 386 |
justify-content: center;
|
| 387 |
flex-shrink: 0;
|
| 388 |
}
|
|
|
|
| 389 |
.send-btn:hover:not(:disabled) {
|
| 390 |
-
background: linear-gradient(135deg, rgba(201,153,58,.35), rgba(201,153,58,.15));
|
| 391 |
border-color: var(--gold);
|
| 392 |
transform: translateY(-1px);
|
| 393 |
-
box-shadow: 0 4px 16px rgba(201,153,58,.2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
}
|
| 395 |
-
.send-btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }
|
| 396 |
|
| 397 |
.input-hint {
|
| 398 |
font-size: .72rem;
|
|
@@ -412,6 +543,7 @@
|
|
| 412 |
}
|
| 413 |
</style>
|
| 414 |
</head>
|
|
|
|
| 415 |
<body>
|
| 416 |
<div class="app">
|
| 417 |
|
|
@@ -433,13 +565,15 @@
|
|
| 433 |
<div class="welcome" id="welcomePane">
|
| 434 |
<div class="welcome-icon">ποΈ</div>
|
| 435 |
<h2>"Seek, and it shall be given unto you"</h2>
|
| 436 |
-
<p>Ask any spiritual or philosophical question. Answers are drawn exclusively from the Bhagavad Gita, Quran,
|
|
|
|
| 437 |
<div class="suggested-queries">
|
| 438 |
<button onclick="askSuggested(this)">What do the scriptures say about forgiveness?</button>
|
| 439 |
<button onclick="askSuggested(this)">How should one face fear and death?</button>
|
| 440 |
<button onclick="askSuggested(this)">What is the purpose of prayer and worship?</button>
|
| 441 |
<button onclick="askSuggested(this)">What is the nature of the soul according to each religion?</button>
|
| 442 |
-
<button onclick="askSuggested(this)">What do the scriptures teach about humility and selfless
|
|
|
|
| 443 |
</div>
|
| 444 |
</div>
|
| 445 |
</div>
|
|
@@ -447,24 +581,20 @@
|
|
| 447 |
<!-- Input -->
|
| 448 |
<div class="input-area">
|
| 449 |
<div class="input-row">
|
| 450 |
-
<textarea
|
| 451 |
-
|
| 452 |
-
placeholder="Ask a question from the sacred textsβ¦"
|
| 453 |
-
rows="1"
|
| 454 |
-
onkeydown="handleKey(event)"
|
| 455 |
-
oninput="autoResize(this)"
|
| 456 |
-
></textarea>
|
| 457 |
<button class="send-btn" id="sendBtn" onclick="sendQuestion()" title="Ask (Enter)">
|
| 458 |
β¦
|
| 459 |
</button>
|
| 460 |
</div>
|
| 461 |
-
<p class="input-hint">Press Enter to ask Β· Shift+Enter for new line Β· Answers grounded strictly in the sacred
|
|
|
|
| 462 |
</div>
|
| 463 |
|
| 464 |
</div>
|
| 465 |
|
| 466 |
<script>
|
| 467 |
-
const API_BASE =
|
| 468 |
let isLoading = false;
|
| 469 |
|
| 470 |
// ββ Helpers ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -562,7 +692,7 @@
|
|
| 562 |
}
|
| 563 |
|
| 564 |
function escapeHtml(str) {
|
| 565 |
-
return str.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
| 566 |
}
|
| 567 |
|
| 568 |
// ββ Send question ββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -598,7 +728,7 @@
|
|
| 598 |
} catch (err) {
|
| 599 |
let msg = err.message;
|
| 600 |
if (msg.includes("fetch") || msg.includes("NetworkError") || msg.includes("Failed")) {
|
| 601 |
-
msg = "
|
| 602 |
}
|
| 603 |
replaceLoadingWithError(loadingEl, msg);
|
| 604 |
} finally {
|
|
@@ -623,4 +753,5 @@
|
|
| 623 |
}
|
| 624 |
</script>
|
| 625 |
</body>
|
|
|
|
| 626 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
+
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Sacred Texts β Divine Knowledge</title>
|
| 8 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 9 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 10 |
+
<link
|
| 11 |
+
href="https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=IM+Fell+English:ital@0;1&display=swap"
|
| 12 |
+
rel="stylesheet" />
|
| 13 |
|
| 14 |
<style>
|
| 15 |
/* ββ Reset & Base βββββββββββββββββββββββββββββββββββββββββββ */
|
| 16 |
+
*,
|
| 17 |
+
*::before,
|
| 18 |
+
*::after {
|
| 19 |
+
box-sizing: border-box;
|
| 20 |
+
margin: 0;
|
| 21 |
+
padding: 0;
|
| 22 |
+
}
|
| 23 |
|
| 24 |
:root {
|
| 25 |
+
--bg: #0d0b07;
|
| 26 |
+
--surface: #16130d;
|
| 27 |
+
--surface-2: #1e1a11;
|
| 28 |
+
--border: #3a2e1a;
|
| 29 |
+
--gold: #c9993a;
|
| 30 |
+
--gold-light: #e8c170;
|
| 31 |
+
--gold-pale: #f5e4b0;
|
| 32 |
+
--cream: #f0e6cc;
|
| 33 |
+
--muted: #7a6a4a;
|
| 34 |
+
--gita: #e07b3b;
|
| 35 |
+
/* saffron */
|
| 36 |
+
--quran: #3bba85;
|
| 37 |
+
/* green */
|
| 38 |
+
--bible: #5b8ce0;
|
| 39 |
+
/* blue */
|
| 40 |
+
--granth: #b07ce0;
|
| 41 |
+
/* violet β Sikh royal purple */
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
html,
|
| 45 |
+
body {
|
| 46 |
height: 100%;
|
| 47 |
background: var(--bg);
|
| 48 |
color: var(--cream);
|
|
|
|
| 55 |
/* ββ Background texture βββββββββββββββββββββββββββββββββββββ */
|
| 56 |
body::before {
|
| 57 |
content: '';
|
| 58 |
+
position: fixed;
|
| 59 |
+
inset: 0;
|
| 60 |
background:
|
| 61 |
+
radial-gradient(ellipse 80% 60% at 20% 10%, rgba(201, 153, 58, .07) 0%, transparent 60%),
|
| 62 |
+
radial-gradient(ellipse 60% 80% at 80% 90%, rgba(91, 140, 224, .05) 0%, transparent 60%),
|
| 63 |
+
radial-gradient(ellipse 50% 50% at 50% 50%, rgba(176, 124, 224, .04) 0%, transparent 60%),
|
| 64 |
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
|
| 65 |
pointer-events: none;
|
| 66 |
z-index: 0;
|
|
|
|
| 94 |
animation: spin 60s linear infinite;
|
| 95 |
display: inline-block;
|
| 96 |
}
|
| 97 |
+
|
| 98 |
+
@keyframes spin {
|
| 99 |
+
to {
|
| 100 |
+
transform: rotate(360deg);
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
|
| 104 |
h1 {
|
| 105 |
font-family: 'Cinzel Decorative', serif;
|
|
|
|
| 107 |
font-weight: 400;
|
| 108 |
color: var(--gold-pale);
|
| 109 |
letter-spacing: .12em;
|
| 110 |
+
text-shadow: 0 0 40px rgba(201, 153, 58, .3);
|
| 111 |
}
|
| 112 |
|
| 113 |
.subtitle {
|
|
|
|
| 136 |
font-family: 'Cormorant Garamond', serif;
|
| 137 |
font-weight: 600;
|
| 138 |
}
|
| 139 |
+
|
| 140 |
+
.badge-gita {
|
| 141 |
+
color: var(--gita);
|
| 142 |
+
border-color: var(--gita);
|
| 143 |
+
background: rgba(224, 123, 59, .1);
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.badge-quran {
|
| 147 |
+
color: var(--quran);
|
| 148 |
+
border-color: var(--quran);
|
| 149 |
+
background: rgba(59, 186, 133, .1);
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
.badge-bible {
|
| 153 |
+
color: var(--bible);
|
| 154 |
+
border-color: var(--bible);
|
| 155 |
+
background: rgba(91, 140, 224, .1);
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
.badge-granth {
|
| 159 |
+
color: var(--granth);
|
| 160 |
+
border-color: var(--granth);
|
| 161 |
+
background: rgba(176, 124, 224, .1);
|
| 162 |
+
}
|
| 163 |
|
| 164 |
/* ββ Chat Window ββββββββββββββββββββββββββββββββββββββββββββ */
|
| 165 |
.chat-window {
|
|
|
|
| 171 |
scrollbar-width: thin;
|
| 172 |
scrollbar-color: var(--border) transparent;
|
| 173 |
}
|
| 174 |
+
|
| 175 |
+
.chat-window::-webkit-scrollbar {
|
| 176 |
+
width: 4px;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
.chat-window::-webkit-scrollbar-thumb {
|
| 180 |
+
background: var(--border);
|
| 181 |
+
border-radius: 4px;
|
| 182 |
+
}
|
| 183 |
|
| 184 |
/* ββ Welcome State ββββββββββββββββββββββββββββββββββββββββββ */
|
| 185 |
.welcome {
|
|
|
|
| 192 |
.welcome-icon {
|
| 193 |
font-size: 3.5rem;
|
| 194 |
margin-bottom: 16px;
|
| 195 |
+
filter: drop-shadow(0 0 20px rgba(201, 153, 58, .4));
|
| 196 |
}
|
| 197 |
|
| 198 |
.welcome h2 {
|
|
|
|
| 229 |
transition: all .2s;
|
| 230 |
text-align: left;
|
| 231 |
}
|
| 232 |
+
|
| 233 |
.suggested-queries button:hover {
|
| 234 |
border-color: var(--gold);
|
| 235 |
color: var(--gold-pale);
|
|
|
|
| 243 |
gap: 8px;
|
| 244 |
animation: fadeUp .4s ease both;
|
| 245 |
}
|
| 246 |
+
|
| 247 |
@keyframes fadeUp {
|
| 248 |
+
from {
|
| 249 |
+
opacity: 0;
|
| 250 |
+
transform: translateY(12px);
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
to {
|
| 254 |
+
opacity: 1;
|
| 255 |
+
transform: translateY(0);
|
| 256 |
+
}
|
| 257 |
}
|
| 258 |
|
| 259 |
.message-user {
|
| 260 |
align-items: flex-end;
|
| 261 |
}
|
| 262 |
+
|
| 263 |
.message-assistant {
|
| 264 |
align-items: flex-start;
|
| 265 |
}
|
|
|
|
| 290 |
}
|
| 291 |
|
| 292 |
.message-assistant .msg-bubble {
|
| 293 |
+
background: linear-gradient(135deg, var(--surface) 0%, rgba(30, 26, 17, .95) 100%);
|
| 294 |
+
border: 1px solid rgba(201, 153, 58, .2);
|
| 295 |
color: var(--cream);
|
| 296 |
font-size: 1rem;
|
| 297 |
border-bottom-left-radius: 4px;
|
| 298 |
+
box-shadow: 0 4px 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(201, 153, 58, .1);
|
| 299 |
}
|
| 300 |
|
| 301 |
+
.msg-bubble p {
|
| 302 |
+
margin-bottom: 1em;
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
.msg-bubble p:last-child {
|
| 306 |
+
margin-bottom: 0;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
.msg-bubble strong {
|
| 310 |
+
color: var(--gold-light);
|
| 311 |
+
font-weight: 600;
|
| 312 |
+
}
|
| 313 |
|
| 314 |
/* ββ Sources Panel ββββββββββββββββββββββββββββββββββββββββββ */
|
| 315 |
.sources {
|
|
|
|
| 327 |
align-items: center;
|
| 328 |
gap: 6px;
|
| 329 |
}
|
| 330 |
+
|
| 331 |
+
.sources-label::before,
|
| 332 |
+
.sources-label::after {
|
| 333 |
content: '';
|
| 334 |
flex: 1;
|
| 335 |
height: 1px;
|
| 336 |
background: var(--border);
|
| 337 |
}
|
| 338 |
+
|
| 339 |
+
.sources-label::before {
|
| 340 |
+
max-width: 20px;
|
| 341 |
+
}
|
| 342 |
|
| 343 |
.source-tags {
|
| 344 |
display: flex;
|
|
|
|
| 355 |
cursor: default;
|
| 356 |
transition: all .2s;
|
| 357 |
}
|
| 358 |
+
|
| 359 |
+
.source-tag:hover {
|
| 360 |
+
transform: translateY(-1px);
|
| 361 |
+
filter: brightness(1.2);
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
.source-gita {
|
| 365 |
+
color: var(--gita);
|
| 366 |
+
border-color: rgba(224, 123, 59, .4);
|
| 367 |
+
background: rgba(224, 123, 59, .08);
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
.source-quran {
|
| 371 |
+
color: var(--quran);
|
| 372 |
+
border-color: rgba(59, 186, 133, .4);
|
| 373 |
+
background: rgba(59, 186, 133, .08);
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
.source-bible {
|
| 377 |
+
color: var(--bible);
|
| 378 |
+
border-color: rgba(91, 140, 224, .4);
|
| 379 |
+
background: rgba(91, 140, 224, .08);
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
.source-granth {
|
| 383 |
+
color: var(--granth);
|
| 384 |
+
border-color: rgba(176, 124, 224, .4);
|
| 385 |
+
background: rgba(176, 124, 224, .08);
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
.source-other {
|
| 389 |
+
color: var(--gold-light);
|
| 390 |
+
border-color: rgba(201, 153, 58, .4);
|
| 391 |
+
background: rgba(201, 153, 58, .08);
|
| 392 |
+
}
|
| 393 |
|
| 394 |
/* ββ Loading ββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 395 |
.loading {
|
|
|
|
| 397 |
align-items: center;
|
| 398 |
gap: 12px;
|
| 399 |
padding: 14px 18px;
|
| 400 |
+
border: 1px solid rgba(201, 153, 58, .15);
|
| 401 |
border-radius: 12px;
|
| 402 |
background: var(--surface);
|
| 403 |
width: fit-content;
|
|
|
|
| 408 |
display: flex;
|
| 409 |
gap: 5px;
|
| 410 |
}
|
| 411 |
+
|
| 412 |
.loading-dots span {
|
| 413 |
+
width: 6px;
|
| 414 |
+
height: 6px;
|
| 415 |
border-radius: 50%;
|
| 416 |
background: var(--gold);
|
| 417 |
animation: dot-pulse 1.4s ease-in-out infinite;
|
| 418 |
}
|
| 419 |
+
|
| 420 |
+
.loading-dots span:nth-child(2) {
|
| 421 |
+
animation-delay: .2s;
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
.loading-dots span:nth-child(3) {
|
| 425 |
+
animation-delay: .4s;
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
@keyframes dot-pulse {
|
| 429 |
+
|
| 430 |
+
0%,
|
| 431 |
+
80%,
|
| 432 |
+
100% {
|
| 433 |
+
opacity: .2;
|
| 434 |
+
transform: scale(.8);
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
40% {
|
| 438 |
+
opacity: 1;
|
| 439 |
+
transform: scale(1.1);
|
| 440 |
+
}
|
| 441 |
}
|
| 442 |
|
| 443 |
.loading-text {
|
|
|
|
| 485 |
outline: none;
|
| 486 |
transition: border-color .2s, box-shadow .2s;
|
| 487 |
}
|
| 488 |
+
|
| 489 |
+
textarea::placeholder {
|
| 490 |
+
color: var(--muted);
|
| 491 |
+
font-style: italic;
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
textarea:focus {
|
| 495 |
+
border-color: rgba(201, 153, 58, .5);
|
| 496 |
+
box-shadow: 0 0 0 3px rgba(201, 153, 58, .08);
|
| 497 |
}
|
| 498 |
|
| 499 |
.send-btn {
|
| 500 |
+
width: 52px;
|
| 501 |
+
height: 52px;
|
| 502 |
border-radius: 12px;
|
| 503 |
+
border: 1px solid rgba(201, 153, 58, .4);
|
| 504 |
+
background: linear-gradient(135deg, rgba(201, 153, 58, .2), rgba(201, 153, 58, .05));
|
| 505 |
color: var(--gold);
|
| 506 |
font-size: 1.3rem;
|
| 507 |
cursor: pointer;
|
|
|
|
| 511 |
justify-content: center;
|
| 512 |
flex-shrink: 0;
|
| 513 |
}
|
| 514 |
+
|
| 515 |
.send-btn:hover:not(:disabled) {
|
| 516 |
+
background: linear-gradient(135deg, rgba(201, 153, 58, .35), rgba(201, 153, 58, .15));
|
| 517 |
border-color: var(--gold);
|
| 518 |
transform: translateY(-1px);
|
| 519 |
+
box-shadow: 0 4px 16px rgba(201, 153, 58, .2);
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
.send-btn:disabled {
|
| 523 |
+
opacity: .3;
|
| 524 |
+
cursor: not-allowed;
|
| 525 |
+
transform: none;
|
| 526 |
}
|
|
|
|
| 527 |
|
| 528 |
.input-hint {
|
| 529 |
font-size: .72rem;
|
|
|
|
| 543 |
}
|
| 544 |
</style>
|
| 545 |
</head>
|
| 546 |
+
|
| 547 |
<body>
|
| 548 |
<div class="app">
|
| 549 |
|
|
|
|
| 565 |
<div class="welcome" id="welcomePane">
|
| 566 |
<div class="welcome-icon">ποΈ</div>
|
| 567 |
<h2>"Seek, and it shall be given unto you"</h2>
|
| 568 |
+
<p>Ask any spiritual or philosophical question. Answers are drawn exclusively from the Bhagavad Gita, Quran,
|
| 569 |
+
Bible, and Guru Granth Sahib.</p>
|
| 570 |
<div class="suggested-queries">
|
| 571 |
<button onclick="askSuggested(this)">What do the scriptures say about forgiveness?</button>
|
| 572 |
<button onclick="askSuggested(this)">How should one face fear and death?</button>
|
| 573 |
<button onclick="askSuggested(this)">What is the purpose of prayer and worship?</button>
|
| 574 |
<button onclick="askSuggested(this)">What is the nature of the soul according to each religion?</button>
|
| 575 |
+
<button onclick="askSuggested(this)">What do the scriptures teach about humility and selfless
|
| 576 |
+
service?</button>
|
| 577 |
</div>
|
| 578 |
</div>
|
| 579 |
</div>
|
|
|
|
| 581 |
<!-- Input -->
|
| 582 |
<div class="input-area">
|
| 583 |
<div class="input-row">
|
| 584 |
+
<textarea id="questionInput" placeholder="Ask a question from the sacred textsβ¦" rows="1"
|
| 585 |
+
onkeydown="handleKey(event)" oninput="autoResize(this)"></textarea>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 586 |
<button class="send-btn" id="sendBtn" onclick="sendQuestion()" title="Ask (Enter)">
|
| 587 |
β¦
|
| 588 |
</button>
|
| 589 |
</div>
|
| 590 |
+
<p class="input-hint">Press Enter to ask Β· Shift+Enter for new line Β· Answers grounded strictly in the sacred
|
| 591 |
+
texts</p>
|
| 592 |
</div>
|
| 593 |
|
| 594 |
</div>
|
| 595 |
|
| 596 |
<script>
|
| 597 |
+
const API_BASE = window.location.origin;
|
| 598 |
let isLoading = false;
|
| 599 |
|
| 600 |
// ββ Helpers ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 692 |
}
|
| 693 |
|
| 694 |
function escapeHtml(str) {
|
| 695 |
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
| 696 |
}
|
| 697 |
|
| 698 |
// ββ Send question ββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 728 |
} catch (err) {
|
| 729 |
let msg = err.message;
|
| 730 |
if (msg.includes("fetch") || msg.includes("NetworkError") || msg.includes("Failed")) {
|
| 731 |
+
msg = "Connecting to the divine knowledge base... Please wait a moment or refresh the page.";
|
| 732 |
}
|
| 733 |
replaceLoadingWithError(loadingEl, msg);
|
| 734 |
} finally {
|
|
|
|
| 753 |
}
|
| 754 |
</script>
|
| 755 |
</body>
|
| 756 |
+
|
| 757 |
</html>
|