-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
106 lines (95 loc) · 3.63 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Medication Reminder - Home</title>
<link rel="stylesheet" href="home.css" />
<link rel="stylesheet" href="chatbot.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/js/all.min.js"></script>
</head>
<body class="light-mode">
<header>
<div class="header-container">
<h1>Interactive Medication Reminder</h1>
<button class="theme-toggle" onclick="toggleDarkMode()">
<span id="theme-icon">🌞</span>
<span id="theme-text">Toggle Theme</span>
</button>
<nav>
<ul>
<li><a href="medication.html" class="btn">Add Medication</a></li>
<li><a href="pill-info.html" class="btn">Pill Info</a></li>
<li><a href="progress.html" class="btn">Track Progress</a></li>
<li><a href="refill.html" class="btn">Refill Pills</a></li>
<li><a href="alarm-sounds.html" class="btn">Set Alarm</a></li>
<li>
<a href="health-journal.html" class="btn">Health-Journal</a>
</li>
<li>
<a href="diet.html" class="btn">Nutrition Analyser</a>
</li>
<li>
<a href="symptoms.html" class="btn">Symptoms</a>
</li>
</ul>
</nav>
</div>
</header>
<main>
<section class="home-description">
<p>
Welcome to your Medication Reminder System. Manage your medications,
set reminders, and stay on top of your health easily!
</p>
</section>
<section class="quote-section">
<h2>Daily Health and Well-being Quote</h2>
<p id="quote-text">Fetching quote...</p>
<p id="quote-author" class="author"></p>
</section>
<section class="chatbot-section">
<h1>Medication Reminder Chatbot</h1>
<div id="chatbox">
<div id="messages"></div>
<input type="text" id="userInput" placeholder="Ask me anything...">
<button id="sendButton">Send</button>
</div>
</section>
</main>
<footer>
<p>© 2024 Medication Reminder, All rights reserved.</p>
</footer>
<script>
// Fetch the daily quote from They Said So API
async function fetchDailyQuote() {
try {
const response = await fetch(
"https://api.api-ninjas.com/v1/quotes?category=health",
{
headers: {
"X-Api-Key": "/LOQvKKB/eDR42q310INFw==LslKWQz8S4U2TrCi",
},
}
);
if (!response.ok) {
throw new Error("Failed to fetch quote");
}
const data = await response.json();
document.getElementById("quote-text").textContent = `"${data[0].quote}"`;
document.getElementById("quote-author").textContent = `- ${data[0].author}`;
} catch (error) {
console.error("Error fetching the quote:", error);
document.getElementById("quote-text").textContent =
"Take care of your body. It's the only place you have to live.";
document.getElementById("quote-author").textContent = "- Jim Rohn";
}
}
// Fetch the quote when the page loads
document.addEventListener("DOMContentLoaded", fetchDailyQuote);
</script>
<script src="darkmode.js"></script>
<script src="chatbot.js"></script>
</body>
</html>