Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!-- Cookie Font --> 
<link href='http://fonts.googleapis.com/css?family=Cookie' rel='stylesheet' type='text/css'>

<div class="circle" id="bg">
  <div class="text"> Happy Birthday AMP! </div> 
  
<!-- <button type="button" onclick='getElementById("bg").style.backgroundColor = "#f69e54"'>Click to Change Colors </button>
-->
  
  <!-- Words on Birthday Hat, Roman Numerals for 23-->
    <div class="X1a"></div>
   <div class="X1b"></div>
    <div class="X2a"></div>
  <div class="X2b"></div>
    <div class="I1"></div>
    <div class="I2"></div>
  <!-- <div class="I3"></div> -->
 
  <!-- Decor on the point of the Birthday Hat -->
  <div class="dot"></div> 
  
 <div class="face">
   <div class="nose"></div>
  <div class="forehead-shine"></div>
  <div class="l-eye">
    <div class="l-lid"></div>
  </div>
  <div class="r-eye">
    <div class="r-lid"></div>
  </div>
   <div class="l-brow"></div>
   <div class="r-brow"></div> 
  <div class="nose"></div>
  <div class="mouth"></div> 
   <div class="l-cheek"></div> 
   <div class="r-cheek"></div> 
 </div> 

 <!-- Outside the Face -->
  <div class="hat">
    <!-- styling for top and margin-top doesn't work, why? 
    <div class="X1"></div>
    <div class="X2"></div>
    <div class="I1"></div>
    <div class="I2"></div> -->  
  </div>
<div class="neck">
  <div class="neck-shadow"></div>
</div>
  
<div class="hair"></div> 
  
  <div class="body">
    <div class="l-cover"></div>
  </div>
   
  <div class="r-body">
     <div class="r-cover"></div>
  </div>
  
  <div class="l-hand"></div>
  <div class="r-hand"></div>
   
</div> 


            
          
!
            
              body {
  background-color: #62babd; 
}

