JSFiddle - React, Tailwind, and code Playground
by core972
HTML
<div id="waiting"></div>
CSS
#waiting {
position: relative;
margin: 5rem;
height: 3rem;
width: 50vw;
background: #c0ff95;
}
#waiting::after {
position: absolute;
bottom: 0;
content: "";
height: 0.5rem;
background-color: #333;
width: 100%;
animation: 2s linear 0s infinite alternate wait;
}
@keyframes wait {
0% {
width: 0;
}
25% {
width: 100%;
transform-origin: right center;
}
50% {
width: 0;
transform-origin: right center;
}
75% {
width: 100%;
}
100% {
width: 0;
}
}