Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <link href='//fonts.googleapis.com/css?family=Signika+Negative:300,400' rel='stylesheet' type='text/css'>

<div class="wrapper">
  <h1>Advanced SVG Shape Morphing</h1>
  <h2>MorphSVGPlugin morphs any SVG &lt;path&gt; regardless of number of points.</h2>

  <svg version="1.1" id="svg2" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="9 80 800 400" style="enable-background:new 9 80 800 400;" xml:space="preserve">
<style type="text/css">
	.st0{fill:#000;stroke:#000000;stroke-miterlimit:10;}
	.st1{fill:#CCCCCC;}
</style>
<rect id="background" x="9" y="80" class="st0" width="800" height="400"/>
<path id="circle" class="st1" d="M490.1,280.649c0,44.459-36.041,80.5-80.5,80.5s-80.5-36.041-80.5-80.5s36.041-80.5,80.5-80.5
	S490.1,236.19,490.1,280.649z"/>
<path id="hippo" class="st1" d="M149,245c2.7-36.7,16.11-69.08,40.1-97.06c27.04-31.6,60.92-47.39,101.63-47.39c15.48,0,38.48,2.45,69.02,7.29 c30.54,4.89,53.53,7.28,69.03,7.28c23.69,0,57.87,8.85,102.53,26.48c7.91,3.01,17.47,11.24,28.7,24.59 c6.38,7.89,16.26,19.77,29.62,35.57c3.04,2.14,7,5.32,11.86,9.6c4.86,4.22,8.19,6.06,10,5.46c0.62-1.84,2.15-4.4,4.58-7.74 c1.21-1.23,1.96-1.83,2.26-1.83c0.93,0.61,1.83,1.21,2.75,1.83c0.91,0.62,1.21,2.42,0.91,5.46c-0.62,5.47-0.91,7.14-0.91,5	c-0.33,3.06-0.76,5.01-1.37,5.95c-3.95,6.67-5.48,11.85-4.55,15.47c0.92,3.32,3.77,8.67,8.64,15.96c4.87,7.29,7.59,12.76,8.19,16.4 c-0.3,2.73-0.43,7.12-0.43,13.21l-4.57,11.38c0,8.51,9.86,23.11,29.62,43.78c9.44,4.22,14.12,18.83,14.12,43.71 c0,19.47-16.09,29.17-48.27,29.17c-4.26,0-8.81-0.13-13.68-0.47c-3.34-1.2-8.2-2.56-14.58-4.07c-7.59-0.93-12.76-3.49-15.48-7.77 c-4.88-6.95-12.78-13.51-23.71-19.58c-1.82-0.88-4.48-4.22-7.98-10.02c-3.5-5.77-6.61-9.42-9.33-10.95 c-2.72-1.49-6.68-1.81-11.86-0.88c-8.81,1.49-13.68,2.26-14.57,2.26c-2.14,0-5.25-0.6-9.34-1.83c-4.11-1.21-7.05-1.83-8.89-1.83 c-2.11,9.73-2.59,19.15-1.36,28.25c0.3,2.45,1.83,4.43,4.56,5.92c4.27,3.05,6.53,4.71,6.85,5.05c2.72,2.11,5.61,5.61,8.64,10.45 c0.62,1.85-0.52,4.95-3.42,9.34c-2.89,4.41-5.22,7.01-7.06,7.74c-1.81,0.79-5.77,1.18-11.85,1.18c-8.82,0-29.45-2.45-30.98-2.73 c-7.59-1.53-14.13-3.94-19.58-7.3c-2.76-1.81-5.91-10.33-9.56-25.52c-3.68-16.41-6.72-26.27-9.14-29.64 c-0.6-0.9-1.36-1.33-2.26-1.33c-1.53,0-4.05,1.49-7.53,4.56c-3.49,2.99-5.86,4.65-7.05,5.01c-4.24,17.9-6.4,26.4-6.4,25.47 c0,7.01,1.97,12.89,5.92,17.77c3.94,4.86,8.06,9.57,12.32,14.11c5.16,5.77,7.74,10.78,7.74,15.04c0,2.41-0.75,4.52-2.28,6.37 c-6.38,7.89-17.02,11.85-31.9,11.85c-16.71,0-27.64-2.28-32.79-6.84c-6.7-5.77-10.95-11.86-12.76-18.2 c-0.3-1.53-1.05-6.09-2.28-13.68c-0.61-4.58-1.98-7.29-4.08-8.18c-6.1-0.92-13.69-2.58-22.78-5.01c-1.84-1.21-3.81-4.26-5.94-9.12 c-3.93-9.4-6.83-15.79-8.66-19.13c-9.13-4.56-23.7-9.7-43.76-15.45c-0.92,1.83-1.35,4.37-1.35,7.72c3.34,4.26,8.34,10.8,15.03,19.58 c5.47,7.29,8.2,14.3,8.2,20.96c0,12.78-8.2,19.13-24.61,19.13c-12.45,0-20.96-0.88-25.52-2.71c-6.67-2.73-12.29-9.14-16.85-19.13 c-7.6-16.74-11.85-26.16-12.76-28.27c-4.87-11.23-8.2-21.13-10.01-29.65c-1.23-6.05-3.06-15.35-5.49-27.8 c-2.12-10.3-5.46-18.36-10.01-24.13C155.33,279.36,147.5,260.6,149,245z"/>
<path id="elephant" class="st1" d="M446.47,99.67c12.1,0,23.83,7,35.23,20.99c11.38,13.99,17.97,20.99,19.76,20.99h17.12 c37,0,65.65,18.52,85.96,55.55c5.35,10.37,13.52,25.59,24.58,45.7c11.01,20.14,23.86,35.01,38.46,44.63 c16.37,10.69,32.92,16.59,49.64,17.63c7.82,0.36,16.39-1.07,25.66-4.3c8.19-3.58,16.36-7.17,24.54-10.75l5.34,11.86 c-26.34,20.21-51.44,30.64-75.3,31.36c-25.62,0.71-53.23-5.51-82.76-18.64c25.26,29.2,47,47.01,65.16,53.39l-4.27,4.3	c-32.04-5.7-61.61-22.1-88.65-49.15c0,0-22.7,15.71-25.37,17.3c-2.67,1.6-3.85,2.91-3.49,3.98c1.43,4.63,8.74,16,21.91,34.06	c13.17,18.13,19.76,27.71,19.76,28.75c0,3.2-4.1,6.38-12.29,9.59c-8.18,3.19-12.62,6.75-13.33,10.65c-0.72,3.2,0.33,7.11,3.2,11.71	c2.83,4.63,4.26,7.43,4.26,8.53c0,7.08-6.23,11.51-18.67,13.3c-2.16,0.33-8.94,0.53-20.31,0.53c-21.35,0-36.67-4.8-45.93-14.35	c-7.47-8.15-13.36-23.05-17.64-44.66c-1.43-7.43-3.91-20.73-7.47-39.9c-36.31,9.25-73.7,13.89-112.17,13.89	c-23.51,0-48.96-1.76-76.38-5.34c4.64,11.76,11.22,31.36,19.8,58.77c-17.81-2.5-39.19-6.05-64.09-10.69	c-11.06,16.72-20.51,24.74-28.33,24.03c-13.89-1.05-33.84-7.99-59.82-20.8c-6.42-3.2-9.61-8.02-9.61-14.44	c0-6.39,4.99-18.16,14.96-35.24c9.95-17.08,15.29-29.01,16.01-35.79c0.72-6.07-1.04-14.4-5.31-25.1	c-5.34-13.89-11.22-40.06-11.22-40.06c-16.39,17.8-31.35,30.8-44.88,38.99c-15.68,9.61-34.2,15.87-55.55,18.67	c-4.27-4.24-7.11-6.38-8.54-6.38c26.34-11.41,52.35-29.38,77.97-53.96c1.08-1.07,7.82-5.86,20.31-14.44	c7.1-4.62,11.37-10.1,12.81-16.52c8.89-35.6,27.05-60.73,54.46-75.34c22.43-11.74,53.95-17.6,94.53-17.6	c18.52,0,36.15,1.24,52.88,3.72c7.83,2.15,20.31,4.66,37.39,7.49c1.43-14.17,6.42-26.75,14.96-37.74 C421.38,106.06,432.95,99.67,446.47,99.67z"/>
<path id="star" class="st1" d="M409.6,198.066l26.833,54.369l60,8.719l-43.417,42.321l10.249,59.758L409.6,335.019
	l-53.666,28.214l10.249-59.758l-43.417-42.321l60-8.719L409.6,198.066z"/>
</svg>
  <div id="slider"></div>


</div>
<div class="brandBar">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/GreenSock-logo-text-outlines.svg"></div>
              
            
!

CSS

              
                
svg {
  width:600px;
}

#hippo, #elephant, #star{
  visibility:hidden;
}

#slider {
  width:560px;
  margin:20px 0;
}

h1 {
  font-size:30px;
}

h2 {
  font-size:16px;
}
              
            
!

JS

              
                //From 7 Hidden Gems of GSAP (Net Magazine)
//Read full article: https://medium.com/net-magazine/7-hidden-gems-of-the-greensock-animation-platform-4fb71389f6ca#.t6xniz19i




/*
Try GreenSock's MorphSVGPlugin for free.
 
 - Press the Fork button
 - add your own SVG, JS and HTML
 - have fun.
 
 Learn more about MorphSVGPlugin here: https://greensock.com/morphSVG
 MorphSVGPlugin is a bonus plugin for Shocking Green and Business Green members: https://www.greensock.com/club

*/

// Demo for 7 Hidden Gems of GSAP article that was published in the June 2016 edition of Net Magazine. Learn more: https://greensock.com/gems

var tl = new TimelineLite(),
    circle = document.getElementById("circle");

tl.to(circle, 1, {morphSVG:"#hippo"}, "+=1")
  .to(circle, 1, {morphSVG:"#star"}, "+=1")
  .to(circle, 1, {morphSVG:"#elephant"}, "+=1")
  .to(circle, 1, {morphSVG:circle}, "+=1");




GSDevTools.create();
              
            
!
999px

Console