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

              
                svg style=("position: absolute; width: 0; height: 0; overflow: hidden;") version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
  defs
    symbol#icon-ellipsis-h viewbox=("0 0 32 32") 
      path d="M19.2,16A3.2,3.2,0,1,1,16,12.8,3.2,3.2,0,0,1,19.2,16Z" 
      path d="M30.2,16A3.2,3.2,0,1,1,27,12.8,3.2,3.2,0,0,1,30.2,16Z" 
      path d="M8.2,16A3.2,3.2,0,1,1,5,12.8,3.2,3.2,0,0,1,8.2,16Z" 
    symbol#icon-arrows-h viewbox=("0 0 32 32") 
      polygon points=("31 16 25 10.4 25 14.33 7 14.33 7 10.4 1 16 7 21.6 7 18 25 18 25 21.6 31 16") /



.row.first-row
  .shift
    .time-block.on-queue On Queue
    .time-block.meal Meal
    .time-block.on-queue On Queue  
    .shift-controls.hide
      ul
        li.gripper
          a href="#"
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink" 
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink"
              
.row
  .shift
    .time-block.on-queue On Queue
    .time-block.meal Meal
    .time-block.on-queue On Queue
    .shift-controls.hide
      ul
        li.gripper
          a href="#"
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink" 
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink"

.row
  .shift
    .time-block.on-queue On Queue
    .time-block.meal Meal
    .time-block.meeting Meeting
    .time-block.on-queue On Queue
    .shift-controls.hide
      ul
        li.gripper
          a href="#"
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink" 
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink"
  
.row
  .shift
    .shift.shift-pending
      .label Changes
      .time-block.time-block-pending-hatch.on-queue On Queue
      .time-block.time-block-pending-hatch.meeting Meeting
      .time-block.time-block-pending-hatch.on-queue On Queue
      .time-block.time-block-pending-hatch.meal Meal
    .shift.shift-original
      .label Original
      .time-block.on-queue On Queue
      .time-block.meeting Meeting
      .time-block.meal Meal
      .time-block.on-queue On Queue
    .shift-controls.hide
      ul
        li.gripper
          a href="#"
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink" 
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink"
        li
          a.compare-toggle href="#" Compare
        li
          a.discard-changes href="#" Discard changes

    
.row
  .shift
    .time-block.on-queue On Queue
    .time-block.meal Meal
    .time-block.on-queue On Queue
    .shift-controls.hide
      ul
        li.gripper
          a href="#"
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink" 
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink"

.row
  .shift
    .time-block.on-queue On Queue
    .time-block.meeting Meeting
    .time-block.meal Meal
    .time-block.on-queue On Queue
    .shift-controls.hide
      ul
        li.gripper
          a href="#"
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink" 
            svg.svg-icon
              use xlink:href="#icon-ellipsis-h" xmlns:xlink="http://www.w3.org/1999/xlink"
              
            
!

CSS

              
                @text-on-queue: #116486;
