cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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">
  <article class="message">
    <div class="message__header-controls">
      <a class="btn btn--warning js-delete" href="#">
        <small class="icon-trash">
          sure?
        </small>
      </a>
    </div>
    <header class="message__header js-undo">
      <figure class="avatar">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4848/profile/profile-80_1.jpg">
          <div class="message__header-features"></div>
        </img>
      </figure>
      <div class="message__header-col">
        <h2 class="message__header-name">
          John Edwards
        </h2>
        <time class="message__header-timestamp timestamp">
          <small class="icon-time"></small>
          18 de sep. de 2013 11:49
        </time>
        <span class="message__header-email">
          <small class="icon-envelope-alt"></small>
          john.example@example.com
        </span>
      </div>
    </header>
    <blockquote class="message__body">
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur saepe ipsa accusantium praesentium tenetur alias ipsum voluptatem optio porro eveniet cum adipisci a sequi earum harum! Fugit ipsam nisi doloribus.</p>
    </blockquote>
    <div class="message__footer">
      <textarea placeholder="Comment..."></textarea>
    </div>
  </article>
</div>

            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Raleway);
@keyframes show{
  0%{
    opacity: 0;
  }
 70%{
   opacity: 1;
 }
 100%{
  opacity: 0;
 }
}
body{
  font-family: 'Raleway', sans-serif;
  background-color: grey;
}
small[class*=icon-]{
  color: #8fa5b3;
}

.container{
  position: relative;
  height: auto;
  width: 500px; 
  margin: 20% auto;
  
  overflow: hidden;
  box-sizing: border-box;
  &:after{
    content: '1 message deleted';
    position: absolute; 
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    height: 20%;
    width: 200px;
    z-index: -1;
    text-align: center;
    font-size: .9em;
    color: white;
    opacity: .6;
    transition: opacity 2.4s;
  }
  &.anim{ 
    .message__header-controls{
      transform: translateX(-90px);
    }
    .message__header{
       transform: translateX(-90px);
       opacity: .45;
    }
  }
  &.deleting{
    .message{
      transform: translateX(-500px);
    } 
    &:after{
      animation: show 2s forwards;
    }
  }
  
}
.message{
  position: relative;
  width: 500px; 
  overflow: hidden;
  box-sizing: border-box;
  background-color: #e0e3ed;
  transition: transform .4s;
}
.avatar{
  display: table-cell;
  background: white;
  padding: 2px;
  width: 75px;
  height: 75px;
  border-radius: 50%;
  box-shadow: 1px 0px 1px rgba(0,0,0,.3);
  overflow: hidden;
  
  > img{
    width: 100%;  
    border-radius: inherit;
    vertical-align: middle;
  }
}
.message__header{
  position: relative;
  width: 120%;
  padding: 10px;
  overflow: hidden;
  border-bottom: 1px solid #cbd8e2 ;
  transition: transform .3s;

}
.message__header-controls{
  position: absolute;
  width: 200px;
  top: 0;
  margin-left: 475px;
  z-index: 1;
  transition: transform .3s;
  
  .btn{
    display: block;
    padding: 10px 10px;
    color: white;
    float: left;
    width: 100%;
    text-decoration: none;
    font-size: .9em;
    &.btn--warning{
      background: #cb4437;
        > small[class*='icon-']{
          color: white;
        }
     &:hover{
      background: darken(#cb4437,5%)
     }
    }
  }
}
.message__header-col{
  display: table-cell;
  vertical-align: top;
  padding-left: 10px;
  span, time{
   display: block;
   font-size: .8em;
   line-height: 1.4em;
   text-shadow: -1px 1px 0px white;
  }
}
.message__header-name{
  color: #3d516e;
  line-height: 1.5em;
  text-shadow: -1px 1px 0px white;
}
.message__header-features{
}
.message__body{
  clear: left;
  background: #f3f5f9;
  padding: 10px;
  border-top: 1px solid white;
  border-bottom: 1px solid #cbd8e2 ;
  > p{
   font-size: .9em;
   line-height: 1.4em;
  }
}
.message__header-actions-lnk{
 float: right;
 margin-right: 15%;
 color: black;
 text-decoration: none;
}
.message__footer{
  padding: 10px;
  border-top: 1px solid white;
  textarea{
    width: 100%;
    box-sizing: border-box;
    border: none;
    height: 30px;
    padding: 4px;
    line-height: 20px;
    resize: none;
    &:focus{
      transition: min-height .8s;
      min-height: 100px;
    }
  }
}

            
          
!
            
              $('.js-delete').on 'click', (e)->
 e.preventDefault()
 $this = $(this)
 setTimeout ( ->
  $this.addClass('js-confirm-delete')
 ), 100
 $(this).parents('.container').addClass('anim')
$('body').on 'click', '.js-confirm-delete', (e)->
 e.preventDefault()
 $(this).parents('.container').addClass('deleting')
$('.js-undo').on 'click', (e)->
 $(this).parents('.container').removeClass('anim')
 $(this).parent().find('.js-delete').removeClass('js-confirm-delete');
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console