-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
175 lines (154 loc) · 8.15 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="react.js">
<title>Medic Navbar</title>
<!-- Bootstrap CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#"><span id="medic">Medic</span></a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="services.html">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact Us</a>
</li>
</ul>
<form class="d-flex" role="search">
<input class="form-control me-2" type="text" name="query" placeholder="Search" aria-label="Search">
<input class="form-control me-2" type="hidden" name="page" value="1">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<!-- Bootstrap JS and dependencies -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>
<div id="animations">
<img src="bacteria (1).png" alt="Bacteria 1" class="animated-virus">
<img src="bacteria2.png" alt="Bacteria 2" class="animated-bacteria">
</div>
<!-- Home Page -->
<div id="home">
<div class="home-bg">
<h1>Medicine Recommendation System</h1>
<form action="https://api.web3forms.com/submit" method="POST" id="recommendation-form">
<input type="hidden" name="access_key" value="e30c341d-c1f7-47a9-878d-084b499c034d">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="symptoms">Symptoms:</label>
<input type="text" id="symptoms" name="symptoms" required>
<label for="contact">Contact Number:</label>
<input type="tel" id="contact" name="contact" required>
<button type="submit">Submit</button>
</form>
<script>
document.getElementById('recommendation-form').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent default form submission
const form = event.target;
const formData = new FormData(form);
fetch('https://api.web3forms.com/submit', {
method: 'POST',
body: formData,
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Form submitted successfully!');
form.reset(); // Reset the form after successful submission
} else {
alert('There was an issue with your submission. Please try again.');
}
})
.catch(error => {
console.error('Error:', error);
alert('There was an error submitting the form. Please try again later.');
});
});
</script>
<script>
document.getElementById('symptoms').addEventListener('input', function() {
const query = this.value;
if (query.length > 0) {
fetch(`https://api.example.com/symptoms?query=${encodeURIComponent(query)}`)
.then(response => response.json())
.then(data => {
const suggestionsContainer = document.getElementById('symptom-suggestions');
suggestionsContainer.innerHTML = '';
suggestionsContainer.style.display = 'block';
data.symptoms.forEach(symptom => {
const suggestionDiv = document.createElement('div');
suggestionDiv.textContent = symptom;
suggestionDiv.addEventListener('click', function() {
document.getElementById('symptoms').value = symptom;
suggestionsContainer.style.display = 'none';
});
suggestionsContainer.appendChild(suggestionDiv);
});
})
.catch(error => {
console.error('Error fetching symptoms:', error);
});
} else {
document.getElementById('symptom-suggestions').style.display = 'none';
}
});
// Hide the suggestions when clicking outside the input or suggestions
document.addEventListener('click', function(event) {
const isClickInside = document.getElementById('symptoms').contains(event.target) ||
document.getElementById('symptom-suggestions').contains(event.target);
if (!isClickInside) {
document.getElementById('symptom-suggestions').style.display = 'none';
}
});
</script>
<div id="ai-results">
<h2>Our AI System Results</h2>
<div class="button-container">
<button class="btn disease" onclick="openPage('disease.html')">Disease</button>
<button class="btn description" onclick="openPage('description.html')">Description</button>
<button class="btn precaution" onclick="openPage('precaution.html')">Precaution</button>
<button class="btn medication" onclick="openPage('medication.html')">Medication</button>
<button class="btn workout" onclick="openPage('workout.html')">Workout</button>
<button class="btn diet" onclick="openPage('diet.html')">Diet</button>
</div>
</div>
<div id="testimonials">
<h2>Testimonials</h2>
<div class="testimonial-container">
<div class="testimonial-box">
<img src="healthy.png" alt="Patient A">
<p>"Great service!"</p>
</div>
<div class="testimonial-box">
<img src="patient.png" alt="Patient B">
<p>"Highly recommend."</p>
</div>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>