123

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.

            
                <div class="hover">
  3D NINTENDO GAMEBOY<br>
  Hover to turn on.</div>
<div class="wrap">
  <div class="cube">
    <div class="side one"></div>
    <div class="side two">
      <div class="deep">◄Off•On►</div>
      <div class="line"></div>
      <div class="line small"></div>
      <div class="line small b"></div>
      <div class="display">
        <div class="line"></div>
        <div class="line t"><span>DOT MATRIX WITH STEREO SOUND</span></div>
        <div class="line d"></div>
        <div class="line e"></div>
        <div class="pwbtn"><span>BATTERY</span></div>
        <div class="innerdisplay">
          <div class="nintendo">Nintendo</div>
          <div class="byrune">By Rune</div>
        </div>
      </div>
      <div class="gbtext">Nintendo<span>GAME BOY<p>TM</p></span>
      </div>
      <div class="crossa"></div>
      <div class="crossb"></div>
      <div class="select"><span>SELECT</span></div>
      <div class="start"><span>START</span></div>
      <div class="btnb"><span>B</span></div>
      <div class="btna"><span>A</span></div>
      <div class="sline a"></div>
      <div class="sline b"></div>
      <div class="sline c"></div>
      <div class="sline d"></div>
      <div class="sline e"></div>
      <div class="sline f"></div>
      <div class="deep b">PHOMES</div>
      
    </div>
    <div class="side three">
      <div class="connector"></div>
    </div>
    <div class="side four">
      <div class="powerbtn"></div>
      <div class="line top"></div>
    </div>
    <div class="side five">
      <div class="connector"></div>
      <div class="volume"></div>
    </div>
    <div class="side six">
      <div class="headphones"></div>
    </div>
  </div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Press+Start+2P);
