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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 version="1.1" xmlns="http://www.w3.org/2000/svg"
       viewBox="0 0 500 528" class="debug">
<g id="puppet">
<g id="torso" class="torso">
  <path d="M205.1,329.4c0,0-7.3-111-7.3-136.5s0.1-37.6,0.1-37.6s18.6-8.7,52.4-8.7s52.4,8.7,52.4,8.7s0.1,12.1,0.1,37.6
    s-8.1,136.5-8.1,136.5H205.1z"/>
  <circle class="regPoint debug" cx="300" cy="168" r="3"/>
  <circle class="regPoint debug" cx="200" cy="168" r="3"/>
  <circle class="regPoint debug" cx="274" cy="307" r="3"/>
  <circle class="regPoint debug" cx="226" cy="307" r="3"/>
  <circle id="head" class="head" cx="250" cy="94" r="47"/>
  	<rect id="neck" x="237" y="129" width="28" height="28"/>
  
  <g class="arm right_arm">
    <g>
      <path d="M385.1,155.8c6.5,0,11.8,5.3,11.8,11.8c0,6.5-5.3,11.8-11.8,11.8l-85.2,1.1c-7.2,0-13-5.8-13-13s5.8-13,13-13L385.1,155.8z
        "/>
      <circle class="regPoint" cx="300" cy="168" r="3"/>
    </g>
    <g id="elbow_right" class="hand right_hand">
      <path d="M384.6,179.4c-6.5,0-11.7-5.3-11.7-11.8s5.3-11.7,11.8-11.7l70.1,2.7c5.2,0,9.4,4.2,9.3,9.4c0,5.2-4.2,9.4-9.4,9.3
        L384.6,179.4z"/>
      <circle class="regPoint" cx="385" cy="168" r="3"/>
    </g>
  </g> 
  
  <g class="arm left_arm">
    <g>
      <path d="M116.3,155.8c-6.5,0-11.8,5.3-11.8,11.8c0,6.5,5.3,11.8,11.8,11.8l85.2,1.1c7.2,0,13-5.8,13-13s-5.8-13-13-13L116.3,155.8z
      "/>
      <circle class="regPoint" cx="200" cy="168" r="3"/>
    </g>
    <g id="elbow_left" class="hand left_hand">
      <path d="M116.8,179.4c6.5,0,11.7-5.3,11.7-11.8c0-6.5-5.3-11.7-11.8-11.7l-70.1,2.7c-5.2,0-9.4,4.2-9.3,9.4c0,5.2,4.2,9.4,9.4,9.3
      L116.8,179.4z"/>
      <circle class="regPoint" cx="117" cy="168" r="3"/>
    </g>
  </g>
</g>

<g class="leg right_leg">
  <g id="hip_right">
    <path d="M369.9,290.5c9.1,0,16.5,7.3,16.5,16.4s-7.3,16.5-16.4,16.5l-95.7,5.4c-10,0-18.2-11.9-18.2-21.9c0-10,8.1-22,18.1-22 L369.9,290.5z"/>
    <circle class="regPoint" cx="275" cy="307" r="3" />
  </g>
  <g id="knee_right" class="foot right_foot">
    <path d="M495.1,315.8l-125.2,7.6c-9.1,0-16.5-7.4-16.5-16.5c0-9.1,7.4-16.5,16.5-16.5l125.2,7.7L495.1,315.8z" />
    <circle class="regPoint" cx="370" cy="307" r="3" />
  </g>
</g>
  
  <g class="leg left_leg">
    <g>
      <path d="M131.2,290.5c-9.1,0-16.5,7.3-16.5,16.4s7.3,16.5,16.4,16.5l95.7,5.4c10,0,18.2-11.9,18.2-21.9s-8.1-22-18.1-22
        L131.2,290.5z"/>
      <circle class="regPoint" cx="226" cy="307" r="3"/>
    </g>
    <g class="foot left_foot">
      <path d="M6,315.8l125.2,7.6c9.1,0,16.5-7.4,16.5-16.5c0-9.1-7.4-16.5-16.5-16.5L6,298.1L6,315.8z"/>
      <circle class="regPoint" cx="131" cy="307" r="3"/>
    </g>
  </g>
