CSS:
[is-offset-path]:not([style]) {
visibility: hidden;
}
.horse-run {
position: absolute;
--offset-path: url(#road);
offset-path: var(--offset-path);
animation: motion 3s linear infinite;
}
.loading {
display: inline-block;
width: 40px; height: 40px;
color: deepskyblue;
text-align: left;
background: radial-gradient(currentColor 2px, transparent 3px);
--offset-path: circle(40%);
}
.loading::before,
.loading::after {
content: "";
position: absolute;
width: 5px; height: 5px;
background-color: currentColor;
border-radius: 50%;
offset-path: var(--offset-path);
offset-rotate: auto 90deg;
animation: motion 1s linear infinite;
}
.loading::before {
animation-delay: -.5s;
}
.horse-polygon {
--offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%);
offset-path: var(--offset-path);
animation: motion 3s linear infinite;
}
@keyframes motion {
0% { offset-distance: 0%;}
100% { offset-distance: 100%;}
}