<div class="container">
<div class="shadow-animation"></div>
<div class="fireworks"></div>
</div>
.shadow-animation {
transform: skew(20deg);
font-size: 10px;
height: 5em;
width: 5em;
background-color: #f9cb30;
color: #333;
animation: animationExample 1s ease 0s infinite alternate both;
margin-bottom: 15em;
}
@keyframes animationExample {
0% {
box-shadow: 0 0 0 0 currentColor, 0 0 0 0 currentColor;
}
25% {
box-shadow: 0 0 0 0 currentColor, 0 0 0 0 currentColor;
}
50% {
box-shadow: 10em 0 0 0 currentColor, 10em 0 0 0 currentColor;
}
75% {
box-shadow: 10em 10em 0 0 currentColor, 10em 0 0 0 currentColor;
}
100% {
box-shadow: 10em 10em 0 0 currentColor, 10em 0 0 0 currentColor;
}
}
.fireworks {
font-size: 5px;
margin-top: 50px;
margin-right: 20em;
border-radius: 50%;
height: 1em;
width: 1em;
color: #333;
animation: explodeCircles 1s ease 0s infinite normal both;
}
@keyframes explodeCircles {
80% {
box-shadow: 20em 0 0 1em currentColor, -20em 0 0 1em currentColor,
0 20em 0 1em currentColor, 0 -20em 0 1em currentColor,
-14.14em -14.14em 0 1em currentColor, -14.14em 14.14em 0 1em currentColor,
14.14em -14.14em 0 1em currentColor, 14.14em 14.14em 0 1em currentColor;
}
100% {
box-shadow: 30em 0 0 -1em currentColor, -30em 0 0 -1em currentColor,
0 30em 0 -1em currentColor, 0 -30em 0 -1em currentColor,
-21.215em -21.215em 0 -1em currentColor,
-21.215em 21.215em 0 -1em currentColor,
21.215em -21.215em 0 -1em currentColor,
21.215em 21.215em 0 -1em currentColor;
}
}
.container {
display: flex;
justify-content: space-between;
padding: 100px 0 0;
width: 90%;
margin: 30px auto;
max-width: 500px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.