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 height="300" width="300">
  <path id="triangle" d="M 0 150 L 250 0 L 250 300 Z" />
</svg>

<svg ID="path01" height="800" width="500">
  <path id="path" d="M 800 400 C 250 475 0 150 450 150 C 775 200 350 400 250 350 Q 150 300 175 200 C 200 125 450 50 600 150 C 750 350 100 550 75 250 C 50 25 650 0 800 200 Z" />
</svg>
              
            
!

CSS

              
                body{
  background-color:grey;
}
svg{
  overflow:visible;
}
#triangle{
  fill:green;
}
#path01{
  position: absolute;
  left: 0;
  fill: none;
}
              
            
!

JS

              
                var triangle =$('#triangle');

var motionPath = MorphSVGPlugin.pathDataToBezier('#path', {align:triangle}) ;

var action = new TimelineMax()
.to(triangle,2,{x:-250},1)
.to(triangle,2,{attr:{d:"M 500 150 L 250 25 L 250 150 L 250 275 Z"}},1)
.to(triangle,0.5,{x:'+=50', repeat:3,yoyo:true},'pin')
.to(triangle,0.5,{attr:{d:"M 500 150 L 250 50 L 250 150 L 250 250 Z"}, repeat:3,yoyo:true},'pin')
.to(triangle,0.5,{attr:{d:"M 500 150 L 275 100 L 300 150 L 275 200 Z"}, ease: Power0.easeNone},'away')
.to(triangle,2,{x:1500, ease: Power3.easeIn},'away')
.set(triangle,{xPercent:-150, yPercent:-150, scale:0.5, transformOrigin:'center'})

.to(triangle, 5, {bezier:{values:motionPath, type:"cubic",  autoRotate:true}, ease:Linear.easeNone, repeat:3 });



              
            
!
999px

Console