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

              
                .pig
  .pig-ear-left-top
    .pig-ear-left-top-inner
  .pig-ear-left-bottom
    .pig-ear-left-bottom-inner
  .pig-eye-left-crescent
    .pig-eye-left
  .pig-bridge
  .pig-main
  .pig-forehead
  .pig-chin
  .pig-ear-right-top
    .pig-ear-right-top-inner
  .pig-ear-right-bottom
    .pig-ear-right-bottom-inner
  .pig-eye-right-crescent
    .pig-eye-right
  .pig-mouth
  .pig-snout
    .pig-snout-end
      .pig-nostril-left
      .pig-nostril-right  
  .pig-tongue-main  
    .pig-tongue-small-circle
    .pig-tongue-half-circle
    .pig-tongue-bottom

              
            
!

CSS

              
                // CALCULATIONS:
$squares_1: 8.33%;
$squares_2: 16.67%;
$squares_3: 25%;
$squares_4: 33.33%;
$squares_5: 41.67%;
$squares_6: 50%;
$squares_7: 58.33%;
$squares_8: 66.67%;
$squares_9: 75%;
$squares_10: 83.33%;
$squares_11: 91.67%;
$squares_12: 100%;

// COLORS:
$black-light: #352b2c;
$black: #000;
$tongue-light: #e76a68;
$tongue-dark: #b9372f;
$pig-skin: #f39e9f;
$pig-skin-shadow: #cd676f;
$snout: #f5c9c4;
$nostrils: #e28689;
$ear-light: #ec8b8f;
$ear-dark: #ad3740;
$background: gray;

body {
  background: $black;
}

.pig {
  position: relative;
  margin: auto;
  display: block;
  width: 360px;
  height: 360px;
  border: solid 5px white;
  background: $background;
}

img {
  position: absolute;
  background: none;
  width: 100%;
  height: 100%;
  top: 0%;
  left: 0%;
  border-radius: 0%;
  z-index: 1;
  opacity: 1;
}

.pig-main {
  position: absolute;
  background: $pig-skin;
  background: linear-gradient(20deg, $pig-skin 78%, $pig-skin-shadow 100%);
  width: $squares_6;
  height: $squares_7;
  top: $squares_5;
  left: $squares_6;
  z-index: 1;
}

.pig-forehead {
  position: absolute;
  background: $pig-skin;
  width: $squares_4;
  height: $squares_4;
  top: $squares_5;
  left: $squares_4;
  z-index: 1;
  border-radius: 100%;
}

.pig-chin {
  position: absolute;
  background: $pig-skin;
  background: blue;
  background: radial-gradient(70% 40% at 2% 95%, $pig-skin-shadow 0%, $pig-skin 100%) no-repeat 50% 50% / 100% 100%;
  width: $squares_4;
  height: $squares_4;
  top: $squares_8;
  left: $squares_3;
  z-index: 1;
  border-radius: 100% 0 0 100%;
}

