HTML代码
<div class="flow-view">
<div class="top-left">
<div class="line-view">
<div class="line"></div>
<div class="point"></div>
</div>
</div>
</div>
css代码
.flow-view {
position: relative;
width: 100%;
height: 30rem;
background: #f9f9f9;
.top-left {
position: absolute;
left: 12rem;
top: 1rem;
width: 27rem;
}
.line-view {
position: absolute;
top: calc(1.5rem - 15px);
left: 0rem;
width: 100%;
height: 30px;
overflow: hidden;
.line {
position: absolute;
top: 14px;
left: 0;
width: 100%;
height: 3px;
overflow: hidden;
background: repeating-linear-gradient(
90deg,
transparent,
transparent 4px,
#333 4px,
#333 10px
);
animation: move-line infinite 50000s linear;
}
.point {
position: absolute;
top: 0;
left: 0;
width: 30px;
height: 30px;
border-radius: 50%;
background: #00fafa28;
// box-shadow: 0px 0px 10px 3px #00fafa;
// border: 10px solid #00fafaee;
// box-sizing: content-box;
animation: move-point infinite 5s linear;
}
.point::before {
content: "";
position: absolute;
top: 10px;
left: 10px;
width: 10px;
height: 10px;
opacity: 1;
border-radius: 50%;
background: #000;
}
}
@keyframes move-line {
from {
background-position: 0px;
}
to {
background-position: 100000vw;
}
}
@keyframes move-point {
0% {
left: 0;
}
100% {
left: 100%;
}
}
}