cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <main class="clearfix full-screen bg--orange">

  <div class="pos--center">

    <section class="head-girl">
      <div class="face-girl">

        <div class="hair"></div>

        <div class="eye left">
          <div class="pupil"></div>
          <div class="glasses-frame left"></div>
        </div>
        <div class="eye right">
          <div class="pupil"></div>
          <div class="glasses-frame right"></div>
        </div>

        <div class="nose"></div>

        <div class="mouth"></div>

      </div>
    </section>

    <section class="hand left">
      <div class="hand__inner">
        <div class="finger pinkie"></div>
        <div class="finger ring"></div>
        <div class="finger middle"></div>
        <div class="finger index"></div>
        <div class="thumb"></div>
      </div>
    </section>

    <section class="hand right">
      <div class="hand__inner">
        <div class="thumb"></div>
        <div class="finger index"></div>
        <div class="finger middle"></div>
        <div class="finger ring"></div>
        <div class="finger pinkie"></div>
      </div>
    </section>

    <section class="ball"></section>

  </div>

</main>
            
          
!
            
              // VARIABLES
$hair-color: brown;
$glasses-color: black;
$skin-color: rgb(255, 230, 230);
$anim-time: 2s;

body,
html {
  margin: 0;
}

.full-screen {
  width: 100vw;
  height: 100vh;
  position: relative;
}

.pos--center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 300px;
  margin-left: -250px;
  margin-top: -150px;
  animation-name: anim-opacity;
  animation-duration: $anim-time;
  animation-fill-mode: forwards;
  background: rgba(0, 0, 0, 0.05);
}

@keyframes anim-opacity {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.bg--orange {
  animation: anim-bg-color $anim-time ease-in-out infinite alternate;
}

@keyframes anim-bg-color {
  0% {
    background-color: lighten(orange, 25%);
  }
  50% {
    background-color: lighten(blue, 30%);
  }
  100% {
    background-color: lighten(orange, 25%);
  }
}

.head-girl {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -75px;
  margin-top: -100px;
  background-color: $skin-color;
  border-radius: 40% 40% 55% 55%;
  width: 150px;
  height: 200px;
  animation: anim-float $anim-time ease-in-out infinite alternate;
}

@keyframes anim-float {
  0% {
    transform: translate3d(0, -20px, 0);
  }
  100% {
    transform: translate3d(0, -40px, 0);
  }
}

.head-girl::after {
  content: "";
  height: 20px;
  width: 100px;
  left: 50%;
  margin-left: -50px;
  position: absolute;
  bottom: -30px;
  border-radius: 100%;
  background-image: radial-gradient(rgba(0, 0, 0, 0.1) 30%, transparent, transparent);
  animation: anim-float-shadow $anim-time ease-in-out infinite alternate;
}

@keyframes anim-float-shadow {
  0% {
    width: 100px;
    opacity: 1;
    margin-left: -50px;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0.5;
    width: 150px;
    margin-left: -75px;
    transform: translate3d(0, 20px, 0);
  }
}

.hair {
  position: absolute;
  top: -30px;
  background-color: $hair-color;
  width: 105%;
  height: 100px;
  border-radius: 100% 100% 30% 0;
  margin-left: -2.5%;
  &::before,
  &::after {
    content: "";
    position: absolute;
    background-color: $hair-color;
    width: 50px;
    height: 50px;
    top: 0;
    border-radius: 0 100%;
  }
  &::before {
    left: -15%;
  }
  &::after {
    transform: rotate(90deg);
    right: -15%;
  }
}

.eye {
  position: absolute;
  top: 34%;
  left: 50%;
  margin-left: -15px;
  border-radius: 100%;
  background-color: #fff;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  &.left {
    transform: translateX(-28px);
  }
  &.right {
    transform: translateX(28px);
  }
}

.glasses-frame {
  border: 8px solid black;
  width: 39px;
  height: 32px;
  position: absolute;
  top: -5px;
  left: -14px;
  border-radius: 16px 10px 20px 30px;
  &::before,
  &::after {
    content: "";
    background-color: $glasses-color;
    width: 25px;
    height: 8px;
    left: -26px;
    position: absolute;
  }
  &::after {
    width: 20px;
    left: 100%;
  }
  &.right {
    left: -10px;
    border-radius: 10px 16px 30px 20px;
    &::before {
      left: 100%;
    }
    &::after {
      display: none;
    }
  }
}

.pupil {
  position: absolute;
  width: 20px;
  height: 20px;
  left: 50%;
  top: 50%;
  margin-left: -10px;
  margin-top: -10px;
  background-color: lighten(blue, 30%);
  border-radius: 100%;
  animation: anim-eye-follow $anim-time ease-in-out infinite alternate;
  &::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    z-index: 10;
    width: 6px;
    height: 6px;
    background-color: $glasses-color;
    border-radius: 100%;
  }
}

@keyframes anim-eye-follow {
  0% {
    transform: rotate(-45deg);
  }
  100% {
    transform: rotate(135deg);
  }
}

.nose {
  border-radius: 200% 200% 100% 100%;
  background-color: darken($skin-color, 10%);
  position: absolute;
  top: 47%;
  left: 50%;
  width: 12px;
  height: 30px;
  margin-left: -6px;
  z-index: 1;
  &::before,
  &::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    left: -3px;
    bottom: 0;
    border-radius: 100%;
    background-color: darken($skin-color, 10%);
  }
  &::after {
    left: 10px;
  }
}

