-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdisease.html
More file actions
154 lines (144 loc) · 9.08 KB
/
disease.html
File metadata and controls
154 lines (144 loc) · 9.08 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Disease Details - Nivaran</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"></script>
</head>
<body class="bg-[#D1B8A6] dark:bg-[#210203] text-gray-800 dark:text-gray-200 transition-colors duration-300">
<nav class="bg-[#D1B8A6] dark:bg-[#210203] p-4 fixed w-full z-50 shadow-lg">
<div class="container mx-auto flex justify-between items-center">
<a href="index.html" class="text-3xl font-bold">Nivaran</a>
<div class="flex items-center space-x-6">
<a href="index.html" class="hover:text-gray-600 dark:hover:text-gray-300 transition duration-300">Back to Home</a>
<button id="themeToggle" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700">
<i class="fas fa-sun text-yellow-500 dark:hidden"></i>
<i class="fas fa-moon text-blue-300 hidden dark:inline"></i>
</button>
</div>
</div>
</nav>
<main class="pt-24 container mx-auto p-8">
<h1 id="diseaseTitle" class="text-5xl font-bold mb-8"></h1>
<div id="diseaseContent" class="grid grid-cols-1 md:grid-cols-2 gap-12">
<div>
<h2 class="text-3xl font-semibold mb-6">Symptoms</h2>
<ul id="symptoms" class="list-disc pl-5 space-y-2 text-lg"></ul>
</div>
<div>
<h2 class="text-3xl font-semibold mb-6">Cure and Treatment</h2>
<p id="cure" class="text-lg leading-relaxed"></p>
</div>
</div>
<div class="mt-12 text-center">
<button id="predictBtn" class="predict-btn text-xl font-semibold">Predict</button>
</div>
</main>
<script>
// Fetch disease details based on URL parameter
const urlParams = new URLSearchParams(window.location.search);
const disease = urlParams.get('disease');
// Disease data
const diseaseData = {
'brain-tumor': {
title: 'Brain Tumor',
symptoms: [
'Persistent headaches',
'Seizures',
'Vision problems or changes',
'Nausea and vomiting',
'Difficulty with balance or coordination',
'Changes in behavior or personality',
'Memory problems or confusion'
],
cure: 'Treatment for brain tumors depends on the type, size, and location of the tumor. Options may include surgery to remove the tumor, radiation therapy to kill cancer cells, and chemotherapy. In some cases, a combination of these treatments may be used. Additionally, medications may be prescribed to manage symptoms such as seizures or swelling in the brain. Regular follow-up care and monitoring are essential for managing the condition and detecting any recurrence.',
resultPage: 'result1.html'
},
'cancer': {
title: 'Cancer',
symptoms: [
'Unexplained weight loss',
'Fatigue',
'Fever',
'Pain',
'Skin changes',
'Changes in bowel or bladder function',
'Persistent cough or trouble breathing'
],
cure: 'Cancer treatment varies widely depending on the type and stage of cancer. Common treatments include surgery to remove tumors, radiation therapy to shrink or kill cancer cells, and chemotherapy. Newer treatments like immunotherapy, which helps the body\'s immune system fight cancer, and targeted therapy, which targets specific genes or proteins, are also being used. Hormone therapy is effective for certain types of cancer. Often, a combination of treatments is used. The goal is to eliminate the cancer, prevent its spread, and improve quality of life. Regular check-ups and follow-up care are crucial in cancer treatment and management.',
resultPage: 'result2.html'
},
'jaundice': {
title: 'Jaundice',
symptoms: [
'Yellowing of the skin and whites of the eyes',
'Dark-colored urine',
'Pale or clay-colored stools',
'Itching',
'Fatigue',
'Abdominal pain or discomfort',
'Nausea and vomiting'
],
cure: 'Treatment for jaundice depends on its underlying cause. In many cases, treating the root condition will resolve jaundice. For newborns with physiological jaundice, phototherapy (light therapy) is often used. In adults, treatment may involve addressing liver diseases, gallbladder issues, or blood disorders. This could include medications, dietary changes, or in some cases, surgery. For instance, if gallstones are the cause, gallbladder removal might be necessary. It\'s crucial to consult a healthcare provider for proper diagnosis and treatment.',
resultPage: 'result3.html'
},
'typhoid': {
title: 'Typhoid',
symptoms: [
'High fever (103°F to 104°F, or 39.4°C to 40°C)',
'Weakness and fatigue',
'Abdominal pain',
'Headache',
'Loss of appetite',
'Diarrhea or constipation',
'Rose-colored spots on the chest (in some cases)'
],
cure: 'Typhoid fever is typically treated with antibiotics. The most commonly prescribed are ciprofloxacin (for non-pregnant adults) and ceftriaxone. The course of antibiotics usually lasts 7 to 14 days. It\'s crucial to complete the full course of antibiotics to prevent relapse. In addition to antibiotics, supportive care is important, including rest, hydration, and fever reduction. In severe cases, hospitalization may be necessary. Prevention through improved sanitation and vaccination in endemic areas is also crucial in managing typhoid fever.',
resultPage: 'result4.html'
},
'diabetes': {
title: 'Diabetes',
symptoms: [
'Increased thirst and frequent urination',
'Extreme hunger',
'Unexplained weight loss',
'Fatigue and weakness',
'Blurred vision',
'Slow-healing sores or frequent infections',
'Tingling or numbness in hands or feet'
],
cure: 'While there is no cure for diabetes, it can be managed effectively. Treatment typically involves lifestyle changes such as maintaining a healthy diet, regular exercise, and weight management. For Type 1 diabetes, insulin therapy is essential. For Type 2 diabetes, oral medications or insulin may be prescribed to help control blood sugar levels. Regular blood sugar monitoring, foot care, and eye exams are important parts of diabetes management. In some cases, newer treatments like continuous glucose monitors or insulin pumps may be recommended.',
resultPage: 'result5.html'
}
};
// Populate the page with disease data
document.getElementById('diseaseTitle').textContent = diseaseData[disease].title;
document.getElementById('symptoms').innerHTML = diseaseData[disease].symptoms.map(symptom => `<li>${symptom}</li>`).join('');
document.getElementById('cure').textContent = diseaseData[disease].cure;
// Add click event for predict button
document.getElementById('predictBtn').addEventListener('click', () => {
window.location.href = diseaseData[disease].resultPage;
});
// GSAP Animations
gsap.from("nav", { y: -100, opacity: 0, duration: 1, ease: "power3.out" });
gsap.from("main > *", { opacity: 0, y: 50, duration: 1, stagger: 0.2, ease: "power3.out" });
// Theme toggle functionality
const themeToggle = document.getElementById('themeToggle');
const htmlElement = document.documentElement;
themeToggle.addEventListener('click', () => {
htmlElement.classList.toggle('dark');
localStorage.setItem('theme', htmlElement.classList.contains('dark') ? 'dark' : 'light');
});
// Check for saved theme preference or prefer-color-scheme
const savedTheme = localStorage.getItem('theme');
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (savedTheme === 'dark' || (!savedTheme && prefersDark)) {
htmlElement.classList.add('dark');
}
</script>
</body>
</html>