.pig-bridge {
  position: absolute;
  background: $pig-skin;
  width: $squares_3;
  height: $squares_2;
  top: $squares_5 + 4%;
  left: $squares_2;
  z-index: 1;
  clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

.pig-ear-left-top {
  position: absolute;
  background: $pig-skin;
  background: linear-gradient(30deg, $pig-skin 21%, $pig-skin-shadow 95%);
  width: $squares_4;
  height: $squares_4;
  top: $squares_1;
  left: $squares_4;
  z-index: 1;
  border-radius: 0% 100% 0% 20%;
}

.pig-ear-left-top-inner {
  position: absolute;
  background: $ear-dark;
  background: linear-gradient(60deg, $ear-light 0%, $ear-dark 70.5%);
  width: 75%;
  height: 75%;
  top: 0;
  left: 0;
  z-index: 1;
  border-radius: 0% 100% 0% 15%;
}

.pig-ear-left-bottom {
  position: absolute;
  background: $pig-skin;
  width: $squares_3;
  height: $squares_3;
  top: $squares_4;
  left: $squares_4;
  z-index: 1;
  border-radius: 0% 0% 0% 100%;
}

.pig-ear-left-bottom-inner {
  position: absolute;
  background: $ear-dark;
  background: linear-gradient(90deg, $ear-light 0%, $ear-dark 100%);
  width: 100%;
  height: 125%;
  top: -12.5%;
  left: 0;
  z-index: 1;
  border-radius: 0% 7% 10% 100%;
}

.pig-ear-right-top {
  position: absolute;
  background: $pig-skin;
  background: linear-gradient(90deg, $pig-skin 25%, $pig-skin-shadow 95%);
  width: $squares_4;
  height: $squares_4;
  top: $squares_1;
  left: $squares_8;
  z-index: 1;
  border-radius: 0% 100% 0% 20%;
}

.pig-ear-right-top-inner {
  position: absolute;
  background: $ear-dark;
  background: linear-gradient(66deg, $ear-light 0%, $ear-dark 70.5%);
  width: 75.1%;
  height: 75%;
  top: 0;
  left: 0;
  z-index: 1;
  border-radius: 0% 100% 0% 0%;
}

.pig-ear-right-bottom {
  position: absolute;
  background: $pig-skin;
  background: linear-gradient(60deg, $ear-light 40%, $ear-dark 100%);
  width: $squares_3;
  height: $squares_3;
  top: $squares_4;
  left: $squares_8;
  z-index: 1;
  border-radius: 0% 0% 0% 100%;
}

.pig-ear-right-bottom-inner {
  position: absolute;
  background: $ear-dark;
  background: linear-gradient(60deg, $ear-light 40%, $ear-dark 100%);
  width: 99.9%;
  height: 100%;
  top: 0%;
  left: 0;
  z-index: 1;
  border-radius: 0% 0% 0% 100%;
}

.pig-eye-left {
  position: absolute;
  background: $background;
  width: 200%;
  height: 200%;
  top: 50%;
  left: -52.5%;
  z-index: 1;
  border-radius: 100%;
}

.pig-eye-left-crescent {
  position: absolute;
  background: $black;
  background: linear-gradient(
    90deg,
    $black-light 0%,
    $black 50%,
    $black-light 100%
  );
  width: $squares_1;
  height: $squares_1;
  top: $squares_6;
  left: $squares_2 + 4.5%;
  z-index: 1;
  border-radius: 100%;
}

.pig-eye-right {
  position: absolute;
  background: $pig-skin;
  width: 200%;
  height: 200%;
  top: 50%;
  left: -52.5%;
  z-index: 1;
  border-radius: 100%;
}

.pig-eye-right-crescent {
  position: absolute;
  background: $black;
  background: linear-gradient(
    90deg,
    $black-light 0%,
    $black 50%,
    $black-light 100%
  );
  width: $squares_1;
  height: $squares_1;
  top: $squares_6 + 4.5%;
  left: $squares_6 + 4.5%;
  z-index: 1;
  border-radius: 100%;
}

.pig-snout {
  position: absolute;
  background: $pig-skin;
  background: linear-gradient(200deg, $pig-skin 40%, $pig-skin-shadow 100%);
  width: $squares_5;
  height: $squares_2;
  top: $squares_7;
  left: $squares_2;
  z-index: 1;
  border-radius: 0% 30% 25px 0%;
}

.pig-snout-end {
  position: absolute;
  background: $snout;
  background: radial-gradient(50% 50% at 50% 50%, $snout 25%, $pig-skin 200%);
  width: 40%;
  height: 100%;
  top: 0%;
  left: -20%;
  z-index: 1;
  border-radius: 100%;
}

.pig-nostril-left {
  position: absolute;
  background: $nostrils;
  width: 20%;
  height: 20%;
  top: 42.5%;
  left: 20%;
  z-index: 1;
  border-radius: 100%;
  opacity: 1;
}

.pig-nostril-right {
  position: absolute;
  background: $nostrils;
  width: 20%;
  height: 20%;
  top: 42.5%;
  right: 20%;
  z-index: 1;
  border-radius: 100%;
  opacity: 1;
}

.pig-mouth {
  position: absolute;
  background: $black;
  width: $squares_5;
  height: $squares_3;
  top: $squares_7;
  left: $squares_2;
  z-index: 1;
  border-radius: 0% 40% 30px 30px;
}

.pig-tongue-main {
  position: absolute;
  // background: $tongue-light;
  background: radial-gradient(50% 50% at 33.3% 50%, $tongue-light 0%, $tongue-dark 100%);
  width: $squares_1 + 4.5%;
  height: $squares_1 + 4.5%;
  top: $squares_9 + 2%;
  left: $squares_5 + 4.5%;
  z-index: 1;
  border-radius: 100%;
}

.pig-tongue-small-circle {
  position: absolute;
  background: $tongue-dark;
  width: 33%;
  height: 16.67%;
  top: 33%;
  left: 0%;
  z-index: 1;
  border-radius: 10px 10px 0% 0%;
}

.pig-tongue-half-circle {
  position: absolute;
  background: $pig-skin;
  width: 100%;
  height: 50%;
  top: 50%;
  left: 0%;
  z-index: 1;
  border-radius: 0% 0% 150px 125px;
}

.pig-tongue-bottom {
  position: absolute;
  background: radial-gradient(75% 100% at 0% 0%, $tongue-light 0%, $tongue-dark 100%);
  width: 66.67%;
  height: 65%;
  top: 50%;
  left: 33.33%;
  z-index: 1;
  border-radius: 0% 0% 100% 100%;
}

              
            
!

JS

              
                
              
            
!
999px

Console