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>
  <defs>    
    <path id="path2" d="M 500 219 C 445.82 237.526 399.939 270.448 366 313 C 338.479 347.506 318.429 389.867 319 434 C 319.392 464.319 329.669 494.298 347.207 519.033 C 364.744 543.769 389.387 563.253 417.133 575.484 C 444.879 587.714 475.638 592.757 505.908 590.977 C 536.177 589.196 565.934 580.67 593 567 C 626.068 550.298 655.464 525.568 675.163 494.193 C 694.862 462.817 704.418 424.648 699 388 C 695.021 361.081 682.989 335.344 664.574 315.31 C 646.158 295.276 621.394 281.081 594.715 275.725 C 568.035 270.369 539.575 273.952 515.24 286.13 C 490.905 298.307 470.896 319.065 460 344 C 453.07 359.86 449.789 377.35 450.895 394.622 C 452 411.895 457.53 428.915 467.115 443.326" />
  </defs>
  <path id="path1" d="M500,400C400,300,600,300,500,400" />
</svg>
              
            
!

CSS

              
                svg {
  position: absolute;
  width: 100%;
  height: 100%;
}

#path1 {
  fill: none;
  stroke: purple;
  stroke-width: 2;
}


              
            
!

JS

              
                
var pathExp = /[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig; 

var path1 = document.querySelector("#path1");
var path2 = document.querySelector("#path2");

var data1 = path1.getAttribute("d").match(pathExp);
var data2 = path2.getAttribute("d").match(pathExp);

var len1 = data1.length;
var len2 = data2.length;

var fill = data1.slice(len1 - 7);

for (var i = len1; i < len2; i += 7) {
  data1.push(...fill);
}

var d1 = data1.join(" ");
var d2 = data2.join(" ");

path1.setAttribute("d", d1);

TweenMax.to(path1, 2, { 
  repeat: -1,
  repeatDelay: 0.1,
  yoyo: true,
  attr: { d: d2 }
});




              
            
!
999px

Console