-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
231 lines (202 loc) · 13.2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SerenityAI - Your Mental Health Companion</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ZY9S9E5VGC"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-ZY9S9E5VGC');
</script>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Custom styles -->
<style>
@keyframes float {
0% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
100% { transform: translateY(0px); }
}
.float { animation: float 3s ease-in-out infinite; }
.gradient-text {
background: linear-gradient(45deg, #4F46E5, #06B6D4);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
</style>
</head>
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen font-sans">
<div class="container mx-auto px-4 py-8">
<header class="text-center mb-12">
<h1 class="text-4xl font-bold gradient-text mb-2">SerenityAI</h1>
<p class="text-xl text-indigo-600">Your Mental Health Companion</p>
</header>
<div class="bg-white rounded-xl shadow-2xl p-8 max-w-2xl mx-auto">
<div class="flex justify-center mb-8">
<button id="start-listening" class="bg-gradient-to-r from-indigo-500 to-blue-500 text-white font-bold py-3 px-6 rounded-full shadow-lg transition duration-300 ease-in-out transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 float">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 inline-block mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<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" />
</svg>
Start SerenityAI
</button>
</div>
<div id="conversation" class="space-y-4">
<div id="user-messages"></div>
<div id="bot-responses"></div>
</div>
</div>
<div class="mt-12 text-center">
<h2 class="text-2xl font-semibold text-indigo-700 mb-4">How SerenityAI Can Help You</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="bg-white p-6 rounded-lg shadow-md">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-indigo-500 mx-auto mb-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<h3 class="text-xl font-semibold mb-2">24/7 Support</h3>
<p class="text-gray-600">Always here to listen and provide guidance, day or night.</p>
</div>
<div class="bg-white p-6 rounded-lg shadow-md">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-indigo-500 mx-auto mb-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" />
</svg>
<h3 class="text-xl font-semibold mb-2">Personalized Advice</h3>
<p class="text-gray-600">Tailored strategies to help you manage stress and anxiety.</p>
</div>
<div class="bg-white p-6 rounded-lg shadow-md">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-indigo-500 mx-auto mb-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<h3 class="text-xl font-semibold mb-2">Progress Tracking</h3>
<p class="text-gray-600">Monitor your mental health journey and celebrate improvements.</p>
</div>
</div>
</div>
</div>
<footer class="bg-gradient-to-r from-indigo-500 to-blue-500 text-white py-6 mt-12">
<div class="container mx-auto px-4 text-center">
<p class="mb-2">© 2024 SerenityAI. All rights reserved.</p>
<p>
</html>
<!-- JavaScript for voice recognition and bot interaction -->
<script>
const recognition = new webkitSpeechRecognition();
recognition.lang = 'en-US';
recognition.interimResults = false;
recognition.maxAlternatives = 1;
recognition.onresult = (event) => {
const transcript = event.results[0][0].transcript;
processCommand(transcript);
};
recognition.onerror = (event) => {
console.error('Speech recognition error:', event.error);
};
function startListening() {
recognition.start();
}
function displayBotResponse(response) {
const botResponses = document.getElementById('bot-responses');
botResponses.innerHTML += `<p class="message bot-message">SerenityAI: ${response}</p>`;
speak(response);
}
function processCommand(command) {
switch (command.toLowerCase()) {
case 'hello':
displayBotResponse('Hello! I am SerenityAI. How can I assist you today?');
break;
case 'what is the weather today':
displayBotResponse('The weather today is sunny with a high of 75 degrees Fahrenheit.');
break;
case 'tell me a joke':
displayBotResponse("Why don’t scientists trust atoms? Because they make up everything!");
break;
case 'how are you':
displayBotResponse("I'm doing well, thank you for asking!");
break;
case 'tell me about yourself':
displayBotResponse("I am SerenityAI, your mental health companion.");
break;
case 'what can you do':
displayBotResponse("I offer relaxation, breathing exercises, daily affirmations, and more.");
break;
case 'start guided relaxation':
displayBotResponse("Let's start a guided relaxation session. Close your eyes, take a deep breath, and focus on relaxing each part of your body, starting from your toes and working your way up to your head.");
break;
case 'give me a daily affirmation':
displayBotResponse("You are worthy of love and happiness. Repeat this affirmation throughout the day to boost your confidence and self-esteem.");
break;
case 'suggest a journaling prompt':
displayBotResponse("Reflect on a recent challenge you faced and write about how you overcame it. Journaling can help you gain insights and perspective on your experiences.");
break;
case 'practice breathing exercises':
displayBotResponse("Let's do a calming breathing exercise. Inhale deeply through your nose for 4 seconds, hold your breath for 4 seconds, and exhale slowly through your mouth for 6 seconds. Repeat this cycle for several minutes.");
break;
case 'set a mental health goal':
displayBotResponse("Think about one aspect of your mental health you'd like to improve, such as managing stress or practicing self-care. Set a SMART goal (Specific, Measurable, Achievable, Relevant, Time-bound) to work towards achieving it.");
break;
case 'recommend mental health resources':
displayBotResponse("Here are some mental health resources you might find helpful:\n- [BetterHelp](https://www.betterhelp.com/get-started/?utm_source=AdWords&utm_medium=Search_PPC_m&utm_term=online+counseling+free_b&utm_content=136971342842&network=g&placement=&target=&matchtype=b&utm_campaign=16805123991&ad_type=text&adposition=&kwd_id=kwd-689501355&gad_source=1&gclid=CjwKCAjwrcKxBhBMEiwAIVF8rBTndvM_DhzaO08Bn2H7q3pKzu4IA906KiQv4l16anzvjb_EODVExRoC0XcQAvD_BwE¬_found=1&gor=start-go)\n- [Talkspace](https://www.talkspace.com/)\n- [Mental Health America](https://www.mhanational.org/)\n- [National Alliance on Mental Illness (NAMI)](https://www.nami.org/)\n- [SAMHSA’s National Helpline](https://www.samhsa.gov/find-help/national-helpline)");
break;
case 'tips for managing stress':
displayBotResponse("Here are some tips for managing stress: 1. Practice mindfulness and meditation. 2. Exercise regularly. 3. Get enough sleep. 4. Connect with loved ones. 5. Set aside time for hobbies and relaxation.");
break;
case 'how to improve sleep quality':
displayBotResponse("To improve sleep quality: 1. Maintain a regular sleep schedule. 2. Create a relaxing bedtime routine. 3. Avoid caffeine and electronics before bed. 4. Make your sleep environment comfortable. 5. Manage stress and anxiety.");
break;
case 'how to boost my mood':
displayBotResponse("To boost your mood: 1. Engage in physical activity. 2. Spend time outdoors. 3. Connect with friends and family. 4. Practice gratitude. 5. Do something you enjoy or try a new hobby.");
break;
case 'what are the signs of burnout':
displayBotResponse("Signs of burnout include: 1. Feeling exhausted all the time. 2. Lack of motivation. 3. Decreased satisfaction and sense of accomplishment. 4. Changes in sleep and appetite. 5. Feeling cynical or detached.");
break;
case 'how to practice self-care':
displayBotResponse("To practice self-care: 1. Prioritize your physical health. 2. Set boundaries and say no when necessary. 3. Engage in activities that bring you joy. 4. Take breaks and rest. 5. Seek support when needed.");
break;
case 'crisis helpline':
displayBotResponse("If you are in crisis, please contact the National Suicide Prevention Lifeline at 1-800-273-TALK (8255) or text HOME to 741741 to reach a trained crisis counselor.");
break;
case 'find a therapist':
displayBotResponse("You can find a therapist through the following resources:\n- [Therapy for Black Girls](https://therapyforblackgirls.com/)\n- [Psychology Today](https://www.psychologytoday.com/us/therapists)\n- [GoodTherapy](https://www.goodtherapy.org/)\n- [Open Path Collective](https://openpathcollective.org/)\n- [Zencare](https://zencare.co/)");
break;
case 'mental health apps':
displayBotResponse("Here are some mental health apps that can help:\n- [Headspace](https://www.headspace.com/)\n- [Calm](https://www.calm.com/)\n- [Moodfit](https://www.getmoodfit.com/)\n- [Happify](https://www.happify.com/)\n- [Insight Timer](https://insighttimer.com/)");
break;
case 'open betterhelp':
openURL("https://www.betterhelp.com/get-started/?utm_source=AdWords&utm_medium=Search_PPC_m&utm_term=online+counseling+free_b&utm_content=136971342842&network=g&placement=&target=&matchtype=b&utm_campaign=16805123991&ad_type=text&adposition=&kwd_id=kwd-689501355&gad_source=1&gclid=CjwKCAjwrcKxBhBMEiwAIVF8rBTndvM_DhzaO08Bn2H7q3pKzu4IA906KiQv4l16anzvjb_EODVExRoC0XcQAvD_BwE¬_found=1&gor=start-go");
break;
case 'open talkspace':
openURL("https://www.talkspace.com/");
break;
case 'open mental health america':
openURL("https://www.mhanational.org/");
break;
case 'open nami':
openURL("https://www.nami.org/");
break;
case 'open samhsa':
openURL("https://www.samhsa.gov/find-help/national-helpline");
break;
default:
displayBotResponse("I'm sorry, I didn't understand that command.");
break;
}
}
function openURL(url) {
window.open(url, '_blank');
}
// Example of opening a URL:
// openURL("https://www.example.com");
function speak(message) {
const utterance = new SpeechSynthesisUtterance(message);
utterance.lang = 'en-US';
speechSynthesis.speak(utterance);
}
document.getElementById('start-listening').addEventListener('click', startListening);
</script>
<p>Click <a class="link" href="https://www.betterhelp.com/get-started/?utm_source=AdWords&utm_medium=Search_PPC_m&utm_term=online+counseling+free_b&utm_content=136971342842&network=g&placement=&target=&matchtype=b&utm_campaign=16805123991&ad_type=text&adposition=&kwd_id=kwd-689501355&gad_source=1&gclid=CjwKCAjwrcKxBhBMEiwAIVF8rBTndvM_DhzaO08Bn2H7q3pKzu4IA906KiQv4l16anzvjb_EODVExRoC0XcQAvD_BwE¬_found=1&gor=start-go">here</a> to learn more about mental health counseling services.</p>
</body>
</html>