cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              .cube
 .front-back
  .left-right
   .ball
    -(1..36).each do |i|
     %div{:class => "ring"}
 -(1..6).each do |i|
  %div{:class => "face#{i}"}
  
            
          
!
            
              $green: #19A598;
$side-length: 300px;
$side-half: $side-length / 2;
$ball-size: 20px;
$ball-half: $ball-size / 2;
$translate-top: $side-half - $ball-size / 2;
$translate-bottom: -$side-half + $ball-size / 2; 
$timing: linear;

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  perspective: 1200px;
  font-family: sans-serif;
  background-color: black;
  text-rendering: optimizeLegibility;
}

.cube {
  position: absolute;
  top: 50%; 
  left: 50%;
  transform-style: preserve-3d;
  animation: spin 20s 7s forwards cubic-bezier(1,0,.37,1);
}

[class^="face"] {
  position: absolute;
  opacity: 0;
  width: $side-length;
  height: $side-length;
  margin: -$side-length / 2;
  background-image: radial-gradient(rgba($green,.5)1px, transparent 1px);
  background-size: 20px 20px;
  outline: 1px solid rgba($green, 0.5);
  text-align: center;
}

[class$="1"] {
  transform: translateZ($side-half);
  animation: reveal 5s forwards $timing;
}

[class$="2"] {
  transform: translateZ(-$side-half);
   opacity: 1;
    
  &:before {
    position: relative;
    content: "AWWWARDS";
    top: 10%;
    color: $green;
    font-size: 1.9em;
  }
}

[class$="3"] {
  transform: rotateY(90deg) translateZ($side-half);
  animation: reveal 6s forwards $timing;
}

[class$="4"] {
  transform: rotateY(-90deg) translateZ($side-half);
  animation: reveal 6s forwards $timing;
}

[class$="5"] {
  transform: rotateX(90deg) translateZ($side-half);
  animation: reveal 6s forwards $timing;
}

[class$="6"] {
  transform: rotateX(-90deg) translateZ($side-half);
  animation: reveal 6s forwards $timing;
}

.ball {
  position: absolute;
  transform-style: preserve-3d;
  top: 50%; 
  left: 50%;
  margin: -$ball-size / 2;
  width: $ball-size;
  height: $ball-size;
  animation: x-axis 1s infinite $timing;
}

.ring {
  position: absolute;
  width: $ball-size;
  height: $ball-size;
  border: 2px solid rgba($green, 0.5);
  border-radius: 50%;
  transform-style: preserve-3d;
}

@for $i from 1 through 17 {
  .ring:nth-child(#{$i}) {
    transform: rotateX($i*10deg);
  }
} 

@for $i from 18 through 36 {
  .ring:nth-child(#{$i}) {
    transform: rotateY($i*10deg);
  }
} 

.left-right {
  transform-style: preserve-3d;
  position: absolute;
  width: $side-length;
  height: $ball-size;
  top: 50%; 
  margin-top: -$ball-size / 2;
  margin-left: -$side-length / 2;
  animation: y-axis 1.2s infinite $timing;
}

.front-back {
  transform-style: preserve-3d;
  animation: z-axis 1.4s infinite $timing;
} 

@keyframes x-axis {
  0%, 100% { 
    transform: translateX($translate-top);
    animation-timing-function: $timing; 
  }
  
  50% { 
    transform: translateX($translate-bottom); 
  }
}

@keyframes y-axis {
  0%, 100% { 
   transform: translateY($translate-top); 
  }
  
  50% { 
   transform: translateY($translate-bottom);
  } 
}

@keyframes z-axis {
  0%, 100% { 
   transform: translateZ($translate-top);
  }
  
  50% { 
   transform: translateZ($translate-bottom);  
  }
}

@keyframes reveal {
  0%, 50% {
    opacity: 0;
  }
  
  100% {
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotateY(0) scale3d(1,1,1);
  }
  
  43% {
    transform: rotateY(360deg) scale3d(1,1,1);
  }
  
  49% {
    transform: rotateY(360deg) scale3d(1,1,1);
  }
  
  50% {
    transform: rotateY(360deg) scale3d(2.01, 2, 2);
  }
  
  51% {
    transform: rotateY(360deg) scale3d(1.99, 2, 2);
  }
  
  52% {
    transform: rotateY(360deg) scale3d(2, 2, 2);
  }
  
  59% {
    transform: rotateY(360deg) scale3d(2, 2, 2);
  }
  
  60% {
    transform: rotateY(360deg) scale3d(2, 2, 4.99);
  }
  
  61% {
    transform: rotateY(360deg) scale3d(2, 2, 5.01);
  }
  
  62% {
    transform: rotateY(360deg) scale3d(2, 2, 5);
  }
  
  80%, 100% {
    transform: rotateY(360deg) scale3d(2, 2, 2);
  }
}

@keyframes fade-in-up {
	0% { 
		opacity: 0;
		transform: translateY(10px);
	}
	100% { 
		opacity: 1;
		transform: translateY(0);
	}
}

            
          
!
            
              // please vote for me at http://conference.awwwards.com/code/nick-katz

// my little css demo is up againgst some great javascript entries. Go css!
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console