【需求描述】使用css动画实现太阳升起效果
<!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">
<title>Document</title>
<style>
html,body{
height: 100%;
}
body{
display: flex;
align-items: center;
justify-content: center;
}
.outer{
width: 300px;
height: 300px;
background: skyblue;
transform: rotate(-45deg);
animation: rotate 5s linear both;
}
.inner{
width: 80px;
height: 80px;
background: orange;
border-radius: 50%;
}
@keyframes rotate {
to{
transform: rotate(45deg);
}
}
.left{
margin-left: 100px;
}
.right{
margin-left: 100px;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(
0deg,
rgba(254, 215, 102, 1) 0%,
rgba(205, 237, 246, 1) 100%
);
}
.right .outer{
background: transparent;
}
</style>
</head>
<body>
<div class="left">
<div class="outer">
<div class="inner"></div>
</div>
</div>
<div class="right">
<div class="outer">
<div class="inner"></div>
</div>
</div>
</body>
</html>