Happy Diwali Lamp Animation

Hello guys in this tutorial we will create Happy Diwali Lamp Animation HTML and CSS

First we need to create two files index.html and style.css then we need to do code for it.

Step:1

Add below code inside index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Happy Diwali Animation</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta https-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" href="style.css" />
  </head>
<body>
	<div class="lamp-outer">
		<div class="lamp"></div>
	</div>
</body>
</html>

Step:2

Then we need to add code for style.css which code i provide in below screen.

* {
  padding: 0;
  margin: 0;
}
body {
    height: 100vh;
    background: #000;
}
.lamp-outer {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.lamp {
    position: relative;
    width: 180px;
    height: 80px;
    background: #790a0a;
    border-bottom-left-radius: 80px;
    border-bottom-right-radius: 80px;
}   
.lamp:before {
    content: "";
    position: absolute;
    top: -20px;
    width: 100%;
    height: 40px;
    background: #ffeb60;
    border-radius: 50%;
    border: 10px solid #9e0909;
    box-sizing: border-box;
}
.lamp:after {
    content: "";
    position: absolute;
    top: calc(-50% - 10px);
    left: 50%;
    width: 20px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 5px #eff000, 0 0 0 10px rgba(255,255,255,.2);
    filter: blur(5px);
    animation: animate 2.5s linear infinite;
    transform-origin: bottom;
}


@keyframes animate {
    0% {
        transform: translateX(-50%) scaleY(1);
    }
    50% {
        transform: translateX(-50%) scaleY(1.3);
    }
    100% {
        transform: translateX(-50%) scaleY(1);
    }
}

Output:

Table of Contents

Leave a Comment