<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
.container {
display: flex;
justify-content: center;
gap: 30px;
margin: 10rem;
}
.child {
width: 30px;
height: 30px;
border-radius: 50%;
}
.child:nth-child(1) {
background-color: violet;
animation: boxShadow1 1.5s ease-in-out infinite forwards;
}
.child:nth-child(2) {
background-color: slateblue;
animation: boxShadow2 1.5s ease-in-out infinite forwards;
animation-delay: 0.3s;
}
.child:nth-child(3) {
background-color: darkslateblue;
animation: boxShadow3 1.5s ease-in-out infinite forwards;
animation-delay: 0.6s;
}
@keyframes boxShadow1 {
50% {
box-shadow: 2px 2px 31px 0px violet;
}
100% {
box-shadow: 0 0 0 0 violet;
}
}
@keyframes boxShadow2 {
50% {
box-shadow: 2px 2px 31px 0px slateblue;
}
100% {
box-shadow: 0 0 0 0 slateblue;
}
}
@keyframes boxShadow3 {
50% {
box-shadow: 2px 2px 31px 0px darkslateblue;
}
100% {
box-shadow: 0 0 0 0 darkslateblue;
}
}
</style>
</head>
<body>
<div class="container">
<span class="child"></span>
<span class="child"></span>
<span class="child"></span>
</div>
</body>
</html>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.