/* Find out how to move button that has position: relative */ 
button {
  width: 150px; 
  height: 60px; 
  position: absolute; 
  right: -60%; 
  top: 20%; 
  color: white; 
  font-family: Courier; 
  background-color: #ea8c82; 
  border: 4px solid #fb556e;  
}
.circle {
  position: relative; 
  margin: auto; 
  width: 400px; 
  height: 400px; 
  border-radius: 50%; 
  background: linear-gradient(#f5be3b, #efc622); /* note - you can add three colors */
  border: 10px solid white;
 /* border-box: border; 
  box-shadow: inset 5px 5px 0px 25px #d6bf80; */  
  margin-top: 3%; 
  
}
/* Search for ways to curve the text with JS only, CSS only, ... */ 
.text {
  position: absolute; 
  top: 20%; 
  right: -90%; 
  font: 300 50px/0.8 'Cookie', Helvetica, sans-serif; /* REVIEW */ 
  color: white;
  text-shadow: 4px 4px 3px rgba(0,0,0,0.1); /* REVEIW */ 

}

.face {
  position: absolute; 
  width: 120px;
  height: 150px; 
  background-color: #dec3ae; 
  border-radius: 60px; 
  left: 35%; 
  top: 25%; 
  z-index: 4; 
  
}

.nose {
  position: absolute; 
  background-color: #c5a78d;
  border-bottom-left-radius: 40px; 
  border-bottom-right-radius: 40px; 
  width: 15px; 
  height: 5px; 
  top: 62%; 
  left: 45%; 
  
}

.forehead-shine {
  position: absolute; 
  background-color: #f1f2ed; 
  width: 8%; 
  height: 10%;
  border-radius: 30px; 
  transform: rotate(110deg);
  -webkit-transform:rotate(110deg); 
  -ms-transform: rotate(110deg); 
  -os-transform: rotate(110deg);
  right: 24%; 
  top: 12%; 
  
}

.l-eye {
  position: absolute; 
  background-color: #231d37; 
  width: 10%; 
  height: 6%; 
  border-radius: 50%;  
  transform: rotate(10deg);
   -webkit-transform:rotate(10deg); 
  -ms-transform: rotate(10deg); 
  -os-transform: rotate(10deg);
  top: 45%;
  left: 25%; 
}

.r-eye {
  position: absolute; 
  background-color: #231d37; 
  width: 10%; 
  height: 6%; 
 border-radius: 50%; 
  transform: rotate(-10deg);
   -webkit-transform:rotate(-10deg); 
  -ms-transform: rotate(-10deg); 
  -os-transform: rotate(-10deg);
  top: 45%;
  right: 25%; 
}

.l-lid {
  position: absolute; 
  background-color: #211a39; 
  width: 30%; 
  height: 250%; 
  transform: rotate(85deg);
   -webkit-transform:rotate(85deg); 
  -ms-transform: rotate(85deg); 
  -os-transform: rotate(85deg);
  top: -130%; 
  left: -20%; 
}

.r-lid {
  position: absolute; 
  background-color: #211a39; 
  width: 30%; 
  height: 250%; 
  transform: rotate(95deg);
   -webkit-transform:rotate(95deg); 
  -ms-transform: rotate(95deg); 
  -os-transform: rotate(95deg);
  top: -130%; 
  left: 80%; 
}

.mouth {
  position: absolute; 
  width: 30%; 
  height: 10%; 
  border-bottom-right-radius: 20px; 
  border-bottom-left-radius: 20px; 
  border: 2px solid #e299a4; 
  background-color: white; 
  top: 70%;
  left: 35%; 
}

.l-brow {
  position: absolute; 
  background-color: #dec3ae; 
  border-radius: 50%; 
  width: 25%; 
  height:5%; /* adjust hight to control curve */ 
  box-shadow:0.5px 2px 0px 0px #211a39; /*first controls vertical mvt, second controls horizontal mvt, others are blur and radius */
  top: 32%; 
  left: 10%; 
  transform: rotate(185deg); /* flipped the shape to get an eyebrow */ 
   -webkit-transform:rotate(185deg); 
  -ms-transform: rotate(185deg); 
  -os-transform: rotate(185deg);
}

.r-brow {
  position: absolute; 
  background-color: #dec3ae; 
  border-radius: 50%; 
  width: 25%; 
  height:5%; /* adjust hight to control curve */ 
  box-shadow:0.5px 2px 0px 0px #211a39; /*first controls vertical mvt, second controls horizontal mvt, others are blur and radius */
  top: 32%; 
  right: 10%; 
  transform: rotate(175deg); /* flipped the shape to get an eyebrow */ 
    -webkit-transform:rotate(175deg); 
  -ms-transform: rotate(175deg); 
  -os-transform: rotate(175deg);
  
}

.hair {
  position: absolute; 
  background-color: black; 
  border-top-right-radius: 60px;
  border-top-left-radius: 60px;
  border-bottom-right-radius: 40px;
  border-bottom-left-radius: 40px; 
  width: 150px; 
  height: 190px; 
  left: 31%;
  top: 21%; 
  z-index: 1; 
}

.neck {
  position: absolute; 
  background-color: #d0b5a1;
  border-radius: 40px; 
  width: 6%; 
  height: 10%; 
  top: 60%; 
  left: 47.3%;
  z-index: 3; 
}

.neck-shadow {
  position: absolute; 
  background-color: #b6967d;
  border-radius: 50px; 
  width: 100%; 
  height: 50%; 
  top: -1%; 
  z-index: 8; 
}

.body {
  position: absolute; 
  background-color: #1fa186;
  border-top-right-radius: 50px; 
  border-top-left-radius: 50px; 
  top: 65%;
  left: 35%; 
  width: 120px; 
  height: 130px; 
  z-index: 1; 
}

/* Find a way to color only half a div */ 
.r-body {
  position: absolute; 
  background-color: #1c947b;
  border-top-right-radius: 50px; 
  border-top-left-radius: 20px; 
  top: 65%;
  right: 35%; 
  width: 60px; 
  height: 128px; 
  z-index: 2; 
}

.l-cover {
  position: absolute; 
  background-color:#1fa186 ;
  border-bottom-left-radius: 20px; 
  border-bottom-right-radius: 10px; 
  transform: rotate(8deg); 
   -webkit-transform:rotate(8deg); 
  -ms-transform: rotate(8deg); 
  -os-transform: rotate(8deg);
  width: 60px; 
  height: 15px; 
  top: 97%;
  left: -1.26%; 
  z-index: 1; 
  
}


.r-cover {
  position: absolute; 
  background-color: #1c947b;
  border-bottom-left-radius: 20px; 
  border-bottom-right-radius: 10px; 
  transform: rotate(-8deg); 
    -webkit-transform:rotate(-8deg); 
  -ms-transform: rotate(-8deg); 
  -os-transform: rotate(-8deg);
  width: 60px; 
  height: 15px; 
  top: 97%;
  left: -1.26%; 
  z-index: 1;
  
}

.l-hand {
  position: absolute; 
  background: #dec3ae; 
  border-radius: 50%; 
  width: 30px; 
  height: 30px; 
  top: 95%; 
  left:44%; 
  z-index: 3; 
}

.r-hand {
  position: absolute; 
  background: #d5b296; 
  border-radius: 50%; 
  width: 30px; 
  height: 30px; 
  top: 95%; 
  right:44%; 
  z-index: 2; 
}

.l-cheek {
  position: absolute;
  width:25px;
  height: 25px; 
  background-color: #ea8c82;
  opacity: 0.8;
  border-radius: 50%;
  top: 52%;
  left: 7%;
}


.r-cheek {
  position: absolute;
  width:25px;
  height: 25px; 
  background-color: #ea8c82;
  opacity: 0.8;
  border-radius: 50%;
  top: 52%;
  right: 7%;
}

/* Birthday hat and its decorations */ 
.hat {
  position: absolute; 
  background: none; 
  width: 0; 
  height: 0; 
  border-left: 40px solid transparent; /* For transparent to work, background: none must be set1 */ 
  border-right: 40px solid transparent; 
  border-bottom: 80px solid #ee7987; 
  top: 5%;
  left: 40%; 
}

.X1a {
  position: absolute; 
  background: white; 
  opacity: 1; 
  width: 3px; 
  height: 20px;
  /* top and margin-top doesn't work, when div elements are children of hat div, why */ 
  transform: rotate(30deg);
  -webkit-transform: rotate(30deg); 
  -ms-transform: rotate(30deg);
  -os-transform: rotate(30deg); 
  top: 16%; 
  left: 45%; 
  z-index: 2; 
   
  
}

.X1b {
  position: absolute; 
  background: white; 
   opacity: 0.8; 
  width: 3px; 
  height: 16px;
  /* top and margin-top doesn't work, when div elements are children of hat div, why */ 
  transform: rotate(-30deg);
  -webkit-transform: rotate(-30deg); 
  -ms-transform: rotate(-30deg);
  -os-transform: rotate(-30deg); 
  top: 16.5%; 
  left: 45%; 
  z-index: 2; 
   
  
}

.X2a {
  position: absolute; 
  background: white;
   opacity: 0.7; 
  width: 3px; 
  height: 20px;
  /* top and margin-top doesn't work, when div elements are children of hat div, why */ 
  transform: rotate(30deg);
  -webkit-transform: rotate(30deg); 
  -ms-transform: rotate(30deg);
  -os-transform: rotate(30deg); 
  top: 16%; 
  left: 48%; 
  z-index: 2; 
   
  
}

.X2b {
  position: absolute; 
  background: white; 
   opacity: 0.6; 
  width: 3px; 
  height: 16px;
  /* top and margin-top doesn't work, when div elements are children of hat div, why */ 
  transform: rotate(-30deg);
  -webkit-transform: rotate(-30deg); 
  -ms-transform: rotate(-30deg);
  -os-transform: rotate(-30deg); 
  top: 16.5%; 
  left: 48%; 
  z-index: 2; 
   
  
}

.I1 {
  position: absolute; 
  background: white; 
   opacity: 0.6; 
  width: 3px; 
  height: 16px;
  /* top and margin-top doesn't work, when div elements are children of hat div, why */ 
  top: 16.5%; 
  left: 51%; 
  z-index: 2; 
   
  
}

.I2 {
  position: absolute; 
  background: white; 
   opacity: 0.5; 
  width: 3px; 
  height: 15px;
  /* top and margin-top doesn't work, when div elements are children of hat div, why */ 
  top: 16.75%; 
  left: 53%; 
  z-index: 2; 
   
  
}

.I3 {
  position: absolute; 
  background: white; 
  opacity: 0.4; 
  width: 3px; 
  height: 14px;
  /* top and margin-top doesn't work, when div elements are children of hat div, why */ 
  top: 17%; 
  left: 55%; 
  z-index: 2; 
   
  
}

.dot {
  position: absolute; 
  background: white; 
  width: 20px; 
  height: 20px;
  border-radius: 50%; 
  box-shadow: 0px 0px 20px 5px white;  /* REVIEW *  fourth gives corner blur, last gives glow?*/ 
  left: 47.65%;
  top: 2%; 
  z-index: 3; 
  
}


            
          
!
            
              //getElementById("bg").style.backgroundColor = "#f69e54"; 

// how to cycle through different colors while clicking one button ? 
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console