Currently, I have a CSS style featuring an animation that scans across a line in a loop. My goal is to apply this animation to a horizontal line, but I am struggling to figure out how to rotate the scanner for a horizontal loop. Below is my current code. Any assistance would be greatly appreciated. Thank you.
code
.vl {
height: 100%;
position: absolute;
right: 4.7%;
top: 0;
background-color: aqua;
box-shadow: 0px 0px 12px aqua;
width: 2.5px;
height: calc(100% - 20px);
border-radius: 50%;
overflow: hidden;
}
hr.h1 {
width: 100%;
height: 0px;
background-color: aqua;
box-shadow: 0px 0px 12px aqua;
width: 100%;
height: calc(100% - 20px);
border-radius: 50%;
overflow: hidden;
}
.scanner {
position: absolute;
top: 0;
left: 0;
background: white;
width: 100%;
height: 20px;
border-radius: 50%;
animation: scanner-loop 3s ease-in-out infinite;
background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
height: 50%;
}
.scanner1 {
position: absolute;
top: 0;
left: 0;
background: white;
width: 100%;
height: 20px;
border-radius: 50%;
animation: scanner-loop 3s ease-in-out infinite;
background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
height: 50%;
}
@keyframes scanner-loop {
0% {
top: 0;
}
50% {
top: 100%;
}
100% {
top: 0;
}
}
<div class="vl">
<div class="scanner"></div>
</div>
<hr class="h1">
<div class="scanner1"></div>
</hr>