<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="3">
<title>Document</title>
</head>
<style>
body{
height: 100vh;
display: grid;
place-items: center;
}
.wrapper{
width: 100px;
height: 100px;
position: relative;
}
.circle{
position: absolute;
left: 50%;
top: 50%;
width: calc(100% - 10px);
height: calc(100% - 10px);
transform: translate(-50%, -50%) rotate(0deg);
border-radius: 50%;
border: 5px solid;
border-color: black black transparent transparent;
animation: round 1s linear infinite;
text-align: inherit;
}
.c2{
border-color: transparent transparent red red;
width: calc(100% - 30px);
height: calc(100% - 30px);
}
@keyframes round {
0%{
transform: translate(-50%, -50%) rotate(0deg);
}
100%{
transform: translate(-50%, -50%) rotate(calc(360deg * var(--i)));
}
}
</style>
<body>
<div class="wrapper">
<div class="circle c1" style="--i:1"></div>
<div class="circle c2" style="--i:-1"></div>
</div>
</body>
</html>
Nenhum comentário:
Postar um comentário