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="rick-container">
    <div class="head-container">
      <div class="head">
        <div class="brow-container">
          <div class="brow"></div>
        </div>
        <div class="eyes-container">
          <div class="left eye">
            <div class="pupil"></div>
          </div>
          <div class="right eye">
            <div class="pupil"></div>
          </div>
        </div>
        <div class="eyebags-container">
          <div class="left eyebag"></div>
          <div class="right eyebag"></div>
        </div>
        <div class="nose"></div>
        <div class="mouth-container">
          <div class="mouth"></div>
          <div class="spittle"></div>
          <div class="spittle-arcs"></div>
        </div>
      </div>
      <div class="ear-container">
        <div class="left ear"></div>
        <div class="right ear"></div>
      </div>
      <div class="hair-container">
        <div class="hair"></div>
      </div>
      <div class="neck"></div>
    </div>
    <div class="body-container">
      <div class="body">
        <div class="shirt">
          <div class="flaps-container">
            <div class="left flap"></div>
            <div class="right flap"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="morty-container">
    <div class="head-container">
      <div class="head">
        <div class="brows-container">
          <div class="left brow"></div>
          <div class="right brow"></div>
        </div>
        <div class="eyes-container">
          <div class="left eye">
            <div class="pupil"></div>
          </div>
          <div class="right eye">
            <div class="pupil"></div>
          </div>
        </div>
        <div class="nose"></div>
        <div class="mouth-container">
          <div class="mouth"></div>
        </div>
      </div>
      <div class="ear-container">
        <div class="left ear"></div>
        <div class="right ear"></div>
      </div>
      <div class="hair-container">
        <div class="hair"></div>
      </div>
    </div>
    <div class="body-container">
      <div class="body"></div>
    </div>
  </div>
</div>

<div class="created">
  <span>Created by</span>
  <a href="https://manz.dev/"><h2>Manz.dev</h2></a>
  <p>on <a href="https://twitch.tv/ManzDev">Twitch</a> / <a href="https://www.youtube.com/watch?v=ZWIgWulXQFg">Youtube</a></p>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300,700&display=swap');
@use postcss-nested;

:root {
  --border-color: #4f5352;
  --rick-skin-color: #ebe6e3;
  --morty-skin-color: #f1daca;
  --rick-hair-color: #bdcccf;
  --morty-hair-color: #a68564;
  --rick-spittle-color: #8bffc5;
  --rick-shirt-color: #d2eaea;
  --morty-shirt-color: #fffac0;
  --rick-hair-shape: polygon(15% 20%, 37% 32%, 49% 0%, 62% 32%, 83% 20%, 74% 43%, 89% 49%, 77% 62%, 88% 71%, 75% 77%, 82% 85%, 73% 84%, 73% 96%, 50% 86%, 25% 96%, 26% 84%, 17% 84%, 24% 77%, 10% 71%, 22% 62%, 9% 49%, 25% 42%);
  --custom-filter:
    drop-shadow(0 4px 0 var(--border-color))
    drop-shadow(4px 0 0 var(--border-color))
    drop-shadow(0 -4px 0 var(--border-color))
    drop-shadow(-4px 0 0 var(--border-color));
  --custom-filter-small:
    drop-shadow(0 2px 0 var(--border-color))
    drop-shadow(2px 0 0 var(--border-color))
    drop-shadow(0 -2px 0 var(--border-color))
    drop-shadow(-2px 0 0 var(--border-color));
}

.container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
}

