Flame animation implemented with CSS3

Flame animation implemented with CSS3

Achieve results

Implementation Code

html

<div class="container">
  <div class="red flame"></div>
  <div class="orange flame"></div>
  <div class="yellow flame"></div>
  <div class="white flame"></div>
  <div class="blue circle"></div>
  <div class="black circle"></div>
</div>

CSS3

body{
  background:black;
}

.container{
  margin:80px auto;
  width: 60px;
  height: 60px;
  position:relative;
  transform-origin:center bottom;
  animation-name: flicker;
  animation-duration:3ms;
  animation-delay:200ms;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.flame{
  bottom:0;
  position:absolute;
  border-bottom-right-radius: 50%;
  border-bottom-left-radius: 50%;
  border-top-left-radius: 50%;
  transform:rotate(-45deg) scale(1.5,1.5);
}

.yellow{
  left:15px; 
  width: 30px;
  height: 30px;
  background:gold;
  box-shadow: 0px 0px 9px 4px gold;
}

.orange{
  left:10px; 
  width: 40px;
  height: 40px;
  background:orange;
  box-shadow: 0px 0px 9px 4px orange;
}

.red{
  left:5px;
  width: 50px;
  height: 50px;
  background:OrangeRed;
  box-shadow: 0px 0px 5px 4px OrangeRed;
}

.white{
  left:15px; 
  bottom:-4px;
  width: 30px;
  height: 30px;
  background:white;
  box-shadow: 0px 0px 9px 4px white;
}

.circle{
  border-radius: 50%;
  position:absolute;  
}

.blue{
  width: 10px;
  height: 10px;
  left:25px;
  bottom:-25px; 
  background: SlateBlue;
  box-shadow: 0px 0px 15px 10px SlateBlue;
}

.black{
  width: 40px;
  height: 40px;
  left:10px;
  bottom:-60px;  
  background: black;
  box-shadow: 0px 0px 15px 10px black;
}

@keyframes flicker{
  0% {transform: rotate(-1deg);}
  20% {transform: rotate(1deg);}
  40% {transform: rotate(-1deg);}
  60% {transform: rotate(1deg) scaleY(1.04);}
  80% {transform: rotate(-2deg) scaleY(0.92);}
  100% {transform: rotate(1deg);}
}

The above is the details of the flame animation implemented by CSS3. For more information about CSS3 flame animation, please pay attention to other related articles on 123WORDPRESS.COM!

<<:  Vue button permission control introduction

>>:  Details on using regular expressions in MySQL

Recommend

Modify the jvm encoding problem when Tomcat is running

question: Recently, garbled data appeared when de...

In-depth understanding of uid and gid in docker containers

By default, processes in the container run with r...

Installing the ping tool in a container built by Docker

Because the Base images pulled by Docker, such as...

Linux installation MySQL tutorial (binary distribution)

This tutorial shares the detailed steps of instal...

Detailed explanation of various usages of proxy_pass in nginx

Table of contents Proxy forwarding rules The firs...

How to make your JavaScript functions more elegant

Table of contents Object parameters using destruc...

960 Grid System Basic Principles and Usage

Of course, there are many people who hold the oppo...

W3C Tutorial (4): W3C XHTML Activities

HTML is a hybrid language used for publishing on ...

mySql SQL query operation on statistical quantity

I won't say much nonsense, let's just loo...

Detailed explanation of incompatible changes of components in vue3

Table of contents Functional Components How to wr...

Node and Python two-way communication implementation code

Table of contents Process Communication Bidirecti...

Detailed explanation of the data responsiveness principle of Vue

This article is mainly for those who do not under...

JS quickly master ES6 class usage

1. How to construct? Let's review the common ...

A brief explanation of the reasonable application of table and div in page design

At the beginning of this article, I would like to ...