cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

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.

            
              <div class="controller">
  <div class="frame"></div>
  
  <div class="logo">#codevember</div>
  
  <div class="pattern one"></div>
  <div class="pattern two"></div>
  <div class="pattern three"></div>
  <div class="pattern four"></div>

  <div class="d-pad">
    <div class="up-down"></div>
    <div class="left-right"></div>
  </div>

  <div class="button b"></div>
  <div class="button a"></div>

  <div class="system-buttons">
    <div class="select"></div>
    <div class="start"></div>
  </div>
</div>

<p class="view-collection">&bull; #codevember &bull; <a href="https://codepen.io/collection/nxZbMW/" target="_blank">View Collection</a> &bull;<br />
  <span>Handcrafted with <span class="love">♥</span> from Austin, TX by <a href="https://twitter.com/fleetingftw">James Fleeting</a></span></p>
            
          
!
            
              @use postcss-simple-vars;
@use postcss-media-minmax;
@use postcss-nested;

$bp: 400px;

html, body {
  height: 100%;
  
  @media screen and (height <= $bp) {
    height: auto;
  }
}

body {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at center, #343436 0%,#1d1f20 100%);
  
  @media screen and (height <= 300px) {
    display: block;
  }
}

.controller {
  flex: 0 0 auto;
  position: relative;
  width: 500px;
  height: 206px;
  background: #d3d3d4;
  border-radius: 7px;
  transform: scale(1.3);
  
  @media screen and (height <= 300px) {
    transform: scale(1);
    margin: 25px auto;
  }
}

.frame {
  position: absolute;
  top: 34px;
  left: 13px;
  width: 476px;
  height: 160px;
  background: #000;
}

.logo {
  position: absolute;
  top: 65px;
  right: 47px;
  color: #ff0000;
  font-size: 12px;
  font-family: 'Press Start 2P', cursive;
}

.d-pad {
  position: relative;
  top: 74px;
  left: 35px;
  width: 95px;
  height: 95px;
  z-index: 1;
  
  &::before, &::after {
    position: absolute;
    top: -1px;
    left: 31px;
    width: 34px;
    height: 97px;
    content: "";
    background: #fff;
    border-radius: 3px;
    z-index: 0;
  }
  
  &::after {
    transform: rotate(90deg);
    z-index: -1;
  }
  
  .up-down, .left-right {
    position: absolute;
    top: 0;
    left: 32px;
    width: 32px;
    height: 95px;
    background: #1a1a1a;
    border-radius: 3px;
  }
  
  .left-right {
    transform: rotate(90deg);
  }
}

.button {
  position: absolute;
  top: 118px;
  width: 57px;
  height: 57px;
  border-radius: 4px;
  background: #ddd;
  
  &::after {
    position: absolute;
    top: 5px;
    left: 5px;
    content: "";
    width: 47px;
    height: 47px;
    border-radius: 50px;
    background: #ff0000;
    box-shadow: 0 1px #333;
    transition: all 0.3s;
  }
  
  &:hover::after {
    box-shadow: 0 0 #333;
  }
  
  &::before {
    position: absolute;
    bottom: -16px;
    right: 0;
    color: #ff0000;
    font-size: 11px;
    font-family: 'Press Start 2P', cursive;
  }
  
  &.a {
    right: 56px;
    
    &::before {
      content: "A";
    }
  }
  
  &.b {
    right: 120px;
    
    &::before {
      content: "B";
    }
  }
}

.system-buttons {
  position: absolute;
  top: 123px;
  left: 160px;
  width: 142px;
  height: 47px;
  border-radius: 8px;
  background: #ddd;
  
  .select, .start {
    position: absolute;
    top: 16px;
    width: 40px;
    height: 16px;
    background: #000;
    border-radius: 8px;
    content: "";
    
    &::before {
      position: absolute;
      top: -39px;
      color: #ff0000;
      font-size: 9px;
      font-family: 'Press Start 2P', cursive;
    }
  }
  
  .select {
    left: 16px;
    
    &::before {
      left: -4px;
      content: "select";
    }
  }
  
  .start {
    right: 16px;
    
    &::before {
      left: -1px;
      content: "start";
    }
  }
}

.pattern {
  position: absolute;
  left: 160px;
  width: 142px;
  height: 25px;
  background: #808080;
  border-radius: 9px;
  
  &.one {
    top: 34px;
    height: 19px;
    border-radius: 0 0 9px 9px;
  }
  
  &.two {
    top: 60px;
  }
  
  &.three {
    top: 91px;
  }
  
  &.four {
    top: 178px;
    height: 16px;
    border-radius: 9px 9px 0 0;
  }
}

.view-collection {
  flex: 0 0 auto;
  margin: 75px 0 0;
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  
  @media screen and (height <= 300px) {
    margin: 25px 0;
  }
  
  span {
    font-size: 13px;
  }
  
  .love {
    color: #cc0000;
  }
  
  a {
    color: #ff0000;
    text-decoration: none;
    transition: all 0.7s;
    
    &:hover, &:focus {
      color: #d3d3d3;
    }
  }
}

            
          
!
999px
Loading ..................

Console