Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
mirak-oracle authored Jul 9, 2024
1 parent 361e972 commit 28a417b
Showing 1 changed file with 88 additions and 57 deletions.
145 changes: 88 additions & 57 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,63 +163,94 @@ <h1>SerenityAI - Your Mental Health Companion</h1>
}

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: [Click the link below to begin with the process]");
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;
default:
displayBotResponse("I'm sorry, I didn't understand that command.");
break;
}
}
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&not_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&not_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);
Expand Down

0 comments on commit 28a417b

Please sign in to comment.