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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                .bg.red

.container.white.z-depth-1
  .row
    .col.s12
      h2 Views and tiles
  .row
    .col.s12.l3
      .view.z-depth-1
        .tile.next-lesson.collapsed
          .head.s
            .subj.red.circle MI
            .block 1
            .room 2.2.04
            .sub Francioni
          .homework
            .insert-tile.z-depth-1 homework-list
        .tile.next-lesson.collapsed
          .head.s
            .subj.red.circle MI
      
            .block 2
            .room 2.2.04
            .sub Francioni
          .homework
            .insert-tile.z-depth-1 homework-list
        .tile.next-lesson.collapsed
          .head.s.red-text
            .subj.grey.circle EN
            .block 3
            .room 5.3.01
            .sub Schlosser
          .homework
            .insert-tile.z-depth-1 homework-list
        .tile.next-lesson.collapsed
          .head.s
            .subj.blue.circle WW
            .block 4
            .room 4.3.11
            .sub Wandelt
          .homework
            .insert-tile.z-depth-1 homework-list
            
    .col.s9
      h3.tile next-lesson
      p displayes information about a lesson (here are multiple tiles composed to a list)
      h5 data
      pre {lesson.room, lesson.class, lesson.teacher, lesson.block, [homework]}
      h5 options
      pre -
   
  .row
    .col.s3
      .view.z-depth-1
        .tile.homework-list
          .head
            h5 Hausaufgaben
              .counter 2/3
          .list.flip
            .list-item
              .image
                .icon.circle.red MI
                .icon-bg.circle.green.darken-1
                  i.material-icons done
              .text
                .title Albatross
                .sub Morgen, Block #3
              .status
                i.material-icons photo_camera
            .list-item
              .image
                .icon.circle.orange EN
                .icon-bg.circle.green.darken-1
                  i.material-icons done
              .text
                .title Normalisieren
                .sub Morgen, 3. Block
              .status
            .list-item.selected
              .image
                .icon.circle.cyan ES
                .icon-bg.circle.green.darken-1
                  i.material-icons done
              .text
                .title Buch Seite 131 - 162 + Heft Seite 19
                .sub Donnerstag, Block #1
              .status
      
    .col.s9
      h3.tile homework-list
      p displays the homework given (either all or queried)
      h5 data
      pre [homework.done, homework.title, homework.features, homework.class]
      h5 options
      pre {display-header: true}
      
      
  .row
    .col.s3
      .view.z-depth-1
        .tile.homework-image
          .head.s
            .subj.red.circle MI
            .title Albatross
            .sub Morgen, Block #3
          .content
            img(src="http://placehold.it/350x550")
          .footer

            
    .col.s9
      h3.tile homework-image
      p displayes information about a homework
      h5 data
      pre [homework.done, homework.title, homework.class, homework.image]
      h5 options
      pre -
      
      
  .row
    .col.s3
      .view.z-depth-1
        .tile.homework-image
          .head.s
            .subj.red.circle MI
            .title Albatross
            .sub Morgen, Block #3
          .content
            img(src="http://placehold.it/350x550")
          .footer

            
    .col.s9
      h3.tile homework-image
      p displayes information about a homework
      h5 data
      pre [homework.done, homework.title, homework.class, homework.image]
      h5 options
      pre -

              
            
!

CSS

              
                .bg {
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:380px;
  
  z-index:-1;
}

.row:not(:first-child) .col:first-child {
  margin-bottom:50px;
}

.container {
  position:relative;
  border-radius:3px;
  margin-top:64px;
  padding:16px;
}

pre {
  margin:1.75rem 0;
  color:#333;
  overflow:hidden;
}

h3 {
  font-family:monospace;
  margin:0 0 .2em 0;
  padding:0;
  
  &.tile:before {
    content:'tile.';
    opacity:.5;
  }
}

.insert-tile {
  margin:1.5rem;
  padding:.75rem;
  color:#555;
  font-size:1.3rem;
  text-align:center;
  &:before {
    content:'{';
  }
  &:after {
    content:'}';
  }
}

