JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.css"
/>
<style>
#myCarousel {
height: 550px;
}
#myCarousel .f-carousel__slide {
display: flex;
justify-content: center;
align-items: center;
width: clamp(150px, 30vw, 250px);
height: clamp(150px, 40vw, 350px);
}
#myCarousel img {
--x: calc(var(--progress) * 100%);
--y: calc((var(--progress) + 0.15) * 200%);
--rot: calc(var(--progress) * 60deg);
width: 100%;
height: 100%;
object-fit: cover;
transform: translate(var(--x), var(--y)) rotate(var(--rot));
transform-origin: 0% 100%;
box-shadow: 0 10px 50px 10px rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
<div>
<div class="f-carousel" id="myCarousel">
<div class="f-carousel__slide">
<img
width="640"
height="640"
alt=""
data-lazy-src="https://lipsum.app/id/31/640x640"
/>
</div>
<div class="f-carousel__slide">
<img
width="640"
height="640"
alt=""
data-lazy-src="https://lipsum.app/id/35/640x640"
/>
</div>
<div class="f-carousel__slide">
<img
width="640"
height="640"
alt=""
data-lazy-src="https://lipsum.app/id/34/640x640"
/>
</div>
<div class="f-carousel__slide">
<img
width="640"
height="640"
alt=""
data-lazy-src="https://lipsum.app/id/60/640x640"
/>
</div>
<div...