Skip to content

Commit 534cc5e

Browse files
authored
Merge pull request #1632 from meghanakn473/add-faq-content
Added FAQ content and styling
2 parents 166022f + b516eb4 commit 534cc5e

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

Website/faq.html

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ <h1 class="text-4xl font-bold text-blue-700 mb-8">
6464
Frequently Asked Questions<span class="text-black">(FAQs)</span>
6565
</h1>
6666
<div class="space-y-4">
67+
<!-- FAQ 1 -->
6768
<div
6869
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
6970
onclick="toggleFaqContent('faq1', this)"
@@ -82,6 +83,7 @@ <h3 class="text-black">
8283
</h3>
8384
</div>
8485

86+
<!-- FAQ 2 -->
8587
<div
8688
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
8789
onclick="toggleFaqContent('faq2', this)"
@@ -100,6 +102,7 @@ <h3 class="text-black">
100102
</h3>
101103
</div>
102104

105+
<!-- FAQ 3 -->
103106
<div
104107
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
105108
onclick="toggleFaqContent('faq3', this)"
@@ -118,6 +121,7 @@ <h3 class="text-black">
118121
</h3>
119122
</div>
120123

124+
<!-- FAQ 4 -->
121125
<div
122126
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
123127
onclick="toggleFaqContent('faq4', this)"
@@ -136,6 +140,7 @@ <h3 class="text-black">
136140
</h3>
137141
</div>
138142

143+
<!-- FAQ 5 -->
139144
<div
140145
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
141146
onclick="toggleFaqContent('faq5', this)"
@@ -153,6 +158,7 @@ <h3 class="text-black">
153158
</h3>
154159
</div>
155160

161+
<!-- FAQ 6 -->
156162
<div
157163
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
158164
onclick="toggleFaqContent('faq6', this)"
@@ -171,6 +177,7 @@ <h3 class="text-black">
171177
</h3>
172178
</div>
173179

180+
<!-- FAQ 7 -->
174181
<div
175182
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
176183
onclick="toggleFaqContent('faq7', this)"
@@ -189,6 +196,7 @@ <h3 class="text-black">
189196
</h3>
190197
</div>
191198

199+
<!-- FAQ 8 -->
192200
<div
193201
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
194202
onclick="toggleFaqContent('faq8', this)"
@@ -207,6 +215,7 @@ <h3 class="text-black">
207215
</h3>
208216
</div>
209217

218+
<!-- FAQ 9 -->
210219
<div
211220
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
212221
onclick="toggleFaqContent('faq9', this)"
@@ -219,48 +228,49 @@ <h3 class="text-black">
219228
</div>
220229
<div id="faq9" class="faq-content bg-white rounded-lg shadow-md">
221230
<h3 class="text-black">
222-
Yes, we offer community support through forums and documentation.
223-
Users can also reach out for direct assistance via our contact
224-
page.
231+
Yes, we have an active community on forums, as well as email and
232+
chat-based support for users.
225233
</h3>
226234
</div>
227235

236+
<!-- FAQ 10 -->
228237
<div
229238
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
230239
onclick="toggleFaqContent('faq10', this)"
231240
>
232241
<div class="flex items-center">
233242
<i class="fas fa-question-circle mr-2"></i>
234-
<span>How can I contribute to the project?</span>
243+
<span>Can I contribute to your project?</span>
235244
</div>
236245
<i class="fas fa-chevron-down rotate"></i>
237246
</div>
238247
<div id="faq10" class="faq-content bg-white rounded-lg shadow-md">
239248
<h3 class="text-black">
240-
We welcome contributions! You can participate by submitting code
241-
improvements, reporting issues, or suggesting features through our
242-
GitHub repository.
249+
Absolutely! We welcome contributions from developers and
250+
researchers. You can find our contribution guidelines on the GitHub
251+
repository.
243252
</h3>
244253
</div>
245254
</div>
246255
</div>
247256
</main>
248-
249257
<script>
250-
function toggleFaqContent(id, element) {
251-
const content = document.getElementById(id);
252-
const icon = element.querySelector(".rotate");
253-
254-
content.classList.toggle("p-4");
258+
function toggleFaqContent(faqId, iconElement) {
259+
const faqContent = document.getElementById(faqId);
260+
const icon = iconElement.querySelector("i");
255261

256-
if (content.classList.contains("active")) {
257-
content.style.height = 0;
258-
} else {
259-
content.style.height = content.scrollHeight + "px";
260-
}
262+
faqContent.classList.toggle("active");
263+
icon.classList.toggle("rotate");
261264

262-
content.classList.toggle("active");
263-
icon.classList.toggle("active");
265+
// Close other FAQs when one is clicked
266+
const allFaqContents = document.querySelectorAll(".faq-content");
267+
const allIcons = document.querySelectorAll(".rotate");
268+
allFaqContents.forEach((content) => {
269+
if (content !== faqContent) content.classList.remove("active");
270+
});
271+
allIcons.forEach((rotateIcon) => {
272+
if (rotateIcon !== icon) rotateIcon.classList.remove("rotate");
273+
});
264274
}
265275
</script>
266276
</body>

0 commit comments

Comments
 (0)