Swiper CSS
Swiper CSS
DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
:root{
--width:100px;
--turn:0;
--height:100px;
--quant:10;
}
.slider{
background-color: blue;
display: flex;
position: relative;
max-width: calc(var(--width) * var(--quant));
height:100px;
overflow: hidden;
}
.slider .item{
background-color: red;
width:100px;
height: 100px;
position: absolute;
left: 100%;
border: 1px solid black;
animation: slide 10s linear infinite;
animation-delay:calc((10s/var(--quant))*(var(--turn)-1));
}
@keyframes slide {
from{
left:100%;
}
to{
left:calc(var(--width)*-1);
}
</style>
</head>
<body>
<div class="slider">
<div class="item" style="--turn: 0"></div>
<div class="item" style="--turn: 1"></div>
<div class="item" style="--turn: 2"></div>
<div class="item" style="--turn: 3"></div>
<div class="item" style="--turn: 4"></div>
<div class="item" style="--turn: 5"></div>
<div class="item" style="--turn: 6"></div>
<div class="item" style="--turn: 7"></div>
<div class="item" style="--turn: 8"></div>
<div class="item" style="--turn: 9"></div>
</div>
</body>
<script>
let clas= document.getElementsByClassName('item');
</script>
</html><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
:root{
--width: 100px;
--turn: 0;
--height: 100px;
--quant: 10;
}
.slider{
background-color: blue;
position: relative;
width: calc(var(--width) * var(--quant));
height: var(--height);
overflow: hidden;
}
.slider .item{
background-color: red;
width: var(--width);
height: var(--height);
position: absolute;
left: 100%;
border: 1px solid black;
animation: slide 10s linear infinite;
animation-delay: calc((10s / var(--quant)) * (var(--turn) - 1));
}
@keyframes slide {
from {
left: 100%;
}
to {
left: calc(var(--width) * -1);
}
}
</style>
</head>
<body>
<div class="slider">
<div class="item" style="--turn: 0"></div>
<div class="item" style="--turn: 1"></div>
<div class="item" style="--turn: 2"></div>
<div class="item" style="--turn: 3"></div>
<div class="item" style="--turn: 4"></div>
<div class="item" style="--turn: 5"></div>
<div class="item" style="--turn: 6"></div>
<div class="item" style="--turn: 7"></div>
<div class="item" style="--turn: 8"></div>
<div class="item" style="--turn: 9"></div>
</div>
</body>
<script>
let items = document.getElementsByClassName('item');
for (let i = 0; i < items.length; i++) {
items[i].style.setProperty('--turn', i);
}
</script>
</html>