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.

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

              
                <main>
  <header>
    <span><i class="fa fa-arrow-left"></i><span class="sr-only">Back</span></span>
    <h3>Today</h3>
    <div class="task-indicators">
      <span>5</span>
      <span><i class="fa fa-check"></i>12</span>
    </div>
  </header>

  <section class="task-list current">
    <h2>Do it now!</h2>
    <ul>
      <li>
        <div class="checkbox">
          <div class="check">
            <input type="checkbox" name="task_00">
            <div class="ripple-container">
              <div class="check-off"></div>
              <div class="check-on"><i class="fa fa-check"></i></div>
              <div class="check-ripple"></div>
            </div>
          </div>
          <div class="label">
            <mark>Cool task</mark>
            <br>
            <time datetime="05-12-2016">12 March 2016 - h 9:30 am</time>
          </div>
        </div>
        <span class="task-msg">Well done!</span>
      </li>
      <li>
        <div class="checkbox">
          <div class="check">
            <input type="checkbox" name="task_00">
            <div class="ripple-container">
              <div class="check-off"></div>
              <div class="check-on"><i class="fa fa-check"></i></div>
              <div class="check-ripple"></div>
            </div>
          </div>
          <div class="label">
            <mark>Cool task</mark>
            <br>
            <time datetime="05-12-2016">12 March 2016 - h 9:30 am</time>
          </div>
        </div>
        <span class="task-msg">Well done!</span>
      </li>
      <li>
        <div class="checkbox">
          <div class="check">
            <input type="checkbox" name="task_01">
            <div class="ripple-container">
              <div class="check-off"></div>
              <div class="check-on"><i class="fa fa-check"></i></div>
              <div class="check-ripple"></div>
            </div>
          </div>
          <div class="label">
            <mark>Another task which takes more than one line</mark>
            <br>
            <time datetime="05-12-2016">12 March 2016</time>
          </div>
        </div>
        <span class="task-msg">Well done!</span>
      </li>
      <li>
        <div class="checkbox">
          <div class="check">
            <input type="checkbox" name="task_02">
            <div class="ripple-container">
              <div class="check-off"></div>
              <div class="check-on"><i class="fa fa-check"></i></div>
              <div class="check-ripple"></div>
            </div>
          </div>
          <div class="label">
            <mark>Cool task</mark>
            <br>
            <time datetime="05-12-2016">12 March 2016</time>
          </div>
        </div>
        <span class="task-msg">Well done!</span>
      </li>
    </ul>
  </section>

  <section class="task-list notcurrent">
    <h3>Do it later</h3>
    <ul>
      <li>
        <div class="checkbox">
          <div class="check">
            <input type="checkbox" name="task_03">
            <div class="ripple-container">
              <div class="check-off"></div>
              <div class="check-on"><i class="fa fa-check"></i></div>
              <div class="check-ripple"></div>
            </div>
          </div>
          <div class="label">
            <mark>Cool task</mark>
            <br>
            <time datetime="05-12-2016">12 March 2016</time>
          </div>
        </div>
        <span class="task-msg">Well done!</span>
      </li>
      <li>
        <div class="checkbox">
          <div class="check">
            <input type="checkbox" name="task_03">
            <div class="ripple-container">
              <div class="check-off"></div>
              <div class="check-on"><i class="fa fa-check"></i></div>
              <div class="check-ripple"></div>
            </div>
          </div>
          <div class="label">
            <mark>Cool task</mark>
            <br>
            <time datetime="05-12-2016">12 March 2016</time>
          </div>
        </div>
        <span class="task-msg">Well done!</span>
      </li>
      <li>
        <div class="checkbox">
          <div class="check">
            <input type="checkbox" name="task_04">
            <div class="ripple-container">
              <div class="check-off"></div>
              <div class="check-on"><i class="fa fa-check"></i></div>
              <div class="check-ripple"></div>
            </div>
          </div>
          <div class="label">
            <mark>Cool task</mark>
            <br>
            <time datetime="05-12-2016">12 March 2016</time>
          </div>
        </div>
        <span class="task-msg">Well done!</span>
      </li>
    </ul>
  </section>
</main>
              
            
!

CSS

              
                /*
Photo credits: https://stocksnap.io/
Pen inspired by Radek Skrzypczak Dribbble. Check it out: https://dribbble.com/shots/2516608-Completed-task-animation
*/

@import "bourbon";
$color1: #1C1D1F; // black
$color2: #F75851; // red
$color3: #DBD5D5; // light gray
$color4: #FFF; // white

$font1: 'Open Sans', sans-serif;

body {
  background-color: $color4;
  font-family: $font1;
  font-size: 14px;
}

