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="grid">
  <div class="column">
    <div class="ghost character">
      <div class="float">
        <div class="face">
          <div class="eyes">
            <div class="left eye"></div>
            <div class="right eye"></div>
          </div>
          <div class="mouth-container">
            <div class="mouth"></div>
          </div>
        </div>
      </div>
        <div class="soul-glow"></div>
    </div>
  </div>
  <div class="column">
    <div class="skull character">
      <div class="face">
        <div class="eyes">
          <div class="left eye"></div>
          <div class="right eye"></div>
        </div>
        <div class="nose-container">
          <div class="nose"></div>
        </div>
      </div>
      <div class="mouth top">
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
      </div>
      <div class="mouth bottom">
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
        <div class="teeth"></div>
      </div>
      <div class="soul-glow"></div>
    </div>
  </div>
  <div class="column">
    <div class="pumpkin character">
      <div class="stem"></div>
      <div class="knife-container">
        <div class="knife"></div>
        <div class="handle"></div>
      </div>
      <div class="face-container">
        <div class="face">
          <div class="eyes">
            <div class="left gap">
              <div class="eye"></div>
            </div>
            <div class="right gap">
              <div class="eye"></div>
            </div>
          </div>
          <div class="mouth-container">
            <div class="nose"></div>
            <div class="mouth"></div>
          </div>
        </div>
      </div>
      <div class="soul-glow"></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://youtu.be/">Youtube</a></p>
</div>
              
            
!

CSS

              
                @use postcss-nested;

body {
  margin: 0;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}

