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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <html>
  <head>
    <title>CSS Keyframe and 3D Animation</title>
    <link href='https://fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
  </head>
  
  <body>
    
   <section id="start">  
     
      <div class="cube">
        <div class="front"></div>
        <div class="back"></div>
        <div class="right"></div>
        <div class="left"></div>
        <div class="top"></div>
        <div class="bottom"></div>
      </div><!-- //cube-->
    </section>
<div class="wordwrap">
  <span class="word first"> Startups</span>
  <span class="word second"> Please</span>
  <span class="word third">Do</span>
  <span class="word fourth">Design</span>
  <span class="word fifth">right</span>
  <span class="word sixth">please</span>
  <span class="word seventh">!</span>
</div>
    
    
  </body>  
</html>
              
            
!

CSS

              
                * {box-sizing: border-box;}

html, body {
margin: 0;
width: 100%;
height: 100%;
}
body {
  background: #f3cf3f;
  font-family:"franchise";
  color:#fff;
  padding: 30px;
  text-align: center;
  overflow:hidden;
}

//STYLING THE CUBE
section {
  width:100px;
  height:100px;
  position:fixed;
  top:50%;
  left:50%;
  margin-top:-50px;
  margin-left:-50px;
  opacity:1;
  transition: all 1s ease;

}
section:after {
    left: -13%;
    height: 16px
}
section:before {
    left: -18%;
    height: 14px
}
.cube {
  position:absolute;
  width:100%;
  height:100%;
  transform-style: preserve-3d;
  animation: rotatecube 3s linear infinite;
  transition:all 1s ease;
  

  div {
    position:absolute;
    width:100%;
    height:100%;
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
    filter: alpha(opacity=100);
    opacity: 1;
    background: gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
    /* Chrome,Safari4  */
    background: linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    /* Chrome10 ,Safari5.1  */
    background: -o-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    /* Opera 11.10  */
    background: -ms-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    /* IE10  */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    /* W3C */
    /* IE6-9 */
    transition: all .5s linear;

  }

}
  .front {background:red; transform: rotateY(0deg) translateZ(50px); }
  .right {background:pink; transform: rotateY(90deg) translateZ(50px); }
  .left {background:orange; transform: rotateY(-90deg) translateZ(50px);}
  .top {background:white; transform: rotateX(90deg) translateZ(50px); }
  .bottom {background:teal; transform: rotateX(-90deg) translateZ(50px);}
  .back {background:green; transform: rotateX(180deg) translateZ(50px);}

/*=============================================
[ Text Styles ]
==============================================*/

.wordwrap {
 width:600px;
 height:600px;
 position:relative;
 top:50%;
 left:50%;
 margin-top:-300px;
 margin-left:-300px;
  
  .word {
   display:inline-block;
   position:absolute;
  } 
}

.first {
 top:50px;
  left:0px;
  font-size:150px;
  opacity:0;
}

.second {
   top:50px;
  left:0;
  font-size:150px;
  opacity:0;
}
.third {
 left:515px;
  top:251px;
  font-size:135px;
  opacity:0;
}
.fourth{
  left:-1px;
  font-size:150px;
  top:160px;
  opacity:0;
}
.fifth{
 left:-6px;
  top:273px;
  font-size:130px;
  opacity:0;
}
.sixth {
 left:-20px;
  top:351px;
  font-size:190px;
  opacity:0;
}
.seventh {
  font-size:430px;
  left:500px;
  top:24px;
  opacity:0;
}

.textshadow{
  transition:1s ease !important;
  text-shadow:0 -1px 0 #858585,0 1px 10px rgba(0,0,0,.6);
}

/*=============================================
[ Clicked Styles ]
==============================================*/
.cubeclicked {
    animation: spin-cube 3s;
    animation-timing-function:ease-in-out;
}
.sectionclicked {
    opacity:0;
    transition-delay: all 1s;
}
.oneclicked {
    animation-fill-mode:forwards;
    transform: translate3d(0px ,0px, 0px);
    animation-name: left-top;
    animation-iteration-count: 1;
    animation-timing-function:ease;
    animation-duration:.5s;

}
.twoclicked {
    animation-fill-mode:forwards;
    transform: translate3d(0px ,0px, 0px);
    animation-name: right;
    animation-iteration-count: 1;
    animation-timing-function:ease;
    animation-duration:.5s;
    animation-delay:.5s;

}
.threeclicked {
    animation-fill-mode:forwards;    
    animation-name: left-spin;
    animation-iteration-count: 1;
    animation-timing-function:ease;
    animation-duration:1s;
    animation-delay:1s;
    transform-origin:bottom left;
}
.fourclicked {
    animation-fill-mode:forwards;
    transform: translate3d(0px ,0px, 0px);
    animation-name: bottom;
    animation-iteration-count: 1;
    animation-timing-function:ease;
    animation-duration:.5s;
    animation-delay:2s;
}
.fiveclicked{
    animation-fill-mode:forwards;
    animation-name: slide;
    animation-iteration-count: 1;
    animation-timing-function:ease;
    animation-duration:1.3s;
    animation-delay:3s;
}
.sixclicked{
    animation-fill-mode:forwards;
    animation-name: scale;
    animation-iteration-count: 1;
    animation-timing-function:linear;
    animation-duration:.5s;
    animation-delay:4s;
}
.sevenclicked {
    animation-fill-mode:forwards;
    animation-name: right-spin;
    animation-iteration-count: 1;
    animation-timing-function:linear;
    animation-duration:.5s;
    animation-delay:4.5s;
    transform-origin:bottom right;
}


