Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  <svg viewBox="0 0 400 200">
    <path d="M50,50 C50,200 120,0 220,100 S 400,150 350,0" fill="none"/>
  <div class="mover"></div>
  <div class="mover anchor"></div>

  <label for="anchor-x">X</label>
  <input type="range" id="anchor-x" value="50" min="-20" max="120"/>
  <output id="output-x">50%</output>

  <label for="anchor-y">Y</label>
  <input type="range" id="anchor-y" value="50" min="-20" max="120"/>
  <output id="output-y">50%</output>


                :root {
  --duration: 9000ms;

svg, main {
  width: 400px;
  height: 200px;
  position: relative;
path {
  stroke: #d8d8dd;
  stroke-width: 2px;
svg {
  position: absolute;

.mover {
  --anchorX: 50%;
  --anchorY: 50%;
  position: absolute;
  height: 50px;
  width: 50px;
  background: hsla(183, 90%, 54%, .3);
  border: 2px solid hsl(183, 100%, 54%);
  border-right-color: hsl(43, 100%, 50%);
  border-left-color: hsl(343, 100%, 50%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  offset-path: path("M50,50 C50,200 120,0 220,100 S 400,150 350,0");
  offset-rotate: auto 90deg;
  offset-anchor: var(--anchorX) var(--anchorY);
  animation: move-along var(--duration) 0ms infinite alternate ease-in-out;
.mover.anchor {
  content: '';
  position: absolute;
  background: red;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  left: 0;
  bottom: 0;
  top: 0;
  offset-anchor: center center;

aside {
  display: none;

@supports (offset-anchor: 70% 70%) {
  aside {
    display: grid;
@supports (offset-position: 70% 70%) {
  #position {
    display: block;
@keyframes move-along {
  100% {
    offset-distance: 100%;

body {
  min-height: 100vh;
  background: #16161c;
  font-family: system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: hsl(183,100%, 97%);
  padding: 2rem 0;
  box-sizing: border-box;
aside {
  margin: 0rem 1rem;
  grid-template-columns: 4em 1fr 4em;
  grid-gap: 1em;
label {
  text-align: right;
input {
  margin-bottom: 1rem;
output {
  opacity: .7;


                var x = document.getElementById('anchor-x');
var y = document.getElementById('anchor-y');
var outputx = document.getElementById('output-x');
var outputy = document.getElementById('output-y');
var mover = document.querySelector('.mover');

x.addEventListener('input', function(e) {
  let x = `${e.currentTarget.value}%`;'--anchorX', x);
  outputx.textContent = x;
y.addEventListener('input', function(e) {
  let y = `${e.currentTarget.value}%`;'--anchorY', y);
  outputy.textContent = y;