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

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

              
                <head>
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700,900" rel="stylesheet">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>
  <div class="links">
    <a href="https://github.com/thesheepman" class='git'><i class="fa fa-github" aria-hidden="true"></i></a>
    <a class="dribble" href='https://dribbble.com/shots/3678061-Card-Animation'><i class="fa fa-dribbble" aria-hidden="true"></i></a></div>
  <div class="card aqua active">
    <div class="card-month">
      <div class="card-month__name">july</div>
      <div class="card-month__divider"></div>
      <div class="card-month__date">17</div>
    </div>
    <div class="card-image"></div>
    <div class="card-content">
      <div class="card-content__author">
        <div class="author__divider"></div>
        <div class="author__name">Andrey Andrey</div>
      </div>
      <div class="card-content__title">The Blue Waves</div>
      <div class="card-content__text">
        <div class="text__time"><i class="fa fa-clock-o" aria-hidden="true"></i> 8 minutes read</div>
        <div class="text__content">
          <i>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatum error cumque repellat atque amet, officiis commodi quos explicabo dignissimos. Saepe.</i>
          <a class="text__content__button" href='#'><i class="fa fa-play-circle" aria-hidden="true"></i></a>
        </div>
      </div>
      <div class="card-content__nav" style='justify-content: flex-end'>
        <!--  <a class="nav__prev" href='#'>prev</a> -->
        <a class="nav__next" href='#'>next</a>
      </div>
    </div>
  </div>
  <div class="card green">
    <div class="card-month">
      <div class="card-month__name">june</div>
      <div class="card-month__divider"></div>
      <div class="card-month__date">21</div>
    </div>
    <div class="card-image"></div>
    <div class="card-content">
      <div class="card-content__author">
        <div class="author__divider"></div>
        <div class="author__name">Igor Mathewshonok</div>
      </div>
      <div class="card-content__title">A Green Revolution</div>
      <div class="card-content__text">
        <div class="text__time"><i class="fa fa-clock-o" aria-hidden="true"></i> 3 minutes read</div>
        <div class="text__content">
          <i>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatum error cumque repellat atque amet, officiis commodi quos explicabo dignissimos. Saepe.</i>
          <a class="text__content__button" href='#'><i class="fa fa-play-circle" aria-hidden="true"></i></a>
        </div>
      </div>
      <div class="card-content__nav">
        <a class="nav__prev" href='#'>prev</a>
        <a class="nav__next" href='#'>next</a>
      </div>
    </div>
  </div>
  <div class="card ochra">
    <div class="card-month">
      <div class="card-month__name">March</div>
      <div class="card-month__divider"></div>
      <div class="card-month__date">17</div>
    </div>
    <div class="card-image"></div>
    <div class="card-content">
      <div class="card-content__author">
        <div class="author__divider"></div>
        <div class="author__name">Abstract Museum</div>
      </div>
      <div class="card-content__title">The Mystery Path</div>
      <div class="card-content__text">
        <div class="text__time"><i class="fa fa-clock-o" aria-hidden="true"></i> 17 minutes read</div>
        <div class="text__content">
          <i>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatum error cumque repellat atque amet, officiis commodi quos explicabo dignissimos. Saepe.</i>
          <a class="text__content__button" href='#'><i class="fa fa-play-circle" aria-hidden="true"></i></a>
        </div>
      </div>
      <div class="card-content__nav">
        <a class="nav__prev" href='#'>prev</a>
        <a class="nav__next" href='#'>next</a>
      </div>
    </div>
  </div>
</body>
              
            
!

CSS

              
                // Vars
$aqua: #40daae
$green: #8fc30f
$ochra: #f7c549
$font-size: 14px
$animation-speed: .3s
@keyframes width-animate
  0%
    opacity: 0
    width: 10%
  100% 
    opacity: 1
    width: 45%
@keyframes width-animate-back
  0%
    opacity: 1 
    width: 45% 
  100% 
    opacity: 0 
    width: 10% 
//Main
body
  font-family: 'Roboto', sans-serif
  font-size: $font-size
  color: #353535
.links
  list-style: none
  float: left
  a
    display: block
    color: #353535
    font-size: 3em
    margin-left: 100px
    transition: .3s
    &.dribble:hover
      color: #ea4c89
    &.git:hover
      color: #f7c549