/*=============================================
[ KeyFrame Animations]
==============================================*/
/*Cube*/
@keyframes rotatecube { 
    0% { transform: rotateY( 0 ) rotateX( 0 ) }
    100% { transform: rotateY( 360deg ) rotateX( 360deg ) }
}
@keyframes spin-cube { 
    0% { transform: rotateY( 0 ) rotateX( 0 ) }
    30% { transform: rotateY( 460deg ) rotateX( 460deg ) }
    60% { transform: rotateY( 360deg ) rotateX( 360deg ) }
    100% { transform: rotateY( 360deg ) rotateX( 360deg ) }
}
/*Text*/
@keyframes left-top { 
    0% { transform: translate3d(-500px, -1000px, 1000px ) rotate(-90deg); font-size: 1200px; }
    1% { transform: translate3d(-500px, -1000px, 1000px ) rotate(-90deg); font-size: 1200px; opacity: 1; }
    100% { transform: translate3d(0px ,0px 0px ) rotate(0deg); font-size: 150px; opacity: 1; }
}
@keyframes right { 
    0% { transform: translate(1000ppx, 0px) }
    1% { transform: translate(1000px, 0px); opacity: 1; }
    100% { transform: translate(0px ,0px ); opacity: 1; }
}
@keyframes left-spin { 
    0% { transform: translate(-1000ppx, 0px) rotate(0deg) }
    1% { transform: translate(-1000px, 0px) rotate(0deg); opacity: 1; }
    50% { transform: translate(0px, 0px) rotate(0deg); opacity: 1; }
    100% { transform: translate(0px ,0px ) rotate(-90deg); opacity: 1; }
}
@keyframes bottom { 
    0% { transform: translate3d(-500px, 1000px, 500px ) rotateY(540deg); font-size: 1200px; }
    1% { transform: translate3d(-500px, 1000px, 500px ) rotateY(540deg); font-size: 1200px; opacity: 1; }
    100% { transform: translate3d(0px ,0px 0px ) rotateY(0deg); font-size: 150px; opacity: 1; }
}
@keyframes slide { 
    0% { transform: translate3d(0px, 0px, 1000px) rotateX(-90deg) }
    1% { transform: translate3d(0px, 0px, 1000px) rotateX(-90deg); opacity: 1; }
    100% { transform: translate3d(0px, 0px, 0px) rotateX(0deg); opacity: 1; }
}
@keyframes bottom slide { 
    0% { transform: translate3d(-500px, -1000px, 500px ) rotate(-30deg); font-size: 1200px; }
    1% { transform: translate3d(-500px, -1000px, 500px ) rotate(-30deg); font-size: 1200px; }
    100% { transform: translate3d(0px ,0px 0px ) rotate(0deg); font-size: 150px; }
}
@keyframes scale { 
    0% { transform: translate(-1000px, 0px) rotateZ(180deg) scale(0,0) }
    1% { transform: translate(-1000px, 0px) rotateZ(180deg) scale(0,0); opacity: 1; }
    100% { -webki-transform: translate(0px, 0px) rotateZ(0deg) scale(1,1); opacity: 1; }
}
@keyframes right-spin { 
    0% { transform: translate(1000ppx, 0px) rotate(90deg) }
    1% { transform: translate(1000px, 0px) rotate(90deg); opacity: 1; }
    50% { transform: translate(0px, 0px) rotate(90deg); opacity: 1; }
    100% { transform: translate(0px ,0px ) rotate(0deg); opacity: 1; }
}
@keyframes slideright { 
    0% { transform: scale(1,1) }
    100% { transform: scale(0,0) }
}

/*=============================================
[ Reset Animation]
==============================================*/
.hide { display:none;}
.show { display: block; opacity: 1; }
.finish { 
animation-fill-mode: forwards; 
animation-name: slideright; 
animation-iteration-count: 1; 
animation-timing-function: ease; 
animation-duration: 1s; 
}
              
            
!

JS

              
                

              
            
!
999px

Console