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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 class="container">
  <svg id="bird" version="1.0" xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 515 515">
    <path id="wing_b" d="M55 50 L375 300 L207 402Z" d2="M190 510 L375 280 L210 380Z" fill="#ED2424"/>
    <path id="head" d="M380 195 L488 252 L375 263Z" d2="M380 195 L478 252 L375 263Z" fill="#ED1D24"/>
    <path id="body" d="M20 516 L380 195 L375 300Z" d2="M20 496 L380 195 L375 280Z" fill="#BE2026"/>
    <path id="wing_f" d="M375 300 L220 394 L120 0Z" d2="M375 280 L210 380 L310 500Z" fill="#CB2126"/>
  </svg>
</div>
              
            
!

CSS

              
                @import "compass/css3";

body{
  width:100%;
  background:#EEF3F7;
  @include background-image(linear-gradient(top, #B2C7D8 0%, #EEF3F7 100%));
  background-repeat:no-repeat;
}
.container{
  margin:50px auto;
  width:400px;
  height:400px;
}
              
            
!

JS

              
                window.onload = function () {
	var duration = 800;
	var bird = Snap.select("#bird");
  var parts = ['wing_b','head','body','wing_f'];
  var elements = [];
  var w = bird.attr('width');
  var h = bird.attr('height');
  
  
  for (i = 0; i < parts.length; i++) {
    var element = bird.select("#" + parts[i]);
    element.attr('d1',element.attr('d'));
    elements.push(element);
  }
  
  var anim1 = function(){
    bird.stop().animate({height:h*.85},duration,mina.easeinout);
    for (i = 0; i < elements.length; i++) {
      elements[i].stop().animate({
        d: elements[i].attr('d2')
      }, duration, mina.easeinout,anim2);
  	}
  }
  
  var anim2 = function(){
    bird.stop().animate({width:w, height:h},duration, mina.easeinout);
    for (i = 0; i < elements.length; i++) {
      elements[i].stop().animate({
        d: elements[i].attr('d1')
      },duration, mina.easeinout,anim1);
  	}
  }
	
  anim1();
}      
              
            
!
999px

Console