MoiMoi-01 commited on
Commit
eefb915
·
verified ·
1 Parent(s): 6226b56

## Project Overview Design and build a premium web & mobile (PWA) front-end for a medical-chatbot platform that justifies a $10 000 price tag through sophisticated user experience, meticulous visual polish and bullet-proof engineering. The product revolves around a scannable Medical Card and must feel exclusive yet friction-less. ## Core User Flows **Registration** - Step-by-step wizard (max 3 screens) collects name, DOB, gender, allergies, chronic conditions, emergency contact and optional avatar. - On submit, a server-side endpoint returns a unique patient UUID and a signed JSON Web Token (JWT). - Front-end renders an animated “Medical Card” – a glossy 3-D card with embedded QR code (SVG + PNG fallback). - Card can be downloaded to Apple/Google Wallet or printed. **Authentication** - Scan-to-Sign-In - Uses WebRTC getUserMedia to open the camera, auto-detects QR, exchanges code for refreshed JWT. - Classic Sign-In - Email / username + password, both sent over HTTPS with HSTS and CSP headers. - Fast Switcher - Horizontal carousel shows avatars of previously signed-in profiles (localStorage). - Tap avatar → enter 4-digit PIN → instant login. - Guest Mode - “Browse as Guest” button skips auth, surfaces a watermark “GUEST – chats not saved”. **Consultation / Chat** - Two-pane split-screen layout: left = conversation, right = context panel (vitals, card, quick actions) [1]. - Messages stream in with typewriter animation and subtle haptic pulse on mobile [2]. - All chats autosave (IndexedDB offline cache + REST sync) except in Guest mode. - Each consultation is versioned so users can revisit timelines. ## Information Architecture | Section | Purpose | |---------|---------| | Top App Bar | Tiny patient card thumbnail, name, age; tap → full profile modal | | Conversation Pane | Rich Markdown, image/file attachments, voice notes | | Context Pane | Quick vitals input, previous prescriptions, “End Session” | | Settings Drawer | Theme toggle, language, manage PIN profiles | | Footer | “Made by Me” signature with micro-animation of signature stroke | ## Visual & Motion Design **Color Palette (AMOLED-only)** - #000000 Black (primary background) - #FFFFFF White (primary text) - #FF3B30 Red (error / destructive) - #D4AF37 Golden (premium accents, buttons) - #00C853 Green (success, online status) - #0A84FF Blue (interactive elements, links) Gradients: use 4-stop radial blends (Black→Blue→Green→Golden) at 10% opacity overlays for depth [2]. **Typography** - Heading: Inter Display, 700 - Body: Inter, 400 - Numeric (PIN, vitals): JetBrains Mono **Components** - Glass-morphism cards with 8 px blur, 1 px golden inner stroke. - Floating Action Button (FAB) with ripple in blue → green. - Lottie animations for card issuance, QR scan success, and “Made by Me” signature. **Motion** - 250 ms cubic-bezier(0.4, 0, 0.2, 1) for UI transitions. - Parallax tilt on Medical Card hover (DeviceOrientation API desktop / mobile). - Scroll-triggered fade-in of chat bubbles. ## Technical Stack - React 18 + TypeScript - Vite build pipeline, TailwindCSS (custom AMOLED palette) - Zustand for client state, React Query for API calls - WebAuthn (optional) for biometric PIN unlock - PWA: Service Worker for offline chat, Add-to-Home-Screen - ESLint + Prettier + Stylelint enforced CI - Lighthouse score ≥ 95 on Performance, Accessibility, Best-Practices, SEO ## Accessibility & Compliance - WCAG 2.2 AA: 4.5:1 contrast (white text on black, golden accents large-text only). - ARIA labels for camera & chat controls. - Reduced-motion media query disables animations. - HIPAA-conscious: all PHI confined to secure API calls, no PHI in localStorage. ## Security Notes - QR contains only opaque UUID; token exchanged server-side. - JWT 15 min expiry, rotating refresh token in HttpOnly cookie. - Content Security Policy blocks inline scripts. - PIN hashes (bcrypt) stored in IndexedDB, never sent off-device. ## Deliverables for the $10 000 Package - Figma design system (components, light & AMOLED dark themes) - Full-stack front-end repo with CI/CD GitHub Actions → Vercel preview - Unit + integration tests (Jest, Testing Library, Cypress e2e) - Lighthouse, Axe, and Playwright accessibility reports - Documentation site (Storybook) explaining components, theming, API mocks - 2 hrs onboarding workshop video call for hand-off This specification leverages your expertise in medical chatbots [3], your preference for colorful gradients and animations [2], centered card / split-screen layouts [1], and your premium high-end style [4]. [1] preferences.interface_layout [2] preferences.interface_design [3] programming.chatbots [4] projects.premium_website - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +441 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: V4
3
- emoji: 🌖
4
- colorFrom: pink
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: v4
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,441 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </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">
6
+ <title>MediChat Pro | Premium Medical Assistant</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
10
+ <style>
11
+ @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');
12
+
13
+ :root {
14
+ --gold: #D4AF37;
15
+ --blue: #0A84FF;
16
+ --green: #00C853;
17
+ --red: #FF3B30;
18
+ }
19
+
20
+ body {
21
+ font-family: 'Inter', sans-serif;
22
+ background-color: #000;
23
+ color: #fff;
24
+ margin: 0;
25
+ padding: 0;
26
+ overflow-x: hidden;
27
+ }
28
+
29
+ .mono {
30
+ font-family: 'JetBrains Mono', monospace;
31
+ }
32
+
33
+ .glass-card {
34
+ background: rgba(0, 0, 0, 0.5);
35
+ backdrop-filter: blur(8px);
36
+ -webkit-backdrop-filter: blur(8px);
37
+ border: 1px solid rgba(212, 175, 55, 0.2);
38
+ box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
39
+ }
40
+
41
+ .gold-border {
42
+ border: 1px solid var(--gold);
43
+ }
44
+
45
+ .inner-gold-border {
46
+ box-shadow: inset 0 0 0 1px var(--gold);
47
+ }
48
+
49
+ .gradient-bg {
50
+ background: radial-gradient(circle at 50% 50%, rgba(10, 132, 255, 0.1) 0%, rgba(0, 200, 83, 0.1) 50%, rgba(212, 175, 55, 0.1) 100%);
51
+ }
52
+
53
+ .fab-ripple {
54
+ position: relative;
55
+ overflow: hidden;
56
+ }
57
+
58
+ .fab-ripple:after {
59
+ content: "";
60
+ display: block;
61
+ position: absolute;
62
+ width: 100%;
63
+ height: 100%;
64
+ top: 0;
65
+ left: 0;
66
+ pointer-events: none;
67
+ background-image: radial-gradient(circle, var(--blue) 10%, transparent 10.01%);
68
+ background-repeat: no-repeat;
69
+ background-position: 50%;
70
+ transform: scale(10,10);
71
+ opacity: 0;
72
+ transition: transform .5s, opacity 1s;
73
+ }
74
+
75
+ .fab-ripple:active:after {
76
+ transform: scale(0,0);
77
+ opacity: 0.3;
78
+ transition: 0s;
79
+ }
80
+
81
+ .chat-bubble {
82
+ opacity: 0;
83
+ transform: translateY(10px);
84
+ transition: opacity 0.3s ease-out, transform 0.3s ease-out;
85
+ }
86
+
87
+ .chat-bubble.visible {
88
+ opacity: 1;
89
+ transform: translateY(0);
90
+ }
91
+
92
+ .typewriter {
93
+ overflow: hidden;
94
+ border-right: 2px solid var(--gold);
95
+ white-space: nowrap;
96
+ margin: 0 auto;
97
+ letter-spacing: 0.15em;
98
+ animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
99
+ }
100
+
101
+ @keyframes typing {
102
+ from { width: 0 }
103
+ to { width: 100% }
104
+ }
105
+
106
+ @keyframes blink-caret {
107
+ from, to { border-color: transparent }
108
+ 50% { border-color: var(--gold) }
109
+ }
110
+
111
+ .medical-card {
112
+ transform-style: preserve-3d;
113
+ transition: transform 0.5s;
114
+ transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
115
+ }
116
+
117
+ .medical-card:hover {
118
+ transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
119
+ }
120
+
121
+ @media (max-width: 768px) {
122
+ .split-layout {
123
+ flex-direction: column;
124
+ }
125
+
126
+ .conversation-pane, .context-pane {
127
+ width: 100% !important;
128
+ }
129
+ }
130
+ </style>
131
+ </head>
132
+ <body class="min-h-screen flex flex-col">
133
+ <!-- Top App Bar -->
134
+ <header class="bg-black py-4 px-6 flex justify-between items-center border-b border-gray-800">
135
+ <div class="flex items-center space-x-4">
136
+ <div class="relative">
137
+ <div class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center cursor-pointer medical-card" id="profileThumbnail">
138
+ <div class="w-8 h-8 rounded-full bg-gradient-to-br from-blue-500 to-green-500 flex items-center justify-center text-white font-bold">JP</div>
139
+ <div class="absolute -bottom-1 -right-1 w-4 h-4 rounded-full bg-green-500 border-2 border-black"></div>
140
+ </div>
141
+ </div>
142
+ <div>
143
+ <h1 class="text-white font-bold">John Peterson</h1>
144
+ <p class="text-gray-400 text-xs">42 years • Blood Type: A+</p>
145
+ </div>
146
+ </div>
147
+ <div class="flex items-center space-x-4">
148
+ <button class="text-gray-400 hover:text-white transition-colors">
149
+ <i class="fas fa-cog text-lg"></i>
150
+ </button>
151
+ <button class="text-gray-400 hover:text-white transition-colors">
152
+ <i class="fas fa-question-circle text-lg"></i>
153
+ </button>
154
+ </div>
155
+ </header>
156
+
157
+ <!-- Main Content -->
158
+ <main class="flex-1 flex split-layout">
159
+ <!-- Conversation Pane -->
160
+ <section class="w-2/3 p-6 flex flex-col" style="height: calc(100vh - 72px);">
161
+ <div class="flex-1 overflow-y-auto mb-4 space-y-4" id="chatContainer">
162
+ <!-- Chat bubbles will be added here by JavaScript -->
163
+ </div>
164
+
165
+ <div class="glass-card rounded-lg p-4 gradient-bg">
166
+ <div class="flex items-center space-x-2">
167
+ <div class="flex-1 relative">
168
+ <input type="text" placeholder="Type your health concern..."
169
+ class="w-full bg-gray-900 text-white px-4 py-3 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
170
+ <div class="absolute right-3 top-3 flex space-x-2">
171
+ <button class="text-gray-400 hover:text-blue-500 transition-colors">
172
+ <i class="fas fa-microphone"></i>
173
+ </button>
174
+ <button class="text-gray-400 hover:text-blue-500 transition-colors">
175
+ <i class="fas fa-paperclip"></i>
176
+ </button>
177
+ </div>
178
+ </div>
179
+ <button class="fab-ripple bg-gradient-to-br from-blue-500 to-green-500 text-white w-12 h-12 rounded-full flex items-center justify-center shadow-lg hover:shadow-xl transition-shadow">
180
+ <i class="fas fa-paper-plane"></i>
181
+ </button>
182
+ </div>
183
+ <div class="mt-2 text-xs text-gray-500 flex justify-between">
184
+ <span>MediChat Pro v2.4.1</span>
185
+ <span>End-to-end encrypted</span>
186
+ </div>
187
+ </div>
188
+ </section>
189
+
190
+ <!-- Context Pane -->
191
+ <section class="w-1/3 border-l border-gray-800 p-6 flex flex-col" style="height: calc(100vh - 72px);">
192
+ <div class="glass-card rounded-lg p-6 mb-6 gradient-bg inner-gold-border">
193
+ <h2 class="text-xl font-bold text-white mb-4 flex items-center">
194
+ <i class="fas fa-id-card mr-2 text-gold-500" style="color: var(--gold);"></i>
195
+ Medical Card
196
+ </h2>
197
+ <div class="medical-card bg-gradient-to-br from-gray-900 to-gray-800 rounded-xl p-6 gold-border shadow-xl cursor-pointer transform transition-transform">
198
+ <div class="flex justify-between items-start mb-6">
199
+ <div>
200
+ <h3 class="text-2xl font-bold">John Peterson</h3>
201
+ <p class="text-gray-400">42 years • Male</p>
202
+ </div>
203
+ <div class="bg-black p-2 rounded">
204
+ <div class="w-16 h-16 bg-white flex items-center justify-center">
205
+ <!-- QR Code Placeholder -->
206
+ <div class="grid grid-cols-4 gap-1 w-12 h-12">
207
+ <div class="bg-black"></div><div class="bg-black"></div><div class="bg-black"></div><div class="bg-black"></div>
208
+ <div class="bg-black"></div><div class="bg-white"></div><div class="bg-white"></div><div class="bg-black"></div>
209
+ <div class="bg-black"></div><div class="bg-white"></div><div class="bg-black"></div><div class="bg-black"></div>
210
+ <div class="bg-black"></div><div class="bg-black"></div><div class="bg-white"></div><div class="bg-black"></div>
211
+ </div>
212
+ </div>
213
+ </div>
214
+ </div>
215
+
216
+ <div class="grid grid-cols-2 gap-4 mb-6">
217
+ <div>
218
+ <p class="text-gray-400 text-xs">Blood Type</p>
219
+ <p class="font-bold">A+</p>
220
+ </div>
221
+ <div>
222
+ <p class="text-gray-400 text-xs">Allergies</p>
223
+ <p class="font-bold">Penicillin</p>
224
+ </div>
225
+ <div>
226
+ <p class="text-gray-400 text-xs">Conditions</p>
227
+ <p class="font-bold">Hypertension</p>
228
+ </div>
229
+ <div>
230
+ <p class="text-gray-400 text-xs">Last Updated</p>
231
+ <p class="font-bold">Jun 15, 2023</p>
232
+ </div>
233
+ </div>
234
+
235
+ <div class="flex justify-between items-center">
236
+ <button class="text-xs bg-black text-white px-3 py-1 rounded flex items-center">
237
+ <i class="fas fa-download mr-1"></i> Save
238
+ </button>
239
+ <div class="text-xs text-gray-400">
240
+ ID: 7X9P-2K4M-6R8Q
241
+ </div>
242
+ </div>
243
+ </div>
244
+ </div>
245
+
246
+ <div class="glass-card rounded-lg p-6 mb-6 gradient-bg inner-gold-border">
247
+ <h2 class="text-xl font-bold text-white mb-4 flex items-center">
248
+ <i class="fas fa-heartbeat mr-2" style="color: var(--red);"></i>
249
+ Quick Vitals
250
+ </h2>
251
+ <div class="grid grid-cols-2 gap-4">
252
+ <div class="bg-gray-900 rounded-lg p-3">
253
+ <p class="text-gray-400 text-xs">Blood Pressure</p>
254
+ <div class="flex items-end">
255
+ <input type="text" value="120" class="bg-transparent border-b border-gray-700 w-8 text-right mono focus:outline-none">
256
+ <span class="mx-1">/</span>
257
+ <input type="text" value="80" class="bg-transparent border-b border-gray-700 w-8 text-right mono focus:outline-none">
258
+ <span class="ml-1 text-xs">mmHg</span>
259
+ </div>
260
+ </div>
261
+ <div class="bg-gray-900 rounded-lg p-3">
262
+ <p class="text-gray-400 text-xs">Heart Rate</p>
263
+ <div class="flex items-end">
264
+ <input type="text" value="72" class="bg-transparent border-b border-gray-700 w-8 text-right mono focus:outline-none">
265
+ <span class="ml-1 text-xs">bpm</span>
266
+ </div>
267
+ </div>
268
+ <div class="bg-gray-900 rounded-lg p-3">
269
+ <p class="text-gray-400 text-xs">Temperature</p>
270
+ <div class="flex items-end">
271
+ <input type="text" value="36.6" class="bg-transparent border-b border-gray-700 w-12 text-right mono focus:outline-none">
272
+ <span class="ml-1 text-xs">°C</span>
273
+ </div>
274
+ </div>
275
+ <div class="bg-gray-900 rounded-lg p-3">
276
+ <p class="text-gray-400 text-xs">Oxygen</p>
277
+ <div class="flex items-end">
278
+ <input type="text" value="98" class="bg-transparent border-b border-gray-700 w-8 text-right mono focus:outline-none">
279
+ <span class="ml-1 text-xs">%</span>
280
+ </div>
281
+ </div>
282
+ </div>
283
+ <button class="w-full mt-4 bg-gradient-to-r from-blue-500 to-green-500 text-white py-2 rounded-lg font-bold hover:opacity-90 transition-opacity">
284
+ Update Vitals
285
+ </button>
286
+ </div>
287
+
288
+ <div class="glass-card rounded-lg p-6 gradient-bg inner-gold-border flex-1 flex flex-col">
289
+ <h2 class="text-xl font-bold text-white mb-4 flex items-center">
290
+ <i class="fas fa-history mr-2" style="color: var(--blue);"></i>
291
+ Recent Consultations
292
+ </h2>
293
+ <div class="flex-1 overflow-y-auto">
294
+ <div class="space-y-3">
295
+ <div class="bg-gray-900 rounded-lg p-4 cursor-pointer hover:bg-gray-800 transition-colors">
296
+ <div class="flex justify-between items-center mb-1">
297
+ <h3 class="font-bold">Headache & Dizziness</h3>
298
+ <span class="text-xs text-gray-400">Jun 12, 2023</span>
299
+ </div>
300
+ <p class="text-sm text-gray-400 truncate">Recommended: hydration, rest, follow up if symptoms persist...</p>
301
+ </div>
302
+ <div class="bg-gray-900 rounded-lg p-4 cursor-pointer hover:bg-gray-800 transition-colors">
303
+ <div class="flex justify-between items-center mb-1">
304
+ <h3 class="font-bold">Blood Pressure Review</h3>
305
+ <span class="text-xs text-gray-400">May 28, 2023</span>
306
+ </div>
307
+ <p class="text-sm text-gray-400 truncate">Current medication appears effective, continue dosage...</p>
308
+ </div>
309
+ <div class="bg-gray-900 rounded-lg p-4 cursor-pointer hover:bg-gray-800 transition-colors">
310
+ <div class="flex justify-between items-center mb-1">
311
+ <h3 class="font-bold">Allergy Symptoms</h3>
312
+ <span class="text-xs text-gray-400">Apr 15, 2023</span>
313
+ </div>
314
+ <p class="text-sm text-gray-400 truncate">Identified potential new allergen, recommended allergy testing...</p>
315
+ </div>
316
+ </div>
317
+ </div>
318
+ <button class="w-full mt-4 bg-black text-white py-2 rounded-lg font-bold border border-gray-700 hover:bg-gray-800 transition-colors">
319
+ View All Consultations
320
+ </button>
321
+ </div>
322
+ </section>
323
+ </main>
324
+
325
+ <!-- Footer -->
326
+ <footer class="bg-black py-4 px-6 border-t border-gray-800 flex justify-between items-center">
327
+ <div class="text-gray-500 text-sm">
328
+ <span class="font-bold" style="color: var(--gold);">MediChat</span> Pro • HIPAA Compliant
329
+ </div>
330
+ <div class="flex items-center space-x-4">
331
+ <button class="text-gray-500 hover:text-white transition-colors">
332
+ <i class="fab fa-apple"></i>
333
+ </button>
334
+ <button class="text-gray-500 hover:text-white transition-colors">
335
+ <i class="fab fa-google-play"></i>
336
+ </button>
337
+ <button class="text-gray-500 hover:text-white transition-colors">
338
+ <i class="fas fa-share-alt"></i>
339
+ </button>
340
+ </div>
341
+ </footer>
342
+
343
+ <!-- Signature Animation -->
344
+ <div class="fixed bottom-4 right-4 text-xs text-gray-500 flex items-center">
345
+ <span class="mr-2">Made by</span>
346
+ <svg width="80" height="20" viewBox="0 0 200 40" class="signature">
347
+ <path fill="none" stroke="var(--gold)" stroke-width="2" stroke-dasharray="300" stroke-dashoffset="300"
348
+ d="M10,30 Q30,10 50,30 T90,30" class="animate-draw" style="animation: draw 2s ease-in-out forwards;"></path>
349
+ </svg>
350
+ </div>
351
+
352
+ <script>
353
+ // Sample chat messages
354
+ const chatMessages = [
355
+ {
356
+ sender: 'bot',
357
+ text: 'Hello John, I\'m your MediChat assistant. How can I help you today?',
358
+ timestamp: '2:45 PM'
359
+ },
360
+ {
361
+ sender: 'user',
362
+ text: 'I\'ve been having headaches for the past 3 days.',
363
+ timestamp: '2:46 PM'
364
+ },
365
+ {
366
+ sender: 'bot',
367
+ text: 'I\'m sorry to hear that. To better assist you, could you rate the pain on a scale from 1 to 10?',
368
+ timestamp: '2:46 PM'
369
+ },
370
+ {
371
+ sender: 'user',
372
+ text: 'About a 6. It\'s persistent but not unbearable.',
373
+ timestamp: '2:47 PM'
374
+ },
375
+ {
376
+ sender: 'bot',
377
+ text: 'Thank you. Based on your medical history, I recommend:\n\n1. Hydration - drink at least 8 glasses of water today\n2. Rest - try to reduce screen time\n3. Monitor - if pain persists beyond 48 hours, we should schedule a video consultation\n\nWould you like me to set a reminder to check in tomorrow?',
378
+ timestamp: '2:48 PM'
379
+ }
380
+ ];
381
+
382
+ // Render chat messages with animation
383
+ function renderChatMessages() {
384
+ const chatContainer = document.getElementById('chatContainer');
385
+ chatContainer.innerHTML = '';
386
+
387
+ chatMessages.forEach((message, index) => {
388
+ const messageElement = document.createElement('div');
389
+ messageElement.className = `chat-bubble flex ${message.sender === 'user' ? 'justify-end' : 'justify-start'}`;
390
+
391
+ messageElement.innerHTML = `
392
+ <div class="max-w-xs md:max-w-md lg:max-w-lg ${message.sender === 'user' ? 'bg-gradient-to-br from-blue-500 to-green-500' : 'bg-gray-800'} rounded-2xl p-4 shadow-lg">
393
+ <div class="text-white">${message.text}</div>
394
+ <div class="text-xs mt-1 ${message.sender === 'user' ? 'text-blue-100' : 'text-gray-400'}">${message.timestamp}</div>
395
+ </div>
396
+ `;
397
+
398
+ chatContainer.appendChild(messageElement);
399
+
400
+ // Animate in
401
+ setTimeout(() => {
402
+ messageElement.classList.add('visible');
403
+
404
+ // Add typewriter effect to bot messages
405
+ if (message.sender === 'bot' && index === 0) {
406
+ const textElement = messageElement.querySelector('div:first-child');
407
+ textElement.classList.add('typewriter');
408
+ }
409
+ }, index * 300);
410
+ });
411
+ }
412
+
413
+ // Medical card hover effect
414
+ function setupMedicalCardHover() {
415
+ const card = document.querySelector('.medical-card');
416
+
417
+ if (window.matchMedia("(min-width: 768px)").matches) {
418
+ card.addEventListener('mousemove', (e) => {
419
+ const xAxis = (window.innerWidth / 2 - e.pageX) / 25;
420
+ const yAxis = (window.innerHeight / 2 - e.pageY) / 25;
421
+ card.style.transform = `perspective(1000px) rotateX(${yAxis}deg) rotateY(${xAxis}deg)`;
422
+ });
423
+
424
+ card.addEventListener('mouseleave', () => {
425
+ card.style.transform = 'perspective(1000px) rotateX(0deg) rotateY(0deg)';
426
+ });
427
+ }
428
+ }
429
+
430
+ // Initialize
431
+ document.addEventListener('DOMContentLoaded', () => {
432
+ renderChatMessages();
433
+ setupMedicalCardHover();
434
+
435
+ // Add animation for signature
436
+ const signature = document.querySelector('.signature path');
437
+ signature.style.animation = 'draw 2s ease-in-out forwards';
438
+ });
439
+ </script>
440
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=MoiMoi-01/v4" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
441
+ </html>