rotate circle
by MD Hasan Patwary
HTML
<div class="circle"></div>
<div class="circle circle2"></div>
<div class="circle circle3"></div>
<input type="range" min="1" max="20" value="10" step="0.1" oninput="document.documentElement.style.setProperty('--spin-speed', this.value + 's')">
CSS
:root {
--spin-speed: 10s;
}
.circle {
width: 200px;
height: 200px;
border-radius: 100%;
border: 4px dashed black;
animation: spin var(--spin-speed) ease-in-out infinite;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.circle.circle2 {
width: 100px;
height: 100px;
}
.circle.circle3 {
width: 50px;
height: 50px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(360deg);
}
100% {
transform: rotate(0deg);
}
}