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.

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="container">
  <div class="item">
    <div class="menu-con">
      <div class="menu-item">
        <div class="fa fa-file"></div>Dashboard</div>
      <div class="menu-item">
        <div class="fa fa-user"></div>Profile</div>
      <div class="menu-item">
        <div class="fa fa-bell"></div>Notifications</div>
      <div class="menu-item">
        <div class="fa fa-comments"></div>Messages</div>
      <div class="menu-item">
        <div class="fa fa-cog"></div>Settings</div>
    </div>
    <div class="card-con">
      <div class="header">
        <div class="header-icon"><i class="fa fa-equals"></i></div>
        <div class="header-title">Notifications</div>
        <div class="search-icon"><i class="fa fa-search"></i></div>
      </div>
      <div class="card-body">
        <div class="line"></div>
        <div class="news one">
          <div class="circle"></div>
          <div class="text-con">
            <div class="time">9:24 AM</div>
            <div class="description">
              <b>John Walker</b> posted a photo on your wall.
            </div>
          </div>
        </div>
        <div class="news two">
          <div class="circle"></div>
          <div class="text-con">
            <div class="time">9:24 AM</div>
            <div class="description">
              <b>John Walker</b> posted a photo on your wall.
            </div>
          </div>
        </div>
        <div class="news three">
          <div class="circle"></div>
          <div class="text-con">
            <div class="time">9:24 AM</div>
            <div class="description">
              <b>Donald Pen</b>  added you as friend.
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="signature">
  <a href="https://twitter.com/its_sheyii" target='_blank'>Created by Seyi Oluwadare</a>
</div>
            
          
!

CSS

            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:700,400);

body {
  margin: 0;
  padding: 0;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  overflow: hidden;
}

.container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to top, #264057 0%, #b2daff 100%);
  width: 400px;
  height: 400px;
  border-radius: 5px;
  box-shadow: 4px 8px 16px 0 rgba(0, 0, 0, 0.3);
  
  .menu-active {
    transform: translateX(-60px);
  }
  
  .card-active {
    transform: translateX(130px);
  }

  .menu-con {
    height: 270px;
    width: 200px;
    position: absolute;
    // top: 60px;
    background: #43627d;
    color: #93b2cd;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0 10px;
    transition: all 0.3s ease-in-out;
    box-shadow: 4px 8px 12px 0 rgba(0, 0, 0, 0.3);

    .menu-item {
      cursor: pointer;
      transition: color 0.3s ease-in-out;
      &:hover {
        color: #ffffff;
      }
    }
    .fa {
      padding: 0 10px;
    }
  } //menu-con

  .card-con {
    display: flex;
    flex-direction: column;
    width: 300px;
    height: 320px;
    transition: all 0.3s ease-in-out;

    box-shadow: 4px 8px 12px 0 rgba(0, 0, 0, 0.3);

    .header {
      display: flex;
      justify-content: space-around;
      align-items: center;
      position: relative;
      color: white;
      background: #5f98cd;
      height: 90px;
      &-title {
        font-weight: bold;
        font-size: 16px;
      }
      .header-icon,
      .search-icon {
        cursor: pointer;
      }
    }
    .card-body {
      position: relative;
      background: #ffffff;
      height: 400px;
      .line {
        height: 260px;
        position: absolute;
        width: 4px;
        left: 27px;
        background-color: #ebebeb;
      }
      .news {
        position: relative;
        display: flex;
        flex-direction: column;
        left: 22px;
        opacity: 1;
        
        .circle {
          border-radius: 50%;
          border: 2px solid #5f98cd;
          height: 10px;
          width: 10px;
          background: white;
          box-shadow: 0 0 0 4px white;
        }

        .text-con {
          margin: 0 20px;
          margin-top: -15px;
          width: 240px;
          color: #707070;
          font-size: 15px;
          cursor: pointer;
          &:hover {
            color: #5f98cd;
          }
          .time {
            font-size: 12px;
          }
          .description {
            margin-bottom: 8px;
          }
        } // text-con
      }
    } //card-body
  } //card-con
}

.one {
  top: 20px;
  animation: slide 1s ease-in-out;
}

.two {
  top: 45px;
  animation: slideTwo 1s ease-in-out;
}

.three {
  top: 70px;
  animation: slideThree 1s ease-in-out;
}

@keyframes slide {
  0% {
    opacity: 0;
    top: 60px;
  }
  
  40%, 100% {
    opacity: 1;
  }
}

@keyframes slideTwo {
  0%, 30% {
    opacity: 0;
    top: 80px;
  }
  
  70%, 100% {
    opacity: 1;
  }
}

@keyframes slideThree {
  0%, 60% {
    opacity: 0;
    top: 100px;
  }
  
  100% {
    opacity: 1;
  }
}

.signature {
  font-size: 14px;
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-weight: bold;
  font-style: italic;
  cursor: pointer;
  a {
    text-decoration: none;
    color: #000000;
  }
}

            
          
!

JS

            
              const headerIcon = document.querySelector(".header-icon");
const card = document.querySelector(".card-con");
const menu = document.querySelector(".menu-con");


headerIcon.addEventListener("click", () => {
  card.classList.toggle('card-active');
  menu.classList.toggle('menu-active');
});
            
          
!
999px

Console