js实现canvas大火燃烧火焰动画效果代码

代码语言:html

所属分类:动画

代码描述:js实现canvas大火燃烧火焰动画效果代码

代码标签: 大火 燃烧 火焰 动画 效果

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

<html>
<head>
    <style>
        body {
            background: #000;
            height: 100vh;
            overflow: hidden;
        }

        canvas {
            -webkit-animation: fade-in 2000ms 1000ms forwards;
            animation: fade-in 2000ms 1000ms forwards;
            background: #000;
            background: radial-gradient(circle at 50% 75%, #311, #000);
            border-radius: 50%;
            bottom: 0;
            box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.05);
            left: 0;
            margin: auto;
            opacity: 0;
            position: absolute;
            right: 0;
            top: 0;
        }

@-webkit-keyframes fade-in {
            to {
                opacity: 1;
            }
        }

@keyframes fade-in {
            to {
                opacity: 1;
            }
        }
        .static {
            -webkit-animation: fade-in2 2000ms 1000ms forwards;
            animation: fade-in2 2000ms 1000ms forwards;
            border-radius: 50%;
            bottom: 0;
            height: 400px;
            margin: auto;
            left: 0;
            opacity: 0;
            position: absolute;
            right: 0;
            top: 0;
            width: 400px;
        }

@-webkit-keyframes fade-in2 {
            to {
                opacity: 0.06;
            }
        }

@keyframes fade-in2 {
            to {
                opacity: 0.06;
            }
        }
    </style>

</head>
<bod>
    <canvas width="400" height="400"></canvas>
    <div class="static"></div>
    <script>
        console.clear();

        let $ = {};

        /*
                       |=|ˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉ/
            [::{}{}{}{}|=| UTILITY
                       |=|________________________________/
            */

        $.PI = Math.PI;
    .........完整代码请登录后点击上方下载按钮下载查看

网友评论0