CODEE
CODEE
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="Healthcare Chatbot: Your 24/7 personal health assistant for
general advice, symptoms, wellness tips, and more.">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap"
rel="stylesheet">
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
body {
font-family: 'Roboto', sans-serif;
line-height: 1.6;
background-color: #f0f4f8;
color: #333;
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
header {
background-color: #2980b9;
color: white;
padding: 20px 0;
text-align: center;
border-radius: 10px;
header h1 {
margin-bottom: 10px;
font-size: 2.5rem;
}
header nav ul {
list-style: none;
padding: 0;
header nav ul li {
display: inline;
margin: 0 20px;
header nav ul li a {
color: white;
text-decoration: none;
font-size: 1.1rem;
text-decoration: underline;
/* Main Section */
main {
padding: 40px 0;
.intro {
text-align: center;
margin-bottom: 40px;
.intro p {
font-size: 1.2rem;
margin-bottom: 20px;
.chat-button {
background-color: #2980b9;
color: white;
border-radius: 25px;
font-size: 1.2rem;
cursor: pointer;
.chat-button:hover {
background-color: #1f6ca8;
/* Features Section */
.features {
display: flex;
justify-content: space-around;
margin-bottom: 50px;
}
.feature-item {
text-align: center;
width: 30%;
padding: 20px;
background-color: #fff;
border-radius: 10px;
.feature-item i {
font-size: 3rem;
margin-bottom: 20px;
color: #2980b9;
.feature-item h3 {
font-size: 1.5rem;
margin-bottom: 10px;
.feature-item p {
font-size: 1rem;
/* About Section */
.about {
text-align: center;
margin-bottom: 50px;
.about h2 {
font-size: 2rem;
margin-bottom: 20px;
.about p {
font-size: 1.1rem;
max-width: 800px;
margin: 0 auto;
footer {
text-align: center;
padding: 30px 0;
background-color: #34495e;
color: white;
margin-top: 50px;
footer .social-links {
list-style-type: none;
padding: 0;
}
footer .social-links li {
display: inline;
margin: 0 10px;
footer .social-links li a {
color: white;
font-size: 1.5rem;
color: #f1c40f;
.chat-container {
display: none;
position: fixed;
bottom: 30px;
right: 30px;
width: 300px;
background-color: white;
border-radius: 10px;
padding: 20px;
z-index: 1000;
.chat-header {
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
.typing-indicator {
display: none;
font-size: 0.9rem;
color: #aaa;
#chat-box {
height: 400px;
width: 100%;
overflow-y: auto;
padding: 10px;
margin-bottom: 20px;
background-color: #fff;
}
.message {
margin: 10px 0;
padding: 10px;
border-radius: 10px;
max-width: 80%;
.user-message {
background-color: #2980b9;
color: white;
margin-left: auto;
.bot-message {
background-color: #ecf0f1;
color: #333;
margin-right: auto;
#user-input {
padding: 10px;
width: 75%;
border-radius: 20px;
#send-button {
padding: 10px 15px;
background-color: #2980b9;
color: white;
border: none;
border-radius: 20px;
cursor: pointer;
#send-button:hover {
background-color: #1f6ca8;
</style>
</head>
<body>
<div class="container">
<header>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#features">Features</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
</header>
<main id="home">
<section class="intro">
<p>Your personal health assistant is ready to help with general health advice, wellness tips,
symptoms, and more. Ask your questions below!</p>
</section>
<h2>Key Features</h2>
<div class="feature-item">
<h3>24/7 Availability</h3>
</div>
<div class="feature-item">
<h3>Health Guidance</h3>
</div>
<div class="feature-item">
</div>
</section>
<section class="about" id="about">
<p>Our chatbot is designed to help you with any healthcare-related questions, providing
fast and accurate responses based on reliable sources.</p>
</section>
</main>
<footer>
<ul class="social-links">
</ul>
</footer>
</div>
<div class="chat-header">
<button onclick="toggleChat()">X</button>
</div>
<div id="chat-box"></div>
<button id="send-button">Send</button>
</div>
<script>
function toggleChat() {
messageDiv.classList.add('message');
messageDiv.textContent = message;
chatBox.appendChild(messageDiv);
function sendMessage() {
addMessage(message, false);
typingIndicator.style.display = 'block';
setTimeout(() => {
addMessage(botResponse, true);
}, 1000);
function getBotResponse(message) {
const responses = {
"hello": "Hello! How can I assist you with your health today?",
"hi": "Hi there! How can I help you with your health today?",
"how are you": "I'm doing great, thank you! How can I help you?",
"how can I stay healthy": "Drink plenty of water, exercise regularly, eat a balanced diet, and get
enough sleep.",
"what are the symptoms of COVID-19": "The common symptoms of COVID-19 include fever, dry
cough, tiredness, and difficulty breathing.",
"what should I eat to stay healthy": "Eating a balanced diet with fruits, vegetables, whole grains,
lean proteins, and healthy fats is key to staying healthy.",
"how can I improve my mental health": "To improve mental health, practice mindfulness, exercise
regularly, stay socially connected, and seek support if needed.",
"can I get COVID-19 from food": "There is currently no evidence that COVID-19 can be transmitted
through food. However, it is always important to wash hands and practice good hygiene.",
"what is a healthy BMI": "A healthy BMI (Body Mass Index) is between 18.5 and 24.9. It’s a
measure of body fat based on height and weight.",
"how often should I exercise": "The World Health Organization recommends at least 150 minutes
of moderate-intensity aerobic activity each week.",
"what is hypertension": "Hypertension, or high blood pressure, is a condition where the force of
blood against the artery walls is too high, which can lead to health issues.",
"what is the best way to lose weight": "The best way to lose weight is through a combination of a
healthy, balanced diet and regular physical activity.",
"what should I do if I feel depressed": "If you feel depressed, it's important to talk to a healthcare
professional or a mental health specialist for advice and support.",
"how to treat a cold": "Drink plenty of fluids, rest, and use over-the-counter medications to relieve
symptoms. Consult a doctor if symptoms worsen.",
"what is a balanced diet": "A balanced diet includes a variety of foods from all the food groups:
vegetables, fruits, proteins, dairy, and grains.",
"what is the meaning of health": "Health is a state of complete physical, mental, and social well-
being, not just the absence of disease or infirmity.",
"can stress cause physical illness": "Yes, chronic stress can affect the body and contribute to
various physical illnesses such as headaches, heart disease, and digestive issues.",
"how to improve sleep": "To improve sleep, maintain a regular sleep schedule, create a relaxing
bedtime routine, and limit screen time before bed.",
"what is the flu": "The flu (influenza) is a contagious respiratory illness caused by flu viruses.
Symptoms include fever, chills, and body aches.",
"how to treat a headache naturally": "Drinking water, resting in a quiet room, and using cold
compresses can help alleviate headaches naturally.",
"what are the symptoms of diabetes": "Common symptoms of diabetes include excessive thirst,
frequent urination, unexplained weight loss, and blurred vision.",
"how can I boost my immune system": "Eating a nutritious diet, exercising regularly, managing
stress, and getting enough sleep are great ways to boost your immune system.",
"what are the symptoms of a stroke": "Signs of a stroke include sudden numbness or weakness,
especially on one side of the body, confusion, and difficulty speaking or understanding speech.",
"what is heart disease": "Heart disease refers to a range of conditions affecting the heart,
including coronary artery disease, heart attacks, and heart failure.",
"how can I prevent heart disease": "To prevent heart disease, maintain a healthy diet, exercise
regularly, avoid smoking, and manage stress.",
"what is mental health": "Mental health refers to a person's emotional, psychological, and social
well-being, affecting how we think, feel, and act.",
"how to deal with anxiety": "Deep breathing, meditation, exercise, and seeking professional
support can help manage anxiety.",
"what is depression": "Depression is a mood disorder that causes persistent feelings of sadness,
hopelessness, and a lack of interest in daily activities.",
"how to improve your mood": "Exercise, socializing with friends, practicing gratitude, and
engaging in enjoyable hobbies can improve your mood.",
"what is a panic attack": "A panic attack is a sudden surge of intense fear or discomfort that often
comes with physical symptoms like heart palpitations and sweating.",
"what are the benefits of yoga": "Yoga helps improve flexibility, reduce stress, increase strength,
and enhance mental clarity.",
"how to relieve stress": "Engaging in activities like meditation, exercise, and hobbies, as well as
talking to someone, can help relieve stress.",
"what is mindfulness": "Mindfulness is the practice of being fully present and engaged in the
moment, which can help reduce stress and improve well-being.",
"how to improve your self-esteem": "Set realistic goals, practice self-compassion, and surround
yourself with positive influences to improve self-esteem.",
"what are the symptoms of a heart attack": "Chest pain, shortness of breath, nausea, and
discomfort in the upper body are common symptoms of a heart attack.",
"how to manage chronic pain": "Chronic pain can be managed through medication, physical
therapy, relaxation techniques, and regular exercise.",
"how to stay hydrated": "Drink water throughout the day and consume hydrating foods like fruits
and vegetables to stay hydrated.",
"what is the role of fiber in the diet": "Fiber aids digestion, helps regulate blood sugar, and can
lower cholesterol levels, promoting overall health.",
"how much sleep do I need": "Adults typically need between 7-9 hours of sleep per night for
optimal health and cognitive function.",
"what are the benefits of regular exercise": "Regular exercise improves cardiovascular health,
strengthens muscles, boosts mood, and promotes better sleep.",
"how to quit smoking": "Seek support, consider nicotine replacement therapy, and avoid triggers
to quit smoking successfully.",
"what is a healthy weight": "A healthy weight is determined by factors like height, body
composition, and lifestyle. A BMI between 18.5 and 24.9 is considered healthy.",
"what is an allergy": "An allergy is an immune system reaction to a substance that is normally
harmless, such as pollen, pet dander, or certain foods.",
"how to prevent allergies": "Avoid known allergens, keep your home clean, and consider using
antihistamines or other medications for symptom relief.",
"how to stay active while working from home": "Take breaks every hour, use a standing desk, or
engage in short workouts during the day to stay active while working from home.",
"what is high blood pressure": "High blood pressure (hypertension) occurs when the force of
blood against your artery walls is consistently too high, which can lead to serious health problems.",
"how to manage diabetes": "Managing diabetes includes monitoring blood sugar levels, eating a
balanced diet, exercising regularly, and taking prescribed medications.",
"what are the symptoms of depression": "Symptoms of depression include persistent sadness, loss
of interest in activities, fatigue, and feelings of worthlessness.",
"what are the benefits of meditation": "Meditation can reduce stress, improve focus, enhance
emotional well-being, and promote relaxation.",
"what are the signs of dehydration": "Signs of dehydration include dry mouth, dizziness, dark
urine, and fatigue.",
"how to boost mental health": "Practice mindfulness, stay socially connected, exercise regularly,
and seek professional help when needed to boost mental health.",
"what are the symptoms of anxiety": "Symptoms of anxiety include rapid heartbeat, shortness of
breath, sweating, and feelings of unease or worry.",
"how to prevent cancer": "To reduce the risk of cancer, maintain a healthy lifestyle by not
smoking, eating a balanced diet, staying active, and avoiding excessive sun exposure.",
"how to reduce sugar intake": "Choose whole foods, limit sugary drinks, read food labels, and
replace sugary snacks with healthier alternatives to reduce sugar intake.",
"how to reduce cholesterol": "Eating a heart-healthy diet with more fruits, vegetables, and whole
grains, exercising, and avoiding trans fats can help reduce cholesterol.",
"what is an autoimmune disease": "An autoimmune disease occurs when the immune system
mistakenly attacks the body’s own cells and tissues.",
"how to manage stress at work": "Take regular breaks, prioritize tasks, set boundaries, and
practice relaxation techniques to manage work-related stress.",
"what is chronic fatigue syndrome": "Chronic fatigue syndrome is a condition characterized by
persistent, unexplained fatigue that doesn't improve with rest.",
"how to prevent type 2 diabetes": "Maintain a healthy weight, eat a balanced diet, exercise
regularly, and monitor blood sugar levels to prevent type 2 diabetes.",
"what is sleep apnea": "Sleep apnea is a sleep disorder where breathing repeatedly stops and
starts during sleep, leading to poor rest and other health issues.",
"how to treat a sore throat": "Drink warm liquids, gargle with saltwater, and use throat lozenges
to soothe a sore throat.",
"what is a healthy diet for heart health": "A heart-healthy diet includes plenty of fruits, vegetables,
whole grains, lean proteins, and healthy fats like those from fish and olive oil.",
"how to improve digestion": "Eat a fiber-rich diet, drink plenty of water, and exercise regularly to
promote healthy digestion.",
"how to treat a stomach ulcer": "Avoid spicy and acidic foods, eat smaller meals, and consult a
doctor for medications to treat a stomach ulcer.",
"how to reduce stress naturally": "Engage in physical activity, meditate, practice deep breathing,
and take time for hobbies to naturally reduce stress.",
"how to manage back pain": "Practice good posture, avoid lifting heavy objects, exercise regularly,
and seek professional treatment if necessary.",
"what is a concussion": "A concussion is a mild traumatic brain injury caused by a blow to the
head, leading to symptoms like dizziness, confusion, and headaches.",
"what are the symptoms of kidney disease": "Common symptoms include fatigue, swelling in the
legs or ankles, and changes in urination.",
"how to maintain healthy bones": "Get plenty of calcium and vitamin D, exercise regularly, and
avoid smoking to maintain strong, healthy bones.",
"what is a healthy heart rate": "A normal resting heart rate for adults is between 60 and 100 beats
per minute.",
"how to prevent osteoporosis": "Weight-bearing exercises, a diet rich in calcium and vitamin D,
and avoiding smoking can help prevent osteoporosis.",
"what are the signs of a cold": "Common signs of a cold include a runny nose, sore throat, cough,
and mild fever.",
"how to treat insomnia": "Try to maintain a regular sleep schedule, avoid caffeine and electronics
before bed, and practice relaxation techniques.",
"how to lower blood sugar levels": "Eating a balanced diet, exercising regularly, and managing
stress can help lower blood sugar levels.",
"how to improve lung health": "Avoid smoking, exercise regularly, and practice deep breathing
exercises to improve lung health.",
"what is vitamin D deficiency": "Vitamin D deficiency can lead to weakened bones and a higher
risk of fractures. Spend time in sunlight and eat foods rich in vitamin D.",
"what is an ear infection": "An ear infection is an inflammation of the ear caused by bacteria or
viruses, leading to symptoms like ear pain, fever, and difficulty hearing.",
"how to boost energy naturally": "Get enough sleep, stay hydrated, eat a balanced diet, and
exercise regularly to boost your energy levels naturally."
};
// Event listeners
sendButton.addEventListener('click', sendMessage);
sendMessage();
});
</script>
</body>
</html>