js实现万圣节鬼火火焰燃烧动画效果代码

代码语言:html

所属分类:动画

代码描述:js集合css代码实现万圣节中两把鬼火火焰在森林中燃烧动画效果代码

代码标签: 万圣节 鬼火 火焰 燃烧 动画

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">


    <link href="https://fonts.googleapis.com/css2?family=Jolly+Lodger&family=Julius+Sans+One&family=Waiting+for+the+Sunrise&display=swap" rel="stylesheet">



    <style>
        :root {
          --fireColor1: #ff5000;
          --fireColor2: rgba(255,80,0,0);
          --fireDuration: 1s;
          --blur: 0.4px;
          --fireSize: 90px;
          --smogColor1: rgb(49, 48, 48);
          --smogColor2: rgba(255,80,0,0);
          --smogDuration: 2s;
          --smogSize: 120px;
        }
        
        * {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
        }
        
        html, body, #scene {
          width: 100%;
          height: 100%;
        }
        
        body {
          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
          background: rgb(0, 0, 0);
        }
        
        h1 {
          width: 100%;
          font-size: 50px;
          text-align: center;
          color: white;
          font-family: 'Italiana', serif;
          font-family: 'Julius Sans One'
        }
        
        #scene {
          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
        }
        
        #fire-container,
        #smog-container {
          font-size: 24px;
        	filter: blur(var(--blur));
        	-webkit-filter: blur(var(--blur));
        	position: relative;
        	width: 10em;
        	height: 12em;
        }
        
        #fire-container .particle {
        	animation: rise var(--fireDuration) ease-in infinite;
        	background-image: radial-gradient(var(--fireColor1) 30%,var(--fireColor2) 70%);
        	border-radius: 50%;
        	mix-blend-mode: screen;
        	opacity: 0;
        	position: absolute;
        	bottom: 0;
        	width: var(--fireSize);
        	height: var(--fireSize);
        }
        
        #smog-container .particle {
        	animation: rise var(--smogDuration) ease-in infinite;
        	background-image: radial-gradient(var(--smogColor1) 30%,var(--smogColor2) 70%);
        	border-radius: 50%;
        	mix-blend-mode: screen;
        	opacity: 0;
        	position: absolute;
        	bottom: 0;
        	width: var(--smogSize);
        	height: var(--smogSize);
        }
        
        #buttons {
          display: flex;
          position: relative;
          justify-content: center;
          
        }
        
        button {
          margin: 10px;
          width: 200px;
          height: 50px;
          border-radius: 30px;
          position: absolute;
          bottom: 0px;
          font-weight: 900;
          border: none;
          font-size: 30px;
          cursor: pointer;
          font-family: system-ui;
          -webkit-box-shadow: 0px 15px 24px -9px rgba(255,255,255,0.2); 
          box-shadow: 0px 15px 24px -9px rgba(255,255,255,0.2);
        }
        
        #yeah,
        #nah {
          display: flex;
          justify-content: center;
          align-items: center;
        }
        
        #.........完整代码请登录后点击上方下载按钮下载查看

网友评论0