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

              
                main
  .pan(ontouchstart)
    .handle
    .outer
    .inner
    .egg-wrapper
      .egg
        .yolk
        
p click & hold on the pan!
  
  
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Montserrat);

$color-bg: #f0ead6;
$color-pan: #080808;
$color-handle: #CDCDCD;
$color-egg: #ffffff;
$color-yolk: #f9d010;

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

body {
  overflow: hidden;
  background-color: $color-bg;
  font-family: 'Montserrat', sans-serif;
  box-shadow: inset rgba(black, 0.2) 0 0 100px 24px;
}

p {
  position: absolute;
  top: 12px;
  left: 0;
  margin: 0;
  color: $color-bg;
  background-color: darken($color-bg, 50%);
  padding: 6px 20px;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 18px;
}

main {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 800px;
  height: 100%;
  margin: auto;
}

.pan {
  position: relative;
  width: 40%;
  border-radius: 100%;
  animation: shakin 6s linear infinite;
  &:after {
    content: '';
    display: block;
    padding-bottom: 100%;
  }
  .outer {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    margin: auto;
    background-color: $color-pan;
    border-radius: 100%;
    z-index: 2;
    box-shadow: inset $color-pan 2px 4px 2px 2px,
      inset rgba(white, 0.2) 2px 8px 12px 4px,
      rgba($color-bg, 0.8) 4px 4px 12px 4px,
      rgba(black, 0.4) 2px 4px 12px 2px;
  }
  .inner {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    margin: auto;
    width: 70%;
    height: 70%;
    background-color: lighten($color-pan, 10%);
    border-radius: 100%;
    z-index: 3;
    box-shadow: inset lighten($color-pan, 10%) 0 2px 4px 6px,
      inset rgba(white, 0.1) 4px 6px 34px 4px,
      $color-pan 0 0 0 10px,
      rgba(white, 0.14) -4px -2px 4px 8px,
      rgba(white, 0.14) 4px 2px 4px 8px;
  }
}

.pan .handle {
  position: absolute;
  top: -35%;
  right: -20%;
  width: 16%;
  height: 50%;
  background-color: $color-pan;
  transform: rotate(45deg);
  z-index: 1;
  border-radius: 30%;
  box-shadow: inset $color-pan 2px 2px 4px 2px,
    inset rgba(white, 0.2) 3px -8px 8px 10px,
    rgba($color-bg, 0.8) 4px 32px 12px 4px,
    rgba(black, 0.15) 6px 38px 12px 4px;
  &:before {
    content: '';
    position: absolute;
    bottom: -30%; right: 0;
    width: 100%;
    height: 50%;
    background-color: $color-handle;
    box-shadow: inset $color-handle 2px 2px 2px 8px,
    inset rgba(white, 0.2) 4px -4px 6px 12px;
  }
}

.egg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  margin: auto;
  background-color: $color-egg;
  width: 40%;
  height: 0;
  padding-bottom: 38%;
  z-index: 4;
  border-radius: 50%;
  box-shadow: inset $color-egg 4px 2px 6px 10px,
      inset rgba(black, 0.2) 0 0 20px 8px;
  animation: sizzlin 1.6s linear alternate infinite;
  &:before, &:after {
    content: '';
    background-color: $color-egg;
    position: absolute;
    height: 0;
    border-radius: 50%;
  }
  &:before {
    top: -2px;
    left: 4px;
    width: 60%;
    padding-bottom: 60%;
    box-shadow: inset $color-egg -2px -12px 4px 6px,
      inset rgba(black, 0.1) 2px 0px 12px 4px;
  }
  &:after {
    bottom: 2px;
    right: 2px;
    width: 70%;
    padding-bottom: 70%;
    box-shadow: inset $color-egg 12px 12px 4px 6px,
      inset rgba(black, 0.1) -6px 0px 12px 4px;
  }
  .yolk {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    margin: auto;
    background-color: $color-yolk;
    width: 50%;
    height: 0;
    padding-bottom: 50%;
    z-index: 5;
    border-radius: 100%;
    box-shadow: inset $color-yolk 0 0 0 4px,
      inset rgba(white, 0.3) 2px 2px 4px 6px,
      inset $color-yolk 2px 2px 4px 16px,
      inset rgba(white, 0.3) -2px -2px 12px 12px,
      rgba(black, 0.05) 0 0 2px 2px;
  }
}

.egg-wrapper {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  margin: auto;
  z-index: 5;
  animation: movin 6s linear infinite;
}

.pan {
  cursor: pointer;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  &:active {
    animation: push 0.6s ease-out;
    .egg-wrapper {
      animation: pop 0.5s 0.14s ease-out;
    }
  }
}

@keyframes sizzlin {
  0% {
    transform: rotate(0)
      scale(0.98);
  }
  10% {
    transform: rotate(0)
      scale(1.01);
  }
  20% {
    transform: rotate(2deg)
      scale(0.997);
  }
  25% {
    transform: rotate(2deg)
      scale(0.998);
  }
  30% {
    transform: rotate(2deg)
      scale(1.01);
  }
  40% {
    transform: rotate(-2deg)
      scale(0.995);
  }
  50% {
    transform: rotate(-2deg)
      scale(1);
  }
  60% {
    transform: rotate(-3deg)
      scale(0.996);
  }
  80% {
    transform: rotate(1deg)
      scale(1);
  }
  90% {
    transform: rotate(1deg)
      scale(0.997);
  }
  100% {
    transform: rotate(0deg)
      scale(1);
  }
}

@keyframes movin {
  0% {
    transform: translate(0,0);
  }
  4% {
    transform: translate(8px,-8px);
  }
  6% {
    transform: translate(0,0);
  }
  7% {
    transform: translate(-4px,4px);
  }
  12% {
    transform: translate(0,0);
  }
  100% {
    transform: translate(0,0);
  }
}

@keyframes shakin {
  0% {
    transform: translate(0,0);
  }
  2% {
    transform: translate(-12px,12px);
  }
  4% {
    transform: translate(0,0);
  }
  6% {
    transform: translate(-6px,6px);
  }
  8% {
    transform: translate(0,0);
  }
  100% {
    transform: translate(0,0);
  }
}

@keyframes push {
  0% {
    transform: scale(1)
      translateZ(0);
  }
  25% {
    transform: scale(0.9)
      translateZ(0);
  }
  50% {
    transform: scale(1.04)
      translateZ(0);
  }
  100% {
    transform: scale(1)
      translateZ(0);
  }
}

@keyframes pop {
  0% {
    transform: rotate(0)
      scale(1)
      translateZ(0);
  }
  50% {
    transform: rotate(20deg)
      scale(1.4)
      translateZ(0);
  }
  80% {
    transform: rotate(0)
      scale(0.8)
      translateZ(0);
  }
  100% {
    transform: rotate(0)
      scale(1)
      translateZ(0);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console