-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6df025a
commit 30e0f92
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
.faq-section { | ||
width: 80%; | ||
margin: 40px auto 0px; | ||
padding: 20px; | ||
background-color: #f4f4f9; | ||
border-radius: 8px; | ||
} | ||
|
||
.faq-section h2 { | ||
text-align: center; | ||
margin-bottom: 20px; | ||
color: #2c3e50; | ||
font-size: x-large; | ||
border-bottom: 2px solid blue; | ||
padding-bottom: 20px; | ||
} | ||
|
||
.faq-item { | ||
border-bottom: 1px solid #dcdde1; | ||
padding: 15px 0; | ||
} | ||
|
||
.question { | ||
display: flex; | ||
justify-content: space-between; | ||
cursor: pointer; | ||
font-size: 1.1em; | ||
font-weight: bold; | ||
color: #2980b9; | ||
align-items: center; | ||
padding: 20px 38px; | ||
padding-bottom: 11px; | ||
border: none; | ||
} | ||
|
||
.question .icon { | ||
font-size: 1.5em; | ||
color: #2980b9; | ||
} | ||
|
||
.answer { | ||
display: none; | ||
margin: 10px 39px 9px; | ||
font-size: 1.5em; | ||
color: #7f8c8d; | ||
} | ||
|
||
.faq-item.active .answer { | ||
display: block; | ||
} | ||
|
||
.faq-item.active .icon { | ||
transform: rotate(45deg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function toggleAnswer(question) { | ||
const faqItem = question.parentElement; | ||
|
||
// Toggle the active class for this item | ||
faqItem.classList.toggle("active"); | ||
|
||
// Update the icon (+ to x) | ||
const icon = faqItem.querySelector(".icon"); | ||
icon.textContent = faqItem.classList.contains("active") ? "×" : "+"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters