particles+svg实现宇宙星星天体转动流星雨动画效果代码
代码语言:html
所属分类:动画
代码描述:particles+svg实现宇宙星星天体转动流星雨动画效果代码,点击鼠标任意位置可产生更多星星。
代码标签: particles svg 宇宙 星星 天体 转动 流星雨 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
h3 {
width: 100%;
color: #fff;
font-family: sans-serif;
font-weight: 200;
}
body {
background-color: #0f022e;
text-align: center;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
#galaxy {
position: relative;
width: 500px;
height: 500px;
border-radius: 50%;
overflow: hidden;
z-index: 1;
border: solid rgba(42, 218, 218, 0.1) 4px;
}
.planet {
position: absolute;
width: 100px;
height: 100px;
border-radius: 50%;
border: none;
background: linear-gradient(to right, #de0061 0%, #00a2a5 100%);
left: 60%;
top: 53%;
transform: rotate(10deg);
transform-origin: center;
box-shadow: 0px 0px 4px 10px rgba(139, 49, 169, 0.52), 0px 0px 4px 20px rgba(63, 167, 143, 0.22);
z-index: 1;
animation: float infinite 10s ease-in-out alternate;
}
@keyframes float {
from {
transform: translate(-20px, 20px) rotate(10deg);
}
to {
transform: translate(20px, -20px) rotate(-30deg);.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0