Pen Settings

HTML

CSS

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

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

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.

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="container">
  <div class="row" id="row1">
    <div class="col-12" id="column1">
      <div id="box1">
        box1
      </div>
      <div id="box2">
        box2
      </div>
      <div id="box3">
        box3
      </div>
      <div id="box4">
        box4
      </div>
      <div id="box5">
        box5
      </div>
      <div id="box6">
        box6
      </div>
    </div>
  </div>
  <div class="row" id="row2">
    <div class="col-12">
      <button  class="button" type="button" id="button1">clicky</button>

    </div>

  </div>
</div>
              
            
!

CSS

              
                   @boxshadowvalues: .05px .25px 4.75px .6px black;
   //LESS VARIABLES
   @box1_color: #00BCD4;
   @box2_color: #00838F;
   @box3_color: #0097A7;
   @box4_color: #00ACC1;
   @box5_color: #4DD0E1;
   @box6_color: #4DD0E1;
   //dont need a start because they all start towards the left
   @box1_animation1_finish-right: 72%;
   @box2_animation1_finish-right: 42%;
   @box3_animation1_finish-right: 25%;
   @box4_animation1_finish-right: 62%;
   @box5_animation1_finish-right: 56%;
   @box6_animation1_finish-right: 10%;
   /*******************************************************/
   /*these are animation classes! you can add them to any box!



*************************************************************/
   
   .fade-in1 {
     animation-name: fade-in1;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .fade-in2 {
     animation-name: fade-in2;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .fade-in3 {
     animation-name: fade-in3;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .fade-in4 {
     animation-name: fade-in4;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .fade-in5 {
     animation-name: fade-in5;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .fade-in6 {
     animation-name: fade-in6;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .materialize1 {
     animation-name: materialize1;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .materialize2 {
     animation-name: materialize2;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .materialize3 {
     animation-name: materialize3;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .materialize4 {
     animation-name: materialize4;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .materialize5 {
     animation-name: materialize5;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .materialize6 {
     animation-name: materialize6;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .unify1 {
     animation-name: unify1;
     animation-duration: 5s;
     animation-iteration-count: 1;
     animation-fill-mode: both;
   }
   
   .unify2 {
     animation-name: unify2;
     animation-duration: 5s;
     animation-iteration-counter: 1;
     animation-fill-mode: both;
   }
   
   .unify3 {
     animation-name: unify3;
     animation-duration: 5s;
     animation-iteration-counter: 1;
     animation-fill-mode: both;
   }
   
   .unify4 {
     animation-name: unify4;
     animation-duration: 5s;
     animation-iteration-counter: 1;
     animation-fill-mode: both;
   }
   
   .unify5 {
     animation-name: unify5;
     animation-duration: 5s;
     animation-iteration-counter: 1;
     animation-fill-mode: both;
   }
   
   .unify6 {
     animation-name: unify6;
     animation-duration: 5s;
     animation-iteration-counter: 1;
     animation-fill-mode: both;
   }
   /*************************************************************

keyframes  - here are the details of the animations


*************************************************************/
   
   @keyframes fade-in1 {
     0% {
       right: 100%;
       opacity: 0;
     }
     100% {
       right: @box1_animation1_finish-right;
       opacity: 1;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes fade-in2 {
     0% {
       right: 100%;
       opacity: 0;
     }
     100% {
       right: @box2_animation1_finish-right;
       opacity: 1;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes fade-in3 {
     0% {
       right: 100%;
       opacity: 0;
     }
     100% {
       right: @box3_animation1_finish-right;
       opacity: 1;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes fade-in4 {
     0% {
       right: 100%;
       opacity: 0;
     }
     100% {
       right: @box4_animation1_finish-right;
       opacity: 1;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes fade-in5 {
     0% {
       right: 100%;
       opacity: 0;
     }
     100% {
       right: @box5_animation1_finish-right;
       opacity: 1;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes fade-in6 {
     0% {
       right: 100%;
       opacity: 0;
     }
     100% {
       right: @box6_animation1_finish-right;
       opacity: 1;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes materialize1 {
     0% {
       background-color: white;
       border-color: @box1_color;
       box-shadow: 0;
     }
     100% {
       border-color: none; //THIS MAY NEED TO BE AN ACTUAL COLOR VALUE!
       background-color: @box1_color;
       box-shadow: @boxshadowvalues;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes materialize2 {
     0% {
       background-color: white;
     }
     100% {
       background-color: @box1_color;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes materialize3 {
     0% {
       background-color: white;
     }
     100% {
       background-color: @box1_color;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes materialize4 {
     0% {
       background-color: white;
     }
     100% {
       background-color: @box1_color;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes materialize5 {
     0% {
       background-color: white;
     }
     100% {
       background-color: @box1_color;
     }
     animation-timing-function: ease-out;
   }
   
   @keyframes materialize6 {
     0% {
       background-color: white;
     }
     100% {
       background-color: @box1_color;
     }
     animation-timing-function: ease-out;
   }
   
   #box1 {
     position: absolute;
     background-color: white;
     border-style: solid;
     border-width: .1px;
     border-color: @box1_color;
     height: 20%;
     width: 18%;
     /*margin: auto;  can't move window around if its auto!*/
     top: 10%;
     right: 72%;
     z-index: 0;
   }
   
   #box2 {
     position: absolute;
     background-color: white;
     border-style: solid;
     border-width: .1px;
     border-color: @box2_color;
     height: 35%;
     width: 18%;
     /*margin: auto;  can't move window around if its auto!*/
     top: 23%;
     right: 42%;
     z-index: 1;
   }
   
   #box3 {
     position: absolute;
     background-color: white;
     border-style: solid;
     border-width: .1px;
     border-color: @box3_color;
     height: 30%;
     width: 12%;
     /*margin: auto;  can't move window around if its auto!*/
     top: 65%;
     right: 25%;
     z-index: 2;
   }
   
   #box4 {
     position: absolute;
     background-color: white;
     border-style: solid;
     border-width: .1px;
     border-color: @box4_color;
     height: 20%;
     width: 5%;
     /*margin: auto;  can't move window around if its auto!*/
     top: 51%;
     right: 62%;
     z-index: 3;
   }
   
   #box5 {
     position: absolute;
     background-color: white;
     border-style: solid;
     border-width: .1px;
     border-color: @box5_color;
     height: 23%;
     width: 24%;
     /*margin: auto;  can't move window around if its auto!*/
     top: 73%;
     right: 56%;
     z-index: 4;
   }
   
   #box6 {
     position: absolute;
     background-color: white;
     border-style: solid;
     border-width: .1px;
     border-color: @box6_color;
     height: 17%;
     width: 24%;
     /*margin: auto;  can't move window around if its auto!*/
     top: 17%;
     right: 10%;
     z-index: 5;
   }
   
   #row1 {
     position: relative;
     height: 500px;
     width: 100%;
     border-color: yellow;
     border-style: solid;
   }
   
   #row2 {
     position: relative;
     height: 100px;
     width: 100%;
     border-color: lightred;
     border-style: solid;
   }
   
   #column1 {
     border-style: solid;
   }
   
   #button1 {
     position: absolute;
     top: 0%;
     right: 50%;
   }
   
   .button {
     padding: 15px 25px;
     font-size: 24px;
     text-align: center;
     cursor: pointer;
     outline: none;
     color: #fff;
     background-color: #4CAF50;
     border: none;
     border-radius: 15px;
     box-shadow: 0 9px #999;
   }
   
   .button:hover {
     background-color: #3e8e41
   }
   
   .button:active {
     background-color: #3e8e41;
     box-shadow: 0 5px #666;
     transform: translateY(4px);
   }
              
            
!

JS

              
                $(document).ready(function() {

});

var click_counter = 1;
$(".button").click(function() {

  //Each click triggers an animation
  if (click_counter == 1) {
    //click1: fade in 2d boxes with light movement (css class called .fade-in1, .fade-in2,... etc)
    for (j = 1; j <= 6; j++) {
      $("#box" + j).addClass("fade-in" + j);
      
    }

  }
  if (click_counter == 2) {
    //click2: add color, box-shadow (css class called .materialize1, .materialize2, ....etc)
    for (j = 1; j <= 6; j++) {
      
      $("#box" + j).addClass("materialize" + j);
      //need to fade the border here
    }
  }
  if (click_counter == 3) {
    //click3: boxes organize into final form (css class called .unify1, .unify2, ...etcs)
    for (j = 1; j <= 6; j++)
      $("#box" + j).addClass("unify" + j);
  }
  if (click_counter == 4) {
    // $("#box1").fadeOut("slow");
  }

  click_counter += 1;
});
              
            
!
999px

Console