JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box">
<div class="spider"></div>
<div id="wave"></div>
</div>
CSS
@keyframes front {
0% {z-index:4; }
50%{z-index:2; }
100%{z-index:0; }
}
@keyframes back {
0% {z-index:0; }
50%{z-index:2; }
100% {z-index:4; }
}
@-webkit-keyframes front {
0% {z-index:4; }
50%{z-index:2; }
100%{z-index:0; }
}
@-webkit-keyframes back {
0% {z-index:0; }
50%{z-index:2; }
100% {z-index:4; }
}
body
{
background:#590f00;
}
.box
{
width:800px;
height:434px;
border-radius:13px;
background:#741400;
margin:55px auto;
border:1px dashed #460c00;
position:relative;
}
.spider
{
width:30px;
height:30px;
position:absolute;
top:140px;
left:250px;
background:#000;
z-index:5;
animation: back 2s;
animation-iteration-count:infinite;
-webkit-animation: back 2s;
-webkit-animation-iteration-count:infinite;
}
#wave {
position: relative;
height: 2px;
width: 600px;
animation: front 2s;
animation-iteration-count:infinite;
-webkit-animation: front 2s;
-webkit-animation-iteration-count:infinite;
}
#wave:before {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 500px;
height: 80px;
right: -50px;
top: 140px;
border:3px solid #ffd800;
}
#wave:after {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 300px;
height: 70px;
left: 0;
top: 27px;
}