</g>
</svg>
              
            
!

CSS

              
                .debug path,.debug{stroke:#FFF;fill:transparent;}
.regPoint{fill:#F00;}
#puppet *{stroke:none; fill:rgba(255,0,0,.3);}
              
            
!

JS

              
                TweenMax.set('.left_arm', {svgOrigin:'200 168'});
TweenMax.set('.left_hand', {svgOrigin:'117 168'});
TweenMax.set('.right_arm', {svgOrigin:'300 168'});
TweenMax.set('.right_hand', {svgOrigin:'385 168'});
TweenMax.set('.left_leg', {svgOrigin:'226 307'});
TweenMax.set('.left_foot', {svgOrigin:'131 307'});
TweenMax.set('.right_leg', {svgOrigin:'274 307'});
TweenMax.set('.right_foot', {svgOrigin:'370 307'});
TweenMax.set('.head', {svgOrigin:'250 130'});
TweenMax.set('.torso, #puppet', {svgOrigin:'250 307'});

function stand(d){
  TweenMax.to('.torso',d, {rotation:0, y:0});
  TweenMax.to('.right_leg',d,{rotation:85}); 
  TweenMax.to('.left_leg',d,{rotation:-85});
  TweenMax.to('.right_foot',d,{rotation:0});
  TweenMax.to('.left_foot',d,{rotation:0});
  TweenMax.to('.right_arm',d,{rotation:60});
  TweenMax.to('.left_arm',d,{rotation:-60});
  TweenMax.to('.right_hand',d,{rotation:80});
  TweenMax.to('.left_hand',d,{rotation:-80});
}

function kick(d){
  TweenMax.to('.torso',d,{rotation:-10, y:0});
  TweenMax.to('.right_leg',d,{rotation:-10});
  TweenMax.to('.left_leg',d,{rotation:-90});
  TweenMax.to('.right_foot',d,{rotation:0});
  TweenMax.to('.left_foot',d,{rotation:-105});
  TweenMax.to('.right_arm',d,{rotation:10});
  TweenMax.to('.left_arm',d,{rotation:40});
  TweenMax.to('.right_hand',d,{rotation:-50});
  TweenMax.to('.left_hand',d,{rotation:40});
}

function crouch(d){
  TweenMax.to('.torso',d,{rotation:0, y:20});
  TweenMax.to('.right_leg',d,{rotation:75});
  TweenMax.to('.left_leg',d,{rotation:-75});
  TweenMax.to('.right_foot',d,{rotation:15});
  TweenMax.to('.left_foot',d,{rotation:-15});
  TweenMax.to('.right_arm',d,{rotation:50});
  TweenMax.to('.left_arm',d,{rotation:-50});
  TweenMax.to('.right_hand',d,{rotation:30});
  TweenMax.to('.left_hand',d,{rotation:-30});
}

function fly(d){
  TweenMax.to('.torso',d,{rotation:0, y:-10});
  TweenMax.to('.right_leg',d,{rotation:93});
  TweenMax.to('.left_leg',d,{rotation:-93});
  TweenMax.to('.right_foot',d,{rotation:0});
  TweenMax.to('.left_foot',d,{rotation:0});
  TweenMax.to('.right_arm',d,{rotation:-80});
  TweenMax.to('.left_arm',d,{rotation:80});
  TweenMax.to('.right_hand',d,{rotation:-20});
  TweenMax.to('.left_hand',d,{rotation:20});
}



TweenMax.delayedCall(1, stand,[1]);
TweenMax.delayedCall(3, fly,[1]);
TweenMax.delayedCall(5, stand,[1]);
TweenMax.delayedCall(7, kick,[.5]);
TweenMax.delayedCall(8, crouch,[1]);
TweenMax.delayedCall(10, stand,[1]);

              
            
!
999px

Console