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

              
                ul#TmpDataTarget.memberList
  - 24.times do |i|
    li.memberBlock
      a[href="#"]
        .memberBlock__image
          img.Lazy[data-original="https://unsplash.it/600/450/?random&c=#{i}" src="https://chocolateboard.chips.jp/_resource/spthx/placeholder.png" alt="" width="300" height="225"]
        p.memberBlock__position Position #{i}
        h2.memberBlock__jaName 苗字 名前 #{i}
        p.memberBlock__enName Firstname Lastname #{i}
              
            
!

CSS

              
                @import 'bourbon';
@import url(https://fonts.googleapis.com/css?family=EB+Garamond);

//  Variables
$c-navy:       #09071e;
$c-orange:     #ff7e00;
$c-brown:      #756C65;
$c-border:     #e2e2e2;
$c-background: #f7f7f7;
$size: 16px;

//  Mixin
@mixin font-size($size) {
  font-size: rem($size);
}

@mixin lineclamp($linenum) {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;

  -webkit-line-clamp: $linenum; // number of lines to show
  -webkit-box-orient: vertical;
}

@mixin clickable-block($color) {
  
  a {
    display: block;
    color: $color;
    text-decoration: none;
    
    &:visited {
      color: $color;
    }
  }
}

@mixin mouseover($property) {
  @include transition-property($property);
  @include transition-duration(.5s);
}

//  Extend
%text-sansSerif {
  font-family: YuGothic, '游ゴシック', sans-serif;
}
%text-serif {
  font-family: 'EB Garamond', YuMincho, '游明朝', serif;
}

// Basis
body {
  @include font-size(14);
  @extend %text-sansSerif;
  color: $c-navy;
}

a {
  color: $c-navy;
  text-decoration: underline;

  &:hover {
    @include mouseover(opacity);
    opacity: .8;
    text-decoration: none;
  }
  
  &:visited {
    color: $c-navy;
  }
}

figure {
  margin: 0;
}

// Styling
.memberList {
  width: 980px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.memberBlock {
  @include clickable-block($c-navy);
  width: 300px;
  margin-bottom: 40px;
  list-style: none;
  position: relative;
  
  &:hover::after {
    @include mouseover(border-color);
    border-color: transparent $c-orange $c-orange transparent;
  }

  &::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-color: transparent $c-background $c-background transparent;
    border-style: solid;
    border-width: 20px;
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: -1;
  }
}

.memberBlock__image {
  background: url(https://chocolateboard.chips.jp/_resource/spthx/loading_navy.gif) no-repeat center center;
  
  img {
    width: 100%;
  }
}

.memberBlock__position {
  @include font-size(12);
  @include lineclamp(1);
  @extend %text-serif;
  margin: 5px 0;
}

.memberBlock__jaName {
  @include font-size(26);
  @include lineclamp(1);
  margin: 5px 0 0;
}

.memberBlock__enName {
  @include font-size(18);
  @include lineclamp(1);
  @extend %text-serif;
  margin: 0;
}

              
            
!

JS

              
                (function($) {

  'use strict';
  
  $(document).on({
    'ready': function(){
      // Lazyload
      // MEMO: 参照 https://www.appelsiini.net/projects/lazyload
      $('img.Lazy').lazyload({
        threshold : 200,
        effect: 'fadeIn',
        effectspeed: 300
      });
    }
  });
  
})(jQuery);
              
            
!
999px

Console