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

              
                <div id="svg_container">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 525 156.1" enable-background="new 0 0 525 156.1" xml:space="preserve">
  
      <!-- This path works fine. -->
<polyline id="circle_line_1" fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" points="9,8.1 102,122.1 224,8.1 "/>
 
  <!-- This line breaks because of the _1_1_1 id name -->
 <polyline id="circle_line_2_1_1" fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" points="305,8.1 404,122.1 499,8.1 "/>
  
    <!-- This line is an exact copy of circle_line_2_1_1 but with a different ID name. -->
<polyline id="circle_line_3_1" fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" points="305,8.1 404,122.1 499,8.1 "/> 
  
</svg>
</div>

<div id="circle_container">
  <div id="circle_1" class="circle_style"></div>
  <div id="circle_2" class="circle_style"></div>
</div>
              
            
!

CSS

              
                #svg_container, #circle_container {
  width: 525px;
  height: 200px;
  position: absolute;
  top: 0px;
  left: 0px;
}

.circle_style {
  width: 25px;
  height: 25px;
  position: absolute;
  background-color: blue;
  border-radius: 50%
}


              
            
!

JS

              
                TweenMax.set(".circle_style", {align:"relative", xPercent: -50, yPercent: -50});

// Greensock can get this path's data
var circlepath1 = MorphSVGPlugin.pathDataToBezier("#circle_line_1");

// But it can't get this path's data due to the multiple numbers and underscores
var circlepath2 = MorphSVGPlugin.pathDataToBezier("#circle_line_2_1_1");

// Uncomment this line for proof that the path data is fine, it's the ID name messing things up
//var circlepath2 = MorphSVGPlugin.pathDataToBezier("#circle_line_3_1");

var timeline_master = new TimelineMax({repeat: -1});
    timeline_master
    .to("#circle_1", 5, {bezier:{values:circlepath1, type:"cubic"}, ease:Linear.easeNone})
    .to("#circle_2", 5, {bezier:{values:circlepath2, type:"cubic"}, ease:Linear.easeNone}, "-=5")
              
            
!
999px

Console