-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
270 lines (238 loc) · 10.9 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
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
<!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>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 20px;
}
h1 {
text-align: center;
}
button {
background-color: #007bff;
color: #fff;
border: none;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
border-radius: 5px;
}
#user-messages, #bot-responses {
margin-top: 20px;
}
.message {
padding: 10px;
margin-bottom: 10px;
border-radius: 5px;
}
.user-message {
background-color: #007bff;
color: #fff;
}
.bot-message {
background-color: #f1f1f1;
color: #333;
}
.container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
p {
margin: 0;
}
.link {
color: #007bff;
text-decoration: none;
}
.link:hover {
text-decoration: underline;
}
footer {
background: linear-gradient(45deg, #6D83F2, #89EAF4);
padding: 1rem 0;
color: #fff;
text-align: center;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
border-top: 1px solid #ccc;
}
footer p {
margin: 0;
font-size: 1rem;
text-shadow: 1px 1px 2px #000;
}
footer .holographic-text {
background: linear-gradient(45deg, #FF6F61, #FFC107, #6D83F2, #89EAF4);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: gradient 3s infinite;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
body {
display: flex;
flex-direction: column;
min-height: 100vh; /* Ensure the body takes up at least the full height of the viewport */
}
.container {
flex: 1; /* Allow the container to grow to fill available space */
}
footer {
margin-top: auto; /* Push the footer to the bottom of the page */
}
</style>
</head>
<link rel="icon" type="image/x-icon" href="/Screenshot_20240511_231153_Chrome.jpg">
<body>
<div class="container">
<h1>SerenityAI - Your Mental Health Companion</h1>
<button id="start-listening">Start SerenityAI</button>
<div id="user-messages"></div>
<div id="bot-responses"></div>
</div>
<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. I am here to provide personalized support, therapy, and resources tailored to your unique needs.");
break;
case 'what can you do':
displayBotResponse("I can offer guided relaxation techniques, daily affirmations, journaling prompts, breathing exercises, goal setting, and resource recommendations to support your mental well-being.");
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>
<footer>
<p class="holographic-text">© SerenityAI. WebWise-Mirak Oracle, part of Mirakle Group. All rights reserved.</p>
</footer>
</body>
</html>