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 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.

HTML

              
                <div class="screen">
  <div class="container">
    <div class="visuals">
      <div class="tv">
        <video width="324" height="282" loop>
          <source src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/355309/8-bit-zelda.mp4" type="video/mp4">
        </video>        
      </div>
      <div class="analysers">
        <div><span>pulse 1</span><canvas id="pulse" width="182" height="60"></canvas></div>
        <div><span>pulse 2</span><canvas id="square" width="182" height="60"></canvas></div>
        <div><span>triangle</span><canvas id="triangle" width="182" height="60"></canvas></div>
        <div><span>noise</span><canvas id="noise" width="182" height="60"></canvas></div>
      </div>
    </div>
    <div class="playlist">
      <a class="song active" data-index="0">The Legend of Zelda (overworld)</a>
      <a class="song" data-index="1">Pac-Man (intro)</a>
      <a class="song" data-index="2">Super Mario Bros (overworld)</a>
      <a class="song" data-index="3">Metroid (title theme)</a>
      <a class="song" data-index="4">Kirby's Adventure (Vegetable Valley)</a>
    </div>
    <div class="play-wrapper">
      <a class="play">Play</a>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background-color: #FFBF2F;
  background-image: linear-gradient(-180deg, #FFBF2F 0%, #FF9F00 100%);
  margin: 0;
  font-family: 'Press Start 2P', cursive;
}

body * {
  user-select: none;
}

.screen {
  width: 564px;
  height: 578px;
  background-color: #470A6C;
  margin: 32px auto 127px auto;
  padding: 20px 0;
  box-sizing: border-box;
  position: relative;
  transform: translateX(-46px);
}

.container {
  margin: 0 20px;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
}

.visuals {
  display: flex;
  justify-content: space-between;
}

.analysers {
  width: 182px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.analysers span {
  color: #01A800;
  font-size: 12px;
  position: absolute;
  margin: 4px 2px;
}

canvas {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/355309/8bit-visualize-bg.svg);
}

.screen:after {
  width: 157px;
  height: 578px;
  background-color: #C93CBD;
  content: "";
  display: block;
  position: absolute;
  left: 100%;    
  top: 0;
  transform: skewY(39deg);
  transform-origin: top left;
}

.screen:before {
  width: 564px;
  height: 127px;
  background-color: #A42C9A;
  content: "";
  display: block;
  position: absolute;
  transform-origin: top left;
  transform: skewX(51deg);
  top: 100%;
}

.playlist {
  background-color: #009AA8;
}

.playlist a {
  display: block;
  font-size: 12px;
  color: #F2F2F2;
  line-height: 36px;
  padding: 0 16px;
  cursor: pointer;
}

.playlist a:hover, .playlist a.active {
  background-color: #F2F2F2;
  color: #01A800;
}

.play-wrapper {
  text-align: center;
}

.play {
  width: 142px;
  height: 42px;
  background-color: #3A00FC;
  display: inline-block;
  margin: 0 auto;
  font-size: 12px;
  line-height: 12px;
  padding: 15px 0;
  text-align: center;
  box-sizing: border-box;
  color: #F9D879;
  -webkit-clip-path: polygon(0% 15%, 5% 15%, 5% 0%, 95% 0%, 95% 15%, 100% 15%, 100% 85%, 95% 85%, 95% 100%, 5% 100%, 5% 85%, 0% 85%);
  clip-path: polygon(0% 15%, 5% 15%, 5% 0%, 95% 0%, 95% 15%, 100% 15%, 100% 85%, 95% 85%, 95% 100%, 5% 100%, 5% 85%, 0% 85%);
  cursor: pointer;
  text-transform: uppercase;
}

.play:hover {
  background-color: #0532FD;
}

.tv {
  height: 282px;
  display: flex;
  align-items: center;
  background-color: #000;    
  padding: 20px;
  box-sizing: border-box;
  margin-right: 20px;
}

.tv video {
  width: 100%;
  height: 100%;
}

html, body {
  min-height: 100%;
}
              
            
!

JS

              
                //Javascript is imported from my other pen, 
//otherwise it would blow up:
//https://codepen.io/gregh/pen/Zexbwo

//I created a project, where you can check the code in separate files:
//https://codepen.io/gregh/project/editor/aAexRX/




/*
The video snippets are taken from the following YouTube videos:

zelda: https://www.youtube.com/watch?v=hhb3LqLtTBM
pacman: https://www.youtube.com/watch?v=jINUCRdN6lw
mario: https://www.youtube.com/watch?v=rc62hFksKo4&
metroid: https://www.youtube.com/watch?v=Ti1V0YMULGs
kirby: https://www.youtube.com/watch?v=rJXM4EPbPe0

*/
              
            
!
999px

Console