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

              
                <!-- 
autor: Marco Barría 
https://twitter.com/marco_bf
-->

<div class="cake">
  <div class="velas">
    <div class="fuego"></div>
    <div class="fuego"></div>
    <div class="fuego"></div>
    <div class="fuego"></div>
    <div class="fuego"></div>
  </div>
  <div class="cobertura"></div>
  <div class="bizcocho"></div>
  <h1>happy birthday!</h1>
  <p>Poly</p>
</div>
              
            
!

CSS

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

//////////////////////////////////////////// var

@D:100px; // Control diameter

///////////////////////////////////////////

html,
body{
  height:100%;
}

body{
  background: rgb(162,123,204);
  background: -moz-radial-gradient(center, ellipse cover,  rgba(162,123,204,1) 0%, rgba(108,82,153,1) 100%);
  background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(162,123,204,1)), color-stop(100%,rgba(108,82,153,1)));
  background: -webkit-radial-gradient(center, ellipse cover,  rgba(162,123,204,1) 0%,rgba(108,82,153,1) 100%);
  background: -o-radial-gradient(center, ellipse cover,  rgba(162,123,204,1) 0%,rgba(108,82,153,1) 100%);
  background: -ms-radial-gradient(center, ellipse cover,  rgba(162,123,204,1) 0%,rgba(108,82,153,1) 100%);
  background: radial-gradient(ellipse at center,  rgba(162,123,204,1) 0%,rgba(108,82,153,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a27bcc', endColorstr='#6c5299',GradientType=1 );
}

/* ============================================== POSITION
*/

.cake{
  position:absolute;
  top:50%; left:50%;
  margin-left:-(@D/2); margin-top:-(@D/2);
  width:@D; height:@D;
}

/* ============================================== BASE
*/

.cake:after{
  background:rgba(235,227,225,1);
  border-radius:@D;
  content:"";
  position:absolute;
  bottom:0; left:0;
  width:@D; height:@D/50;
}

.cake:before{

}

/* ============================================== Candle
*/

.velas{
  background:rgba(255,255,255,1);
  border-radius:100%;
  position:absolute;
  top:50%; left:50%;
  margin-left:-(@D/2)/20;
  margin-top:-(@D/2)/6;
  width:@D/20; height:@D/6;
}

.velas:after,
.velas:before{
  background:rgba(255,0,0,0.4);
  content:"";
  position:absolute;
  width:100%; height:@D/45;
}

.velas:after{
  top:25%; left:0;
}

.velas:before{
  top:45%; left:0;
}

/* ============================================== Fire
*/

.fuego{
  border-radius:100%;
  box-shadow:0 0 40px 10px rgba(248,233,209,0.2);
  position:absolute;
  top:-12px; left:50%;
  margin-left:-(@D/2)/15;
  //margin-top:-(@D/2)/10;
  width:@D/15; height:@D/8;
}

.fuego:nth-child(1){
  animation:fuego 2s infinite;
}

.fuego:nth-child(2){
  animation:fuego 1.5s infinite;
}

.fuego:nth-child(3){
  animation:fuego 1s infinite;
}

.fuego:nth-child(4){
  animation:fuego 0.5s infinite;
}

.fuego:nth-child(5){
  animation:fuego 0.2s infinite;
}

/* ============================================== Animation Fire
*/

@keyframes fuego{
  0%{
    background:rgba(254,248,97,0.5);
    transform:translateY(0) scale(1);
  }
  50%{
    background:rgba(255,50,0,0.1);
    transform:translateY(-(@D/5)) scale(0);
  }
  100%{
    background:rgba(254,248,97,0.5);
    transform:translateY(0) scale(1);
  }
}

/* ============================================== Frosting
*/

.cobertura{
  background:rgba(236,231,227,1);
  border-radius:@D/2;
  position:absolute;
  top:60%; left:50%;
  margin-left:-(@D/2)/1.8;
  margin-top:-(@D/2)/10;
  width:@D/1.8; height:@D/8;
  z-index:10;
}

.cobertura:after,
.cobertura:before{
  background:rgba(236,231,227,1);
  border-radius:@D;
  content:"";
  position:absolute;
  width:@D/20; height:@D/10;
}

.cobertura:after{
  top:@D/15; right:@D/7;
}

.cobertura:before{
  top:@D/10; right:@D/11;
}

/* ============================================== BIZCOCHO
*/

.bizcocho{
  background:rgba(109,56,38,1);
  position:absolute;
  bottom:0; left:50%;
  margin-left:-(@D/2)/2;
  width:@D/2; height:@D/3;
}

.bizcocho:after,
.bizcocho:before{
  background:rgba(236,231,227,0.6);
  content:"";
  position:absolute;
  width:100%; height:@D/20;
}

.bizcocho:after{
  top:30%; left:0;
}

.bizcocho:before{
  top:60%; left:0;
}

/* ============================================== TEXT
*/

h1,
p{
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-style:italic;
  text-align:center;
  width:100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

h1{
  color:rgba(108,82,153,1);
  font-size:1em;
  margin-top:6.8em;
}

p{
  color:rgba(236,231,227,0.6);
  font-size:0.8em;
  line-height:2em;
}
              
            
!

JS

              
                
              
            
!
999px

Console