Merge pull request 'Carousel Text' (#6) from feature/carouseltext into main
Reviewed-on: #6
This commit is contained in:
commit
3c219eb85f
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 49 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 164 KiB |
|
|
@ -14,7 +14,13 @@ const { images } = Astro.props;
|
|||
{
|
||||
images.map((image) => (
|
||||
<div class="swiper-slide">
|
||||
<Image src={image} alt="" />
|
||||
<div class="flex! flex-col items-center justify-center relative">
|
||||
|
||||
<div class="uppercase text-2xl lg:text-9xl text-white shadow-2xl absolute font-secondary">
|
||||
{image.text}
|
||||
</div>
|
||||
<Image src={image.image} alt="" />
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
|
@ -36,23 +42,24 @@ const { images } = Astro.props;
|
|||
|
||||
<script>
|
||||
import Swiper from "swiper";
|
||||
import { Navigation, Pagination, Scrollbar } from 'swiper/modules';
|
||||
|
||||
const swiper = new Swiper('.swiper', {
|
||||
modules: [Navigation, Pagination, Scrollbar],
|
||||
const swiper = new Swiper(".swiper", {
|
||||
// Optional parameters
|
||||
loop: true,
|
||||
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
|
||||
// If we need pagination
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
el: ".swiper-pagination",
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
el: '.swiper-scrollbar',
|
||||
// Navigation arrows
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
});
|
||||
|
||||
// And if we need scrollbar
|
||||
scrollbar: {
|
||||
el: ".swiper-scrollbar",
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -20,15 +20,33 @@ import FormationSection from "../components/section/FormationSection.astro";
|
|||
import FooterSection from "../components/section/FooterSection.astro";
|
||||
|
||||
const carouselImages2 = [
|
||||
"https://picsum.photos/1920/800?random=1&grayscale",
|
||||
"https://picsum.photos/1920/800?random=2&grayscale",
|
||||
"https://picsum.photos/1920/800?random=3&grayscale",
|
||||
{
|
||||
image: "https://picsum.photos/1920/800?random=1&grayscale",
|
||||
text: "Justicia",
|
||||
},
|
||||
{
|
||||
image: "https://picsum.photos/1920/800?random=2&grayscale",
|
||||
text: "Paz",
|
||||
},
|
||||
{
|
||||
image: "https://picsum.photos/1920/800?random=3&grayscale",
|
||||
text: "",
|
||||
}
|
||||
];
|
||||
|
||||
const carouselImages3 = [
|
||||
"https://picsum.photos/1920/800?random=1&grayscale",
|
||||
"https://picsum.photos/1920/800?random=2&grayscale",
|
||||
"https://picsum.photos/1920/800?random=3&grayscale",
|
||||
{
|
||||
image: "https://picsum.photos/1920/800?random=1&grayscale",
|
||||
text: "Justicia",
|
||||
},
|
||||
{
|
||||
image: "https://picsum.photos/1920/800?random=2&grayscale",
|
||||
text: "Paz",
|
||||
},
|
||||
{
|
||||
image: "https://picsum.photos/1920/800?random=3&grayscale",
|
||||
text: "",
|
||||
}
|
||||
];
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue