File size: 21,263 Bytes
9d837ba | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Serinity - Mental Healthcare</title>
<link rel="icon" type="image/svg+xml" href="/static/icons/logo.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="/static/css/style.css">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
paper: '#F6F3EE',
ink: '#262521',
moss: '#4B6358',
clay: '#9C7A5B',
signal: '#B4483C'
}
}
}
}
</script>
</head>
<body class="bg-paper text-ink min-h-screen flex flex-col font-body">
<!-- Loading Screen -->
<div id="loadingScreen" class="fixed inset-0 bg-paper z-50 flex flex-col items-center justify-center transition-opacity duration-500">
<h1 class="logo-text">Serinity</h1>
<div class="loading-dots" id="loadingDots">
<span></span>
<span></span>
<span></span>
</div>
<button class="btn-primary mt-8" id="startButton" disabled>
Initializing...
</button>
<p id="wakeupText" class="text-sm text-clay mt-4 text-center max-w-xs mx-auto font-utility">
Validating credentials...
</p>
</div>
<!-- Auth Screen -->
<div id="authScreen" style="display: none;" class="fixed inset-0 bg-paper z-40 flex flex-col items-center justify-center p-4 overflow-y-auto custom-scrollbar">
<div class="panel p-8 max-w-md w-full my-auto shadow-sm">
<!-- Logo/Branding -->
<div class="flex items-center gap-3 mb-8 justify-center">
<img src="/static/icons/logo.svg" alt="Serinity Logo" class="w-10 h-10">
<h2 class="text-3xl font-display text-ink">Serinity</h2>
</div>
<!-- Login Form -->
<div id="loginFormContainer" class="block space-y-5">
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Username / Email *</label>
<input type="text" id="loginUsername" placeholder="Username or Email" class="w-full bg-paper border border-ink p-3 text-ink focus:outline-none focus:border-moss transition">
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Password</label>
<input type="password" id="loginPassword" class="w-full bg-paper border border-ink p-3 text-ink focus:outline-none focus:border-moss transition" placeholder="Enter password">
</div>
<div class="flex justify-between items-center text-xs font-utility uppercase tracking-widest mt-2">
<button id="showForgotPwdBtn" class="text-clay hover:text-ink transition">Forgot Password?</button>
</div>
<button id="loginBtn" class="w-full btn-primary py-3 font-utility uppercase tracking-widest text-sm mt-4">
Log In
</button>
<div class="text-center mt-6 border-t border-ink/20 pt-6">
<p class="text-xs text-clay font-utility uppercase tracking-widest mb-3">New Patient?</p>
<button id="showSignupBtn" class="w-full bg-transparent border border-ink text-ink hover:bg-ink hover:text-paper transition py-3 font-utility uppercase tracking-widest text-sm">
Create Account
</button>
</div>
</div>
<!-- Signup Form -->
<div id="signupFormContainer" class="hidden space-y-4">
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Full Name *</label>
<input type="text" id="signupName" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss" placeholder="Jane Doe">
</div>
<div class="grid grid-cols-3 gap-4">
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Username *</label>
<input type="text" id="signupUsername" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss">
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Gender *</label>
<select id="signupGender" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss">
<option value="">Select</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Age</label>
<input type="number" id="signupAge" min="5" max="99" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss">
</div>
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Email *</label>
<input type="email" id="signupEmail" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss" placeholder="jane@example.com">
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Password *</label>
<input type="password" id="signupPassword" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss">
</div>
<div class="grid grid-cols-2 gap-4">
<div class="relative" id="nationalityWrapper">
<label class="block text-xs font-utility text-clay uppercase mb-1" title="For cultural context">Nationality *</label>
<input type="text" id="signupNationality" autocomplete="off" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss" placeholder="e.g. India">
<div id="nationalityDropdown" class="hidden absolute left-0 right-0 top-full mt-1 bg-paper border border-ink z-50 max-h-48 overflow-y-auto shadow-lg">
<!-- Populated by JS -->
</div>
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Primary Concern *</label>
<select id="signupConcern" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss">
<option value="">Select...</option>
<option value="Anxiety">Anxiety</option>
<option value="Depression">Depression</option>
<option value="Stress">Stress</option>
<option value="Sleep">Sleep Issues</option>
<option value="General">General Wellness</option>
<option value="Other">Other</option>
</select>
</div>
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Emergency Contact Name</label>
<input type="text" id="signupEmergencyName" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss" placeholder="John Doe">
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Emergency Contact Phone</label>
<input type="tel" id="signupEmergencyPhone" class="w-full bg-paper border border-ink p-2 text-ink focus:outline-none focus:border-moss" placeholder="+1 234 567 8900">
</div>
</div>
<button id="signupCompleteBtn" class="w-full btn-primary py-3 font-utility uppercase tracking-widest text-sm mt-4">
Create Account
</button>
<button id="backToLoginBtn1" class="w-full bg-transparent text-clay hover:text-ink transition py-3 font-utility uppercase tracking-widest text-xs mt-2">
← Back to Login
</button>
</div>
<!-- Forgot Password Form -->
<div id="forgotPwdFormContainer" class="hidden space-y-4">
<p class="text-sm text-clay font-body mb-4">Enter your email address and a new password.</p>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">Email Address</label>
<input type="email" id="forgotPwdEmail" class="w-full bg-paper border border-ink p-3 text-ink focus:outline-none focus:border-moss transition" placeholder="jane@example.com">
</div>
<div>
<label class="block text-xs font-utility text-clay uppercase mb-1">New Password</label>
<input type="password" id="resetNewPassword" class="w-full bg-paper border border-ink p-3 text-ink focus:outline-none focus:border-moss" placeholder="Min. 8 characters">
</div>
<button id="submitResetBtn" class="w-full btn-primary py-3 font-utility uppercase tracking-widest text-sm mt-2">
Update Password
</button>
<button id="backToLoginBtn2" class="w-full bg-transparent text-clay hover:text-ink transition py-3 font-utility uppercase tracking-widest text-xs mt-2">
← Back to Login
</button>
</div>
</div>
</div>
<!-- Profile Selection Screen Removed -->
<!-- Patient Dashboard -->
<div class="hidden max-w-5xl mx-auto w-full h-screen p-4 flex-col fade-in overflow-hidden" id="dashboardScreen">
<div class="bg-paper border border-ink p-6 lg:p-10 flex-1 flex flex-col min-h-0 h-full">
<!-- Header -->
<div class="flex justify-between items-start border-b border-ink/30 pb-6 mb-6 shrink-0">
<div>
<h2 class="text-3xl font-display text-ink" id="dashboardPatientName">Patient Name</h2>
<p class="text-xs font-utility tracking-widest uppercase text-clay mt-2" id="dashboardPatientAge">Age: --</p>
</div>
<button class="btn-primary" id="dashboardStartBtn">NEW SESSION</button>
</div>
<!-- Content -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-10 flex-1 min-h-0 overflow-hidden" id="dashboardContent">
<!-- Profile left -->
<div class="space-y-6 overflow-y-auto pr-4 custom-scrollbar" id="dashboardDomains">
<h3 class="font-utility uppercase text-clay text-sm border-b border-ink/30 pb-2">Clinical Profile</h3>
<p class="text-clay text-sm italic">Loading profile data...</p>
</div>
<!-- Column 2: Session History -->
<div class="flex flex-col min-h-0 h-full">
<h3 class="font-utility uppercase text-clay text-sm border-b border-ink/30 pb-2 mb-4 shrink-0">Session History</h3>
<div id="dashboardSessionsList" class="flex-1 overflow-y-auto pr-4 space-y-4 custom-scrollbar">
<p class="text-clay text-sm italic">Loading previous sessions...</p>
</div>
</div>
</div>
<div class="mt-8 pt-6 border-t border-ink/30 shrink-0 flex flex-wrap justify-between items-center gap-4">
<button class="text-xs font-utility tracking-widest text-clay hover:text-ink uppercase transition flex items-center gap-2" id="dashboardLogoutBtn">
<span>←</span> LOGOUT
</button>
<div class="flex gap-4">
<button class="text-xs font-utility tracking-widest text-signal border border-signal hover:bg-signal hover:text-paper uppercase transition px-4 py-2 flex items-center gap-2" id="dashboardResetBtn">
RESET DATA
</button>
<button class="text-xs font-utility tracking-widest text-paper bg-signal hover:bg-signal/90 uppercase transition px-4 py-2 flex items-center gap-2" id="dashboardDeleteBtn">
DELETE ACCOUNT
</button>
</div>
</div>
</div>
</div>
<!-- Main App (Hidden Initially) -->
<div id="mainApp" style="display: none;" class="flex flex-col h-screen">
<!-- Header -->
<header class="bg-paper border-b border-ink sticky top-0 z-50 py-2 md:py-3 shadow-sm">
<div class="w-full px-3 md:px-12 mx-auto flex items-center justify-between gap-1 md:gap-2">
<!-- Left: Logo & Title -->
<div class="flex items-center gap-2 md:gap-4 shrink-0 min-w-0">
<img src="/static/icons/logo.svg" alt="Serinity Logo" class="w-8 h-8 md:w-10 md:h-10 opacity-90 shrink-0">
<div class="flex flex-col justify-center min-w-0">
<h1 class="text-xl md:text-3xl font-display text-ink leading-none truncate" id="headerName">Serinity</h1>
<p class="text-[10px] md:text-xs font-utility text-clay tracking-widest uppercase mt-0.5 truncate hidden sm:block">Clinical Session</p>
</div>
</div>
<!-- Right: Controls -->
<div class="flex items-center gap-2 shrink-0">
<span id="sessionStats" class="text-xs font-utility text-moss uppercase hidden lg:block"></span>
<select
id="voiceSelect"
class="bg-paper border border-ink text-ink text-xs md:text-sm font-utility px-1 py-1.5 outline-none focus:border-moss w-[70px] sm:w-[140px] md:w-[200px] cursor-pointer hover:bg-ink/5 truncate shrink-0"
>
<option value="">Voice: Off</option>
</select>
<!-- Mobile Slider Toggle -->
<label class="flex sm:hidden items-center cursor-pointer gap-1.5 shrink-0" title="Toggle Audio Response">
<div class="relative flex items-center">
<input type="checkbox" id="audioOutputToggleMobile" class="sr-only">
<div id="audioToggleTrack" class="block bg-ink/30 w-10 h-6 rounded-full transition-colors duration-200"></div>
<div id="audioToggleDot" class="dot absolute left-1 top-1 bg-paper w-4 h-4 rounded-full transition-transform duration-200"></div>
</div>
<svg id="audioToggleIconMobile" class="w-4 h-4 text-ink/50 transition-colors duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072M17.95 6.05a8 8 0 010 11.9M6.5 8.5H4a1 1 0 00-1 1v5a1 1 0 001 1h2.5l4 4V4.5l-4 4z"></path>
</svg>
</label>
<!-- Desktop Button Toggle -->
<button
id="audioOutputToggleDesktop"
class="hidden sm:flex border border-ink text-ink hover:bg-moss hover:border-moss hover:text-paper transition-all items-center justify-center px-2 py-1.5 md:px-3 shrink-0 gap-1"
title="Toggle Audio Response"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072M17.95 6.05a8 8 0 010 11.9M6.5 8.5H4a1 1 0 00-1 1v5a1 1 0 001 1h2.5l4 4V4.5l-4 4z"></path>
</svg>
<span class="text-xs font-utility uppercase tracking-wide" id="audioToggleLabelDesktop">Audio Off</span>
</button>
<button
id="endSessionBtn"
class="text-signal hover:text-signal/70 transition-colors border border-signal flex items-center justify-center px-2 py-1.5 md:px-3 shrink-0"
title="End Session"
>
<span class="text-xs md:text-sm font-utility uppercase tracking-wide md:hidden">End</span>
<span class="hidden md:inline text-sm font-utility uppercase tracking-wide">End Session</span>
</button>
</div>
</div>
</header>
<!-- Chat Container -->
<div class="flex-1 overflow-hidden flex flex-col w-full">
<div id="chatWrapper" class="flex-1 overflow-y-auto px-6 md:px-12 py-8 custom-scrollbar">
<div id="chat" class="flex flex-col gap-6 max-w-3xl mx-auto pb-8"></div>
</div>
</div>
<!-- Fixed Bottom Controls -->
<div class="bg-paper border-t border-ink sticky bottom-0">
<div class="w-full px-6 md:px-12 mx-auto py-4">
<!-- Input Mode Toggle -->
<div class="flex justify-center gap-4 mb-4">
<button id="textModeBtn" class="btn-toggle active uppercase tracking-wider text-xs">Text</button>
<button id="voiceModeBtn" class="btn-toggle uppercase tracking-wider text-xs">Audio</button>
</div>
<!-- Voice Input -->
<div id="voiceInput" class="hidden flex-col items-center gap-3">
<button
id="micBtn"
class="w-14 h-14 border border-ink rounded-full flex items-center justify-center transition-all duration-200 hover:bg-moss hover:border-moss hover:text-paper group text-ink"
style="touch-action: none;"
>
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"></path>
</svg>
</button>
<p id="status" class="text-xs font-utility text-clay uppercase tracking-widest">Hold Space to speak</p>
</div>
<!-- Text Input -->
<div id="textInput" class="block">
<div class="chat-input-container max-w-3xl mx-auto">
<input
type="text"
id="chatInput"
class="chat-input"
placeholder="Enter message..."
autocomplete="off"
/>
<button id="sendBtn" class="px-4 py-2 bg-ink text-paper text-sm font-utility uppercase transition-colors hover:bg-moss">
Submit
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Confirmation Modal -->
<div id="confirmationModal" style="display: none;" class="fixed inset-0 bg-ink/50 backdrop-blur-sm z-[60] flex flex-col items-center justify-center p-4 fade-in">
<div class="bg-paper border border-signal p-8 max-w-sm w-full shadow-lg">
<h2 class="text-xl font-display text-signal mb-2" id="confirmModalTitle">Are you sure?</h2>
<p class="text-clay text-sm mb-6" id="confirmModalText">This action cannot be undone.</p>
<div class="flex gap-4">
<button id="confirmModalCancelBtn" class="flex-1 bg-transparent border border-ink text-ink hover:bg-ink hover:text-paper transition py-2 font-utility uppercase tracking-widest text-sm">
CANCEL
</button>
<button id="confirmModalConfirmBtn" class="flex-1 bg-signal text-paper hover:bg-signal/80 transition py-2 font-utility uppercase tracking-widest text-sm">
CONFIRM
</button>
</div>
</div>
</div>
<!-- Continue Session Modal -->
<div id="continueSessionModal" style="display: none;" class="fixed inset-0 bg-ink/50 backdrop-blur-sm z-[60] flex flex-col items-center justify-center p-4 fade-in">
<div class="bg-paper border border-signal p-8 max-w-sm w-full shadow-lg">
<h2 class="text-xl font-display text-signal mb-2">Active Session Found</h2>
<p class="text-clay text-sm mb-6">You have a previous session that is still open. Would you like to pick up where you left off, or end it and start a new one?</p>
<div class="flex flex-col gap-3">
<button id="continueSessionBtn" class="w-full bg-signal text-paper hover:bg-signal/80 transition py-2 font-utility uppercase tracking-widest text-sm">
Continue Session
</button>
<button id="endAndStartNewBtn" class="w-full bg-transparent border border-ink text-ink hover:bg-ink hover:text-paper transition py-2 font-utility uppercase tracking-widest text-sm">
End & Start New
</button>
</div>
</div>
</div>
<!-- Alert Modal -->
<div id="alertModal" style="display: none;" class="fixed inset-0 bg-ink/50 backdrop-blur-sm z-[70] flex flex-col items-center justify-center p-4 fade-in">
<div class="bg-paper border border-ink p-8 max-w-sm w-full shadow-lg">
<h2 class="text-xl font-display text-ink mb-2" id="alertModalTitle">Notice</h2>
<p class="text-clay text-sm mb-6" id="alertModalText"></p>
<button id="alertModalOkBtn" class="w-full bg-ink text-paper hover:bg-moss transition py-2 font-utility uppercase tracking-widest text-sm">
OK
</button>
</div>
</div>
<!-- Delete Account Confirmation Modal -->
<div id="deleteAccountConfirmModal" style="display: none;" class="fixed inset-0 bg-ink/50 backdrop-blur-sm z-50 flex flex-col items-center justify-center p-4">
<div class="panel p-8 max-w-sm w-full shadow-lg">
<h2 class="text-xl font-display text-signal mb-2">Delete Account?</h2>
<p class="text-clay text-sm mb-6">Are you sure you want to completely delete your account? This action is irreversible and all data will be erased.</p>
<div class="flex gap-4">
<button id="deleteAccountCancelBtn" class="flex-1 bg-transparent border border-ink text-ink hover:bg-ink hover:text-paper transition py-2 font-utility uppercase tracking-widest text-sm">
CANCEL
</button>
<button id="deleteAccountConfirmBtn" class="flex-1 bg-signal text-paper hover:bg-signal/80 transition py-2 font-utility uppercase tracking-widest text-sm">
DELETE
</button>
</div>
</div>
</div>
<script type="module" src="/static/js/app.js"></script>
</body>
</html> |