.mouth {
  position: absolute;
  background-color: #fff;
  top: 68%;
  height: 30px;
  width: 60px;
  margin-left: -30px;
  border-radius: 30% 30% 100% 100%;
  left: 50%;
  animation: anim-mouth $anim-time ease-in-out infinite alternate;
  &::before,
  &::after {
    content: "";
    border-radius: 50%;
    box-shadow: -1px 3px 0 darken($skin-color, 5%);
    -webkit-transform: rotate(-20deg);
    transform: rotate(-40deg);
    position: absolute;
    width: 20px;
    height: 12px;
    top: -10px;
    left: -11px;
  }
  &::before {
    animation: anim-mouth-left $anim-time ease-in-out infinite alternate;
  }
  &::after {
    left: 53px;
    box-shadow: 1px 3px 0 darken($skin-color, 5%);
    transform: rotate(40deg);
    animation: anim-mouth-right $anim-time ease-in-out infinite alternate;
  }
}

@keyframes anim-mouth {
  0% {
    width: 60px;
    margin-left: -30px;
  }
  50% {
    width: 40px;
    margin-left: -20px;
  }
  100% {
    width: 60px;
    margin-left: -30px;
  }
}

@keyframes anim-mouth-left {
  0% {
    transform: rotate(-40deg) translate3d(0, 0, 0);
    opacity: 1;
  }
  50% {
    transform: rotate(-40deg) translate3d(-10px, 0px, 0);
    opacity: 0;
  }
  100% {
    transform: rotate(-40deg) translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes anim-mouth-right {
  0% {
    transform: rotate(40deg) translate3d(0, 0, 0);
    opacity: 1;
  }
  50% {
    transform: rotate(40deg) translate3d(-10px, 10px, 0);
    opacity: 0;
  }
  100% {
    transform: rotate(40deg) translate3d(0, 0, 0);
    opacity: 1;
  }
}

.hand {
  position: absolute;
  width: 40px;
  height: 44px;
  margin-left: -20px;
  margin-top: -22px;
  left: 50%;
  top: 50%;
  &.left {
    transform: translate3d(-175px, -20px, 0);
    animation: anim-float-hand-left $anim-time ease-in-out infinite alternate;
  }
  &.right {
    transform: translate3d(175px, -20px, 0);
    animation: anim-float-hand-right $anim-time ease-in-out infinite alternate;
    animation-delay: $anim-time;
  }
}

@keyframes anim-float-hand-left {
  0% {
    transform: translate3d(-175px, -20px, 0);
  }
  100% {
    transform: translate3d(-195px, -25px, 0);
  }
}

@keyframes anim-float-hand-right {
  0% {
    transform: translate3d(175px, -20px, 0);
  }
  100% {
    transform: translate3d(195px, -25px, 0);
  }
}

.hand__inner {
  position: absolute;
  display: flex;
  width: 40px;
  height: 44px;
  margin-left: -20px;
  margin-top: -22px;
  left: 50%;
  top: 50%;
  background: #fff;
  border-radius: 20% 20% 40% 40%;
}

.thumb,
.finger {
  position: absolute;
  background: #fff;
}

.thumb {
  width: 11px;
  left: -7px;
  border-radius: 30% 80% 50% 100%;
  top: 4px;
  height: 40px;
  transform: rotate(-25deg);
  .hand.left & {
    left: auto;
    right: -7px;
    border-radius: 80% 0 100% 50%;
    transform: rotate(25deg);
  }
}

.finger {
  position: relative;
  width: 13px;
  height: 35px;
  border-radius: 30% 30% 50% 50%;
  &.index {
    top: -20px;
  }
  &.middle {
    top: -30px;
  }
  &.ring {
    top: -23px;
  }
  &.pinkie {
    top: -10px;
  }
}

.hand.left .hand__inner {
  transform: rotate(-45deg);
}

.hand.right .hand__inner {
  transform: rotate(45deg);
}

.hand::after {
  content: "";
  height: 20px;
  width: 50px;
  left: 50%;
  margin-left: -25px;
  position: absolute;
  bottom: -115px;
  border-radius: 100%;
  background-image: radial-gradient(rgba(0, 0, 0, 0.1) 30%, transparent, transparent);
}

.hand.left::after {
  animation: anim-float-hand-left-shadow $anim-time ease-in-out infinite alternate;
}

.hand.right::after {
  animation: anim-float-hand-right-shadow $anim-time ease-in-out infinite alternate;
  animation-delay: $anim-time;
}

@keyframes anim-float-hand-left-shadow {
  0% {
    width: 50px;
    opacity: 0.75;
    margin-left: -15px;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0.5;
    width: 70px;
    margin-left: -25px;
    transform: translate3d(-10px, 0, 0);
  }
}

@keyframes anim-float-hand-right-shadow {
  0% {
    width: 50px;
    opacity: 0.75;
    margin-left: -15px;
    transform: translate3d(-10px, 0, 0);
  }
  100% {
    opacity: 0.5;
    width: 70px;
    margin-left: -25px;
    transform: translate3d(0, 0, 0);
  }
}

.ball {
  animation: anim-swing $anim-time ease-in-out infinite alternate;
  position: absolute;
  width: 380px;
  margin-left: -190px;
  height: 1px;
  left: 50%;
  top: 38%;
  &::after {
    content: "";
    position: absolute;
    border-radius: 100%;
    width: 30px;
    height: 30px;
    top: -15px;
    left: -15px;
    z-index: 10;
    background-image: linear-gradient(green 50%, blue 50%);
    animation: ball-animation $anim-time ease-in-out infinite alternate;
  }
}

@keyframes anim-swing {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(180deg);
  }
}

@keyframes ball-animation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(1440deg);
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console