.rick-container {
  width: 300px;

  & .head-container {
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    z-index: 2;

    & .head {
      width: 38%;
      height: 60%;
      border: 4px solid var(--border-color);
      background: var(--rick-skin-color);
      border-radius: 80px;
      position: relative;
      z-index: 2;
      transform: translate(-2px, -15px);
      display: flex;
      justify-content: center;

      & .brow-container {
        width: 90%;
        height: 25%;
        transform: translate(0, 8px);
        display: flex;
        align-items: flex-end;
        position: relative;
        z-index: 1;

        & .brow {
          width: 90%;
          height: 20%;
          background: var(--rick-hair-color);
          border-radius: 25px;
          border: 4px solid var(--border-color);
          display: flex;
          flex-direction: column;
          align-items: center;

          &::before,
          &::after {
            position: absolute;
            content: "";
            display: block;
            width: 80%;
            height: 4px;
            border-radius: 50px;
            background: var(--border-color);
          }

          &::before {
            width: 30%;
            transform: translate(0, -20px);
          }

          &::after {
            width: 65%;
            transform: translate(0, -12px);
          }
        }
      }

      & .eyes-container {
        position: absolute;
        width: 100%;
        height: 50px;
        transform: translate(0, 42px);
        display: flex;
        justify-content: space-around;

        & .eye {
          width: 40px;
          height: 40px;
          border: 4px solid var(--border-color);
          border-radius: 50%;
          overflow: hidden;
          background: #fff;

          &::before {
            content: "";
            display: block;
            width: 100%;
            height: 50%;
            background: var(--rick-skin-color);
            border-bottom: 4px solid var(--border-color);
            position: relative;
            z-index: 4;
            animation: closeEyes 2s linear infinite alternate;
          }

          & .pupil {
            content: "";
            display: block;
            width: 5px;
            height: 12px;
            border-radius: 50%;
            background: var(--border-color);
            transform: translate(18px, -4px) rotate(25deg);
            position: relative;
            z-index: 1;

            &::before,
            &::after {
              content: "";
              display: block;
              width: 12px;
              height: 4px;
              position: absolute;
              border-radius: inherit;
              background: inherit;
              transform: translate(-3px, 3px) rotate(-30deg);
            }

            &::after {
              transform: translate(-3px, 3px) rotate(30deg);
            }
          }
        }
      }

      & .eyebags-container {
        position: absolute;
        width: 100%;
        height: 50px;
        transform: translate(0, 51px);
        display: flex;
        justify-content: space-around;

        & .eyebag {
          width: 40px;
          height: 40px;
          border-radius: 50%;
          border: 3px solid var(--border-color);
          clip-path: polygon(0 80%, 100% 80%, 100% 100%, 0 100%);
        }
      }

      & .nose {
        position: absolute;
        border: 3px solid var(--border-color);
        width: 11px;
        height: 20px;
        border-top: 0;
        border-radius: 0 0 25px 25px;
        transform: translate(0, 90px);
      }

      & .mouth-container {
        position: absolute;
        width: 100%;
        height: 40px;
        transform: translate(0, 120px);
        display: flex;
        justify-content: center;

        & .mouth {
          border-top: 3px solid var(--border-color);
          border-radius: 15px / 8px;
          width: 60%;
          position: relative;
          z-index: 2;

          &::before,
          &::after {
            position: absolute;
            content: "";
            display: block;
            border-bottom: 4px solid var(--border-color);
            width: 15px;
            height: 10px;
            border-radius: 50%;
          }

          &::before {
            transform: translate(-10px, -2px) rotate(85deg);
          }

          &::after {
            transform: translate(64px, -2px) rotate(-85deg);
          }
        }

        & .spittle {
          position: absolute;
          z-index: 0;
          width: 30%;
          height: 15%;
          border-radius: 0 0 25px 25px;
          background: var(--rick-spittle-color);
          transform: translate(0, 2px);
          filter: var(--custom-filter-small);

          &::after,
          &::before {
            position: absolute;
            content: "";
            display: block;
            background: inherit;
            width: 10px;
            height: 24px;
            border-radius: inherit;
          }

          &::before {
            transform: translate(2px, 0);
            width: 26px;
            height: 10px;
          }

          &::after {
            transform: translate(14px, 0);
          }
        }

        & .spittle-arcs {
          position: absolute;
          width: 40px;
          height: 40px;

          &::before,
          &::after {
            position: absolute;
            content: "";
            display: block;
            background: var(--rick-spittle-color);
            width: 4px;
            height: 4px;
            z-index: 5;
            border: 3px solid var(--border-color);
            border-radius: 40%;
          }

          &::before {
            height: 8px;
            transform: translate(-2px, 20px) rotate(-45deg);
          }

          &::after {
            transform: translate(40px, 20px);
          }
        }
      }
    }

    & .ear-container {
      position: absolute;
      z-index: 1;
      display: flex;
      justify-content: space-between;
      width: 150px;
      height: 30px;
      transform: translate(-2px, -100px);

      & .ear {
        width: 20px;
        height: 30px;
        background: var(--rick-skin-color);
        border: 4px solid var(--border-color);
        border-radius: 25px;
      }
    }

    & .hair-container {
      position: absolute;
      width: 100%;
      height: 100%;
      filter: var(--custom-filter);

      & .hair {
        width: 100%;
        height: 90%;
        background: var(--rick-hair-color);
        clip-path: var(--rick-hair-shape);
      }
    }

    & .neck {
      position: absolute;
      width: 40px;
      height: 25px;
      border: 4px solid var(--border-color);
      border-radius: 0 0 15px 15px / 0 0 8px 8px;
      background: var(--rick-skin-color);
    }
  }

  & .body-container {
    width: 100%;
    height: 150px;
    transform: translate(0, -12px);
    display: flex;
    justify-content: center;
    filter: var(--custom-filter);

    & .body {
      width: 100%;
      height: 100%;
      background: #fff;
      clip-path: polygon(20% 100%, 25% 25%, 50% 0, 75% 25%, 80% 100%);
      display: flex;
      justify-content: center;

      &::before,
      &::after {
        content: "";
        display: block;
        position: absolute;
        border-left: 4px solid var(--border-color);
        width: 5px;
        height: 80px;
      }

      &::after {
        transform: translate(-50px, 72px) rotate(4deg);
      }

      &::before {
        transform: translate(55px, 72px) rotate(-4deg);
      }

      & .shirt {
        width: 20%;
        height: 100%;
        background: var(--rick-shirt-color);
        border: 4px solid var(--border-color);
        border-radius: 30px 30px 0 0;
        border-top: 0;
        border-bottom: 0;
      }

      & .flaps-container {
        width: 200%;
        height: 100%;
        display: flex;
        justify-content: space-around;
        filter: var(--custom-filter);
        position: relative;
        z-index: 5;

        & .flap {
          background: #fff;
          width: 35px;
          height: 100%;
          transform: translate(-38px, 0);
          clip-path: polygon(0 65%, 100% 0, 100% 100%, 5% 100%, 0 90%, 85% 80%);

          &.right {
            transform: translate(-22px, 0) scale(-1, 1);
          }
        }
      }
    }
  }
}

