Web/HTML | CSS|JAVASCRIPT
transfrom, keyframes 도형 회전하기(HTML, CSS)
싸공
2020. 7. 18. 18:15
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.wi{
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
top: 50%;
left: 50%;
background-color: #6e6438;
position: absolute;
transform: translate(-50%, -50%);
display: flex;
}
.box{
width: 200px;
height: 200px;
animation: rotate 2.5s infinite;
background: linear-gradient(to right, rgb(90, 92, 231) 50%, #f16d6d 50%);
background-size: 200% 100%;
background-position:right bottom;
transform: rotate(-90deg);
border-radius: 15%;
}
@keyframes rotate{
0%{
background-position: right bottom;
}
50%{
background-position: left bottom;
transform: rotate(90deg);
}
100%{
background-position: right bottom;
transform: rotate(270deg);
}
}
</style>
<body>
<div class="wi">
<div class="box"></div>
</div>
</body>
</html>