svg
  path(d='M20,20 C20,100 200,0 200,100')
.block
View Compiled
* {
  box-sizing: border-box;
}
body {
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  min-height: 100vh;
  background: #ddd;
}
@media (prefers-color-scheme: dark) {
  body {
    background: #222;
  }
}
:root {
  --line: #c800ff;
}
svg {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
}
path {
  fill: none;
  stroke: var(--line);
  stroke-width: 5px;
}
.block {
  offset-path: path('M20,20 C20,100 200,0 200,100');
  -webkit-animation: move 3000ms infinite alternate ease-in-out;
          animation: move 3000ms infinite alternate ease-in-out;
  width: 40px;
  height: 40px;
  border-radius: 0%;
  background: rgba(0,64,255,0.5);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -150px;
  margin-top: -75px;
  border: 4px solid var(--line);
  -webkit-transform: translate(0, 0);
          transform: translate(0, 0);
}
@-webkit-keyframes move {
  0% {
    offset-distance: 0%;
  }
  100% {
    offset-distance: 100%;
  }
}
@keyframes move {
  0% {
    offset-distance: 0%;
  }
  100% {
    offset-distance: 100%;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.