Skip to content

Added FAQ content and styling #1632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 30 additions & 20 deletions Website/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h1 class="text-4xl font-bold text-blue-700 mb-8">
Frequently Asked Questions<span class="text-black">(FAQs)</span>
</h1>
<div class="space-y-4">
<!-- FAQ 1 -->
<div
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
onclick="toggleFaqContent('faq1', this)"
Expand All @@ -82,6 +83,7 @@ <h3 class="text-black">
</h3>
</div>

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

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

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

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

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

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

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

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

<!-- FAQ 10 -->
<div
class="bg-blue-500 text-white rounded-lg shadow-md p-4 flex justify-between items-center cursor-pointer"
onclick="toggleFaqContent('faq10', this)"
>
<div class="flex items-center">
<i class="fas fa-question-circle mr-2"></i>
<span>How can I contribute to the project?</span>
<span>Can I contribute to your project?</span>
</div>
<i class="fas fa-chevron-down rotate"></i>
</div>
<div id="faq10" class="faq-content bg-white rounded-lg shadow-md">
<h3 class="text-black">
We welcome contributions! You can participate by submitting code
improvements, reporting issues, or suggesting features through our
GitHub repository.
Absolutely! We welcome contributions from developers and
researchers. You can find our contribution guidelines on the GitHub
repository.
</h3>
</div>
</div>
</div>
</main>

<script>
function toggleFaqContent(id, element) {
const content = document.getElementById(id);
const icon = element.querySelector(".rotate");

content.classList.toggle("p-4");
function toggleFaqContent(faqId, iconElement) {
const faqContent = document.getElementById(faqId);
const icon = iconElement.querySelector("i");

if (content.classList.contains("active")) {
content.style.height = 0;
} else {
content.style.height = content.scrollHeight + "px";
}
faqContent.classList.toggle("active");
icon.classList.toggle("rotate");

content.classList.toggle("active");
icon.classList.toggle("active");
// Close other FAQs when one is clicked
const allFaqContents = document.querySelectorAll(".faq-content");
const allIcons = document.querySelectorAll(".rotate");
allFaqContents.forEach((content) => {
if (content !== faqContent) content.classList.remove("active");
});
allIcons.forEach((rotateIcon) => {
if (rotateIcon !== icon) rotateIcon.classList.remove("rotate");
});
}
</script>
</body>
Expand Down
Loading