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

The difference between redundant and duplicate indexes in MySQL

MySQL allows you to create multiple indexes on a ...

How to turn a jar package into a docker container

How to turn a jar package into a docker container...

MySQL 8.x msi version installation tutorial with pictures and text

1. Download MySQL Official website download addre...

How to run postgreSQL with docker

1. Install Docker. Reference URL: Docker Getting ...

MySQL 8.0.11 compressed version installation tutorial

This article shares the installation tutorial of ...

How to use skeleton screen in vue project

Nowadays, application development is basically se...

HTML+CSS+JS sample code to imitate the brightness adjustment effect of win10

HTML+CSS+JS imitates win10 brightness adjustment ...

Mysql database scheduled backup script sharing

BackUpMysql.sh script #!/bin/bash PATH=/bin:/sbin...

Native JS to achieve draggable login box

This article shares a draggable login box impleme...

MySQL 5.7.23 decompression version installation tutorial with pictures and text

It is too troublesome to find the installation tu...

JavaScript Array Detailed Summary

Table of contents 1. Array Induction 1. Split a s...

Build a severe weather real-time warning system with Node.JS

Table of contents Preface: Step 1: Find the free ...

Docker installation and configuration steps for RabbitMQ

Table of contents Single-machine deployment Onlin...

Sample code for separating the front-end and back-end using FastApi+Vue+LayUI

Table of contents Preface Project Design rear end...