Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +363 -19
- prompts.txt +0 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
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: in-vitra
|
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,363 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>InVitra - Your Fertility Journey Guide</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 |
+
<style>
|
10 |
+
.gradient-bg {
|
11 |
+
background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
|
12 |
+
}
|
13 |
+
.chat-bubble {
|
14 |
+
border-radius: 1.5rem;
|
15 |
+
max-width: 80%;
|
16 |
+
}
|
17 |
+
.user-bubble {
|
18 |
+
background-color: #7e22ce;
|
19 |
+
color: white;
|
20 |
+
border-bottom-right-radius: 0.5rem;
|
21 |
+
}
|
22 |
+
.bot-bubble {
|
23 |
+
background-color: #f5f3ff;
|
24 |
+
color: #1f2937;
|
25 |
+
border-bottom-left-radius: 0.5rem;
|
26 |
+
}
|
27 |
+
.fade-in {
|
28 |
+
animation: fadeIn 0.5s ease-in;
|
29 |
+
}
|
30 |
+
@keyframes fadeIn {
|
31 |
+
from { opacity: 0; transform: translateY(10px); }
|
32 |
+
to { opacity: 1; transform: translateY(0); }
|
33 |
+
}
|
34 |
+
.hero-image {
|
35 |
+
width: 300px;
|
36 |
+
height: 300px;
|
37 |
+
object-fit: cover;
|
38 |
+
border-radius: 50%;
|
39 |
+
border: 5px solid white;
|
40 |
+
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
|
41 |
+
}
|
42 |
+
.resource-card:hover {
|
43 |
+
transform: translateY(-5px);
|
44 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
45 |
+
}
|
46 |
+
</style>
|
47 |
+
</head>
|
48 |
+
<body class="gradient-bg min-h-screen font-sans">
|
49 |
+
<!-- Header -->
|
50 |
+
<header class="bg-gradient-to-r from-purple-800 to-purple-600 text-white shadow-lg">
|
51 |
+
<div class="container mx-auto px-4 py-6">
|
52 |
+
<div class="flex justify-between items-center">
|
53 |
+
<div class="flex items-center space-x-3">
|
54 |
+
<i class="fas fa-baby-carriage text-3xl"></i>
|
55 |
+
<h1 class="text-2xl font-bold">InVitra</h1>
|
56 |
+
</div>
|
57 |
+
<nav>
|
58 |
+
<ul class="flex space-x-6">
|
59 |
+
<li><a href="#chat" class="hover:text-purple-200 transition">Chat</a></li>
|
60 |
+
<li><a href="#resources" class="hover:text-purple-200 transition">Resources</a></li>
|
61 |
+
<li><a href="#about" class="hover:text-purple-200 transition">About</a></li>
|
62 |
+
</ul>
|
63 |
+
</nav>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
</header>
|
67 |
+
|
68 |
+
<!-- Hero Section -->
|
69 |
+
<section class="py-16 px-4">
|
70 |
+
<div class="container mx-auto flex flex-col items-center text-center">
|
71 |
+
<img src="https://images.unsplash.com/photo-1607748851687-ba9a10438621?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80"
|
72 |
+
alt="Supportive hands"
|
73 |
+
class="hero-image mb-8">
|
74 |
+
<h2 class="text-4xl font-bold text-purple-900 mb-4">Your Personalized IVF Companion</h2>
|
75 |
+
<p class="text-lg text-purple-800 mb-6 max-w-2xl">Empowering women with knowledge, support, and personalized advice throughout every step of the IVF process.</p>
|
76 |
+
<a href="#chat" class="bg-gradient-to-r from-purple-700 to-purple-500 hover:from-purple-800 hover:to-purple-600 text-white px-6 py-3 rounded-full font-medium transition shadow-lg">
|
77 |
+
Start Chatting <i class="fas fa-chevron-right ml-2"></i>
|
78 |
+
</a>
|
79 |
+
</div>
|
80 |
+
</section>
|
81 |
+
|
82 |
+
<!-- Interactive Advice Chat -->
|
83 |
+
<section id="chat" class="bg-white rounded-xl shadow-lg p-6 mb-20 container mx-auto max-w-4xl">
|
84 |
+
<h2 class="text-3xl font-bold text-center text-purple-900 mb-8">Ask Our IVF Advisor</h2>
|
85 |
+
<div class="max-w-3xl mx-auto">
|
86 |
+
<div id="chat-container" class="h-96 overflow-y-auto mb-6 p-4 bg-purple-50 rounded-lg flex flex-col space-y-4">
|
87 |
+
<div class="bot-bubble chat-bubble p-4 self-start max-w-xs md:max-w-md fade-in">
|
88 |
+
<p>Hello! I'm here to help answer your questions about the IVF process. What would you like to know today?</p>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
<div class="flex">
|
92 |
+
<input type="text" id="user-input" placeholder="Ask about medications, side effects, success rates..."
|
93 |
+
class="flex-grow px-4 py-3 border-2 border-purple-300 rounded-l-full focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-300">
|
94 |
+
<button id="send-btn" class="bg-gradient-to-r from-purple-700 to-purple-500 hover:from-purple-800 hover:to-purple-600 text-white px-6 py-3 rounded-r-full transition">
|
95 |
+
<i class="fas fa-paper-plane"></i>
|
96 |
+
</button>
|
97 |
+
</div>
|
98 |
+
<div class="mt-4 flex flex-wrap justify-center gap-2">
|
99 |
+
<button class="quick-question bg-purple-100 hover:bg-purple-200 text-purple-700 px-4 py-2 rounded-full text-sm transition">
|
100 |
+
Medication side effects?
|
101 |
+
</button>
|
102 |
+
<button class="quick-question bg-purple-100 hover:bg-purple-200 text-purple-700 px-4 py-2 rounded-full text-sm transition">
|
103 |
+
Success rates by age?
|
104 |
+
</button>
|
105 |
+
<button class="quick-question bg-purple-100 hover:bg-purple-200 text-purple-700 px-4 py-2 rounded-full text-sm transition">
|
106 |
+
Emotional support tips?
|
107 |
+
</button>
|
108 |
+
<button class="quick-question bg-purple-100 hover:bg-purple-200 text-purple-700 px-4 py-2 rounded-full text-sm transition">
|
109 |
+
What's the typical cost?
|
110 |
+
</button>
|
111 |
+
<button class="quick-question bg-purple-100 hover:bg-purple-200 text-purple-700 px-4 py-2 rounded-full text-sm transition">
|
112 |
+
How long does IVF take?
|
113 |
+
</button>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
</section>
|
117 |
+
|
118 |
+
<!-- Resources Section -->
|
119 |
+
<section id="resources" class="mb-20 container mx-auto max-w-4xl">
|
120 |
+
<h2 class="text-3xl font-bold text-center text-purple-900 mb-12">Helpful Resources</h2>
|
121 |
+
<div class="grid md:grid-cols-2 gap-8">
|
122 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden transition duration-300 resource-card">
|
123 |
+
<div class="h-48 bg-gradient-to-r from-purple-100 to-purple-50 flex items-center justify-center">
|
124 |
+
<i class="fas fa-pills text-6xl text-purple-600"></i>
|
125 |
+
</div>
|
126 |
+
<div class="p-6">
|
127 |
+
<h3 class="text-xl font-semibold text-purple-800 mb-3">IVF Medications Guide</h3>
|
128 |
+
<p class="text-gray-600 mb-4">Comprehensive information about fertility drugs, their purposes, and potential side effects.</p>
|
129 |
+
<a href="#" class="text-purple-600 font-medium hover:text-purple-800 flex items-center">
|
130 |
+
Read More <i class="fas fa-arrow-right ml-2"></i>
|
131 |
+
</a>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden transition duration-300 resource-card">
|
135 |
+
<div class="h-48 bg-gradient-to-r from-purple-100 to-purple-50 flex items-center justify-center">
|
136 |
+
<i class="fas fa-apple-alt text-6xl text-purple-600"></i>
|
137 |
+
</div>
|
138 |
+
<div class="p-6">
|
139 |
+
<h3 class="text-xl font-semibold text-purple-800 mb-3">Nutrition & IVF</h3>
|
140 |
+
<p class="text-gray-600 mb-4">Dietary recommendations to support your fertility and IVF treatment success.</p>
|
141 |
+
<a href="#" class="text-purple-600 font-medium hover:text-purple-800 flex items-center">
|
142 |
+
Read More <i class="fas fa-arrow-right ml-2"></i>
|
143 |
+
</a>
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden transition duration-300 resource-card">
|
147 |
+
<div class="h-48 bg-gradient-to-r from-purple-100 to-purple-50 flex items-center justify-center">
|
148 |
+
<i class="fas fa-heartbeat text-6xl text-purple-600"></i>
|
149 |
+
</div>
|
150 |
+
<div class="p-6">
|
151 |
+
<h3 class="text-xl font-semibold text-purple-800 mb-3">Emotional Wellness</h3>
|
152 |
+
<p class="text-gray-600 mb-4">Strategies for managing stress and emotional challenges during your IVF journey.</p>
|
153 |
+
<a href="#" class="text-purple-600 font-medium hover:text-purple-800 flex items-center">
|
154 |
+
Read More <i class="fas fa-arrow-right ml-2"></i>
|
155 |
+
</a>
|
156 |
+
</div>
|
157 |
+
</div>
|
158 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden transition duration-300 resource-card">
|
159 |
+
<div class="h-48 bg-gradient-to-r from-purple-100 to-purple-50 flex items-center justify-center">
|
160 |
+
<i class="fas fa-calendar-check text-6xl text-purple-600"></i>
|
161 |
+
</div>
|
162 |
+
<div class="p-6">
|
163 |
+
<h3 class="text-xl font-semibold text-purple-800 mb-3">IVF Timeline</h3>
|
164 |
+
<p class="text-gray-600 mb-4">Understand what to expect at each stage of the IVF process with our detailed timeline.</p>
|
165 |
+
<a href="#" class="text-purple-600 font-medium hover:text-purple-800 flex items-center">
|
166 |
+
Read More <i class="fas fa-arrow-right ml-2"></i>
|
167 |
+
</a>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
</div>
|
171 |
+
</section>
|
172 |
+
|
173 |
+
<!-- About Section -->
|
174 |
+
<section id="about" class="bg-gradient-to-b from-purple-50 to-white rounded-xl p-8 mb-20 container mx-auto max-w-4xl">
|
175 |
+
<h2 class="text-3xl font-bold text-center text-purple-900 mb-8">About InVitra</h2>
|
176 |
+
<div class="flex flex-col md:flex-row items-center">
|
177 |
+
<div class="md:w-1/3 mb-8 md:mb-0 md:pr-8">
|
178 |
+
<img src="https://images.unsplash.com/photo-1579684385127-1ef15d508118?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=880&q=80"
|
179 |
+
alt="Supportive community"
|
180 |
+
class="rounded-lg shadow-md w-full">
|
181 |
+
</div>
|
182 |
+
<div class="md:w-2/3">
|
183 |
+
<h3 class="text-xl font-semibold text-purple-800 mb-4">Our Mission</h3>
|
184 |
+
<p class="text-gray-700 mb-6">InVitra was created by Regina Sil and Clem Delangue to provide compassionate, evidence-based support for women navigating the complex IVF journey. Our platform combines medical expertise with personal understanding to guide you through every step.</p>
|
185 |
+
<div class="space-y-4">
|
186 |
+
<div class="flex items-start">
|
187 |
+
<i class="fas fa-check-circle text-purple-600 mr-4 mt-1"></i>
|
188 |
+
<span>Trusted information reviewed by fertility specialists</span>
|
189 |
+
</div>
|
190 |
+
<div class="flex items-start">
|
191 |
+
<i class="fas fa-check-circle text-purple-600 mr-4 mt-1"></i>
|
192 |
+
<span>Personalized guidance tailored to your situation</span>
|
193 |
+
</div>
|
194 |
+
<div class="flex items-start">
|
195 |
+
<i class="fas fa-check-circle text-purple-600 mr-4 mt-1"></i>
|
196 |
+
<span>24/7 access to support when you need it most</span>
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
<button class="mt-6 bg-gradient-to-r from-purple-700 to-purple-500 hover:from-purple-800 hover:to-purple-600 text-white px-6 py-3 rounded-full font-medium transition shadow">
|
200 |
+
Contact Us <i class="fas fa-envelope ml-2"></i>
|
201 |
+
</button>
|
202 |
+
</div>
|
203 |
+
</div>
|
204 |
+
</section>
|
205 |
+
|
206 |
+
<!-- Footer -->
|
207 |
+
<footer class="bg-gradient-to-r from-purple-900 to-purple-800 text-white py-12">
|
208 |
+
<div class="container mx-auto px-4 text-center">
|
209 |
+
<div class="mb-8">
|
210 |
+
<h3 class="text-xl font-bold mb-4">InVitra</h3>
|
211 |
+
<p class="text-purple-200 max-w-2xl mx-auto">Empowering women with knowledge and support throughout their fertility journey.</p>
|
212 |
+
</div>
|
213 |
+
<div class="flex justify-center space-x-6 mb-6">
|
214 |
+
<a href="#" class="text-purple-200 hover:text-white text-2xl transition"><i class="fab fa-facebook"></i></a>
|
215 |
+
<a href="#" class="text-purple-200 hover:text-white text-2xl transition"><i class="fab fa-instagram"></i></a>
|
216 |
+
<a href="#" class="text-purple-200 hover:text-white text-2xl transition"><i class="fab fa-twitter"></i></a>
|
217 |
+
<a href="#" class="text-purple-200 hover:text-white text-2xl transition"><i class="fab fa-linkedin"></i></a>
|
218 |
+
</div>
|
219 |
+
<div class="border-t border-purple-800 pt-6 text-purple-300">
|
220 |
+
<p>© 2023 InVitra. All rights reserved.</p>
|
221 |
+
<p class="mt-2 text-sm">Created by Regina Sil & Clem Delangue</p>
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
</footer>
|
225 |
+
|
226 |
+
<script>
|
227 |
+
// IVF Knowledge Base
|
228 |
+
const ivfKnowledge = {
|
229 |
+
"medication side effects": {
|
230 |
+
response: "Common IVF medication side effects may include:<br><br>" +
|
231 |
+
"• Headaches<br>" +
|
232 |
+
"• Mood swings<br>" +
|
233 |
+
"• Bloating<br>" +
|
234 |
+
"• Mild abdominal pain<br>" +
|
235 |
+
"• Breast tenderness<br>" +
|
236 |
+
"• Hot flashes<br><br>" +
|
237 |
+
"Severe side effects like OHSS (Ovarian Hyperstimulation Syndrome) are rare but require immediate medical attention if you experience severe pain, nausea/vomiting, or sudden weight gain."
|
238 |
+
},
|
239 |
+
"success rates by age": {
|
240 |
+
response: "IVF success rates vary significantly by age:<br><br>" +
|
241 |
+
"• Under 35: ~40-50% per cycle<br>" +
|
242 |
+
"• 35-37: ~35-40% per cycle<br>" +
|
243 |
+
"• 38-40: ~25-30% per cycle<br>" +
|
244 |
+
"• 41-42: ~15-20% per cycle<br>" +
|
245 |
+
"• Over 42: ~5-10% per cycle<br><br>" +
|
246 |
+
"These are general statistics - your doctor can provide more personalized estimates based on your specific situation."
|
247 |
+
},
|
248 |
+
"emotional support tips": {
|
249 |
+
response: "Coping with IVF emotionally:<br><br>" +
|
250 |
+
"1. Join a support group (like ours!)<br>" +
|
251 |
+
"2. Practice mindfulness or meditation<br>" +
|
252 |
+
"3. Communicate openly with your partner<br>" +
|
253 |
+
"4. Set realistic expectations<br>" +
|
254 |
+
"5. Take breaks when needed<br>" +
|
255 |
+
"6. Consider counseling with a therapist specializing in fertility<br>" +
|
256 |
+
"7. Maintain other interests outside of IVF<br><br>" +
|
257 |
+
"Remember it's normal to feel a range of emotions during this process."
|
258 |
+
},
|
259 |
+
"cost": {
|
260 |
+
response: "IVF costs vary widely but typically range from $12,000-$20,000 per cycle in the US. This usually includes:<br><br>" +
|
261 |
+
"• Medications ($3,000-$6,000)<br>" +
|
262 |
+
"• Monitoring appointments<br>" +
|
263 |
+
"• Egg retrieval procedure<br>" +
|
264 |
+
"• Laboratory fees<br>" +
|
265 |
+
"• Embryo transfer<br><br>" +
|
266 |
+
"Additional costs may apply for genetic testing, frozen embryo transfers, or donor materials. Some insurance plans offer partial coverage."
|
267 |
+
},
|
268 |
+
"timeline": {
|
269 |
+
response: "A typical IVF cycle takes about 6-8 weeks from start to pregnancy test:<br><br>" +
|
270 |
+
"1. Ovarian stimulation: 8-14 days<br>" +
|
271 |
+
"2. Egg retrieval: 1 day procedure<br>" +
|
272 |
+
"3. Fertilization & embryo development: 3-5 days<br>" +
|
273 |
+
"4. Embryo transfer: 1 day procedure<br>" +
|
274 |
+
"5. Wait for pregnancy test: 9-14 days<br><br>" +
|
275 |
+
"Some protocols may vary this timeline, especially if using birth control pills first or freezing embryos for future transfer."
|
276 |
+
},
|
277 |
+
"preparation": {
|
278 |
+
response: "To prepare for IVF:<br><br>" +
|
279 |
+
"• Stop smoking and limit alcohol<br>" +
|
280 |
+
"• Maintain a healthy BMI<br>" +
|
281 |
+
"• Take prenatal vitamins (especially folic acid)<br>" +
|
282 |
+
"• Reduce caffeine intake<br>" +
|
283 |
+
"• Manage stress through relaxation techniques<br>" +
|
284 |
+
"• Review medications with your doctor<br>" +
|
285 |
+
"• Consider acupuncture (some find it helpful)<br><br>" +
|
286 |
+
"Your clinic will provide specific instructions for your protocol."
|
287 |
+
},
|
288 |
+
"default": {
|
289 |
+
response: "I'm here to help with your IVF questions. Could you please be more specific about what information you're looking for? For example, you could ask about:<br><br>" +
|
290 |
+
"• Medication side effects<br>" +
|
291 |
+
"• Success rates by age<br>" +
|
292 |
+
"• Emotional support tips<br>" +
|
293 |
+
"• IVF costs<br>" +
|
294 |
+
"• The IVF timeline<br>" +
|
295 |
+
"• How to prepare for IVF"
|
296 |
+
}
|
297 |
+
};
|
298 |
+
|
299 |
+
// Chat functionality
|
300 |
+
document.addEventListener('DOMContentLoaded', function() {
|
301 |
+
const chatContainer = document.getElementById('chat-container');
|
302 |
+
const userInput = document.getElementById('user-input');
|
303 |
+
const sendBtn = document.getElementById('send-btn');
|
304 |
+
const quickQuestions = document.querySelectorAll('.quick-question');
|
305 |
+
|
306 |
+
function addMessage(message, isUser) {
|
307 |
+
const messageDiv = document.createElement('div');
|
308 |
+
messageDiv.className = `${isUser ? 'user-bubble' : 'bot-bubble'} chat-bubble p-4 ${isUser ? 'self-end' : 'self-start'} max-w-xs md:max-w-md fade-in`;
|
309 |
+
messageDiv.innerHTML = `<p>${message}</p>`;
|
310 |
+
chatContainer.appendChild(messageDiv);
|
311 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
312 |
+
}
|
313 |
+
|
314 |
+
function getResponse(question) {
|
315 |
+
question = question.toLowerCase();
|
316 |
+
for (const key in ivfKnowledge) {
|
317 |
+
if (question.includes(key)) {
|
318 |
+
return ivfKnowledge[key].response;
|
319 |
+
}
|
320 |
+
}
|
321 |
+
return ivfKnowledge.default.response;
|
322 |
+
}
|
323 |
+
|
324 |
+
function handleUserInput() {
|
325 |
+
const question = userInput.value.trim();
|
326 |
+
if (question) {
|
327 |
+
addMessage(question, true);
|
328 |
+
userInput.value = '';
|
329 |
+
|
330 |
+
// Simulate typing indicator
|
331 |
+
const typingIndicator = document.createElement('div');
|
332 |
+
typingIndicator.className = 'bot-bubble chat-bubble p-4 self-start max-w-xs md:max-w-md';
|
333 |
+
typingIndicator.innerHTML = '<div class="flex space-x-2"><div class="w-2 h-2 rounded-full bg-gray-400 animate-bounce"></div><div class="w-2 h-2 rounded-full bg-gray-400 animate-bounce" style="animation-delay: 0.2s"></div><div class="w-2 h-2 rounded-full bg-gray-400 animate-bounce" style="animation-delay: 0.4s"></div></div>';
|
334 |
+
chatContainer.appendChild(typingIndicator);
|
335 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
336 |
+
|
337 |
+
// Remove typing indicator after delay and show response
|
338 |
+
setTimeout(() => {
|
339 |
+
chatContainer.removeChild(typingIndicator);
|
340 |
+
const response = getResponse(question);
|
341 |
+
addMessage(response, false);
|
342 |
+
}, 1000 + Math.random() * 1000);
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
// Event listeners
|
347 |
+
sendBtn.addEventListener('click', handleUserInput);
|
348 |
+
userInput.addEventListener('keypress', function(e) {
|
349 |
+
if (e.key === 'Enter') {
|
350 |
+
handleUserInput();
|
351 |
+
}
|
352 |
+
});
|
353 |
+
|
354 |
+
quickQuestions.forEach(button => {
|
355 |
+
button.addEventListener('click', function() {
|
356 |
+
userInput.value = this.textContent;
|
357 |
+
handleUserInput();
|
358 |
+
});
|
359 |
+
});
|
360 |
+
});
|
361 |
+
</script>
|
362 |
+
<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=clem/in-vitra" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
363 |
+
</html>
|
prompts.txt
ADDED
File without changes
|