.morty-container {
  width: 300px;
  height: 250px;
  transform: translateX(-100px);

  & .head-container {
    width: 100%;
    height: 175px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    z-index: 2;

    & .head {
      width: 45%;
      height: 75%;
      border: 4px solid var(--border-color);
      background: var(--morty-skin-color);
      border-radius: 80px;
      position: relative;
      z-index: 2;
      transform: translate(-2px, -15px);
      display: flex;
      justify-content: center;

      & .brows-container {
        position: absolute;
        width: 100%;
        height: 20px;
        display: flex;
        justify-content: space-around;

        & .brow {
          width: 40px;
          height: 35px;
          border: 4px solid var(--border-color);
          border-radius: 30%;
          border-left: 0;
          border-bottom: 0;
          border-right: 0;
          transform: translate(0, 25px);

          &.left {
            border-top-right-radius: 0;
          }

          &.right {
            border-top-left-radius: 0;
          }
        }
      }

      & .eyes-container {
        position: absolute;
        width: 92%;
        height: 50px;
        transform: translate(0, 32px);
        display: flex;
        justify-content: space-around;

        & .eye {
          width: 45px;
          height: 45px;
          border: 4px solid var(--border-color);
          border-radius: 50%;
          overflow: hidden;
          background: #fff;
          clip-path: polygon(0 16%, 100% 16%, 100% 100%, 0 100%);

          &::before {
            content: "";
            display: block;
            width: 100%;
            height: 50%;
            background: var(--morty-skin-color);
            border-bottom: 4px solid var(--border-color);
            position: relative;
            z-index: 4;
            animation: closeEyes 2s linear infinite alternate;
          }

          & .pupil {
            content: "";
            display: block;
            width: 5px;
            height: 12px;
            border-radius: 50%;
            background: var(--border-color);
            transform: translate(18px, -4px) rotate(25deg);
            position: relative;
            z-index: 1;

            &::before,
            &::after {
              content: "";
              display: block;
              width: 12px;
              height: 4px;
              position: absolute;
              border-radius: inherit;
              background: inherit;
              transform: translate(-3px, 3px) rotate(-30deg);
            }

            &::after {
              transform: translate(-3px, 3px) rotate(30deg);
            }
          }
        }
      }

      & .nose {
        position: absolute;
        border: 4px solid var(--border-color);
        width: 8px;
        height: 12px;
        border-top: 0;
        border-radius: 0 0 25px 25px;
        transform: translate(5px, 80px) rotate(-45deg);
      }

      & .mouth-container {
        position: absolute;
        border-left: 4px solid var(--border-color);
        width: 6px;
        height: 12px;
        transform: translate(-5px, 105px);

        & .mouth::before,
        & .mouth::after {
          position: absolute;
          content: "";
          display: block;
          border: 4px solid var(--border-color);
          width: 6px;
          height: 12px;
          border-top: 0;
          border-radius: 0 0 25px 25px;
          transform: translate(-4px, 4px);
        }

        & .mouth::after {
          width: 6px;
          height: 12px;
          border-left: 0;
          transform: translate(8px, -4px);
        }
      }
    }

    & .ear-container {
      position: absolute;
      z-index: 1;
      display: flex;
      justify-content: space-between;
      width: 170px;
      height: 30px;
      transform: translate(-2px, -60px);

      & .ear {
        width: 20px;
        height: 20px;
        background: var(--morty-skin-color);
        border: 6px solid var(--border-color);
        border-radius: 50px;
      }
    }

    & .hair-container {
      position: absolute;
      width: 50%;
      height: 80%;
      border: 6px solid var(--border-color);
      background: var(--morty-hair-color);
      transform: translate(-3px, -30px);
      border-radius: 42% 50% / 45% 50%;
    }
  }

  & .body-container {
    width: 300px;
    height: 100px;
    transform: translate(0, -12px);
    display: flex;
    justify-content: center;
    filter: var(--custom-filter);

    & .body {
      width: 55%;
      height: 200%;
      background: var(--morty-shirt-color);
      border-radius: 50% 50% 0 0;
      overflow: hidden;
      clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
      display: flex;
      justify-content: center;
      position: absolute;
      transform: translate(0, -25px);

      &::before,
      &::after {
        content: "";
        display: block;
        position: absolute;
        border-left: 4px solid var(--border-color);
        width: 5px;
        height: 80px;
      }

      &::after {
        transform: translate(-50px, 72px) rotate(4deg);
      }

      &::before {
        transform: translate(55px, 72px) rotate(-4deg);
      }
    }
  }
}

@keyframes closeEyes {
  0%,
  85% { height: 50%; }

  100% { height: 100%; }
}

.created {
  background: 
    url(https://assets.codepen.io/154065/internal/avatars/users/default.png),
    linear-gradient(to bottom, #884ced, #ec1cce);
  background-size: 75px 75px, cover;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 2em;
  
  & span,
  & h2,
  & p,
  & a {
    font-family: Montserrat;
    margin: 0;
  }
  
  & a,
  & p,
  & span {
    color: #fff;    
  }
  
  & h2 {
    font-weight: 700;
    transform: translate(0, -4px);    
  }
  
  & a {
    text-decoration-color: rgba(255,255,255,0.4);
  }
  
  & a:hover {
    color: #e6e82a;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console