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

              
                .bowl
  .back
  .spoon
    .scoop
  .contents
    .syrup
    .riceball.uno
      .face
    .riceball.dos
      .face
    .riceball.tres
      .face
              
            
!

CSS

              
                $bg: #f7e5d7;
$white: #fff;
$black: #000;

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: $bg;
}

.riceball {
  position: absolute;
  width: 200px;
  height: 200px;
  background: $white;
  border-radius: 50%;
  background: url(https://assets.codepen.io/242759/felt.jpeg) (0 0) / (10em 10em),
    $white;
  background-blend-mode: hard-light;
  box-shadow: inset -25px -25px 25px rgba(229, 219, 211, 0.8),
    5px 5px 15px 5px rgba(216, 200, 190, 0.3);
  clip-path: inset(-40px -30px 25% -20px);

  .face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(5deg);
    width: 30px;
    height: 20px;
    background: $black;
    border-radius: 50%;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    &::before,
    &::after {
      display: block;
      content: "";
      position: absolute;
      top: -5px;
      width: 12px;
      height: 12px;
      background: $black;
      border-radius: 50%;
    }
    &::before {
      left: -40px;
    }
    &::after {
      right: -40px;
    }
  }
  &.uno {
    left: 150px;
    bottom: 65px;
    .face {
      transform: translate(-50%, -50%) rotate(-20deg);
      animation: 3s face-bob infinite;
      &::before,
      &::after {
        animation: 3s eye-bulge infinite;
      }
    }
    animation: 3s rice-up infinite;
  }
  &.dos {
    left: 20px;
    bottom: -35px;
    .face {
      transform: translate(-50%, -50%) rotate(-5deg);
    }
    animation: 1s little-bob1 linear infinite;
  }
  &.tres {
    bottom: 0;
    right: 30px;
    animation: 1.2s little-bob2 linear infinite;
  }
}

.syrup {
  position: absolute;
  bottom: -50px;
  width: 500px;
  height: 200px;
  border-radius: 50%;
  background: url(https://assets.codepen.io/242759/felt.jpeg) (0 0) / (10em 10em),
    radial-gradient(
      ellipse at bottom center,
      rgba(240, 173, 66, 1) 0%,
      rgba(254, 218, 144, 1) 31%,
      rgba(240, 173, 66, 1) 66%,
      rgba(254, 218, 144, 1) 86%,
      rgba(240, 173, 66, 1) 100%
    );
  background-blend-mode: hard-light;
}

.bowl {
  position: absolute;
  top: calc(50% + 100px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 250px;
  background: url(https://assets.codepen.io/242759/felt.jpeg) (0 0) / (15em 15em),
    radial-gradient(
      ellipse at top left,
      $white 0%,
      rgba(252, 252, 252, 1) 35%,
      rgba(241, 204, 187, 1) 60%,
      rgba(253, 241, 221, 1) 70%,
      $white 80%
    );
  background-blend-mode: hard-light;
  border-bottom-left-radius: 230px;
  border-bottom-right-radius: 230px;
  box-shadow: 15px 40px 80px -30px #C5AE9F;
}

.back {
  position: absolute;
  top: -100px;
  width: 500px;
  height: 200px;
  border-radius: 50%;
  background: url(https://assets.codepen.io/242759/felt.jpeg) (0 0) / (10em 10em),
    radial-gradient(
      ellipse at bottom right,
      $white 0%,
      rgba(252, 252, 252, 1) 35%,
      rgba(241, 204, 187, 1) 60%,
      rgba(253, 241, 221, 1) 75%,
      $white 90%
    );
  background-blend-mode: hard-light;
}

.contents {
  position: fixed;
  bottom: 150px;
  width: 500px;
  height: 400px;
  border-bottom-left-radius: 50% 100px;
  border-bottom-right-radius: 50% 100px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  overflow: hidden;
}

.spoon {
  position: absolute;
  top: -60%;
  left: -200px;
  transform: rotate(25deg);
  width: 300px;
  height: 40px;
  background: url(https://assets.codepen.io/242759/felt.jpeg) (0 0) / (5em 10em),
    linear-gradient(to bottom, $white 40%, #e2d7cb 100%);
  background-blend-mode: hard-light;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  animation: spoon-up 3s infinite;
  .scoop {
    position: absolute;
    top: 50%;
    right: -200px;
    transform: translateY(-50%);
    width: 220px;
    height: 140px;
    border-radius: 50%;
    background: url(https://assets.codepen.io/242759/felt.jpeg) (0 0) / (10em 10em),
      $white;
    background-blend-mode: hard-light;
    box-shadow: inset -10px -5px 15px rgba(206, 180, 153, 1), 10px 10px 50px -10px #C5AE9F;
    &::before {
      display: block;
      content: "";
      position: absolute;
      top: 2px;
      left: 50%;
      transform: translateX(-50%);
      width: 200px;
      height: 120px;
      background: url(https://assets.codepen.io/242759/felt.jpeg) (0 0) /
          (
            10em 10em
          ),
        linear-gradient(to bottom, #e2d7cb 20%, $white 100%);
      background-blend-mode: hard-light;
      border-radius: 50%;
    }
  }
}

@keyframes spoon-up {
  0% {
    top: -60%;
    left: -200px;
  }
  25% {
    top: -80%;
    transform: rotate(15deg);
  }
  50% {
    top: -90%;
    left: -300px;
    transform: rotate(25deg);
  }
  100% {
    top: -60%;
    left: -200px;
    transform: rotate(25deg);
  }
}

@keyframes rice-up {
  0% {
    left: 150px;
    bottom: 65px;
    clip-path: inset(-40px -30px 25% -20px);
  }
  25% {
    bottom: 160px;
    clip-path: inset(-40px -30px 0 -20px);
  }
  50% {
    left: 20px;
    bottom: 140px;
    clip-path: inset(-40px -30px 0 -20px);
  }
  55% {
    clip-path: inset(-40px -30px 0 -20px);
  }
  100% {
    left: 150px;
    bottom: 65px;
    clip-path: inset(-40px -30px 25% -20px);
  }
}

@keyframes eye-bulge {
  0% {
    width: 12px;
    height: 12px;
  }
  50% {
    width: 18px;
    height: 18px;
  }
  100% {
    width: 12px;
    height: 12px;
  }
}

@keyframes little-bob1 {
  0% {
    bottom: -35px;
    clip-path: inset(-40px -30px 25% -20px);
  }
  50% {
    bottom: -33px;
    clip-path: inset(-40px -30px 23% -20px);
  }
  100% {
    bottom: -35px;
    clip-path: inset(-40px -30px 25% -20px);
  }
}

@keyframes little-bob2 {
  0% {
    bottom: 0;
    clip-path: inset(-40px -30px 25% -20px);
  }
  50% {
    bottom: -2px;
    clip-path: inset(-40px -30px 26% -20px);
  }
  100% {
    bottom: 0;
    clip-path: inset(-40px -30px 25% -20px);
  }
}

/* this doesn't work for some reason in the new Chrome update:
@keyframes face-bob {
  0% {
    transform: translate(-50%, -50%) rotate(10deg);
  }
  50% {
    height: 10px;
    transform: translate(-50%, -50%) rotate(-10deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(10deg);
  }
}
*/
              
            
!

JS

              
                
              
            
!
999px

Console