Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                
<svg viewBox="0 0 100 1000">
  <path stroke="#444" fill="none" stroke-width="2" d="M50,0 C100,0 100,50 50,50
    C0,50 0,100 50,100
    C100,100 100,150 50,150
    C0,150 0,200 50,200
    C100,200 100,250 50,250
    C0,250 0,300 50,300
    C100,300 100,350 50,350
    C0,350 0,400 50,400
    C100,400 100,450 50,450
    C0,450 0,500 50,500
    C100,500 100,550 50,550
    C0,550 0,600 50,600
    C100,600 100,650 50,650
    C0,650 0,700 50,700
    C100,700 100,750 50,750
    C0,750 0,800 50,800
    C100,800 100,850 50,850
    C0,850 0,900 50,900
    C100,900 100,950 50,950
    C0,950 0,1000 50,1000
    C100,1000 100,1050 50,1050" id="theMotionPath" />
  <circle cx="" cy="" r="15" fill="#45bcde" id="css-motion-path"/>
  <circle cx="" cy="" r="15" fill="red">

          <!-- Define the motion path animation -->
          <animateMotion dur="5s" repeatCount="indefinite">
             <mpath xlink:href="#theMotionPath"/>
          </animateMotion>
      </circle>
</svg>
<aside>
<p>
  This is an SVG with a curvy path, a red circle, and a blue circle. The red circle is animated with SMIL. The blue circle is animated with CSS Motion Path + CSS Animations. 
  </p>
  <p>SMIL defines an <code>animateMotion</code> inside the circle element in the SVG. It has good support in Chrome, Firefox, Opera, &amp; Safari... though it is deprecated in Chrome/Opera (not to happen any time soon, however, as alternatives need to be fully implemented before that happens). There is currently no Edge support.
  <p>CSS Motion Path has pieces implemented in Chrome (46+) &amp; Opera (33+) through the <code>motion</code> properties (<code>motion-path</code> + <code>motion-offset</code>). This is an early spec and the properties have been renamed, so Chrome 56+ supports this through the equivalent but renamed <code>offset</code> properties (<code>offset-path</code> + <code>offset-distance</code>).
</p>
</aside>
              
            
!

CSS

              
                svg {
  height: 1000px;
  width: 100px;
}
svg circle#css-motion-path {
  animation: move-it 5s -2.5s infinite both linear;
  motion-path: path("M50,0 C100,0 100,50 50,50 C0,50 0,100 50,100 C100,100 100,150 50,150 C0,150 0,200 50,200 C100,200 100,250 50,250C0,250 0,300 50,300C100,300 100,350 50,350C0,350 0,400 50,400C100,400 100,450 50,450C0,450 0,500 50,500C100,500 100,550 50,550C0,550 0,600 50,600  C100,600 100,650 50,650    C0,650 0,700 50,700    C100,700 100,750 50,750    C0,750 0,800 50,800    C100,800 100,850 50,850    C0,850 0,900 50,900    C100,900 100,950 50,950    C0,950 0,1000 50,1000    C100,1000 100,1050 50,1050");
  offset-path: path("M50,0 C100,0 100,50 50,50 C0,50 0,100 50,100 C100,100 100,150 50,150 C0,150 0,200 50,200 C100,200 100,250 50,250C0,250 0,300 50,300C100,300 100,350 50,350C0,350 0,400 50,400C100,400 100,450 50,450C0,450 0,500 50,500C100,500 100,550 50,550C0,550 0,600 50,600  C100,600 100,650 50,650    C0,650 0,700 50,700    C100,700 100,750 50,750    C0,750 0,800 50,800    C100,800 100,850 50,850    C0,850 0,900 50,900    C100,900 100,950 50,950    C0,950 0,1000 50,1000    C100,1000 100,1050 50,1050");
}

@keyframes move-it {
  100% {
    motion-offset: 100%;
    offset-distance: 100%;
  }
}

aside {
  display: inline-block;
  color: #d4d7dd;
  font-size: 1.2rem;
  font-size: calc(3vw + .2em);
  line-height: 1.4;
  font-family: -apple-system, "Segoe UI", "Roboto", sans-serif;
  padding: 2rem;
  width: calc(100% - 100px);
}
p {
  margin-bottom: 2rem;
}
code {
  font-family: monospace;
}

body {
  height: 100vh;
  background: #16161c;
  display: flex;
}
* {
  box-sizing: border-box;
}
              
            
!

JS

              
                
              
            
!
999px

Console