.next-lesson {
  margin:0 -7.5rem;
  padding:0 7.5rem;
  overflow:hidden;
  
  &:not(:last-child)  {
    border-bottom:1px solid #ddd;
  }
  
  &:not(:first-child) .head{
    padding-top:8px;
  }
  
  &:last-child {
    margin-bottom:-9px;
    border-bottom:0;
  }
}

.view:not(h3) {
  padding:.75rem;
  overflow:hidden;
}
.tile {

}

.subj {
  height:3rem;
  width:3rem;
  color:#fff;
  text-align:center;
  font-size:1.5rem;
  font-weight:300;
  padding-top:.8rem;
  display:inline-block;
  float:left;
  margin:0 16px 0 4px;
}

.head {
  border-bottom:1px solid #ddd;
  margin: 0 -.75rem;
  padding:0  .75rem;
  padding-bottom:.75rem;
  &.s {
    min-height:3.75rem;
  }
}

.room, .title {
  font-size:1.3rem;
  padding-bottom:.5rem;
}
.sub {
  opacity:.8;
  font-weight:500;
}
.block {
  float:right;
  opacity:.4;
  font-size:1.64rem;
  padding-top:.55rem;
  &:before  {
    content:'#';
  }
}
.counter {
  float:right;
  opacity:.4;
}

h5 {
  padding-left:3px;
}

.list {
  position:relative;
  
  .list-item {
    border-bottom:1px solid #ddd;
    padding:.75rem;
    margin:0 -.75rem;
    display:flex;
    
    .image {
      flex-grow:0;
      flex-shrink: 0;
      flex-basis:56px;
      height:~"calc(3rem - 1px)";
    }
    
    .text {
      flex-grow:1;
      display:flex;
      justify-content:center;
      flex-direction:column;
    }
    
    .status {
      flex-grow:0;
      flex-shrink: 0;
      padding:8px;
      padding-right:0;
      cursor:default;
      i {
        color:#999;
        display:block;
      }
    }
    
    .sub {
      opacity:.8;
    }
  }
}



.content {
  img {
    margin-top:.75rem;
    width:100%;
    height:auto;
  }
}

//- list-flip -//
.list-item {
  transition:.3s;
  
  .icon, .icon-bg {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none;   /* Chrome/Safari/Opera */
    -khtml-user-select: none;    /* Konqueror */
    -moz-user-select: none;      /* Firefox */
    -ms-user-select: none;       /* IE/Edge */
    user-select: none;    
    height:3rem;
    width:3rem;
    position:absolute;
    color:white;
    font-size:1.5rem;
    font-weight:300;
    padding-top:.8rem;
    text-align:center;
    cursor:pointer;
    transition:.3s;
    backface-visibility:hidden;
  }
  .icon-bg {
    transform:rotateY(180deg);
    padding:.5rem;

    .material-icons {
      font-size:2rem;
    }
  }
  &.selected {
    background:#eee;

    .icon {
      transform:rotateY(180deg);
    }
    .icon-bg {
      transform:rotateY(0deg);
    }
  }
}
              
            
!

JS

              
                $.fn.redraw = function(){
  $(this).each(function(){
    var redraw = this.offsetHeight;
  });
};

$.fn.setClass = function (class_,state) {
  state = state == undefined ? true : state;
  if (state) {
    this.addClass(class_);
  } else { 
    this.removeClass(class_);
  }
};

$(function () {
  $('.list.flip .icon, .icon-bg').click(function () {
    $(this).closest('.list-item').toggleClass('selected');
    var self = this;
    if ($(this).text() == "ES") {
      setTimeout(function ()  {
        $(self).closest('.list-item').removeClass('selected');
        Materialize.toast('at least you tried',10000);
      },500)
    }
  })
  
  $('.next-lesson').each(function (k,v) {
    var $v = $(v),
        height_open = $v.outerHeight(true), 
        height_closed = $v.find('.head').outerHeight(true) - 1,
        open = $v.hasClass('collapsed');
      
    $v.transition({
      height: (open?height_closed:height_open)
    }, 300);
    
    $v.click(function () {
      open = !$v.hasClass('collapsed');
      
      $v.setClass('collapsed',open);
      
      $v.transition({
        height: (open?height_closed:height_open)
      }, 300);
    })
    
    
  })
  
  $('.btn-large').click(function () {
    $('body').css({cursor:'wait'});
  })
})

              
            
!
999px

Console