Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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.


Auto Save

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.


                <h1>arrayToRawPath() GSAP Demo</h1>

<svg id="svg" viewBox="0 0 900 200">
  <path id="path" />

<a href=""><img class="gsap-3-logo" src="" width="150" /></a>


                html, body {
  margin: 0;
  padding: 0;
  background-color: black;
  color: white;
  font-family: "Signika Negative", sans-serif;
  text-align: center;
  background-color: #111;

h1 {
  margin: 20px;
  text-align: center;

svg {
  overflow: visible;
  height: 100%;
  max-width: 100%;

circle {
  fill: white;

path {
  stroke-width: 3px;
  stroke: #88ce02;
  fill: none;

.nav {
  display: flex;
  justify-content: center;
  padding: 0 0 20px 0;
  align-content: center;

.gsap-3-logo {
    width: 20vw;
    max-width: 150px;
    position: fixed;
    bottom: 15px;
    right: 15px;



let anchors = [{x:50, y:130}, {x:300, y:10}, {x:510, y:100}, {x:700, y:190}, {x:850, y:100}], // anchor coordinates (feel free to change these if you want)
    rawPath = MotionPathPlugin.arrayToRawPath(anchors, {curviness:0.5}),
    path = document.querySelector("#path"),
    svg = document.querySelector("#svg");

path.setAttribute("d", MotionPathPlugin.rawPathToString(rawPath));

// place the anchors as <circle> elements
for (let i = 0; i < anchors.length; i++) {
  createSVG("circle", svg, {cx: anchors[i].x, cy: anchors[i].y, r: 5});

// animate with drawSVG
gsap.from(path, {
  duration: 4, 
  ease: "power1.inOut"

// helper function for creating SVG elements
function createSVG (type, container, attributes) {
    var element = document.createElementNS("", type),
        reg = /([a-z])([A-Z])/g,
    for (p in attributes) {
        element.setAttributeNS(null, p.replace(reg, "$1-$2").toLowerCase(), attributes[p]);
    return element;