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 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

              
                <div class="wrapper">
  <div class="r2d2-head">
    <div class="r2d2-head-sensor-area">
      <div class="sensor sensor-large"></div>
      <div class="sensor sensor-small sensor-left"></div>
      <div class="sensor sensor-small sensor-right"></div>
    </div><!-- /r2d2-head-sensor-area -->
    <div class="r2d2-face-area">
    	<div class="face-box-small face-box-margin-left box-border"></div>
    	<div class="face-box-middle face-box-margin-left box-border"></div>
    	<div class="face-box-small face-box-rounded face-box-margin-left box-border"></div>
    	<div class="face-box-large face-box-margin-left box-border">
    		<div class="eye box-border"></div>
    	</div>
    	<div class="face-box-small face-box-margin-left box-border"></div>
    	<div class="face-border-bottom"></div>
    </div><!-- /r2d2-face-area -->
  </div><!-- /r2d2-head -->
  <div class="r2d2-arms">
      <div class="left-arm">
        <div class="left-shoulder box-border"></div>
        <div class="small-arm-part small-arm-left"></div>
          <div class="wrist wrist-left box-border">
            <div class="wrist-circle box-border"></div>
          </div>
        <div class="hand box-border hand-left"></div>
      </div><!-- left-arm -->
      
      <div class="right-arm">
        <div class="right-shoulder box-border"></div>
        <div class="small-arm-part small-arm-right"></div>
          <div class="wrist wrist-right box-border">
            <div class="wrist-circle box-border"></div>
          </div>
        <div class="hand box-border hand-right"></div>
      </div><!-- right-arm -->
  </div><!-- r2d2-arms -->
  <div class="r2d2-body">
  	<div class="body-line box-border first-line"></div>
  	<div class="body-line box-border second-line"></div>
  	<div class="body-line box-border third-line"></div>

  	<div class="body-box body-box-large box-border body-box-large-left"></div>
  	<div class="body-box body-box-small box-border body-box-small-left"></div>

  	<div class="body-box body-box-small box-border body-box-small-right"></div>
  	<div class="body-box body-box-large box-border body-box-large-right"></div>
    	<div class="body-box-center box-border">
    		<div class="body-center-box-inner inner-top box-border"></div>
    		<div class="body-center-box-inner inner-bottom box-border"></div>
    	</div>
      <div class="body-bottom-box left-box box-border"></div>
      <div class="body-bottom-small-horizontal body-bottom-small-left box-border"></div>
      <div class="body-bottom-square-box body-bottom-square-left box-border"></div>

      <div class="body-bottom-small-horizontal body-bottom-small-right box-border"></div>
      <div class="body-bottom-square-box body-bottom-square-right box-border"></div>
      <div class="body-bottom-box right-box box-border"></div>
      <div class="body-bottom-circle circle-center box-border"></div>
        <div class="body-bottom-border clearfix">
          <div class="body-bottom-inner-square first-square"></div>
          <div class="body-bottom-inner-square"></div>
          <div class="body-bottom-inner-square"></div>
          <div class="body-bottom-inner-square"></div>
          <div class="body-bottom-inner-square last-square"></div>
        </div>
  </div><!-- /r2d2-body -->
  <div class="feet"></div>
</div><!-- /wrapper -->

<div class="credit">
  <p>2013 by <a href="https://twitter.com/_kevinatari">Kevin Gimbel</a>. Feel free to create new things based on it or optimize my work. I'd be happy if you link to this Pen as soon as you use the code in any way. Thanks <span class="red">&hearts;</span></p>
</div> <!-- credit -->
              
            
!

CSS

              
                @import "compass/css3";

/* Codepen.io credits */
.credit {
  width:500px;
  margin:20px auto;
  padding:10px 20px;
  background:#f1f1f1;
  color:#000000;
  font-size:0.7em;
  -webkit-border-radius:3px;
  -moz-border-radius:3px;
  border-radius:3px;
  box-shadow:0px 0px 4px rgba(0,0,0,0.6);
  -moz-box-shadow:0px 0px 4px rgba(0,0,0,0.6);
}

a {
  color:#227799;
  text-decoration:none;
}

