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

              
                <div class="container">
  <div class="body">
    <img src="https://drive.google.com/uc?export=view&id=1rJpLxiCRTZLge6hDTtNGGihx_ZGO-hhR">
  </div>
  <div class="head">
    <img src="https://drive.google.com/uc?export=view&id=1MHNjIlYzGCeGiVRZuJk0X6Fo2HN8w8g7">
  </div>
  <div class="left-hand">
    <img src="https://drive.google.com/uc?export=view&id=1oHicpOUWD8D7k6tvDT2COtSS6HBVj_zk">
  </div>
  <div class="right-hand">
    <img src="https://drive.google.com/uc?export=view&id=1oHicpOUWD8D7k6tvDT2COtSS6HBVj_zk">
  </div>
  <div class="left-reg">
    <img src="https://drive.google.com/uc?export=view&id=1YX-LCXOTwDjPFkTkW6DJ30gJuTx1DDvC">
  </div>
  <div class="right-reg">
    <img src="https://drive.google.com/uc?export=view&id=1YX-LCXOTwDjPFkTkW6DJ30gJuTx1DDvC">
  </div>
</div>
              
            
!

CSS

              
                div {
  display: inline-block;
}
img {
  width: 100%;
  height: 100%;
}
.container {
  position: relative;
  width: 100px;
  height: 100px;
  left: 150px;
  top: 150px;
}
.body {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
}
.head {
  position: absolute;
  width: 200%;
  left: -50%;
  top: -160%;
  transform-origin: 50% 80%;
}
.left-hand {
  position: absolute;
  width: 30%;
  left: 75%;
  top: 40%;
  transform-origin: 50% 10%;
}
.right-hand {
  position: absolute;
  width: 30%;
  left: 0;
  top: 40%;
  transform-origin: 50% 10%;
  z-index: -3;
}
.left-reg {
  position: absolute;
  width: 50%;
  left: 40%;
  top: 150%;
  z-index: -1;
  transform-origin: 50% 10%;
}
.right-reg {
  position: absolute;
  width: 50%;
  left: 0%;
  top: 150%;
  z-index: -2;
  transform-origin: 50% 10%;
}
              
            
!

JS

              
                $(function(){
  var bodyFlag = 1;//体用フラグ
  var headFlag = 1;//頭用フラグ
  var leftHandFlag = 1;//左腕用フラグ
  var rightHandFlag = 0;//右腕用フラグ
  var leftRegFlag = 0;//左足用フラグ
  var rightRegFlag = 1;//右足用フラグ
  
  var bodyCnt = 0;//体用カウンタ
  var headCnt = 0;//頭用カウンタ
  var leftHandCnt = 0;//左腕用カウンタ
  var rightHandCnt = 0;//右腕用カウンタ
  var leftRegCnt = 0;//左足用カウンタ
  var rightRegCnt = 1;//右足用カウンタ
  
  var bodyWidth = 1;
  
  var head = $(".head");
  var body = $(".body");
  var leftHand = $(".left-hand");
  var rightHand = $(".right-hand");
  var leftReg = $(".left-reg");
  var rightReg = $(".right-reg");
  
  setInterval(function(){
    /***** 頭 *****/
    head.css("transform","rotate(" + (headCnt*0.1) +"deg)");
    
    if (headCnt == 5) {
      headFlag = 1;
    } else if (headCnt == -5) {
      headFlag = 0;
    }
    
    if (headFlag == 1) {
      headCnt--;
    } else if (headFlag == 0) {
      headCnt++;
    }  

    /***** 体 *****/
    body.css("transform","scaleX(" + (bodyWidth+bodyCnt*0.005) + ")");
    
    if (bodyCnt == 15) {
      bodyFlag = 1;
    } else if (bodyCnt == 0) {
      bodyFlag = 0;
    }
    
    if (bodyFlag == 1) {
      bodyCnt--;
    } else if (bodyFlag == 0) {
      bodyCnt++;
    }
    
    /***** 左腕 *****/
    leftHand.css("transform","rotate(" + (leftHandCnt) +"deg)");
    
    if (leftHandCnt == 15) {
      leftHandFlag = 1;
    } else if (leftHandCnt == -15) {
      leftHandFlag = 0;
    }
    
    if (leftHandFlag == 1) {
      leftHandCnt--;
    } else if (leftHandFlag == 0) {
      leftHandCnt++;
    }
    
    /***** 右腕 *****/
    rightHand.css("transform","rotate(" + (rightHandCnt) +"deg)");
    
    if (rightHandCnt == 15) {
      rightHandFlag = 1;
    } else if (rightHandCnt == -15) {
      rightHandFlag = 0;
    }
    
    if (rightHandFlag == 1) {
      rightHandCnt--;
    } else if (rightHandFlag == 0) {
      rightHandCnt++;
    }
    
    /***** 左足 *****/
    leftReg.css("transform","rotate(" + (leftRegCnt) +"deg)");
    
    if (leftRegCnt == 15) {
      leftRegFlag = 1;
    } else if (leftRegCnt == -15) {
      leftRegFlag = 0;
    }
    
    if (leftRegFlag == 1) {
      leftRegCnt--;
    } else if (leftRegFlag == 0) {
      leftRegCnt++;
    }
    
    /***** 右足 *****/
    rightReg.css("transform","rotate(" + (rightRegCnt) +"deg)");
    
    if (rightRegCnt == 15) {
      rightRegFlag = 1;
    } else if (rightRegCnt == -15) {
      rightRegFlag = 0;
    }
    
    if (rightRegFlag == 1) {
      rightRegCnt--;
    } else if (rightRegFlag == 0) {
      rightRegCnt++;
    }
    
  },100);
});
              
            
!
999px

Console