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

              
                
<svg viewBox="0 0 800 600">
  
  <path class="partA00" d="M 130 60 Q 280 20 240 150"/>
  <path class="partB00 hidden" d="M 130 60 Q 300 0 240 150 "/>
  <path class="hover" d="M 130 60 Q 280 20 240 150"/>
  
  <path class="partA01" d="M 240 150 C 180 310 310 300 340 190"/>
  <path class="partB01 hidden" d="M 240 150 C 160 360 280 360 340 190"/>
  <path class="hover" d="M 240 150 C 180 310 310 300 340 190"/>
  
  <path class="partA02" d="M 340 190 C 380 70 410 120 430 180 "/>
  <path class="partB02 hidden" d="M 340 190 C 370 50 410 70 430 180"/>
  <path class="hover" d="M 340 190 C 380 70 410 120 430 180"/>
</svg>
              
            
!

CSS

              
                body{
  margin:0;
  background-color:grey;
}
path{
  fill:none;
  stroke:green;
  stroke-width:5px;
}
.hidden{
  visibility:hidden;
}
.hover{
  stroke:transparent;
  stroke-width:20px;
}

              
            
!

JS

              
                console.clear();

gsap.utils.toArray(".hover").forEach(function(hov, i) {
  
  var thisCurveA = document.querySelector('.partA0' + i);
  var thisCurveB = document.querySelector('.partB0' + i);

  var wiggle = gsap.to(thisCurveA, {morphSVG:thisCurveB, duration:0.1, repeat:1, yoyo:true, paused:true});

  hov.addEventListener("mouseenter", wiggleOut);
  //hov.addEventListener("mouseleave", wiggleIn);

  function wiggleOut(){
   wiggle.play(0);
  }

  function wiggleIn(){
     wiggle.reverse();
  }
  console.log(hov );
});

           
              
            
!
999px

Console