I am working on creating a bootstrap5 carousel that includes a video with fixed dimensions and a box-shadow applied to it.
However, I am facing an issue where the box-shadow expands during each slide transition, making it appear as if the video element's height/width has changed.
I need assistance in figuring out how to keep the box-shadow in the same position, preventing any messy or buggy transitions:
snippet:
.monkey-video {
/* box-shadow: 0px 0px -60px -40px rgba(255, 255, 255, 0.35) inset; */
width: 200;
height: 240;
box-shadow: rgba(255, 255, 255, 0.35) 0px 5px 15px;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="187a77776c6b6c6a7968582d3628362a">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b6964647f787f796a7b4b3e253a2538">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
<body class="bg-dark">
<section id="chars-section" class="position-relative" style="width: 100%;">
<div class="d-flex flex-column justify-content-evenly align-items-center ">
<h3 class="p-1" style="font-family: 'league_spartanbold'; color: #F8C84A;">MEET THE MONKEYS</h3>
<div id="carousel-monkeys" class="carousel slide carousel-fade" data-bs-ride="carousel">
<div class="carousel-inner monkey-video">
<div id="0" class="carousel-item active">
<div class="d-flex justify-content-center w-100">
<video width="200" height="240" autoplay muted loop>
<source src="./img/Neandermonkey - Vídeo.mp4" type="video/mp4">
Your browser does not support the video, please use a different browser.
</video>
</div>
</div>
<div id="1" class="carousel-item">
<div class="d-flex justify-content-center w-100">
<video width="200" height="240" autoplay muted loop>
<source src="./img/Medieval - Vídeo.mp4" type="video/mp4">
Your browser does not support the video, please use a different browser.
</video>
</div>
</div>
<div id="2" class="carousel-item">
<div class="d-flex justify-content-center w-100">
<video width="200" height="240" autoplay muted loop>
<source src="./img/Futuro - Vídeo.mp4" type="video/mp4">
Your browser does not support the video, please use a different browser.
</video>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carousel-monkeys" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carousel-monkeys" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</section>
</body>