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

              
                <div class="cartoon hb">
  <div class="horn r ha"></div>
  <div class="horn r ha"></div>
  <div class="leg hb ha"></div>
  <div class="leg hb ha"></div>
  <div class="body b">
    <div class="tongue b"></div>
    <div class="fang b ha"></div>
    <div class="mouth r ha hb"></div>
    <div class="eye b r ha hb"></div>
  </div>
  <div class="correction ha r"></div>
</div>

<a id="youtube" href="https://www.youtube.com/watch?v=fcwuKsPb_FQ" target="_blank">
  <span>See how this video was made</span>
</a>
              
            
!

CSS

              
                html, body {
  overflow: hidden;
  background: #7c66
}

.cartoon {
  position: absolute;
  bottom: 0%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 80vmin;
  height: 80vmin;
}

.cartoon div {
  position: absolute;
  box-sizing: border-box;
}

.b {
  border: 0.5vmin solid;
}

.r {
  border-radius: 100%;
}

.hb::before,
.ha::after {
  content: "";
  display: block;
  position: absolute;
  box-sizing: border-box;
}

/****/
.cartoon {
  --skin: #7c6;
  --line: #222;
  --eye: #ffa;
  --tooth: #ff9;
  --mouth: #0002;
  --iris: #369c;
  --tongue: #f00a;
  color: var(--line);
}

.body {
  width: 60%;
  height: 70%;
  background: var(--skin);
  border-radius: 100% / 120% 120% 65% 60%;
  top: 10%;
  left: 50%;
  transform: translate(-50%, 0);
  overflow: hidden;
}

.eye {
  width: 55%;
  height: 46%;
  top: 15%;
  left: 50%;
  transform: translate(-50%, 0);
  box-shadow: 0 0 0 2vmin var(--skin), -2vmin -2vmin 0 -0.5vmin, 2vmin -2vmin 0 -0.5vmin;
  background: var(--eye);
  box-shadow: inset 0 0 4vmin -2.5vmin var(--tongue);
}

.eye::before {
  width: 12vmin;
  height: 12vmin;
  background: var(--line);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2vmin var(--iris);
}

.eye::after {
  width: 3vmin;
  height: 3vmin;
  background: #fff;
  border-radius: 50%;
  top: 25%;
  left: 60%;
  box-shadow: 2vmin 2vmin 0 -0.75vmin #fff, 2.5vmin 0.5vmin 0 -1.1vmin #fff;
}

.mouth {
  width: 80%;
  height: 70%;
  top: 23%;
  left: 55%;
  transform: translate(-50%, 0) rotate(33deg);
  border: 0.5vmin solid transparent;
  border-right: 0.25vmin solid transparent;
  border-bottom: 0.5vmin solid;
  box-shadow: 0 0 0 5vmin var(--skin), inset -3vmin 8vmin var(--skin), inset 35vmin -4vmin var(--mouth);
  
}

.mouth::before {
  width: 120%;
  height: 130%;
  background: var(--skin);
  border-radius: 50%;
  transform: rotate(-30deg);
  border: 0.5vmin solid transparent;
  border-bottom: 0.5vmin solid;
  border-right: 0.3vmin solid transparent;
  top: -39%;
  left: -34%;
}

.mouth::after {
  width: 5vmin;
  height: 5vmin;
  border: 0.5vmin solid transparent;
  border-left: 0.5vmin solid;
  border-radius: 50%;
  top: 82.5%;
  left: 13.5%;
  transform: rotate(20deg);
}

.fang {
  width: 10%;
  height: 9%;
  background: var(--tooth);
  top: 72.5%;
  left: 56%;
  transform: rotate(45deg) skew(10deg);
}

.fang::after {
  width: 100%;
  height: 100%;
  border: 0.5vmin solid;
  background: var(--tooth);
  top: 270%;
  left: -30%;
  transform: rotate(10deg);
}

.tongue {
  width: 30%;
  height: 12%;
  border-radius: 100vmin 100vmin 0 0;
  top: 84%;
  left: 30%;
  background: var(--tongue);
  transform: rotate(10deg);
}

.leg {
  width: 20%;
  height: 30%;
  background-image: linear-gradient(85deg, transparent 19.75%, var(--line) 20% 22.5%, var(--skin) 22.75% 60%, transparent 0), linear-gradient(-85deg, transparent 19.75%, var(--line) 20% 22.5%, var(--skin) 22.75% 60%, transparent 0);
  bottom: 0;
  left: 39%;
  transform: translate(-50%, 0);
}

.leg + .leg {
  left: 64%;
  transform: translate(-50%, 0) skew(5deg);
}


.leg::before {
  width: 5vmin;
  height: 5vmin;
  border: 0.5vmin solid;
  bottom: 0;
  border-radius: 100% 100% 30% 30%;
  background: var(--skin);
  box-shadow: 5vmin 0 0 -0.45vmin var(--skin), 10vmin 0 0 -0.45vmin var(--skin), 5vmin 0, 10vmin 0
}

.leg::after {
  width: 3vmin;
  height: 4vmin;
  border: 0.5vmin solid;
  background: var(--eye);
  bottom: 0;
  left: 0.75vmin;
  border-radius: 100% / 50% 50% 120% 120%;
  box-shadow: 5.25vmin 0 0 -0.45vmin var(--eye), 10.5vmin 0 0 -0.45vmin var(--eye), 5.25vmin 0, 10.5vmin 0
}

.horn {
  width: 20%;
  height: 20%;
  border: 0.5vmin solid transparent;
  border-left: 0.5vmin solid;
  border-bottom: 0.5vmin solid;
  transform: rotate(25deg);
  overflow: hidden;
  top: 5%;
  left: 25%;
}

.horn::after {
  width: 100%;
  height: 100%;
  border: 0.5vmin solid;
  border-radius: 50%;
  top: -40%;
  left: 12%;
  box-shadow: -0.5vmin 2vmin #fffa, 0 0 0 10vmin var(--eye);
}

.horn + .horn {
  left: 60%;
  top: 10%;
  transform: rotate(-190deg);
}

.horn + .horn::after {
  box-shadow: -0.5vmin 2vmin #0001, 0 0 0 10vmin var(--eye);
}

.correction {
  width: 10%;
  height: 5%;
  background: var(--skin);
  bottom: 20%;
  left: 35%;
  box-shadow: 19vmin 0 0 1vmin var(--skin)
}


/***/

#youtube {
  z-index: 2;
  display: block;
  width: 100px;
  height: 70px;
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: red;
  border-radius: 50% / 11%;
  transition: transform 0.5s;
}

#youtube:hover,
#youtube:focus {
  transform: scale(1.1);
}

#youtube::before {
  content: "";
  display: block;
  position: absolute;
  top: 7.5%;
  left: -6%;
  width: 112%;
  height: 85%;
  background: red;
  border-radius: 9% / 50%;
}

#youtube::after {
  content: "";
  display: block;
  position: absolute;
  top: 20px;
  left: 40px;
  width: 45px;
  height: 30px;
  border: 15px solid transparent;
  box-sizing: border-box;
  border-left: 30px solid white;
}

#youtube span {
  font-size: 0;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

              
            
!

JS

              
                
              
            
!
999px

Console