image carousel

i want to add a rich text over the images so when i hover the image the description appear. please anyone can help me do that
this is my code :

<!-- Add Slick CSS -->

<link rel=“stylesheet” type=“text/css” href=“https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css”/>

<link rel=“stylesheet” type=“text/css” href=“https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css”/>

<!-- Add jQuery (required by Slick) -->

<script src=“https://code.jquery.com/jquery-3.6.0.min.js”></script>

<!-- Add Slick JavaScript -->

<script type=“text/javascript” src=“https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js”></script>

<div class=‘visionaires-section’>

<div class=“slick-carousel”>

{% for item in module.field_group %}

{% if item.image_field.src %}

{% set sizeAttrs = ‘width=“{{ item.image_field.width }}” height=“{{ item.image_field.height }}”’ %}

{% if item.image_field.size_type == ‘auto’ %}

{% set sizeAttrs = ‘width=“{{ item.image_field.width }}” height=“{{ item.image_field.height }}” style=“max-width: 100%; height: auto;”’ %}

{% elif item.image_field.size_type == ‘auto_custom_max’ %}

{% set sizeAttrs = ‘width=“{{ item.image_field.max_width }}” height=“{{ item.image_field.max_height }}” style=“max-width: 100%; height: auto;”’ %}

{% endif %}

{% set loadingAttr = item.image_field.loading != ‘disabled’ ? ‘loading=“{{ item.image_field.loading }}”’ : ‘’ %}

<img src=“{{ item.image_field.src }}” alt=“{{ item.image_field.alt }}” {{ loadingAttr }} {{ sizeAttrs }}>

{% endif %}

{% endfor %}

</div>

</div>
css:

/* Style for the carousel items */
.slick-carousel {
margin: 0 auto;
width: 80%; /* Adjusted width */
}

.slick-carousel img {
width: 80%; /* Adjusted width */
height: auto; /* Adjusted height to auto */
display: block;
object-fit: cover;
transition: transform 0.3s ease, filter 0.3s ease; /* Add transition for smoother scaling and blur */
}

/* Scale the center image */
.slick-center img {
transform: scale(1.2); /* Adjusted scaling */
filter: blur(0); /* Remove blur effect on center image */
}

.slick-carousel img:not(.slick-center) {
filter: blur(3px); /* Apply blur effect to non-centered images */
}

}
js:
$(document).ready(function(){
var $carousel = $(‘.slick-carousel’);
$carousel.on(‘init’, function(event, slick) {
var $currentSlide = $(slick.$slides.get(slick.currentSlide));
$currentSlide.addClass(‘centered’);
});
$carousel.slick({
centerMode: true,
centerPadding: ‘0px’,
slidesToShow: 3,
responsive: [
{
breakpoint: 768,
settings: {
arrows: false,
centerMode: true,
centerPadding: ‘0px’,
slidesToShow: 1
}
},
{
breakpoint: 480,
settings: {
arrows: false,
centerMode: true,
centerPadding: ‘0px’,
slidesToShow: 1
}
}
]
});
$carousel.on(‘afterChange’, function(event, slick, currentSlide, nextSlide) {
var $currentSlide = $(slick.$slides.get(currentSlide));
$currentSlide.addClass(‘centered’);
});
$carousel.on(‘beforeChange’, function(event, slick, currentSlide, nextSlide) {
var $currentSlide = $(slick.$slides.get(currentSlide));
$currentSlide.removeClass(‘centered’);
});
});

Hi @SBENALI9

So to achieve that you need to add a text field below your image. Position that text over an image and set its opacity to 0.

Now on .slick-carousel img:hover set the text opacity to 1 and you are good to go. You can also use transition property for a smooth animation. You can take a look at this live example for more details.

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!