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

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.

            
              .container
 .cube
  - (1..6).each do |i|
   %div.face #{}
 .cube
  - (1..6).each do |i|
   %div.face #{}
 .cube
  - (1..6).each do |i|
   %div.face #{}
  
            
          
!
            
              $g: #dec7a5;
$c: #ccc;
$te: #00ffc2;
$t: rgba(255,255,255,0);
$o: #ffc635;

body{
  display:-webkit-box;
  display:-ms-flexbox;
  display:flex;
  width:100vw;
  height:100vh;
  -webkit-box-align:center;
      -ms-flex-align:center;
          align-items:center;
  -webkit-box-pack:center;
      -ms-flex-pack:center;
          justify-content:center;
  background: 
-webkit-linear-gradient(315deg, $o 25%, transparent 25%) -50px 0,
-webkit-linear-gradient(225deg, $o 25%, transparent 25%) -50px 0,
-webkit-linear-gradient(135deg, $o 25%, transparent 25%),
-webkit-linear-gradient(45deg, $o 25%, transparent 25%);
  background: 
linear-gradient(135deg, $o 25%, transparent 25%) -50px 0,
linear-gradient(225deg, $o 25%, transparent 25%) -50px 0,
linear-gradient(315deg, $o 25%, transparent 25%),
linear-gradient(45deg, $o 25%, transparent 25%);	
  background-size: 100px 100px;
  background-color: $te;
  .container {
    width: 200px;
    height: 200px;
    position: relative;
    -webkit-perspective: 1000px;
            perspective: 1000px;
    margin-top:100px;
    -webkit-animation:wobble 5s ease-in-out infinite alternate;
            animation:wobble 5s ease-in-out infinite alternate;
    @-webkit-keyframes wobble{
      from{
        -webkit-transform:rotate(10deg);
                transform:rotate(10deg);
      }
      to{
        -webkit-transform:rotate(-10deg);
                transform:rotate(-10deg);
      }
    }
    @keyframes wobble{
      from{
        -webkit-transform:rotate(10deg);
                transform:rotate(10deg);
      }
      to{
        -webkit-transform:rotate(-10deg);
                transform:rotate(-10deg);
      }
    }
    .cube{
      width: 100%;
      height: 100%;
      position: absolute;
      -webkit-transform-style: preserve-3d;
              transform-style: preserve-3d;
      -webkit-transform:translateX(-50%) translateY(-50%) rotateY(50deg);
              transform:translateX(-50%) translateY(-50%) rotateY(50deg);
      position:absolute;
      top:50%;
      left:50%;
      &:nth-of-type(1){
        &:before, &:after{
          content:'';
          position:absolute;
          width:15px;
          height:150px;
          background:darken($c, 50%);
          top:-120px;
          border-radius:30px 30px 0 0;
          left:50px;
        }
        &:after{
          -webkit-transform:rotateY(-90deg);
                  transform:rotateY(-90deg)
        }
        -webkit-animation:spinning1 20s linear infinite;
                animation:spinning1 20s linear infinite;
        @-webkit-keyframes spinning1{
          from{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(0deg) scaleX(1.2);
                    transform:translateX(-50%) translateY(-50%) rotateY(0deg) scaleX(1.2);
          }
          to{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(360deg) scaleX(1.2);
                    transform:translateX(-50%) translateY(-50%) rotateY(360deg) scaleX(1.2);
          }
        }
        @keyframes spinning1{
          from{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(0deg) scaleX(1.2);
                    transform:translateX(-50%) translateY(-50%) rotateY(0deg) scaleX(1.2);
          }
          to{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(360deg) scaleX(1.2);
                    transform:translateX(-50%) translateY(-50%) rotateY(360deg) scaleX(1.2);
          }
        }
        .face{
          &:nth-of-type(4){
            &:before, &:after{
              content:'';
              position:absolute;
              width:80%;
              height:80%;
              box-shadow:inset 0 0 20px 10px darken($c, 7.5%);
              left:50%;
              top:50%;
              -webkit-transform:translateX(-50%) translateY(-50%);
                      transform:translateX(-50%) translateY(-50%);
              border-radius:30px;
            }
            &:after{
              width:50%;
              height:50%;
              box-shadow:0 0 10px 0px darken($c, 7%), inset 0 -2px 0 11px darken($c, 5%);
              background:-webkit-radial-gradient(center, circle, darken($c, 50%), darken($c, 50%) 2px, transparent 2px), darken($c, 5%);
              background:radial-gradient(circle at center, darken($c, 50%), darken($c, 50%) 2px, transparent 2px), darken($c, 5%);
              background-size:10px;
            }
          }
        }
      }
      &:nth-of-type(2){
        -webkit-animation:spinning2 20s linear infinite;
                animation:spinning2 20s linear infinite;
        @-webkit-keyframes spinning2{
          from{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(0deg);
                    transform:translateX(-50%) translateY(-50%) rotateY(0deg);
          }
          to{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(360deg);
                    transform:translateX(-50%) translateY(-50%) rotateY(360deg);
          }
        }
        @keyframes spinning2{
          from{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(0deg);
                    transform:translateX(-50%) translateY(-50%) rotateY(0deg);
          }
          to{
            -webkit-transform:translateX(-50%) translateY(-50%) rotateY(360deg);
                    transform:translateX(-50%) translateY(-50%) rotateY(360deg);
          }
        }
        .face{
          &:nth-of-type(4){
            background:$c;
            &:before, &:after{
              content:'';
              position:absolute;
              left:50%;
              -webkit-transform:translateX(-50%);
                      transform:translateX(-50%);
              top:30px;
              width:80px;
              height:100px;
              background:-webkit-repeating-linear-gradient(right, $c, $c 7.5px, $t 7.5px, $t 25px), -webkit-repeating-linear-gradient(top, darken($c, 10%), darken($g, 5%) 15px, $t 15px, $t 25px);
              background:repeating-linear-gradient(to left, $c, $c 7.5px, $t 7.5px, $t 25px), repeating-linear-gradient(to bottom, darken($c, 10%), darken($g, 5%) 15px, $t 15px, $t 25px);
              border-radius:5px;
            }
            &:after{
              top:170px;
              height:70px;
              background:-webkit-repeating-linear-gradient(right, $c, $c 7.5px, $t 7.5px, $t 25px), -webkit-linear-gradient(left, red, red 24px, $t 10px), -webkit-linear-gradient(left, $c, $c 24px, $t 10px), -webkit-repeating-linear-gradient(top, darken($c, 10%), darken($g, 5%) 15px, $t 15px, $t 25px);
              background:repeating-linear-gradient(to left, $c, $c 7.5px, $t 7.5px, $t 25px), linear-gradient(to right, red, red 24px, $t 10px), linear-gradient(to right, $c, $c 24px, $t 10px), repeating-linear-gradient(to bottom, darken($c, 10%), darken($g, 5%) 15px, $t 15px, $t 25px);
              border-radius:5px;
              background-size:100%, 25px 15px, 25px 17px, 100%;
              background-repeat:no-repeat;
              background-position:center, top right, 30px 50px, center;
            }
          }
        }
      }
      &:nth-of-type(1), &:nth-of-type(3){
        margin-top:-120px;
        -webkit-transform:translateX(-50%) translateY(-50%) rotateY(50deg) scaleX(1.2);
                transform:translateX(-50%) translateY(-50%) rotateY(50deg) scaleX(1.2);
        .face{
          height:120px;
          &:last-of-type{
            -webkit-transform: rotateX( -90deg ) translateZ(-10px );
                    transform: rotateX( -90deg ) translateZ(-10px );
          }
        }
      }
      &:nth-of-type(3){
        -webkit-transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(50deg) scaleX(1.4);
                transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(50deg) scaleX(1.4);
        -webkit-animation:spinning3 20s linear infinite;
                animation:spinning3 20s linear infinite;
        @-webkit-keyframes spinning3{
          from{
            -webkit-transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(0deg) scaleX(1.4);
                    transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(0deg) scaleX(1.4);
          }
          to{
            -webkit-transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(360deg) scaleX(1.4);
                    transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(360deg) scaleX(1.4);
          }
        }
        @keyframes spinning3{
          from{
            -webkit-transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(0deg) scaleX(1.4);
                    transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(0deg) scaleX(1.4);
          }
          to{
            -webkit-transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(360deg) scaleX(1.4);
                    transform:translateX(-50%) translateY(calc(-50% + 250px)) rotateY(360deg) scaleX(1.4);
          }
        }
        z-index:-1;
        margin-top:0px;
        .face{
          height:40px;
          &:nth-of-type(4){
            &:before{
              content:'';
              position:absolute;
              width:30px;
              left:calc(50% - 15px);
              height:7.5px;
              background:darken($c, 30%);
              border-radius:30px;
              top:14px;
            }
          }
        }
       }
      .face{
          margin: 0;
          width: 100px;
          height: 250px;
          display: block;
          position: absolute;
          -webkit-transform: rotateY(   0deg ) translateZ( 50px );
                  transform: rotateY(   0deg ) translateZ( 50px );
          background:$g;
          -webkit-animation:shading 20s linear infinite;
                  animation:shading 20s linear infinite;
          -webkit-animation-delay:-10s;
                  animation-delay:-10s;
          @-webkit-keyframes shading{
            0%{
              -webkit-filter:brightness(0.25);
                      filter:brightness(0.25);
            }
            50%{
              -webkit-filter:brightness(1);
                      filter:brightness(1);
            }
            100%{
              -webkit-filter:brightness(0.25);
                      filter:brightness(0.25);
            }
          }
          @keyframes shading{
            0%{
              -webkit-filter:brightness(0.25);
                      filter:brightness(0.25);
            }
            50%{
              -webkit-filter:brightness(1);
                      filter:brightness(1);
            }
            100%{
              -webkit-filter:brightness(0.25);
                      filter:brightness(0.25);
            }
          }
          
          &:nth-of-type(2){
            -webkit-transform: rotateX( 180deg ) translateZ( 50px );
                    transform: rotateX( 180deg ) translateZ( 50px );
            -webkit-animation-delay:-20s;
                    animation-delay:-20s;
            

          }
          &:nth-of-type(3){
            -webkit-transform: rotateY(  90deg ) translateZ( 50px );
                    transform: rotateY(  90deg ) translateZ( 50px );
            -webkit-animation-delay:-15s;
                    animation-delay:-15s;
          }
          &:nth-of-type(4){
            -webkit-transform: rotateY( -90deg ) translateZ( 50px );
                    transform: rotateY( -90deg ) translateZ( 50px );
            background:$c;
            -webkit-animation-delay:-5s;
                    animation-delay:-5s;
            
          }
          &:nth-of-type(5){
            -webkit-transform: rotateX(  90deg ) translateZ( 50px );
                    transform: rotateX(  90deg ) translateZ( 50px );
            height:100px;
            background:darken($c, 5%);
          }
          &:nth-of-type(6){
            -webkit-transform: rotateX( -90deg ) translateZ( 200px );
                    transform: rotateX( -90deg ) translateZ( 200px );
            height:100px;
            background:darken($c, 5%);
          }
      }
    }
  }
}
            
          
!
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