I'm currently working on a carousel component that functions without the use of JavaScript.
While I have made significant progress towards my goal, I am facing challenges with the animation itself.
The desired behavior is for the slides to animate one after another continuously. For example, I want the "A" box to follow the "G" box in the sequence.
I am determined to make this code work without relying on JavaScript. Any suggestions or tips to enhance the code and accomplish this objective would be greatly appreciated!
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
.st-carousel-container {
display: flex;
align-items: center;
position: absolute;
top: 0;
align-items: center;
bottom: 0;
left: 0;
right: 0;
}
.st-carousel {
width: 100%;
margin-left: auto;
margin-right: auto;
padding-left: 48px;
padding-right: 48px;
position: relative;
}
.st-carousel__screen {
overflow: hidden;
margin-left: -16px;
margin-right: -16px;
}
...
<div class="st-carousel-container">
<div class="st-carousel">
<div class="st-carousel__screen">
<div class="st-carousel__track">
<div class="st-carousel__item st-demo-in-1 st-demo-in-2 st-demo-in-3">
<div class="st-carousel__item-content">a</div>
</div>
...
<div class="st-carousel__item st-demo-in-1 st-demo-in-2 st-demo-in-3">
<div class="st-carousel__item-content">g</div>
</div>
</div>
</div>
</div>
</div>
If you check out this link and view the autoplay sample, it depicts exactly what I aim to achieve!