<div class="slider">
<figure class="circle">
<img class="image" src="//placehold.it/300x300?text=1" alt="">
</figure>
<figure class="circle">
<img class="image" src="//placehold.it/300x300?text=2" alt="">
</figure>
<figure class="circle">
<img class="image" src="//placehold.it/300x300?text=3" alt="">
</figure>
<figure class="circle">
<img class="image" src="//placehold.it/300x300?text=4" alt="">
</figure>
</div>
* {
box-sizing: border-box;
}
body {
display: flex;
background-color: #ff9800;
margin: 0;
height: 100vh;
}
.slider {
position: relative;
width: 90vmin;
margin: auto;
border-radius: 50%;
overflow: hidden;
}
.slider::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
background:
radial-gradient(circle farthest-side, #ff9800 25%, transparent calc(25% + 1px)),
linear-gradient(-45deg, transparent 50%, #ff9800 calc(50% + 1px)),
linear-gradient(45deg, #ff9800 50%, transparent calc(50% + 1px));
z-index: 1;
}
.slider::after {
content: '';
display: block;
padding-bottom: 100%;
}
.circle {
position: absolute;
width: 100%;
height: 100%;
margin: 0;
animation: opac 8s step-end infinite;
}
.circle:nth-child(1) {
animation-delay: -8s;
}
.circle:nth-child(2) {
animation-delay: -6s;
}
.circle:nth-child(3) {
animation-delay: -4s;
}
.circle:nth-child(4) {
animation-delay: -2s;
}
.circle::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
background:
linear-gradient(-45deg, transparent 50%, #ff9800 calc(50% + 1px)),
linear-gradient(45deg, #ff9800 50%, transparent calc(50% + 1px));
transform: rotate(90deg);
animation: rotate 8s ease-in-out infinite;
}
.circle:nth-child(1)::before {
animation-delay: -8s;
}
.circle:nth-child(2)::before {
animation-delay: -6s;
}
.circle:nth-child(3)::before {
animation-delay: -4s;
}
.circle:nth-child(4)::before {
animation-delay: -2s;
}
.image {
display: block;
margin-left: 50%;
width: 50%;
height: 100%;
object-fit: cover;
}
@keyframes rotate {
0% {
transform: rotate(90deg);
}
7%, 18% {
transform: rotate(0);
}
25%, 100% {
transform: rotate(-90deg);
}
}
@keyframes opac {
0% {
opacity: 1;
}
25%, 100% {
opacity: 0;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.