particlesjs实现下雪天火箭升空发射动画效果代码

代码语言:html

所属分类:动画

代码描述:particlesjs实现下雪天火箭升空发射动画效果代码

代码标签: particlesjs 下雪 火箭 升空 发射 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!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">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.5.6.1.css">
<style>
body{
    margin: 0;
    padding: 0;
}

section{
    width: 100%;
    height: 100vh;
    background: linear-gradient(#6d00a9,#190027);
}

section .rocket{
    pointer-events: none;
    position: absolute;
    top:60%;
    left:15%;
    width: 200px;
    height: 200px;
    font-size: 8em;
    text-align: center;
    line-height: 200px;
    border-radius: 50%;
    box-shadow: inset 0 0 55px rgba(255,255,255,.1);
    animation: move 5s linear infinite;
}

.rocket::before{
    content: '';
    position: absolute;
    top:90px;
    left: 20px;
    width: 30%;
    height:60%;
    background: #ff0;
    transform: rotate(45deg);
    border-radius: 50%;    
    filter: blur(15px);
    z-index: -1;
    animation:flue 5s linear infinite;
}

.rocket .fa{
    color:#fff;
}

@keyframes flue{
    0%{
        background: #00abff;
        transform: rotate(45deg) scaleY(1);
    }
    25%{
        background: #ffff90;
    }
    50%{
        background: #f100ff;
        transform: rotate(45deg) scaleY(2);
    }
    75%{
        background: #09dbff;
    }
    100%{
        background: #00abff;
        transform: rotate(45deg) scaleY(1);
    }
}

@keyframes move{
    0%{
        transform: translate(-20px,-20px);
    }
    25%{
        transform: translate(20px,0px);
    }
    50%{
        transform: translate(-20px,20px);
    }
    75%{
        transform: translate(20px,0px);
    }
    100%{
        transform: translate(-20px,-20px);
    }
}
</style>
</head>
<body>
<section id='particles-js'>
        <div class="rocket">
            <i class="fa fa-rocket" aria-hidden="true"></i>
        </div>
</section>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/particles-min.js"></script>
<script>

particlesJS('particles-js',
  
  {
    "particles": {
      "number": {
        "value": 100,
        "density": {
          "enable": true,
          "value_area": 800
        }
      },
      "color": {
        "value": "#ffffff"
      },
      "shape": {
        "type": ["circle","star"],
        "stroke": {
          "width": 0,
          "color": "#000000".........完整代码请登录后点击上方下载按钮下载查看

网友评论0