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

            
              <div class="container">
  <div class="box">
    <div class="box__row">
      <div data-cell='1' class="box__row-cell">
        <div class="box__row-cell-info">
          <p class='box__row-cell-info-ep'>EP <span>04</span></p>
        </div>
        <div class="box__row-cell-info">
          <p class='box__row-cell-info-title'>Proxima Nova is Over</p>
        </div>
        <div class="box__row-cell-info">
          <div class="box__row-cell-info-sign"></div>
        </div>
        <div class="box__row-cell-info box__row-cell-info--time">
          <p>43 minutes</p>
        </div>
        <div class="box__row-cell-info--full">
          <h1 class="box__row-cell-info--full-heading">Proxima Nova is Over</h1>
          <p class="box__row-cell-info--full-par">
            Seriously though, it's over.
          </p>
        </div>
      </div>


      <div data-cell='2' class="box__row-cell">
        <div class="box__row-cell-info">
          <p class=' box__row-cell-info-ep'>EP <span>03</span></p>
        </div>
        <div class="box__row-cell-info">
          <p class=' box__row-cell-info-title'>Proxima Nova is Over</p>
        </div>
        <div class="box__row-cell-info">
          <div class="box__row-cell-info-sign"></div>
        </div>
        <div class="box__row-cell-info box__row-cell-info--time">
          <p>44 minutes</p>
        </div>
        <div class="box__row-cell-info--full">
          <h1 class="box__row-cell-info--full-heading">Proxima Nova is Over</h1>
          <p class="box__row-cell-info--full-par">
            Seriously though, it's over.
          </p>
        </div>
      </div>
    </div>

    <div class="box__row">
      <div data-cell='3' class="box__row-cell">
        <div class="box__row-cell-info">
          <p class=' box__row-cell-info-ep'>EP <span>02</span></p>
        </div>
        <div class="box__row-cell-info">
          <p class=' box__row-cell-info-title'>Proxima Nova is Over</p>
        </div>
        <div class="box__row-cell-info">
          <div class="box__row-cell-info-sign"></div>
        </div>
        <div class="box__row-cell-info box__row-cell-info--time">
          <p>41 minutes</p>
        </div>
        <div class="box__row-cell-info--full">
          <h1 class="box__row-cell-info--full-heading">Proxima Nova is Over</h1>
          <p class="box__row-cell-info--full-par">
            Seriously though, it's over.
          </p>
        </div>
      </div>

      <div data-cell='4' class="box__row-cell">
        <div class="box__row-cell-info">
          <p class=' box__row-cell-info-ep'>EP <span>01</span></p>
        </div>
        <div class="box__row-cell-info">
          <p class=' box__row-cell-info-title'>Proxima Nova is Over</p>
        </div>
        <div class="box__row-cell-info">
          <div class="box__row-cell-info-sign"></div>
        </div>
        <div class="box__row-cell-info box__row-cell-info--time">
          <p >42 minutes</p>
        </div>
        <div class="box__row-cell-info--full">
          <h1 class="box__row-cell-info--full-heading">Proxima Nova is Over</h1>
          <p class="box__row-cell-info--full-par">
            Seriously though, it's over.
          </p>
        </div>
      </div>
    </div>

    <div data-content='1' class="box__content">
      <div class="box__content-wrapper">
        <div class="box__content-inner">
          <div class="box__content-text">
            <h2 class='box__content-text-heading'>SYNOPSIS - 43 MIN</h2>
            <p class='box__content-text-par'>
              Suspendisse non orci porta, consectetur tellus in, gravida felis. Aenean vel posuere lacus. Quisque eget rutrum elit. In eu tortor eget velit scelerisque porttitor.
            </p>
            <p class='box__content-text-par'>
              Morbi nisl metus, hendrerit eget ante sed, consequat egestas urna. Quisque et rutrum ligula, eu rutrum ex. Nunc neque mauris, laoreet eu auctor vitae, rutrum molestie dolor. Pellentesque vel vulputate elit, quis rhoncus sapien.
            </p>
            <h2 class='box__content-text-heading'>SHOW NOTES</h2>
            <ul class='box__content-text-list'>
              <li class='box__content-text-item'>
                Vitae ultrices
              </li>
              <li class='box__content-text-item'>
                Aenean vel
              </li>
              <li class='box__content-text-item'>
                Ut condimentum
              </li>
              <li class='box__content-text-item'>
                Aenean metus
              </li>
              <li class='box__content-text-item'>
                Quisque sodales
              </li>
              <li class='box__content-text-item'>
                Accumsan metus
              </li>
            </ul>
            <h2 class='box__content-text-heading'>FOLLOW</h2>
            <a class='box__content-text-link' href="https://twitter.com/mrspok407" target='_blank'>mrspok407 | @mrspok407</a><br>
            <a class='box__content-text-link' href="https://codepen.io/mrspok407/" target='_blank'>Checkout my other pens</a>
          </div>
        </div>
      </div>
    </div>

    <div data-content='2' class="box__content">
      <div class="box__content-wrapper">
        <div class="box__content-inner">
          <div class="box__content-text">
            <h2 class='box__content-text-heading'>SYNOPSIS - 44 MIN</h2>
            <p class='box__content-text-par'>
              Suspendisse non orci porta, consectetur tellus in, gravida felis. Aenean vel posuere lacus. Quisque eget rutrum elit. In eu tortor eget velit scelerisque porttitor.
            </p>
            <p class='box__content-text-par'>
              Morbi nisl metus, hendrerit eget ante sed, consequat egestas urna. Quisque et rutrum ligula, eu rutrum ex. Nunc neque mauris, laoreet eu auctor vitae, rutrum molestie dolor. Pellentesque vel vulputate elit, quis rhoncus sapien.
            </p>
            <h2 class='box__content-text-heading'>SHOW NOTES</h2>
            <ul class='box__content-text-list'>
              <li class='box__content-text-item'>
                Vitae ultrices
              </li>
              <li class='box__content-text-item'>
                Aenean vel
              </li>
              <li class='box__content-text-item'>
                Ut condimentum
              </li>
              <li class='box__content-text-item'>
                Aenean metus
              </li>
              <li class='box__content-text-item'>
                Quisque sodales
              </li>
              <li class='box__content-text-item'>
                Accumsan metus
              </li>
            </ul>
            <h2 class='box__content-text-heading'>FOLLOW</h2>
            <a class='box__content-text-link' href="https://twitter.com/mrspok407" target='_blank'>mrspok407 | @mrspok407</a><br>
            <a class='box__content-text-link' href="https://codepen.io/mrspok407/" target='_blank'>Checkout my other pens</a>
          </div>
        </div>
      </div>
    </div>

    <div data-content='3' class="box__content">
      <div class="box__content-wrapper">
        <div class="box__content-inner">
          <div class="box__content-text">
            <h2 class='box__content-text-heading'>SYNOPSIS - 41 MIN</h2>
            <p class='box__content-text-par'>
              Suspendisse non orci porta, consectetur tellus in, gravida felis. Aenean vel posuere lacus. Quisque eget rutrum elit. In eu tortor eget velit scelerisque porttitor.
            </p>
            <p class='box__content-text-par'>
              Morbi nisl metus, hendrerit eget ante sed, consequat egestas urna. Quisque et rutrum ligula, eu rutrum ex. Nunc neque mauris, laoreet eu auctor vitae, rutrum molestie dolor. Pellentesque vel vulputate elit, quis rhoncus sapien.
            </p>
            <h2 class='box__content-text-heading'>SHOW NOTES</h2>
            <ul class='box__content-text-list'>
              <li class='box__content-text-item'>
                Vitae ultrices
              </li>
              <li class='box__content-text-item'>
                Aenean vel
              </li>
              <li class='box__content-text-item'>
                Ut condimentum
              </li>
              <li class='box__content-text-item'>
                Aenean metus
              </li>
              <li class='box__content-text-item'>
                Quisque sodales
              </li>
              <li class='box__content-text-item'>
                Accumsan metus
              </li>
            </ul>
            <h2 class='box__content-text-heading'>FOLLOW</h2>
            <a class='box__content-text-link' href="https://twitter.com/mrspok407" target='_blank'>mrspok407 | @mrspok407</a><br>
            <a class='box__content-text-link' href="https://codepen.io/mrspok407/" target='_blank'>Checkout my other pens</a>
          </div>
        </div>
      </div>
    </div>

    <div data-content='4' class="box__content">
      <div class="box__content-wrapper">
        <div class="box__content-inner">
          <div class="box__content-text">
            <h2 class='box__content-text-heading'>SYNOPSIS - 42 MIN</h2>
            <p class='box__content-text-par'>
              Suspendisse non orci porta, consectetur tellus in, gravida felis. Aenean vel posuere lacus. Quisque eget rutrum elit. In eu tortor eget velit scelerisque porttitor.
            </p>
            <p class='box__content-text-par'>
              Morbi nisl metus, hendrerit eget ante sed, consequat egestas urna. Quisque et rutrum ligula, eu rutrum ex. Nunc neque mauris, laoreet eu auctor vitae, rutrum molestie dolor. Pellentesque vel vulputate elit, quis rhoncus sapien.
            </p>
            <h2 class='box__content-text-heading'>SHOW NOTES</h2>
            <ul class='box__content-text-list'>
              <li class='box__content-text-item'>
                Vitae ultrices
              </li>
              <li class='box__content-text-item'>
                Aenean vel
              </li>
              <li class='box__content-text-item'>
                Ut condimentum
              </li>
              <li class='box__content-text-item'>
                Aenean metus
              </li>
              <li class='box__content-text-item'>
                Quisque sodales
              </li>
              <li class='box__content-text-item'>
                Accumsan metus
              </li>
            </ul>
            <h2 class='box__content-text-heading'>FOLLOW</h2>
            <a class='box__content-text-link' href="https://twitter.com/mrspok407" target='_blank'>mrspok407 | @mrspok407</a><br>
            <a class='box__content-text-link' href="https://codepen.io/mrspok407/" target='_blank'>Checkout my other pens</a>
          </div>
        </div>
      </div>
    </div>
    <div class="box__close">
      <span></span><br>
      <span></span>
      <span></span><br>
      <span></span>
      <span></span>
      <span></span>
    </div>
    <div class="box__episodes">EPISODES</div>
    <div class='box__smokebg'>
      
    </div>
    <div class='box__title'>
      <h1 class='box__title-heading'>LOREM<br>
        <span>IPSUM</span></h1>
      <p class='box__title-par'>egestas sapien</p>
    </div>
  </div>
