Skip to content

Commit 9de21de

Browse files
committed
FAQ's section
1 parent 21004f7 commit 9de21de

File tree

4 files changed

+400
-0
lines changed

4 files changed

+400
-0
lines changed

src/_includes/components/dropdown.njk

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{% macro renderDropdown(question) %}
2+
<div class="space-y-4">
3+
<div class="bg-white shadow-lg rounded-md overflow-hidden">
4+
<button
5+
class="w-full text-left p-4 font-semibold text-lg flex justify-between items-center relative overflow-hidden group hover:bg-[#8385F2] hover:text-white focus:outline-none transition-colors duration-300"
6+
onclick="
7+
const answer = this.nextElementSibling;
8+
const icon = this.querySelector('svg');
9+
answer.classList.toggle('hidden');
10+
icon.classList.toggle('rotate-180');
11+
12+
if (!answer.classList.contains('hidden')) {
13+
this.classList.add('bg-[#8385F2]', 'text-white');
14+
} else {
15+
this.classList.remove('bg-[#8385F2]', 'text-white');
16+
}
17+
"
18+
>
19+
<span class="relative z-10">{{ question }}</span>
20+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 transition-transform duration-300 relative z-10 text-gray-800" fill="none" viewBox="0 0 24 24" stroke="currentColor">
21+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
22+
</svg>
23+
</button>
24+
<div class="hidden p-2 text-black border-t text-justify border-gray-200">
25+
{{ caller() }}
26+
</div>
27+
</div>
28+
</div>
29+
{% endmacro %}

src/_includes/navbar.njk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
"link": "https://in.pycon.org/blog/",
3737
"hasSubmenu": false,
3838
"isExternal": true
39+
},
40+
{
41+
"name": "FAQ's",
42+
"link": "faqs",
43+
"hasSubmenu": false,
44+
"isExternal": false
3945
}
4046
] %}
4147

0 commit comments

Comments
 (0)