added hamburger menu and fixed swiper button

This commit is contained in:
Esteban Paz 2026-02-12 19:03:51 -05:00
parent 3c219eb85f
commit f69cc5799e
2 changed files with 41 additions and 18 deletions

View File

@ -17,7 +17,31 @@ import Button from "./ui/Button.astro";
<a class="hover:text-colorPrimary transition" href="#programs">Programas</a> <a class="hover:text-colorPrimary transition" href="#programs">Programas</a>
<a class="hover:text-colorPrimary transition" href="#news">Noticias</a> <a class="hover:text-colorPrimary transition" href="#news">Noticias</a>
</div> </div>
<div class="drawer lg:hidden">
<input id="my-drawer-1" type="checkbox" class="drawer-toggle" />
<div class="drawer-content">
<!-- Page content here -->
<label for="my-drawer-1" class="btn drawer-button">Open drawer</label>
</div>
<div class="drawer-side">
<label for="my-drawer-1" aria-label="close sidebar" class="drawer-overlay"></label>
<ul class="menu min-h-full w-80 p-4 bg-[#22523F] text-white">
<!-- Sidebar content here -->
<p class="font-secondary text-colorPrimary font-bold leading-none py-2 text-xl ">
<a href="/">Centro del Reino<br /> De Paz y Justicia</a>
</p>
<div class="font-primary font-bold flex flex-col gap-1 text-lg p-0">
<li><a><a class="hover:text-colorPrimary transition" href="#somos">Somos</a></a></li>
<li><a><a class="hover:text-colorPrimary transition" href="#programs">Programas</a></a></li>
<li><a><a class="hover:text-colorPrimary transition" href="#news">Noticias</a></a></li>
</div>
<div class="w-50"> <div class="w-50">
<Button class="px-8 py-2 uppercase text-lg mt-8" title="Contacto" url="#contact" variant="primary" />
</div>
</ul>
</div>
</div>
<div class="w-50 hidden md:block">
<Button class="px-8 py-2 uppercase" title="Contacto" url="#contact" variant="primary" /> <Button class="px-8 py-2 uppercase" title="Contacto" url="#contact" variant="primary" />
</div> </div>
</nav> </nav>

View File

@ -42,24 +42,23 @@ const { images } = Astro.props;
<script> <script>
import Swiper from "swiper"; import Swiper from "swiper";
const swiper = new Swiper(".swiper", { import { Navigation, Pagination, Scrollbar } from 'swiper/modules';
// Optional parameters
const swiper = new Swiper('.swiper', {
modules: [Navigation, Pagination, Scrollbar],
loop: true, loop: true,
// If we need pagination
pagination: {
el: ".swiper-pagination",
},
// Navigation arrows
navigation: { navigation: {
nextEl: ".swiper-button-next", nextEl: '.swiper-button-next',
prevEl: ".swiper-button-prev", prevEl: '.swiper-button-prev',
}, },
// And if we need scrollbar pagination: {
scrollbar: { el: '.swiper-pagination',
el: ".swiper-scrollbar",
}, },
});
scrollbar: {
el: '.swiper-scrollbar',
},
});
</script> </script>