</div>
            
          
!
            
              html {
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

*,
*:before,
*:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
}

@mixin mediaMaxH($height) {
  @media screen and (max-height: $height) {
    @content;
  }
}

$bgPageClr: #131417;
$bgCellClr: rgba(0, 0, 0, .5);
$bgContentClr: #1C1E22;
$cellHvrClr: #F25555;

$rows: 2;
$cellsInRow: 2;

$cellAnSpeed: 400 * 1ms;
$hoverDarkSpeed: 500 * 1ms;

.container {
  height: 100vh;
  background-color: $bgPageClr;
}

.box {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  width: 80%;
  height: 80%;
  background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/537051/smoke_texture2714-min.jpg') center center no-repeat;
  background-size: cover;
  box-shadow: 0 0 50px 0 rgba(75, 27, 27, .7);
  z-index: 1;
  overflow: hidden;
  &__row {
    &-cell {
      position: absolute;
      top: 35%;
      left: 50%;
      width: (50% - 2%) / $cellsInRow;
      height: (60% - 2%) / $rows;
      background-color: $bgCellClr;
      transform: translateZ(0);
      transition: all $cellAnSpeed 600ms, width 300ms 300ms, background-color 300ms 600ms;
      cursor: pointer;
      overflow: hidden;
      z-index: 2;
      &:after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: $hoverDarkSpeed;
      }
      &:before {
        content: '';
        position: absolute;
        top: -5%;
        left: -5%;
        width: 110%;
        height: 110%;
        background-color: rgba(0, 0, 0, 0);
        opacity: 1;
        transition: 300ms;
        z-index: -3;
      }
      &:hover:before {
        background-color: $cellHvrClr;
      }
      &-info {
        margin-left: 20px;
        width: 100px;
        color: #fff;
        transition: $cellAnSpeed $cellAnSpeed + 450;
        &-ep {
          margin-top: 25px;
          font-size: 10px;
          span {
            padding-left: 10px;
          }
          @include mediaMaxH(915px) {
            margin-top: 10px;
          }
        }
        &-title {
          letter-spacing: 2px;
          margin-top: 15px;
          font-size: 20px;
          @include mediaMaxH(692px) {
            margin-top: 8px;
            font-size: 18px;
          }
          @include mediaMaxH(692px) {
            font-size: 16px;
            margin-top: 4px;
          }
        }
        &-sign {
          margin: 15px 0 0 2px;
          height: 3px;
          width: 20px;
          background-color: #fff;
          border-radius: 1px;
          transition: 200ms;
          z-index: 10;
          @include mediaMaxH(800px) {
            margin-top: 10px;
          }
        }
      }
      &-info--time {
        position: absolute;
        bottom: 18px;
        font-size: 10px;
        @include mediaMaxH(650px) {
          right: 20px;
          text-align: right;
        }
      }
      &-info--full {
        transform: translateX(-50px);
        opacity: 0;
        margin: 50px 0 0 90px;
        transition: 300ms;
        &-heading {
          line-height: 60px;
          width: 300px;
          color: #131313;
          font: {
            size: 60px;
            weight: 900;
          }
        }
        &-par {
          padding-top: 50px;
          color: #fff;
        }
      }
    }
    @for $i from 1 through $cellsInRow {
      &-cell:nth-child(#{$i + 1}) {
        left: 50% + ((50% / $cellsInRow) * $i);
      }
    }
  }
  @for $i from 1 through $rows {
    &__row:nth-child(#{$i + 1}) {
      .box__row-cell {
        top: 35% + (65% / $rows) * $i;
      }
    }
  }
  &__content {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    background-color: $bgContentClr;
    transform: translateZ(0);
    opacity: 0;
    z-index: -10;
    transition: all 400ms 600ms, z-index 0ms 0ms;
    &-wrapper {
      position: relative;
      margin-left: auto;
      width: 50%;
      height: 100%;
      overflow: hidden;
    }
    &-inner {
      position: absolute;
      left: 18px;
      transform: translateX(50px);
      width: 100%;
      height: 100%;
      overflow: auto;
      opacity: 0;
      transition: $cellAnSpeed, opacity 200ms;
    }
    &-text {
      padding: 20px 0 30px 8px;
      width: 300px;
      max-width: 100%;
      color: #ababab;
      &-heading {
        position: relative;
        margin: 50px 0 20px 0;
        color: #f5f5f5;
        font: {
          size: 16px;
        }
        &:after {
          content: '';
          position: absolute;
          top: -15px;
          left: 0;
          width: 20px;
          height: 2px;
          background-color: #a73c3c;
          box-shadow: 0 0 1px 0 #a73c3c;
        }
      }
      &-par {
        line-height: 22px;
        padding-bottom: 10px;
        font: {
          size: 14px;
        }
      }
      &-list {
        list-style-type: none;
      }
      &-item {
        padding-bottom: 3px;
        font: {
          size: 14px;
        }
      }
      &-link {
        text-decoration: none;
        color: #ababab;
        font: {
          size: 14px;
        }
        &:hover {
          text-decoration: underline;
        }
      }
    }
  }
  &__close {
    position: absolute;
    top: 50px;
    left: 100px;
    height: 20px;
    width: 20px;
    font-size: 0;
    cursor: pointer;
    z-index: 9999;
    &:after,
    &:before {
      content: '';
      position: absolute;
      top: 9px;
      left: -14px;
      transform: rotate(45deg);
      width: 35px;
      height: 2px;
      background-color: #fff;
      opacity: 0;
      transition: 500ms;
    }
    &:before {
      transform: rotate(-45deg);
    }
    span {
      position: relative;
      display: inline-block;
      margin: 1px;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background-color: #fff;
      transition: $cellAnSpeed 500ms;
    }
    @for $i from 6 through 10 {
      span:nth-child(#{$i}) {
        right: 6px;
      }
    }
  }
  &__episodes {
    position: absolute;
    top: 28%;
    right: 15px;
    color: #fff;
    letter-spacing: 2px;
    font-size: 10px;
    &:after {
      content: '';
      position: absolute;
      top: -20px;
      right: 2px;
      width: 15px;
      height: 1px;
      background-color: #fff;
    }
  }
  &__smokebg {
    position: absolute;
    top: -10%;
    left: -10%;
    transform: translate3d(0, 0, 0) rotate(0.01deg);
    width: 120%;
    height: 120%;
    background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/537051/smoke-min.png') center center no-repeat;
    background-size: cover;
    z-index: -10;
    opacity: .5;
    animation: smokebg 60s infinite alternate;
    @keyframes smokebg {
      25% {
        transform: translate3d(100px, 0, 0) rotate(0.01deg)
      }
      50% {
        transform: translate3d(75px, -25px, 0) rotate(0.01deg)
      }
      75% {
        transform: translate3d(45px, 30px, 0) rotate(0.01deg)
      }
      100% {
        transform: translate3d(25px, -15px, 0) rotate(0.01deg)
      }
    }
  }
  &__title {
    position: absolute;
    top: 25%;
    left: 9%;
    &-heading {
      position: relative;
      color: #7b2222;
      letter-spacing: 3px;
      line-height: 65px;
      font: {
        size: 65px;
      }
      &:after {
        content: '';
        position: absolute;
        top: 170px;
        left: 0;
        width: 20px;
        height: 2px;
        box-shadow: 0 0 1px 0 #000;
        background-color: #000;
      }
      span {
        letter-spacing: 6px;
        color: #fff;
      }
    }
    &-par {
      text-transform: uppercase;
      margin-top: 35%;
      color: #7b2222;
      font: {
        size: 13px;
        weight: bold;
      }
    }
  }
}