.grid {
  width: 800px;
  height: 100px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.character {
  position: relative;
  filter: drop-shadow(0 0 15px var(--character-glow, red));
  animation: move-right 8s linear 1 forwards;
  transform: scale(1.5);
}

.soul-glow {
  width: var(--width);
  height: var(--height);
  background: radial-gradient(var(--color, #7909fa) 25%, transparent 50% 85%);
  border-radius: 50%;
  position: absolute;
  top: var(--offset-y, 0);
  left: 0;
  mix-blend-mode: screen;
  animation: floating 1s infinite alternate-reverse;
}

.ghost {
  --width: 125px;
  --height: 225px;

  background:
    radial-gradient(ellipse 135px 200px at 50% 15%, #fff 25%, #fff0 90%),
    radial-gradient(circle 75px at 50% 40%, #fff 35%, #fff0 90%);
  width: var(--width);
  height: var(--height);
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: floating 2s ease-in-out infinite alternate;

  & .eyes {
    display: flex;
    justify-content: space-around;
    transform: translateY(50px);
    width: 100%;
    margin: auto;

    & .eye {
      width: 25px;
      height: 25px;
      border-radius: 50%;
      background: #000;
      margin: 0 5px;
    }
  }

  & .mouth-container {
    display: flex;
    justify-content: center;
    transform: translateY(55px);

    & .mouth {
      width: 20px;
      height: 35px;
      border-radius: 25px;
      background: #000;
    }
  }

  & .soul-glow {
    --width: 125px;
    --height: 125px;
    --color: red;
    --offset-y: 25px;
  }
}

.pumpkin {
  --width: 200px;
  --height: 150px;
  --bgcolor: #ff872e;
  --character-glow: lime;

  width: var(--width);
  height: var(--height);
  background-color: var(--bgcolor);
  background-image: radial-gradient(ellipse 150px 30px at 50% 100%, #ef5507 20%, var(--bgcolor) 50% 100%);
  border-radius: 50% / 45% 45% 60% 60%;

  & .knife-container {
    width: 140px;
    height: 40px;
    position: absolute;
    display: flex;
    transform: translate(110px, -29px) rotate(304deg);

    & .knife {
      width: 80px;
      height: 30px;
      background: #cedbdf;
      border-radius: 0% 0% 0% 100% / 0% 100% 0% 100%;
      clip-path: polygon(35% 0, 100% 0, 100% 100%, 35% 100%);
    }

    & .handle {
      width: 50px;
      height: 15px;
      background: #6d1a1a;
      border-radius: 0 15px 15px 0;
    }
  }

  & .stem {
    --stem-clip: polygon(60% 0, 80% 0, 35% 35%, 100% 80%, 80% 100%, 20% 100%, 50% 80%, 0 35%);

    background: #03412c;
    width: 50px;
    height: 60px;
    position: absolute;
    top: -60px;
    left: calc(50% - 25px);
    clip-path: var(--stem-clip);

    &::after {
      content: "";
      display: block;
      background: #07845c;
      width: 100%;
      height: 100%;
      clip-path: var(--stem-clip);
      transform: translate(6px, 0);
    }
  }

  & .face-container {
    width: 75%;
    margin: auto;
    height: 100%;
    border-radius: 50%;
    border: 5px solid #ef5507;
    border-top: 0;
    border-bottom: 0;

    &::before {
      content: "";
      display: block;
      width: 1px;
      height: 95%;
      border: 2px solid #ef5507;
      background: #ef5507;
      border-radius: 50%;
      position: absolute;
      left: 48.5%;
    }
  }

  & .face {
    display: flex;
    flex-direction: column;
    transform: translateY(25px);
  }

  & .eyes {
    display: flex;
    justify-content: space-around;
    width: 70%;
    margin: auto;

    & .gap {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: #640002;
      position: relative;

      &.left {
        border-left: 5px solid #dc4202;

        & .eye {
          bottom: 2px;
          left: 2px;
        }
      }

      &.right {
        border-right: 5px solid #dc4202;

        & .eye {
          bottom: 2px;
          right: 8px;
        }
      }

      &.left .eye::after {
        bottom: 2px;
        right: 4px;
      }

      &.right .eye::after {
        top: 2px;
        right: 4px;
      }

      & .eye {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #18ad3b;
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;

        &::before {
          content: "";
          display: block;
          width: 10px;
          height: 12px;
          background: #31ff3d;
          top: 4px;
          left: 4px;
          position: absolute;
          border-radius: 50%;
          transform: rotate(45deg);
        }

        &::after {
          content: "";
          display: block;
          width: 6px;
          height: 6px;
          background: #640002;
          border-radius: 50%;
          border: 2px solid #31ff3d;
          position: absolute;
          z-index: 2;
        }
      }
    }
  }

  & .mouth-container {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;

    & .nose {
      width: 25px;
      height: 25px;
      background: #640002;
      clip-path: polygon(50% 0, 0 100%, 100% 100%);
    }

    & .mouth {
      width: 105px;
      height: 85px;
      background: #640002;
      border-radius: 0 0 50% 50% / 0 0 100% 100%;
      position: relative;
      overflow: hidden;

      &::after {
        content: "";
        height: 100%;
        width: 120%;
        background: var(--bgcolor);
        position: absolute;
        top: -55%;
        left: -10%;
        border-radius: 0 0 50% 50% / 0 0 100% 100%;
      }

      &::before {
        content: "";
        height: 10px;
        width: 12px;
        background: var(--bgcolor);
        position: absolute;
        top: 35%;
        left: 27%;
        box-shadow:
          40px 0 0 var(--bgcolor),
          20px 24px var(--bgcolor);
      }
    }
  }

  & .soul-glow {
    --color: transparent;
  }
}

.skull {
  --width: 125px;
  --height: 125px;
  --character-glow: #7909FA;

  width: var(--width);
  height: var(--height);
  border-radius: 50%;
  background: #fff;
  position: relative;
  top: -40px;

  & .face {
    display: flex;
    flex-direction: column;
    transform: translateY(45px);
  }

  & .eyes {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin: auto;

    & .eye {
      width: 25px;
      height: 25px;
      border-radius: 50%;
      background: #000;

      &.left {
        width: 40px;
        height: 40px;
      }

      &.right {
        transform: translate(-10px, 10px);
      }
    }
  }

  & .nose-container {
    width: 100%;
    display: flex;
    justify-content: center;

    & .nose {
      width: 15px;
      height: 15px;
      background: #000;
      border-radius: 50% 50% 10% 10% / 90% 90% 10% 10%;
    }
  }

  & .mouth {
    background: #fff;
    width: 50%;
    margin: auto;

    & .teeth {
      width: 8px;
      height: 10px;
      background: #fff;
    }
  }

  & .mouth.top {
    height: 20px;
    transform: translateY(50px);
    border-radius: 0 0 35% 35%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    & .teeth {
      border-radius: 0 0 4px 4px;
      transform: translateY(var(--y, 10px));
    }

    & .teeth:nth-child(1),
    & .teeth:nth-child(6) {
      --y: 4px;
    }

    & .teeth:nth-child(2),
    & .teeth:nth-child(5) {
      --y: 6px;
    }
  }

  & .mouth.bottom {
    width: 42%;
    height: 10px;
    border-radius: 0 0 25px 25px;
    animation: move-mouth 0.15s ease infinite alternate;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    transform: translateY(72px);

    & .teeth {
      border-radius: 4px 4px 0 0;
      transform: translateY(var(--y, -5px));
    }
  }

  & .soul-glow {
    --width: 125px;
    --height: 125px;
    --offset-y: 30px;
  }
}

@keyframes floating {
  0% {
    transform: translateY(-20%) scale(1.5);
  }

  100% {
    transform: translateY(-30%) scale(1.5);
  }
}

@keyframes move-mouth {
  0% {
    transform: translateY(52px);
  }

  100% {
    transform: translateY(70px);
  }
}

.pumpkin .gap.left .eye {
  animation: move-eye 0.5s ease infinite;
}

.pumpkin .gap.right .eye {
  animation: move-eye 0.5s ease infinite reverse;
}

@keyframes move-eye {
  0%,
  100% { transform: translate(0, 0) rotate(45deg); }
  25% { transform: translate(5px, 0) rotate(-45deg); }
  50% { transform: translate(5px, -5px) rotate(45deg); }
  75% { transform: translate(0, -5px) rotate(-45deg); }
}

.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

              
                /* Look mom, without JS */
              
            
!
999px

Console