@import url(https://fonts.googleapis.com/css?family=Ubuntu:500,500italic);
//Thanks Chris Simmons
*{backface-visibility:hidden;} 

$grey: #222;
$gbgrey:#a09f9c;
$wrapsize:300px;
$cubesize:100px;
$opacity:1;
$tempo: 10s;

body{
  background:#222;
  overflow:hidden;
}

.hover{
  font-family: 'Press Start 2P', cursive;
  font-size:10px;
  color:#f2f2f2;
  padding:30px;
  width:12%;
  line-height:20px;
  text-align:center;
}

.wrap{
  height:$wrapsize;
  width:$wrapsize;
  position:absolute;
  left:0;right:0;top:0;bottom:0;
  margin:auto;
  background:$grey;
  perspective: 1000px;
  transition:transform 2s ease;
}

.cube{
  position:absolute;
  left:0;right:0;top:0;bottom:0;margin:auto;
  transition:transform 2s ease;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  animation: rotate $tempo infinite;
}

.cube:hover .pwbtn{
  background:darkred;
  box-shadow: inset 1px 1px 5px 0px rgba(0,0,0,0.50);
}

.cube:hover .nintendo{
  top:30px;
}
.cube:hover .byrune{
  top:40px;
}

.side{
  position:absolute;
  border:1px solid rgba(0,0,0,0.05);
  opacity:$opacity;
  filter:alpha(opacity=NaN);
  left:0;right:0;top:0;bottom:0;
  margin:auto;
  height:$cubesize;
  width:$cubesize;
  transform-style: preserve-3d;
  transition: transform 1s ease;
}

.side.one{
  background:$gbgrey;
  border-radius:10px;
  border-bottom-right-radius:30px;
  height:300px;
  width:180px;
  transform: translateZ( -25px );
}
.side.two{
  background: linear-gradient(-55deg, #a09f9c 89%, #6d6b6b 100%);
  border-radius:10px;
  border-bottom-right-radius:30px;
  height:300px;
  width:180px;
  transform: translateZ( 25px );
  
}
.side.three{
  background:$gbgrey;
  height:280px;
  width:50px;
  top:10px;
  bottom:10px;
  transform: rotateY( -90deg ) translateZ( 90px ); 
}
.side.four{
  background:$gbgrey;
  height:50px;
  width:165px;
  transform: rotateX( 90deg ) translateZ( 150px );
}
.side.five{
  background:$gbgrey;
  height:265px;
  width:50px;
  bottom:25px;
  top:10px;
  transform: rotateY( 90deg ) translateZ( 90px );
}
.side.six{
  background:$gbgrey;
  height:50px;
  width:145px;
  right:25px;
  left:10px;
  transform: rotateX( -90deg ) translateZ( 150px );
}

.deep, .deep.b{
  position:absolute;
  text-align:center;
  left:20px;
  height:8px;
  width:25px;
  background:#b5b4b0;
  border-radius:10px;
  box-shadow: inset 0px 3px 5px 0px rgba(0,0,0,0.22);
  font-size:5px;
  line-height:8px;
  color:$gbgrey;
}
.deep.b{
  bottom:1px;
  left:80px;
}

.line{
  position:absolute;
  top:10px;
  width:100%;
  height:2px;
  background:#d5d4ce;
  box-shadow: 1px 1px 1px grey;
  opacity:.3;
  filter:alpha(opacity=30);
}

.line.small, .line.small.b{
  width:2px;
  height:9px; 
  top:0;
  left:10px;
  box-shadow: 1px 0px 4px;
}

.line.small.b{
  left:initial;
  right:10px;
}

.display .line{
  background:#800050;
   box-shadow: 0px 0px 0px;
  width:40px;
  height:2px;
  top:5px;
  left:5px;
}
.display .line.t{
  background:#0e0050;
  box-shadow: 0px 0px 0px;
  width:40px;
  height:2px;
  top:8px;
  left:5px;
}

.display .line.t span{
  position:absolute;
  width:100px;
  left:45px;
  top:-3px;
  font-size:4px;
  color:lightgray;
  font-weight:100;
}

.display .line.d{
  width:23px;
  left:initial;
  right:5px;
}

.display .line.e{
  background:#0e0050;
  width:23px;
  top:8px;
  left:initial;
  right:5px;
}

.display{
  position:absolute;
  left:0;right:0;top:25px;margin:auto;
  border: 1px solid gray;
  border-radius:5px;
  border-bottom-right-radius:30px;
  height:115px;
  width:150px;
  background:#535360;
}

.pwbtn{
  position:absolute;
  left:7px;
  top:30px;
  height:5px;
  width:5px;
  border-radius:5px;
  background-color:#222;
}

.pwbtn span{
  font-size:4px;
  color:gray;
  margin-left:-2px;
  margin-top:-2px;
}

.innerdisplay{
  position:absolute;
  top:0;bottom:0;left:0;right:0;margin:auto;
  border: 1px solid black;
  height:80px;
  width:90px;
  background:#606d01;
  box-shadow: inset 10px 7px 5px -6px rgba(0,0,0,0.45);
  text-align:center;
  overflow:hidden;
}

.nintendo, .byrune{
  position:absolute;
  width:70px;
  height:17px;
  left:0;right:0;top:-20px;margin:auto;
  font-family: 'Press Start 2P', cursive;
  font-size:7px;
  color:#222;
  border-radius:10px;
  transition:top 2s linear;
}
.byrune{
  top:-10px;
  font-size:6px;
}

.gbtext{
  position:absolute;
  display:inline-block;
  top:142px;
  left:15px;
  font-size:9px;
  color:#170079;
  font-family: 'Ubuntu', sans-serif;
}

.gbtext span{
  font-size:11px;
  font-family: 'Ubuntu', sans-serif;
  font-style:italic;
}

.gbtext span p{
  position:absolute;
  bottom:-5px;
  right:-8px;
  font-size:5px;
  font-style:initial;
}

.crossa, .crossb{
  position:absolute;
  border-radius:3px;
  box-shadow:1px 1px 1px ;
  width:40px;
  height:15px;
  background:#111;
  bottom:93px;
  left:15px;
  transform:translateZ(4px);
}

.select, .start{
  position:absolute;
  bottom:45px;
  left:65px;
  width:20px;
  height:4px;
  background:grey;
  font-size:5px;
  transform:rotate(-15deg);
  box-shadow: 0px 0px 5px #222;
  transform:translateZ(4px) rotate(-15deg);
}

.select span, .start span{
  color:#170079;
  position:absolute;
  top:7px;
  left:2px;
}

.start{
  left:95px;
}

.crossb{
  bottom:80px;
  left:27px;
  height:40px;
  width:15px;
}

.btna, .btnb{
  position:absolute;
  right:10px;
  bottom:90px;
  height:28px;
  width:28px;
  border-radius:20px;
  background:#7a2859;
  box-shadow: inset 2px 2px 5px 0px rgba(255,255,255,0.21);
}

.btnb{
  right:48px;
  bottom:77px;
}
.btna span, .btnb span{
  color:#170079;
  position:absolute;
  top:30px;
  left:22px;
  font-family: 'Ubuntu', sans-serif;
  font-size:9px;
  transform:rotate(-28deg);
  text-shadow: 1px 1px 2px grey;
}

.sline{
  position:absolute;
  height:2px;
  width:26px;
  border-radius:2px;
  background:gray;
  bottom:13px;
  right:30px;
  transform:rotate(55deg);
}

.sline.b{right:24px;bottom:18px;}
.sline.c{right:18px;bottom:22px;}
.sline.d{right: 12px;bottom:27px;}
.sline.e{right:6px;bottom:31px;}
.sline.f{right:0px;bottom:36px;}

.powerbtn{
  position:absolute;
  height:10px;
  width:10px;
  background:grey;
  bottom:20px;
  right:10px;
  border-radius:10px;
}

.volume, .connector{
  position:absolute;
  left:25px;
  top:70px;
  height:20px;
  width:10px;
  background:#000;
}

.volume{
  top:40px;
  width:5px;
}

.headphones{
  height:10px;
  width:10px;
  border-radius:10px;
  background:#222;
  top:0;left:0;right:0;margin:auto;
}

@keyframes rotate{
  0%{transform: rotateY( 0deg ) rotateX( 0deg );transform: rotateY( 0deg ) rotateX( 0deg );}
  20%{transform:  rotateX( 20deg )rotateY( 30deg );transform:  rotateX( 20deg )rotateY( 30deg );}
  50%{}
  80%{transform: rotateX( -30deg )rotateY( -30deg );transform: rotateX( -30deg )rotateY( -30deg );}
  100%{transform: rotateY( 0deg ) rotateX( 0deg );transform: rotateY( 0deg ) rotateX( 0deg );}
  }
            
          
!
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