.active {
  left: 0 !important;
  top: 0 !important;
  height: 100%;
  width: 50%;
  background-color: $cellHvrClr;
  z-index: 5;
  transition: all $cellAnSpeed 400ms, width 300ms $cellAnSpeed + 400;
  cursor: default;
  opacity: 1 !important;
  @for $i from 1 through 4 {
    .box__row-cell-info:nth-child(#{$i}) {
      transform: translateX(50px);
      opacity: 0;
      transition: 300ms 50ms * ($i - 1) ease-in, opacity 375ms 50ms * ($i - 1);
    }
  }
  .box__row-cell-info--full {
    transform: translateX(0);
    opacity: 1;
    transition: 300ms 900ms;
  }
}

.cell-fade {
  opacity: 0;
  transition: all $cellAnSpeed 400ms, width 300ms $cellAnSpeed + 400, opacity 200ms 300ms;
}

.hover-cell {
  &:after {
    opacity: 1;
  }
}

.show-content {
  opacity: 1;
  z-index: 2;
  transition: all 300ms $cellAnSpeed, z-index 0ms 0ms;
  .box__content-inner {
    transform: translateX(0);
    opacity: 1;
    transition: 300ms 1100ms;
  }
}

.box-close-active {
  &:after,
  &:before {
    opacity: 1;
    transform: rotate(135deg);
    transition: 500ms 800ms;
  }
  &:before {
    transform: rotate(45deg);
  }
  span {
    opacity: 0;
    transition: 0ms 800ms;
  }
}
            
          
!
            
              $(document).ready(function() {
  var animation = false,
      animDur = 1000,
      $row = $('.box__row'),
      $cell = $('.box__row-cell'),
      $content = $('.box__content'),
      $closeBtn = $('.box__close');

  var animFalse = function() {
    animation = false;
  }

  var active = function() {
    if (animation) return;
    var cellData = $(this).data('cell');
    var $content = $('.box__content[data-content=' + cellData + ']');
    animation = true;

    $cell.addClass('cell-fade');
    $(this).addClass('active');
    $content.addClass('show-content');
    $closeBtn.addClass('box-close-active');

    setTimeout(animFalse, animDur);
  }

  var close = function() {
    animation = true;
    
    $cell.removeClass('active cell-fade');
    $content.removeClass('show-content');
    $(this).removeClass('box-close-active');

    setTimeout(animFalse, animDur);
  }

  $row.on('click', '.box__row-cell', active);
  $closeBtn.on('click', close);
  $cell.on({
    mouseenter: function() {
      $cell.addClass('hover-cell');
      $(this).removeClass('hover-cell');
    },
    mouseleave: function() {
      $cell.removeClass('hover-cell');
    }
  });
});
            
          
!
999px
Loading ..................

Console