add accordtion

This commit is contained in:
2025-04-21 13:51:29 -03:00
parent 4cd136ea04
commit 735e35ff71
17 changed files with 73 additions and 902 deletions

View File

@@ -1,16 +1,16 @@
---
import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/solid'
import { Icon } from 'astro-icon/components'
const { items = [] } = Astro.props
---
<div id="carousel" class="relative">
<button id="prev" class="inset-y-0 left-0 px-1.5 bg-white/10 absolute cursor-pointer lg:hidden z-10">
<ChevronLeftIcon className="w-6" />
<button id="prev" class="inset-y-0 left-0 px-1.5 bg-white/10 absolute cursor-pointer lg:hidden z-1">
<Icon name="chevron-left" class="size-6" />
</button>
<button id="next" class="inset-y-0 right-0 px-1.5 bg-white/10 absolute cursor-pointer lg:hidden z-10">
<ChevronRightIcon className="w-6" />
<button id="next" class="inset-y-0 right-0 px-1.5 bg-white/10 absolute cursor-pointer lg:hidden z-1">
<Icon name="chevron-right" class="size-6" />
</button>
<div
@@ -18,7 +18,7 @@ const { items = [] } = Astro.props
>
{
items.map((Component, idx) => (
<div class="snap-center flex-shrink-0 max-lg:w-full flex justify-center itens-center z-0">
<div class="snap-center flex-shrink-0 max-lg:w-full flex justify-center itens-center">
<Component class="size-48 lg:size-38 fill-white" id={`slide${idx + 1}`} />
</div>
))
@@ -31,7 +31,7 @@ const { items = [] } = Astro.props
const slides = carousel.querySelectorAll('.snap-center')
let currentIndex = 0
const scrollToSlide = (index) => {
const scrollToSlide = (index: number) => {
if (index >= 0 && index < slides.length) {
slides[index].scrollIntoView({
behavior: 'smooth',