Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <div class="cassette">
  <div class="yellow">
    <h1>Best Mixtape Ever</h1>
    <div class="middle">
      <div class="l">
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
      </div>
      <div class="m"></div>
      <div class="r">
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
      </div>
    </div>
  </div>
  <div class="bottom">
      <div class="middle"></div>
      <div class="l sides"></div>
      <div class="r sides"></div>
  </div>
</div>
              
            
!

CSS

              
                $t: transparent;
$bk: #FFC700;


@mixin on-circle($item-count, $circle-size, $item-size) {  
  position: relative;
  width:  $circle-size;
  height: $circle-size;
  border-radius: 50%;
  padding: 0; 
  list-style: none;
  
  > * {
    display: block;
    position: absolute;
    top:  50%; 
    left: 50%;
    margin: -($item-size / 2);
    width:  $item-size;
    height: $item-size;
  
    $angle: (360 / $item-count);
    $rot: 0;
 
    @for $i from 1 through $item-count {
      &:nth-of-type(#{$i}) {
        transform: rotate($rot * 1deg) translate($circle-size / 2) rotate($rot * -1deg);
      }
 
      $rot: $rot + $angle;
    }
  }
}


body {

  font-size: 1.5vmin;
  background: 
  #ffc700;
      
 width:100vw;
  height:100vh;
  
}
.cassette {  
  width: 46em; 
  height: 28.5em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 13px;
  background: 
    linear-gradient(
      to right,
      rgba(#fff,.7), 
      #DCDBD2) 
      0% 88% / 3em 8em,    
    linear-gradient(
      #DCDBD2 49%, 
      #DCDBD2 51%) 
      0% 88% / 3em 8em,
    linear-gradient(
      to right,
      rgba(#fff,1), 
      #fff) 
      100% 88% / 1em 8em,      
    linear-gradient(
      #fff 49%, 
      #fff 51%) 
      100% 88% / 3em 8em,    
    ;
  background-repeat: no-repeat;
  &:after {
  box-shadow: 
    -10px 0 15px -2px rgba(#232323,.2),
    -10px 0 25px 12px rgba(#3d3d3d,.5), 
    -45px 0 15px -2px rgba(#232323,.3),
    15px 0 25px 15px rgba(#232323,.2),
    0 0 85px 30px rgba(#3d3d3d,.2),
    0 0 5px 5px rgba(#232323,.1)
    ;    
    content: "";
    width: 45em;
    height: 28.5em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 13px;
    background: 
    linear-gradient(
      #fff 49%, 
      #F5F5F5 51%) 
      50% 100% / 100% .5em
    ;

  }
  .yellow{
    h1{
      font-family: 'Indie Flower', cursive;
      font-size:4em;
      text-align:center;
      margin-top:15px;
    }
    z-index:4;
    box-shadow: 
      inset 0px 0px 1px 0 rgba(#fff,1),      
      inset 0px 0px 5px 0 rgba(#cd9e00,1)
      ;  
    width: 40em;
    height: 18em;
    border-radius: 7px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);   
    position:absolute;
    background: rgba(#FEDE00,1);
    .middle{
      width: 26em;
      height:6em;
      position: absolute;
      top: 57%;
      left: 50%;
      transform: translate(-50%, -50%);
      background:  
    linear-gradient(
      to left,
      $t,
      #F4F5F0, 
     rgba(#CFCECA,.2)) 
    26% 50% /1em 5em,         
    linear-gradient(
      #F4F5F0 49%, 
     #F4F5F0 51%) 
    26% 0% /2em 6em,          
    linear-gradient(
      #fff 20%, 
     #CFCECA) 
    19% 7% /4em .5em,  
    linear-gradient(
      to right,
      $t,
      #F4F5F0, 
     rgba(#CFCECA,.2)) 
    77% 50% /1em 5em,         
    linear-gradient(
      #F4F5F0 49%, 
     #F4F5F0 51%) 
    74% 0% /2em 6em,          
    linear-gradient(
      #fff 20%, 
     #CFCECA) 
    87% 7% /4em .5em,         
// left square         
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba(#232323, .6),
      rgba(#232323, .3) 50%, 
      rgba($t, 0) 53%)
      4% 56% / 4.5em 4.5em,         
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba($bk, 1) 50%, 
      rgba($t, 0) 51%)
      3.5% 50% / 4.7em 4.7em,           
        // right square 
    radial-gradient(
      100% 100% at 70% 50%, 
      rgba(#232323, .6),
      rgba(#232323, .3) 50%, 
      rgba($t, 0) 53%)
      92% 54% / 4.5em 4.5em,         
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba($bk, 1) 50%, 
      rgba($t, 0) 51%)
      94% 50% / 4.7em 4.7em,
// middle square 
    linear-gradient(
      #F4F5F0 49%, 
     #F4F5F0 51%) 
    74% 0% /2em 6em,        
    linear-gradient(
      #F4F5F0 49%, 
      #F4F5F0 51%) 
    50% 0% /10em .5em,    
    linear-gradient(
      #F4F5F0 49%, 
      #F4F5F0 51%) 
    50% 100% /10em .5em,  
    linear-gradient(
      #F4F5F0 49%, 
     #F4F5F0 51%) 
    26% 0% /2em 6em,           
    radial-gradient(
      100% 100% at 0% 50%, 
      rgba(#D3CECA, 1) 50%, 
      rgba($t, 0) 53%)
      32% 50% / 3em 4.5em,         
    radial-gradient(
      100% 100% at 100% 50%, 
      rgba(#D3CECA, 1) 50%, 
      rgba($t, 0) 53%)
      68% 50% / 3em 4.5em,         
    radial-gradient(
      100% 100% at 100% 50%, 
      rgba(#232323, 1) 50%, 
      rgba($t, 0) 51%)
      48% 50% / 10em 10em,            
    linear-gradient(
      to right,
      rgba(#232323,.4) 19%, 
      rgba(#232323,.8) 51%) 
    50% 50% / 9.5em 5em,       
    linear-gradient(
      $bk 49%, 
      $bk 51%) 
    50% 50% / 9.5em 5em, 
// main middle square   
     
    linear-gradient(
      #F4F5F0 49%, 
      #F4F5F0 51%) 
    50% 0% / 19em 6em,   
// left square          
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba(#F4F5F0, 1) 50%, 
      rgba($t, 0) 51%)
      1% 0% / 6em 6em,   
// right square           
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba(#F4F5F0, 1) 50%, 
      rgba($t, 0) 51%)
      99% 0% / 6em 6em,         
        ;
      background-repeat: no-repeat;
      .l{
        width: 4.5em;
        height: 4.5em; 
        border: 1px solid #F4F5F0;
        content: '';
        position: absolute;
        border-radius: 50%;
        box-shadow: inset 0 0 10px 10px rgba(#232323,.9);
        left:2%;
        top: 50%; 
        transform: translate(0%, -50%);  
        @include on-circle($item-count: 6, $circle-size: 4.7em, $item-size: .6em);        .dot{
          width: .4em;
          height:.7em;
          background: #F4F5F0; 
        }
        &:after{
          content: '';
          width: 4em;
          height:4em;
          position:absolute;
          border-radius: 50%;
          top: 50%;
          left:-1%;
          transform: translate(0%, -50%);  
        }        
      }
      .r{
        width: 4.5em;
        height: 4.5em; 
        border: 1px solid #F4F5F0;
        content: '';
        position: absolute;
        border-radius: 50%;
        box-shadow: inset 0 0 10px 10px rgba(#232323,.9);
        left:67%;
        top: -30%; 
        transform: translate(50%, -50%);  
        @include on-circle($item-count: 6, $circle-size: 4.7em, $item-size: .6em);        .dot{
          width: .4em;
          height:.7em;
          background: #F4F5F0; 
        }
        &:after{
          content: '';
          width: 4em;
          height:4em;
          position:absolute;
          border-radius: 50%;
          top: 50%;
          left:-1%;
          transform: translate(0%, -50%);  
        }        
      } 
    }
  }
  .bottom{
     z-index:4;
    width: 32.2em;
    height: 7.5em;
    position: absolute;
    top: 87%;
    left: 50%;
    transform: translate(-50%, -50%); 
    // 
    &:after{
      content: '';
      position: absolute;
      width: 29em;
      height: 7.5em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);    
      background:
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba(#232323, .5),
      rgba(#232323, .8) 50%, 
      rgba($t, 0) 53%)
      26% 80% / 1.5em 1.5em,         
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba($bk, 1),
      rgba($bk, 1) 50%, 
      rgba($t, 0) 53%)
      26% 80% / 1.5em 1.5em,        
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba(#232323, .5),
      rgba(#232323, .8) 50%, 
      rgba($t, 0) 53%)
      74.5% 80% / 1.5em 1.5em,         
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba($bk, 1),
      rgba($bk, 1) 50%, 
      rgba($t, 0) 53%)
      74.5% 80% / 1.5em 1.5em,          
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba(#232323, .5),
      rgba(#232323, .8) 50%, 
      rgba($t, 0) 53%)
      93% 88% / 2em 2em,         
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba($bk, 1),
      rgba($bk, 1) 50%, 
      rgba($t, 0) 53%)
      93% 88% / 2em 2em,         
                
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba(#232323, .5),
      rgba(#232323, .8) 50%, 
      rgba($t, 0) 53%)
      7% 88% / 2em 2em,         
    radial-gradient(
      100% 100% at 50% 50%, 
      rgba($bk, 1),
      rgba($bk, 1) 50%, 
      rgba($t, 0) 53%)
      7% 88% / 2em 2em,         
        ;
      background-repeat: no-repeat;
    }
    .middle{
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);      
      width: 28.5em;
      height: 100%; 
      position: absolute;
      position:absolute;
      background:#F6F7F2;
      // background:red;
      box-shadow: 0px 0 10px rgba(#888,.3);       
      // z-index:2;
      &:after{
       
      width: 29em;
      height: 7.5em;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);         
        content: '';
        position: absolute;
      }
    }
    .sides{
      
      width: 33.3%;
      height: 100%;
      position: absolute;
    }
      .l{   
        border-top-left-radius:5px;
    box-shadow: 
      -5px 2px 5px -1px rgba(#888,.3)
      ;         
        position:absolute;
      transform: skew(-11deg) translate(-50%, -50%);
      top: 50%;
      left: 17%;
      background:#F6F7F2;
      }   
      .r{     
    border-top-right-radius:5px;       
    box-shadow: 
      5px 2px 5px -1px rgba(#888,.3)
      ;         
        position:absolute;
      transform: skew(11deg) translate(-50%, -50%);
      top: 50%;
      left: 83%;
      background:#F6F7F2;
      }    
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console