div+css模拟太阳系行星轨迹运动公转动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css模拟太阳系行星轨迹运动公转动画效果代码
代码标签: div css 模拟 太阳系 行星 轨迹 运动 公转 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
background: #000F;
color: #FFFA;
margin: 0;
width: 100vw;
}
ol {
all: unset;
aspect-ratio: 1 / 1;
container-type: inline-size;
display: grid;
width: 100%;
}
li {
aspect-ratio: 1 / 1;
border: 1px dashed;
border-radius: 50%;
display: grid;
grid-area: 1 / 1;
place-self: center;
width: var(--d, 2cqi);
&::after {
animation: rotate var(--t, 3s) linear infinite;
aspect-ratio: 1 / 1;
background: var(--b, hsl(0, 0%, 50%));
border-radius: 50%;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
content: '';
display: block;
offset-path: content-box;
width: var(--w, 2cqi);
}
}
@keyframes rotate {
to {
offset-distance: 100%;
}
}
.sun {
--b: radia.........完整代码请登录后点击上方下载按钮下载查看
网友评论0