.inactive
  .card-image:before
    animation: width-animate-back $animation-speed forwards !important
  .author__divider
    animation: width-animate-back $animation-speed forwards !important
.active
  display: flex !important
  .card-image:before
    animation: width-animate $animation-speed forwards
  .author__divider
    animation: width-animate $animation-speed forwards
.card
  &:last-of-type
    .nav__next
      display: none
.card
  overflow: hidden
  display: none
  flex-flow: row wrap
  justify-content: flex-start
  box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.5)
  width: 60%
  margin: 0 auto
  position: relative
  height: 100vh
  .card-content
    padding: 2em 2em 2em 3em
    display: flex
    flex-direction: column
    width: 40%
    justify-content: space-between
    .card-content__nav
      display: flex
      justify-content: space-between
      flex-flow: row wrap
      margin-top: 1em
      a
        text-decoration: none
        color: #585858
        font-weight: 700
        text-transform: uppercase
        transition: .2s
        &:hover
          color: #ababab
    .card-content__text
      .text__content
        color: #a7a7a7
        margin: 2em 0em
        position: relative
        &:after
          background: linear-gradient(to top, #fff 0, transparent 100%)
          content: " "
          width: 100%
          height: 50%
          position: absolute
          left: 0
          bottom: 0
        .text__content__button
          cursor: pointer
          position: absolute
          font-size: 4em
          top: -10px
          left: 45%
      .text__time
        margin: 1em 0em
      .fa-clock-o
        padding-right: 10px
        color: #a7a7a7
    .card-content__title
      font-weight: 900
      font-size: 2em
      color: #252525
    .card-content__author
      display: flex
      flex-flow: row wrap
      justify-content: space-between
      position: relative
      margin-bottom: 2em
      .author__divider
        width: 50%
        height: 1em
        position: relative
        top: 3px
      .author__name
        font-weight: 700
        font-size: 1.2em
  .card-image
    width: 45%
    transition: width 2s
    &:before
      content: ""
      position: absolute
      width: 5%
      height: 100%
      background-size: cover
      background-position: center center
      transition: width 2s
  .card-month
    padding: 2em 1em
    display: flex
    flex-direction: column
    justify-content: space-around
    .card-month__name
      text-orientation: upright
      writing-mode: vertical-rl
      letter-spacing: 1em
      text-transform: uppercase
      font-weight: 900
    .card-month__divider
      height: 10em
      background: #000
      width: 3px
      margin-left: 8px
      margin-top: 2em
      margin-bottom: 2em
    .card-month__date
      font-weight: 900
  // Custom Cards
  &.aqua
    .card-month__divider
      background: $aqua
    .card-image:before
      background-image: url(http://i.imgur.com/Etx8s9g.jpg)
    .author__divider
      background: $aqua
    .text__content__button i
      color: $aqua
      text-shadow: 0px 0px 10px $aqua
  &.green
    .card-month__divider
      background: $green
    .card-image:before
      background-image: url(http://i.imgur.com/X5CqPG8.jpg)
    .author__divider
      background: $green
    .text__content__button i
      color: $green
      text-shadow: 0px 0px 10px $green
  &.ochra
    .card-month__divider
      background: $ochra
    .card-image:before
      background-image: url(http://i.imgur.com/NayL3CM.jpg)
    .author__divider
      background: $ochra
    .text__content__button i
      color: $ochra
      text-shadow: 0px 0px 10px $ochra
              
            
!

JS

              
                var animationSpeed = 250; //ms
var activeClass = "active";
var inactiveClass = "inactive";

$(".nav__next").click(function() {
  event.preventDefault();
  $(".card.active").addClass(inactiveClass);
  setTimeout(function() {
    $(".card.active").removeClass(activeClass).next().addClass(activeClass);
  }, animationSpeed);
});
$(".nav__prev").click(function() {
  event.preventDefault();
  $(".card.active").addClass(inactiveClass);
  setTimeout(function() {
    $(".card.active")
      .removeClass(activeClass)
      .removeClass(inactiveClass)
      .prev()
      .removeClass(inactiveClass)
      .addClass(activeClass);
  }, animationSpeed);
});

              
            
!
999px

Console