Connect with us!
Heat Waves Animation HTML and CSS tutorial
Wave animation using to represent heat using HTML and CSS tutorial.
CSS Properties
Following are the CSS properties used:
Margin: The margin CSS shorthand property sets the margin area on all four sides of an element.
Background: The background shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method.
Animation-delay: The animation-delay CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation.
Border-radius: The border-radius CSS property rounds the corners of an element’s outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners.
Box-shadow: The box-shadow CSS property adds shadow effects around an element’s frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color.
Content: The content CSS property replaces an element with a generated value. Objects inserted using the content property are anonymous replaced elements.
Height: The height CSS property specifies the height of an element. By default, the property defines the height of the content area. If box-sizing is set to border-box, however, it instead determines the height of the border area.
Inset: The inset CSS property is a shorthand that corresponds to the top, right, bottom, and/or left properties. It has the same multi-value syntax of the margin shorthand.
Position: The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.
Width: The width CSS property sets an element’s width. By default, it sets the width of the content area, but if box-sizing is set to border-box, it sets the width of the border area.
Heat Waves Code Block
Here is the code for implementing the Heat Waves Animation.
.heat-waves {
margin: 80px;
width: 40px;
height: 40px;
border-radius: 50%;
background: #ffa500;
box-shadow: 0 0 0 0 #ffa50040;
position: relative;
}
.heat-waves:before,
.heat-waves:after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: 0 0 0 0 #ffa50040;
animation-delay: -0.5s;
}
Yay! We have created the static Heat Waves Animation.
Here is the output:
Heat Waves CSS Animation
pulsing animation can be implemented by scaling up and down the shape linearly.
Following are the classes used for animation.
The @keyframes CSS at-rule controls the intermediate steps in a CSS animation sequence by defining styles for keyframes (or waypoints) along the animation sequence. This gives more control over the intermediate steps of the animation sequence than transitions.
The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.
Here is the CSS animation class implementing CSS.
@keyframes pulsing {
100% {
box-shadow: 0 0 0 80px #ffa50000;
}
}
The following way is to declare the CSS Class inside the class block.
.heat-waves {
margin: 80px;
width: 40px;
height: 40px;
border-radius: 50%;
background: #ffa500;
box-shadow: 0 0 0 0 #ffa50040;
animation: pulsing 1.5s infinite linear;
position: relative;
}
.heat-waves:before,
.heat-waves:after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: 0 0 0 0 #ffa50040;
animation: inherit;
animation-delay: -0.5s;
}
@keyframes pulsing {
100% {
box-shadow: 0 0 0 80px #ffa50000;
}
}
Following is the output for Heat Waves Animation animation.
Heat Waves Animation CSS Video Tutorial
You can find the complete coding tutorial in the following YouTube Short video.
Complete Code using HTML and CSS
Copy and paste the complete code in Visual studio code to view the output.
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.heat-waves {
margin: 80px;
width: 40px;
height: 40px;
border-radius: 50%;
background: #ffa500;
box-shadow: 0 0 0 0 #ffa50040;
animation: pulsing 1.5s infinite linear;
position: relative;
}
.heat-waves:before,
.heat-waves:after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: 0 0 0 0 #ffa50040;
animation: inherit;
animation-delay: -0.5s;
}
@keyframes pulsing {
100% {
box-shadow: 0 0 0 80px #ffa50000;
}
}
</style>
<title>Salow Studios</title>
</head>
<body>
<h1>Heat Waves Animation</h1>
<div class="heat-waves"></div>
</body>
</html>
Thank you for reading this article. I hope that it helps you creating your own Heat Waves Animation Animation using CSS and HTML. See you in next tutorial!