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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div id="koala"></div>
            
          
!

CSS

            
              body{
  background: #25A9FC;
}

.box{
  position: relative;
  margin: auto;
  display: block;
  margin-top: 8%;
  width: 600px;
  height: 420px;
  background: none;
  border: solid 3px white;
}

.head{
  position: absolute;
  top:16.5%;
  left: 25%;
  width: 50%;
  height: 67%;
  background: #A6BECF;
  border-radius: 50%;
  z-index: 3;
}

.outer-ear-left{
  position: absolute;
  width: 33%;
  height: 47%;
  left: 17%;
  top: 20%;
  background: #A6BECF;
  border-radius: 50%;
  z-index: 1;
}

.outer-ear-right{
  position: absolute;
  width: 33%;
  height: 47%;
  right: 17%;
  top: 20%;
  background: #A6BECF;
  border-radius: 50%;
  z-index: 1;
}

.inner-ear-left{
  position: absolute;
  border-radius: 50%;
  width: 28%;
  height: 40%;
  top: 23.5%;
  left: 19.5%;
  background: #819CAF;
  z-index: 2;
}

.inner-ear-right{
  position: absolute;
  border-radius: 50%;
  width: 28%;
  height: 40%;
  top: 23.5%;
  right: 19.5%;
  background: #819CAF;
  z-index: 2;
}

.outer-eye-left{
  position: absolute;
  background: white;
  width: 16%;
  height: 22%;
  top: 32%;
  left: 35%;
  border-radius: 50%;
  z-index: 4;
}

.outer-eye-right{
  position: absolute;
  background: white;
  width: 16%;
  height: 22%;
  top: 32%;
  right: 35%;
  border-radius: 50%;
  z-index: 4;
}

.pupil-left{
  position: absolute;
  width: 4.5%;
  height: 7%;
  top: 40%;
  left: 40.5%;
  border-radius: 50%;
  background: #27354A;
  z-index: 5;
} 

.pupil-right{
  position: absolute;
  width: 4.5%;
  height: 7%;
  top: 40%;
  right: 40.5%;
  border-radius: 50%;
  background: #27354A;
  z-index: 5;
}

.nose{
  position: absolute;
  background: #BE845F;
  width: 13%;
  height: 30.5%;
  left: 43.5%;
  top: 45%;
  border-radius: 50px;
  z-index: 5;
}

.hair-left{
  position: absolute;
  top: 12%;
  left: 39%;
  width: 10%;
	height: 12%;
	background:  #A6BECF;
	-webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.hair-right{
  position: absolute;
  top: 14%;
  left: 50%;
  width: 10%;
	height: 12%;
	background:  #A6BECF;
	-webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

@media all and (max-width: 600px) {
  .box{
    position: relative;
    margin: auto;
    display: block;
    margin-top: 2%;
    width: 400px;
    height: 280px;
    background: none;

  }
}
            
          
!

JS

            
              //village
class Koala extends React.Component {
  render() {
    return (
      <Box/>
    )
  }
}

//neighborhood
class Box extends React.Component {
  render() {
    return (
     <div className="box">
       <EarLeft/>
       <EarRight/>
       <EyeLeft/>
       <EyeRight/>
       <Head/>
       <Nose/>
       <HairLeft/>
       <HairRight/>
     </div>
    )
  }
}

//blocks
class EarLeft extends React.Component {
  render() {
    return (
      <div>
        <OuterEarLeft/>
        <InnerEarLeft/>
      </div>
    )
  }
}

class EarRight extends React.Component {
  render() {
    return (
      <div>
        <OuterEarRight/>
        <InnerEarRight/>
      </div>
    )
  }
}

class EyeLeft extends React.Component {
  render() {
    return (
      <div>
        <OuterEyeLeft/>
        <PupilLeft/>
      </div>
    )
  }
}
class EyeRight extends React.Component {
  render() {
    return (
      <div>
        <OuterEyeRight/>
        <PupilRight/>
      </div>
    )
  }
}

//houses
class Head extends React.Component {
  render() {
    return (
      <div className="head"></div>
    )
  }
}

class Nose extends React.Component {
  render() {
    return (
      <div className="nose"></div>
    )
  }
}

class HairLeft extends React.Component {
  render() {
    return (
      <div className="hair-left"></div>
    )
  }
}

class HairRight extends React.Component {
  render() {
    return (
      <div className="hair-right"></div>
    )
  }
}

class OuterEarRight extends React.Component {
  render() {
    return (
      <div className="outer-ear-right"></div>
    )
  }
}

class InnerEarRight extends React.Component {
  render() {
    return (
      <div className="inner-ear-right"></div>
    )
  }
}

class OuterEarLeft extends React.Component {
  render() {
    return (
      <div className="outer-ear-left"></div>
    )
  }
}

class InnerEarLeft extends React.Component {
  render() {
    return (
      <div className="inner-ear-left"></div>
    )
  }
}

class OuterEyeLeft extends React.Component {
  render() {
    return (
      <div className="outer-eye-left"></div>
    )
  }
}

class PupilLeft extends React.Component {
  render() {
    return (
      <div className="pupil-left"></div>
    )
  }
}

class OuterEyeRight extends React.Component {
  render() {
    return (
      <div className="outer-eye-right"></div>
    )
  }
}

class PupilRight extends React.Component {
  render() {
    return (
      <div className="pupil-right"></div>
    )
  }
}

//"inject" to DOM
ReactDOM.render(
  <Koala/>,
  document.getElementById('koala')
);
            
          
!
999px

Console