CSS Flame Animation

Developer
Size
2,927 Kb
Views
34,408

How do I make an css flame animation?

An animated flame using only CSS3 animations and box-shadow. Wanted to see if I could make fire with just CSS - flame on! :). What is a css flame animation? How do you make a css flame animation? This script and codes were developed by Adrian Payne on 18 August 2022, Thursday.

CSS Flame Animation Previews

CSS Flame Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS Flame Animation</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ 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);}
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <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> <script src="js/index.js"></script>
</body>
</html>

CSS Flame Animation - Script Codes CSS Codes

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);}
}

CSS Flame Animation - Script Codes JS Codes

/* An animated flame using only CSS3 animations and box-shadow. Wanted to see if I could make fire with just CSS - flame on! :) */
CSS Flame Animation - Script Codes
CSS Flame Animation - Script Codes
Home Page Home
Developer Adrian Payne
Username dazulu
Uploaded August 18, 2022
Rating 4.5
Size 2,927 Kb
Views 34,408
Do you need developer help for CSS Flame Animation?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Adrian Payne (dazulu) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!