html, body {
  * {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
}

main {
  width: 90%;
  max-width: 425px;
  margin: 30px auto;
  background-color: $color1;
  position: relative;
  z-index: 0;

  header {
    text-align: justify;
    color: $color4;
    line-height: 0;
    padding: 10px 5%;
    position: relative;

    span, h3, .task-indicators {
      display: inline-block;
      width: auto;
      line-height: 1.5;
    }

    h3 {
      @include transform(translateX(-50%));
      position: absolute;
      left: 50%;
      font-weight: 400;
    }

    .task-indicators {
      font-size: 12px;

      span {
        padding: 0 8px;
        border-radius: 2px;
        border: 1px solid currentColor;
        display: inline-block;
        margin-left: 5px;

        &:nth-child(1) {
          color: $color2;
        }

        &:nth-child(2) {
          color: darken($color3, 20%);

          i[class*="fa-"] {
            padding-right: 3px;
          }
        }
      }
    }

    &:after {
      content: '';
      display: inline-block;
      width: 100%;
    }
  }
}

header {
  background-color: $color1;
}

mark {
  background-color: transparent;
}

h2 {
  font-size: 21px;
}

.checkbox {
  text-align: justify;
  direction: rtl;
  position: relative;
  line-height: 0;

  &:after {
    content: '';
    width: 100%;
    display: inline-block;
  }

  input, .label, .check {
    display: inline-block;
    vertical-align: middle;
  }

  .label {
    max-width: 200px;
  }

  .check {
    position: relative;
  }

  input[type="checkbox"] {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;

    &:focus {
      outline: 0;
    }

    &:checked {
      + .ripple-container {

        .check-off {
          border-color: $color4;
        }

        .check-on {
          @include transform(scale(0.8));
          @include transition(transform .3s);
          color: $color4;
        }

        .check-ripple {
          &:before, &:after {
            @include transition(all 0.65s cubic-bezier(0.25, 0.8, 0.25, 1));
            opacity: 0;
          }

          &:before {
            @include transform(scale(3));
          }

          &:after {
            @include transform(scale(1.5));
          }
        }
      }
    }
    
    + .ripple-container {
      width: auto;
      position: relative;
      display: inline-block;
      width: 25px;
      height: 25px;
      top: 2px;
      pointer-events: none;

      &:before {
        content: '';
        position: absolute;
        border-radius: 2px;
        display: block;
        height: auto;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        @include transition(all .5s);
      }

      .check-off {
        position: absolute;
        width: 25px;
        height: 25px;
        left: 0;
        top: 0;
        border-radius: 2px;
        border: 2px solid lighten($color2, 15%);
        transition: border-color ease 0.28s;
      }

      .check-on {
        @include transform(scale(0));
        @include transition(all 0s);
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        text-align: center;
        line-height: 25px;
      }

      .check-ripple {
        &:before, &:after {
          @include transition(all 0s);
          @include transform(scale(0));
          content: '';
          position: absolute;
          display: block;
          border-radius: 50%;
          width: 25px;
          height: 25px;
          opacity: 1;
        }

        &:before {
          background-color: rgba(white, .35);
        }

        &:after {
          background-color: rgba($color3, .6);
        }
      }
    }
  }
}

// SECTIONS
.task-list {
  position: relative;
  color: $color4;
  padding: 15px 25px;

  mark {
    color: $color4;
    display: inline-block;
    margin-bottom: 3px;
  }

  time {
    font-weight: 300;
    font-size: 12px;
  }


  h2 {
    margin: 10px 0;
    font-weight: 700;
  }

  h3 {
    margin: 0 0 10px;
    text-align: center;
    text-transform: uppercase;
    color: lighten($color1, 50%);
    font-size: 14px;
    font-weight: 400;
  }

  ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;

    li {
      @include transition(all 0.2s ease-out);
      padding: 15px 0;
      position: relative;

      .label {
        @include transition(all 0.2s ease-out);
        margin-bottom: 2px;
        line-height: 1.2;
        direction: ltr;
        text-align: left;
        opacity: 1;
      }

      .task-msg {
        @include transform(translate3d(0, -50%, 0));
        right: 40px;
        top: 47%;
        position: absolute;
        text-transform: uppercase;
        font-size: 12px; 
        opacity: 0;
      }
      
      /* CHECKED STYLE */
      // The following class is added to the <li> item when the relative checkbox get checked
      &.task-checked {

        .task-msg {
          @include animation(fadeInOut 2s);
        }

        .label {
          opacity: 0.5;
        }
      }
    }
  }

  &.current {
    @include linear-gradient(45deg, rgba(214,43,49,1) 0%, rgba($color2,1) 100%);
    z-index: 1;

    ul {
      li {
        border-top: 1px solid lighten($color2, 5%);
      }
    }

    &:after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0.1;
      z-index: 0;
      background: {
        image: url('https://snap-photos.s3.amazonaws.com/img-thumbs/960w/XNZTUL720T.jpg');
        repeat: no-repeat;
        size: cover;
        position: center;
      }
    }    
  }

  &.notcurrent {
    color: lighten($color4, 5%);
    background-color: $color1;

    ul {
      li {
        border-top: 1px solid lighten($color1, 10%);
      }
    }

    ul, mark {
      color: lighten($color1, 35%);
    }

    .checkbox {
      input[type="checkbox"] {
        + .ripple-container {
          .check-off {
            border: 2px solid $color4;
          }
        }
      }
    }
  }
}

// ANIMATIONS //
@include keyframes(fadeInOut) {
  0% {
    opacity: 0;
    @include transform(translate3d(10px, -50%, 0));
  }

  30% {
    opacity: 1;
    @include transform(translate3d(0, -50%, 0));
  }

  75% {
    opacity: 1;
    @include transform(translate3d(0, -50%, 0));
  }

  100% {
    opacity: 0;
    @include transform(translate3d(-10px, -50%, 0));
  }
}
              
            
!

JS

              
                (function($) {

  /* Select the checkbox */
  var checkList = $('.check'),
      toDoCheck = checkList.children('input[type="checkbox"]');

  /* Check out whether checkbox is checked, and add 'task-checked' class to
    the closest <li> item
  */
  toDoCheck.each(function(index, element) {
    var $this = $(element),
        taskItem = $this.closest('li');

    $this.on('click', function(e) {
       taskItem.toggleClass('task-checked');
    });
  });

})(jQuery);
              
            
!
999px

Console