Can someone help me here, im trying to get netflix swiper effect. But when im hovering over card , the whole swiper position is getting changed.
And when i hover the card details also not getting smooth effect.
Im using bootstrap just for card.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Swiper demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
<!-- Link Swiper's CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.css" />
<!-- Bootstrap -->
<link rel="stylesheet" href=" https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
<!-- Demo styles -->
<style>
html,
body {
position: relative;
height: 100%;
}
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0;
padding: 0;
}
.swiper {
width: 100%;
height: auto;
overflow:visible;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
display: flex;
justify-content: center;
align-items: center;
transition: all 200ms ease-in 500ms;
-webkit-transition: all 200ms ease-in 500ms;
}
.swiper-slide:hover{
box-shadow: 0px 15px 30px 0px #000000;
z-index: 50;
transform: scale(1.5) !important;
-webkit-transform: scale(1.5) !important;
top: -15px;
}
.swiper-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.swiper-container {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.card {
height: 100%;
}
.card-body{
display: none;
transition: all 200ms ease-in 500ms;
-webkit-transition: all 200ms ease-in 500ms;
}
.swiper-slide:hover .card-body{
display:block;
}
.swiper-slide:hover + .swiper-slide{
z-index: 0;
position: relative;
}
</style>
</head>
<body>
<div class="swiper-container">
<!-- Swiper -->
<div class="swiper mySwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="card" style="width: 18rem;">
<img src="https://s3.amazonaws.com/static.rogerebert.com/uploads/review/primary_image/reviews/extraction-2-movie-review-2023/extraction-2-movie-review-2023.jpeg" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="card" style="width: 18rem;">
<img src="https://s3.amazonaws.com/static.rogerebert.com/uploads/review/primary_image/reviews/extraction-2-movie-review-2023/extraction-2-movie-review-2023.jpeg" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="card" style="width: 18rem;">
<img src="https://s3.amazonaws.com/static.rogerebert.com/uploads/review/primary_image/reviews/extraction-2-movie-review-2023/extraction-2-movie-review-2023.jpeg" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="card" style="width: 18rem;">
<img src="https://s3.amazonaws.com/static.rogerebert.com/uploads/review/primary_image/reviews/extraction-2-movie-review-2023/extraction-2-movie-review-2023.jpeg" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="card" style="width: 18rem;">
<img src="https://s3.amazonaws.com/static.rogerebert.com/uploads/review/primary_image/reviews/extraction-2-movie-review-2023/extraction-2-movie-review-2023.jpeg" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="card" style="width: 18rem;">
<img src="https://s3.amazonaws.com/static.rogerebert.com/uploads/review/primary_image/reviews/extraction-2-movie-review-2023/extraction-2-movie-review-2023.jpeg" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="card" style="width: 18rem;">
<img src="https://s3.amazonaws.com/static.rogerebert.com/uploads/review/primary_image/reviews/extraction-2-movie-review-2023/extraction-2-movie-review-2023.jpeg" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
</div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
</div>
<!-- Swiper JS -->
<script src="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js"></script>
<!-- Initialize Swiper -->
<script>
var swiper = new Swiper(".mySwiper", {
// effect: "coverflow",
slidesPerView: 6,
spaceBetween: 30,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script>
</body>
</html>
Also text size is not responsive.