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="candle">
   <div id="flame" class="lit"></div>
</div>

<div class="cake">
  <div class="plate"></div>
</div>


              
            
!

CSS

              
                body {
  background: #222222;
}

.cake {
  position: relative;
  top: 100px;
  margin: auto;
  width: 200px;
  height: 60px;
  background: #f2bbc5;
  border-radius: 100%;
  

  box-shadow: 
    0px 4px 0px #f2bbc5, 
    0px 8px 0px #f2bbc5, 
    
    0px 12px 0px #7b5d4b, 
    0px 16px 0px #7b5d4b, 
    0px 20px 0px #7b5d4b, 
    0px 24px 0px #7b5d4b, 
    0px 28px 0px #7b5d4b,
    0px 32px 0px #7b5d4b,
    
    0px 36px 0px #fff1c7,
    0px 40px 0px #fff1c7, 
    0px 44px 0px #fff1c7, 
    0px 48px 0px #fff1c7, 
    
    0px 52px 0px #f2bbc5, 
    0px 56px 0px #f2bbc5, 
    
    0px 60px 0px #7b5d4b, 
    0px 64px 0px #7b5d4b, 
    0px 68px 0px #7b5d4b, 
    0px 72px 0px #7b5d4b, 
    0px 76px 0px #7b5d4b, 
    0px 80px 0px #7b5d4b;
}

.plate {
  position: absolute;
  height: 90px;
  width: 300px;
  bottom:-95px;
  left: 50%;
  margin-left: -150px;
  border-radius: 100%;
  background: #fff;
  box-shadow: 0px 6px 0px #898989;
  z-index: -1;
}

.candle {
  position: relative;
  height: 50px;
  width: 12px;
  top: 130px;
  margin: auto;
  background-color: #fff;
  border-radius: 4px;
  z-index:10;
}

#flame {
   position: absolute;
   z-index: 10; 
}


.out {
  background-color: #795548;
  width: 2px;
  height: 10px;
  top: -8px;
  left: 50%;
  margin-left: -1px;
}

.lit {
  background-color: #ffc950;
  width: 15px;
  height: 35px;
  filter: blur(1px);
  
/*  Info on border radius. http://www.css3.info/preview/rounded-border/ */
    
  border-top-left-radius: 10px 35px;    
  border-top-right-radius:  10px 35px;
  border-bottom-right-radius: 10px 10px;
  border-bottom-left-radius: 10px 10px;
  top: -34px;
  margin: auto;
  
/*   http://www.css3.info/preview/box-shadow/ */
  box-shadow: 
    0 0 17px 7px rgba(244, 231, 112, 0.71); 
  transform-origin: bottom;
  animation: flicker 1s ease-in-out alternate infinite;
}

@keyframes flicker {
  0% {
    transform: skewX(5deg);
    box-shadow: 
    0 0 17px 10px rgba(244, 231, 112, 0.71);
  }
  
  25% {
    transform: skewX(-5deg);
    box-shadow: 
    0 0 17px 5px rgba(244, 231, 112, 0.71);
  }
  
  50% {
    transform: skewX(10deg);
    box-shadow: 
    0 0 17px 7px rgba(244, 231, 112, 0.71);
  }
  
  75% {
    transform: skewX(-10deg);
    box-shadow: 
    0 0 17px 5px rgba(244, 231, 112, 0.71);
  }
  
  100% {
    transform: skewX(5deg);
    box-shadow: 
    0 0 17px 10px rgba(244, 231, 112, 0.71);
  }
}

              
            
!

JS

              
                document.getElementById('flame').addEventListener('click', flameToggle);

function flameToggle() {
    this.classList.toggle('lit');
    this.classList.toggle('out');
}


              
            
!
999px

Console