@text-meeting: multiply(#f00, @text-on-queue);
@text-meal: multiply(#fb3, @text-on-queue);

@bg-on-queue: #aae6fa;
@bg-meeting: mix(#f00, @bg-on-queue, 80%);
@bg-meal: mix(#fb3, @bg-on-queue, 80%);

@bg-original-on-queue: #aae6fa;
@bg-original-meeting: #f00;
@bg-original-meal: #fb3;

.row {
  display: flex;
  height: 30px;
  border-bottom: solid 1px #e8e8e8;
  align-items: center;
  justify-content: center;
  width: 100%;
  
  &.first-row {
    border-top: solid 1px #e8e8e8;
  }
}

.shift {
  position: relative;
  display: flex;
  width: 800px;
  margin: 0;
  
  &:hover {
    .time-block {
      &.on-queue {
        color: @text-on-queue;
        background: @bg-on-queue;
      }

      &.meeting {
        color: rgba(255,255,255, .95);
        background: #f00;
      }

      &.meal {
        color: @text-meal;
        background: #fb3;
      }
    }
    
    .shift-controls {
      transition: .25s ease-out;
      transition-delay: 1s;
      opacity: 1;
      height: 24px;
    }
  }
  
  > .shift.shift-original {
    position: absolute;
    bottom: 0;
    
    .label {
      top: 2px;
    }
    
    .time-block {
      border-top: solid 1px transparent;
      height: 1px;
      transition: .25s ease-in;
      transition-delay: .35s;
      
      &.on-queue {
        background: #aae6fa;
      }
      &.meeting {
        background: #f00;
      }
      &.meal {
        background: #fb3;
      }
    }
  }
  
  .label {
    color: @text-on-queue;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    left: 4px;
    position: absolute;
    opacity: 0;
    transition: .25s ease-in;
    height: 12.5px;
    line-height: 12.5px;
    z-index: 5;
  }
  
  &.shift-pending {
    .label {
      top: 0;
    }

    .time-block {
      transition-delay: .4s;
    }
  }
}

.time-block {
  cursor: pointer;
  height: 25px;
  line-height: 25px;
  font-size: 13px;
  text-align: center;
  flex: 1 0 auto;
  transition: .25s ease-in;
  
  &.on-queue {
    color: @text-on-queue;
    background: lighten(@bg-on-queue, 12.5%);
  }
  
  &.meeting {
    color: @text-meeting;
    background: lighten(@bg-meeting, 37.5%);
    max-width: 100px;
  }

  &.meal {
    color: @text-meal;
    background: lighten(@bg-meal, 27.5%);
    max-width: 150px;
  }
  
  &.time-block-pending-hatch {
    position: relative;
    font-weight: 500;

    &.on-queue {
      text-shadow: 1px 1px 0 lighten(@bg-on-queue, 12.5%), -1px 1px 0 lighten(@bg-on-queue, 12.5%), -1px -1px 0 lighten(@bg-on-queue, 12.5%), 1px -1px 0 lighten(@bg-on-queue, 12.5%);
      background-color: #e6f8fe;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2300befd' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    }
    &.meeting {
      text-shadow: 1px 1px 0 lighten(@bg-meeting, 37.5%), -1px 1px 0 lighten(@bg-meeting, 37.5%), -1px -1px 0 lighten(@bg-meeting, 37.5%), 1px -1px 0 lighten(@bg-meeting, 37.5%);
      background-color: #fcdfdf;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ff0000' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    }
    &.meal {
      text-shadow: 1px 1px 0 lighten(@bg-meal, 27.5%), -1px 1px 0 lighten(@bg-meal, 27.5%), -1px -1px 0 lighten(@bg-meal, 27.5%), 1px -1px 0 lighten(@bg-meal, 27.5%);
      background-color: #fbf2da;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffb900' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    }
  }
}

.shift:hover {
  .time-block-pending-hatch {
    &.on-queue {
      text-shadow: 1px 1px 0 #4ccdf7, -1px 1px 0 #4ccdf7, -1px -1px 0 #4ccdf7, 1px -1px 0 #4ccdf7;
      background-color: #4ccdf7;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    }

    &.meeting {
      text-shadow: 1px 1px 0 #f00, -1px 1px 0 #f00, -1px -1px 0 #f00, 1px -1px 0 #f00;
      background-color: #ff0000;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    }

    &.meal {
      text-shadow: 1px 1px 0 #fb3, -1px 1px 0 #fb3, -1px -1px 0 #fb3, 1px -1px 0 #fb3;      
      background-color: #ffbb33;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    }
  }
}

.shift-controls {
  border: solid 1px @text-on-queue;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  position: absolute;
  font-size: 12px;
  height: 24px;
  top: 0;
  left: 0;
  z-index: 10;
  width: calc(~"100% - 1px");
  
  ul {
    display: flex;
    background: rgba(17, 100, 134, .95);
    border-radius: 0 0 3px 3px;
    padding: 0;
    margin: 0;
    position: relative;
    top: 24px;
    left: -1px;
    
    li {
      display: flex;
      justify-content: center;
      align-items: center;
      margin: 0;
      padding: 4px 8px;
      list-style-type: none;
      
      a {
        color: #fff;
        text-decoration: none;
        flex: 0 0 auto;
        display: inline-block;
        
        &:hover {
          text-decoration: underline;
        }
        
        &.discard-changes {
          padding-right: 8px;
        }
      }
      
      &.gripper {
        cursor: ew-resize;
        height: 14px;
        padding-top: 0;
        padding-bottom: 0;
        position: relative;
        top: 10px;

        a {
          cursor: ew-resize;
          display: flex;
          flex-flow: column;
          opacity: .5;

          .svg-icon {
            + .svg-icon {
              position: relative;
              top: -12px;
            }
          }
        }
      }
    }
  }
}

.shift.is-comparing {
  .label {
    opacity: 1;
    transition: .25s ease-out;
    transition-delay: .35s;
  }
  
  .time-block {
    color: rgba(0,0,0,0) !important;
    text-shadow: none !important;
    transition: .25s ease-out;
  }

  > .shift-original {
      .time-block {
        height: 12.5px;
        transition: .25s ease-out;
        border-top-color: #fff;
    }
  }
}

.shift > .shift-original.is-restored {
  .time-block {
    height: 24px;
    transition: .25s ease-out;
    border-top-color: transparent;
  }
}

.shift {
  > .shift.is-restored {
    bottom: -12.5px;
    position: absolute;
    
    .label {
      display: block;
      top: 6px;
      text-align: center;
      width: 100%;
    }
    
    .timeblock {
      &.on-queue {
        color: @text-on-queue;
      }
      &.meeting {
        color: @text-meeting;
      }
      &.meal {
        color: @text-meal;
      }
    }
    
    & + .shift-controls {
      top: -12.5px;
      transition: none;
    }
  }
}

body {
  font-family: Helvetica Neue;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-flow: column;
}

html, body {
  height: 100%;
}

.hide {
  display: none !important;
}

.show {
  display: flex;
}

.svg-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.fadeIn--shift-controls,
.fadeIn--shift-conrtrols-ul {
  animation-delay: 1s;
}

.fadeIn--shift-conrtrols-ul {
  animation-duration: .5s;
}

              
            
!

JS

              
                $ ->
$('.shift').hover (->
  $(this).children('.shift-controls').removeClass('hide').addClass('show animated fadeIn fadeIn--shift-controls')
  $(this).find(".shift-controls ul").addClass('animated fadeIn fadeIn--shift-conrtrols-ul')
  return
), ->
  $(this).children('.shift-controls').removeClass('show').addClass('hide')
  $(this).removeClass 'is-comparing'
  return

$('.compare-toggle').on 'click', ->
  $(this).closest('.shift').toggleClass 'is-comparing'
  return

$('.discard-changes').on 'click', ->
  $this = $('.discard-changes') # need to declare variable for nested setTimeout to work
  setTimeout (->
    $this.closest('.shift').children('.shift-pending').addClass('animated fadeOut')
    setTimeout (->
      $this.closest('.shift-controls').siblings('.shift-original').addClass('is-restored').removeClass('shift-original')
      $this.closest('.shift-controls').siblings('.is-restored').find('.label').text('Original restored')
      $this.closest('.shift').children('.shift-pending').addClass('hide')
    ), 500
    setTimeout (->
      $this.closest('ul').find('li:not(.gripper)').addClass('animated fadeOut')
      setTimeout (->
        $this.closest('ul').find('li:not(.gripper)').addClass('hide')
      ), 300
    ), 500
    return
  ), 1
  return
              
            
!
999px

Console