File tree Expand file tree Collapse file tree 3 files changed +45
-6
lines changed
Expand file tree Collapse file tree 3 files changed +45
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ const {title, description, id} = Astro .props ;
3+ console .log (" index" , id )
4+ ---
5+ <div x-data =" {
6+ visible: false,
7+ toggle() {
8+ this.visible = !this.visible
9+ }
10+ }"
11+
12+ class:list ={ [
13+ " bg-white py-6 transition-all duration-300 ease-in-out overflow-hidden" ,
14+ { " border-b-0" : id === null },
15+ { " border-b-2" : id },
16+ ]} >
17+
18+ <div @click =" toggle()" class =" text-lg font-semibold cursor-pointer" >
19+ { title }
20+ </div >
21+
22+ <div
23+ x-transition
24+ class =" transition-all duration-300 ease-in-out overflow-hidden"
25+ :class =" visible ? 'max-h-40 opacity-100' : 'max-h-0 opacity-0'"
26+
27+ >
28+ <p class =" text-gray-600 mt-2 overflow-hidden" >
29+ { description }
30+ </p >
31+ </div >
32+ </div >
Original file line number Diff line number Diff line change 11---
22import commonQuestions from " ../assets/common-questions.json" ;
3+ import Accordion from " ./Accordion.astro" ;
34---
45
56<section class =" py-16 bg-gray-50" >
67 <div class =" container mx-auto px-4" >
78 <h2 class =" text-3xl font-bold text-center mb-12" >Preguntas frecuentes</h2 >
8- <div class =" container mx-auto space-y-6 " >
9+ <div class =" container faqs-container mx-auto shadow-md p-6 pt-0 " >
910 {
10- commonQuestions .map ((question ) => (
11- <div class = " bg-white p-6 rounded-lg shadow-md" >
12- <h3 class = " text-lg font-semibold mb-2" >{ question .title } </h3 >
13- <p class = " text-gray-600" >{ question .description } </p >
14- </div >
11+ commonQuestions .map ((question , index ) => (
12+ <Accordion { ... question } id = { index ++ < commonQuestions .length - 1 ? index ++ : null } />
1513 ))
1614 }
1715 </div >
Original file line number Diff line number Diff line change 3636 svg {
3737 @apply text-sm;
3838 }
39+
40+ /* FAQ collapsibles style */
41+ summary {
42+ list-style : none; /* Elimina el marcador predeterminado */
43+ }
44+
45+ summary ::-webkit-details-marker {
46+ display : none; /* Para navegadores basados en Webkit (Chrome, Safari) */
47+ }
3948}
You can’t perform that action at this time.
0 commit comments