<section>
  <svg viewBox="0 0 240 200"><path d="M0,0 C40,240 200,240 240,0" fill="none" stroke="lightgrey"/></svg>
  <div class="pathed"></div>
</section>
section {
  width: 244px;
  height: 200px;
  border: 2px dashed lightgrey
}
body {
  display: flex;
  padding: 10px;
  flex-wrap: wrap;
  gap: 30px;
  margin: 0;
  height: 100vh;
  justify-content: center;
  align-items: center;
}

div {
  width: 50px;
  height: 50px;
  border: 1px solid hsl(343,100%,58%,.3);
  border-right: 5px solid hsl(343,100%,58%);
  background: hsla(343,100%,58%,.3) radial-gradient(circle, hsl(343,100%,58%,1) 3px, hsl(343,100%,58%,0) 3px);
  display: flex;
  justify-content:center;
  align-items: center;
  font-family: monospace, sans-serif;
}

.pathed {
  offset-path: path('M0,0 C40,240 200,240 240,0');
  position: absolute;
  animation: distance 4000ms infinite ease-in-out;
}
@keyframes distance {
  100% {
    offset-distance: 100%;
  }
}
code {
  position: absolute;
  top: 100px;
  right: 10px;
  left: 10px;
  line-height: 1.5; 
}
section {
  position: relative;
}

* {
  box-sizing: border-box;
}

svg {
  position: absolute;
  opacity: .333;
  stroke-width: 2px;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.