a:hover {
  color:#222222;
  border:none;
}
.red {color:#7a0208;}
/* END Codepen.io credits*/

$blue      :    #112D68;
$red       :    #F52921;
$silver    :    darken(#E9E9E9,10%);
$white     :    #ffffff;
$dark      :    #222222;
$dark-grey :    lighten(#222222,10%);

$r2d2-width:    300px;

$page-bg  :   #222222;
/* 
Colors

http://www.colourlovers.com/palette/128400/R2D2
http://www.colourlovers.com/palette/89369/iam_r2

*/

* {
  margin:0; 
  padding:0; 
  position:relative;
  box-sizing:border-box;

 /* uncomment wrap every element with a border
  border:1px solid red !important;
  
  */
}

body {
 background:$page-bg;
}

.wrapper {
 width:300px;
 height:auto;
 margin:20px auto 100px auto;
}

.box-border {
  border:2px solid $dark;
}

.clearfix, .clearfix:after {
  content:'';
  display: table;
  clear: both;
}

/* ----------------- R2D2::buildHead() ---- PiepPiepPiep ---*/

.r2d2-head {
  width:$r2d2-width;
  height:370px;
  background:$silver;
  border-radius:100% / 80%;
   &:after{ /* upper body part */
      width:300px;
      height:140px;
      content:'';
      position:absolute;
      left:0;
      bottom:0;
      background:$white;
    } 
}

.r2d2-head-sensor-area {
  width:85px;
  height:85px;
  background:$blue;
  position: absolute;
  left:50%;
  margin-left: -40px;
  top:20px;
}

.sensor {
  background:$dark-grey;
}

.sensor-large {
  width: 55px;
  height: 55px;
  border-radius: 100%;
  margin: 5px auto;
  border:5px solid $dark;
}

.sensor-small {
  width: 15px;
  height: 15px;
  border-radius: 100%;
  border:2px solid $dark;
}

.sensor-left, .sensor-right {
  position: absolute;
  bottom:3px;
}

.sensor-left {
  left:3px;
}

.sensor-right {
  right: 3px;
}

.r2d2-face-area { 
  width: $r2d2-width;
  height: 100px;
  position: absolute;
  bottom: 140px;
  left: 0;
  z-index: 9999;
}

.face-box-small, .face-box-middle, .face-box-large{
  height: 75px;
  background: $blue;
  display:inline-block;   
}

.face-box-small {
  width: 35px;
}

.face-box-middle {
  width: 55px; 
}

.face-box-large {
  width: 65px;
}

.face-box-rounded {
  border-radius: 100% / 40%;
}

.face-box-margin-left {
  margin-left:10px;
}

.face-border-bottom {
  width: 100%;
  height: 10px;
  background: $blue;
  border-top:2px solid $dark;
  border-bottom:2px solid $dark;
  margin-top: 10px;
}

.eye {
  width: 50px;
  height: 50px;
  margin: 10px auto;
  background:-webkit-radial-gradient(center,$red,darken($red,20%));
  border-radius: 100%;
}

/* ----------------- R2D2::buildArms() ---- PiepPiepPiep ---*/
.r2d2-arms {
  width: 450px;
  height: 420px;
  margin-left:-100px;
  position: absolute;
  top:225px;
  left:25px;
  background: none;
  z-index: -1;

}
.right-arm, .left-arm {
  width: 75px;
  height: 420px;}
.right-arm {
  position: absolute;
  top:0;
  right:0;
}

.left-shoulder, .right-shoulder {
  width: 75px;
  height: 150px;
  background: $white;
}

.left-shoulder {
  border-top-left-radius:5px;
  border-bottom-left-radius:5px;  
}

.right-shoulder {
  border-top-right-radius:5px;
  border-bottom-right-radius:5px;  
}

.small-arm-part {
  width: 40px;
  height: 100px;
  background: $white;
  z-index:2;
}

.small-arm-left {
  position: absolute;
  top:150px;
  right:5px;
    &:before {
      content:'';
      width:10px;
      height:100%;
      position: absolute;
      top:0;
      left: -10px;
      background: $blue;
    }
}


.small-arm-right {
  position: absolute;
  top:150px;
  right:30px;
    &:before {
      content:'';
      width:10px;
      height: 100%;
      position: absolute;
      top:0;
      right: -10px;
      background: $blue;
    }
}

.wrist {
  width: 100px;
  height: 100px;
  background: $white;
  border-radius: 20px;
}

.wrist-right, .wrist-left {
  position: absolute;
  top:250px;
}

.wrist-right {
  right:-5px;
}

.wrist-left {
  position: absolute;
  top:250px;
  left:-5px;
}

.wrist-circle {
  width: 50px;
  height: 50px;
  background: $blue;
  border-radius: 100%;
  position: absolute;
  top:15px;
  left:25px;
  z-index:1;
}


.hand {
  height: 100px;
  width: 100px;
  background: $white;
  margin-top: 180px;
}

.hand-left {
  position: absolute;
  left:-10px;
    &:before {
      content:'';
      width: 0;
      height: 0;
      position: absolute;
      top:1px;
      left:30px;
      border-bottom:100px solid $page-bg;
      border-left:80px solid transparent;
      border-right: 80px solid transparent;
      -webkit-transform:rotate(-5deg);
    }
}

.hand-right {
  position: absolute;
  right:-10px;
    &:before {
      content:'';
      width: 0;
      height: 0;
      position: absolute;
      top:1px;
      right:30px;
      border-bottom:100px solid $page-bg;
      border-left:80px solid transparent;
      border-right: 80px solid transparent;
      -webkit-transform:rotate(5deg);
    }
}

/* ----------------- R2D2::buildBody() ---- PiepPiepPiep ---*/

.r2d2-body {
  width: $r2d2-width;
  height: 150px;
  background: $white;
}

.body-line {
  width: 180px;
  height: 15px;
  margin-left:60px;
  background: $blue;
  border-radius: 10px;
}

.first-line, .second-line, .third-line {
  position: absolute;
  left:0;
}

.first-line {
  top:-120px;
}

.second-line {
  top:-100px;
}

.third-line {
  top:-80px;
}

.body-box {
  width: 30px;
  background: $white;
  position: absolute;
  border-radius: 20px / 15px;
}

.body-box-small {
  height: 100px;
  top:-60px;
}

.body-box-large {
  height: 160px;
  top:-120px;
}

.body-box-large-left, .body-box-large-right {
  position: absolute;
}

.body-box-large-left {
  left: 20px;
}

.body-box-large-right {
  right: 20px;
}

.body-box-small-left {
  left:70px;
}

.body-box-small-right {
  right:70px;
}

.body-box-center {
  width: 60px;
  height: 105px;
  background:$blue;
  border-radius: 70px / 20px;
  position: absolute;
  top:-60px;
  left: 50%;
  margin-left: -30px;
}

.body-center-box-inner {
  width: 30px;
  height: 43px;
  background:$white;
  margin:5px auto 0 auto;
  border-radius:5px;
}

/* Lower body parts */
.body-bottom-box,.body-bottom-square-box,
.body-bottom-small-horizontal, .body-bottom-circle {
  position: absolute;
}
.body-bottom-box {
  width: 30px;
  height: 70px;
  border-radius: 50px;
  background: $blue;
  top:50px;
}

.left-box {
  left:20px;
}

.right-box {
  right:20px;
}

.body-bottom-small-horizontal {
  width: 40px;
  height: 20px;
  border-radius: 50px;
  background: $white;
  top:48px;
}

.body-bottom-small-left {
  left:65px; 
}

.body-bottom-small-right {
  right:65px; 
}

.body-bottom-square-box {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  background: $white;
  top:75px;
}

.body-bottom-square-left {
  left:65px;
}

.body-bottom-square-right {
  right:65px;
}

.body-bottom-circle {
  width: 60px;
  height: 60px;
  border-radius: 100%;
  background: $blue;
}

.circle-center {
  top:55px;
  left:50%;
  margin-left: -30px;
}

.body-bottom-border {
  width: $r2d2-width;
  height: 50px;
  bottom:-140px;
  left:0;
  background:$silver;
  border-top: 2px solid $dark;
  border-bottom: 2px solid $dark;
}

.body-bottom-inner-square {
  width: 50px;
  height:50px;
  border-right: 2px solid $dark;
  display: inline-block;
  float:left;
}
/*
.first-square:before {
  content:'';
  width: 25px;
  height: 60px;
  display:block;
  position: absolute;
  left:-12px;
  top:0px;
  background: $page-bg;
  -webkit-transform:rotate(-24deg);

}

.last-square:after {
  content:'';
  width: 25px;
  height: 60px;
  display:block;
  position: absolute;
  right:-62px;
  top:0px;
  background: $page-bg;
  -webkit-transform:rotate(24deg);

}
*/


/* ----------------- R2D2::buildFeet() ---- PiepPiepPiep ---*/

.feet {
  width: 50px;
  height: 75px;
  margin:42px auto;
  background: $white;
    &:after {
      content:'';
      position: absolute;
      top:20px;
      left:-35px;
      width: 0;
      height: 0;
      border-bottom:80px solid $white;
      border-left:60px solid transparent;
      border-right: 60px solid transparent;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console