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

              
                header.header[role="banner"]
  h1.header__id 
    a[href="FIXME"] スペサン
  nav.navigation
    ul
      li
        a[href="#about"] About
      li
        a[href="#service"] Service
      li
        a[href="#team"] Team
      li
        a[href="#company"] Company
      li
        a[href="https://sp-thanks.com/news/"] News
      li
        a[href="#contact"] Contact

main.main[role="main"]
  .section--hero
    p.section--hero__message 
      | Designing moments,
      br
      | Driving emotions
  section#about.section
    .section__content
      h2.section__title About
      h3.section__subTitle 人を幸せにする 心震える瞬間の創造
      .section__body
        p ここにコンテンツ
        p.text--center
          a.button--white[href="https://sp-thanks.com/about/"] READ MORE
  section#service.section
    .section__content
      h2.section__title Service
      h3.section__subTitle 人生のあらゆる瞬間に、オーダーメイドの感動を提供する
      .section__body
        p ここにコンテンツ
        figure
          img.Lazy[data-original="https://unsplash.it/800/600/?random" src="https://chocolateboard.chips.jp/_resource/spthx/placeholder.png" alt="" width="400" height="300"]
  section#team.section
    .section__content
      h2.section__title Team
      h3.section__subTitle 人の心を動かす「ものづくり」のプロフェッショナルチーム
      .section__body
        p ここにコンテンツ
        figure
          img.Lazy[data-original="https://unsplash.it/800/600/?random" src="https://chocolateboard.chips.jp/_resource/spthx/placeholder.png" alt="" width="400" height="300"]
        p.text--center
          a.button--navy[href="https://sp-thanks.com/team/"] ABOUT OUR TEAM
  section#company.section
    .section__content
      h2.section__title Company
      h3.section__subTitle 会社概要
      .section__body
        p ここにコンテンツ
  section#contact.section
    .section__content
      h2.section__title Contact
      h3.section__subTitle あなたの想いも、カタチにしてみませんか?
      .section__body
        p ここにコンテンツ
        p.text--center
          a.button--white[href="https://sp-thanks.com/contact/"] CONTACT
        
  footer.footer[role="contentinfo"]
    small © SPECIAL THANKS.
.video
  video[src="https://chocolateboard.chips.jp/_resource/spthx/sample.mp4" autoplay loop] 
              
            
!

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;
$side-gutter: 40px;

//  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 generate-dot($size) {
  content: '';
  display: block;
  margin-right: auto;
  margin-left: auto;
  width: $size;
  height: $size;
  border-radius: $size/2;
  background-color: $c-orange;
}

@mixin generate-button($color) {
  $h: 60px;
  width: 500px;
  height: $h;
  line-height: $h;
  display: inline-block;
  box-sizing: border-box;
  background-repeat: no-repeat;
  background-position: center top;
  background-image: url(https://chocolateboard.chips.jp/_resource/spthx/button--#{$color}.svg);
  text-decoration: none;
}

// Extend
%text-sansSerif {
  font-family: YuGothic, '游ゴシック', sans-serif;
}
%text-serif {
  font-family: 'EB Garamond', YuMincho, '游明朝', serif;
}
%text-en {
  letter-spacing: .03em;
  font-weight: normal;
}
%wrapper {
  width: 100%;
  min-width: 1000px;
  padding-right: $side-gutter;
  padding-left: $side-gutter;
  box-sizing: border-box;
}

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

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

  &:hover {
    @include transition-property(opacity);
    @include transition-duration(.5s);
    opacity: .8;
    text-decoration: none;
  }
  
  &:visited {
    color: $c-navy;
  }
}

figure {
  margin: 0;
}

// Styling
.video {
  width: 100%;
  height: 100vh;
  min-width: 1000px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1000;
  overflow: hidden;
  
  video {
    min-width: 100%;
    min-height: 100%;
  }
}

.header {
  @include transition-property(color, background);
  @include transition-duration(.5s);
  @extend %wrapper;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  box-sizing: border-box;
  z-index: 1000;
  position: absolute;
  padding-top: 40px;
}

.header__id {
  margin: 0;
  
  a {
    width: 131px;
    height: 50px;
    display: block;
    text-indent: -9999px;
    background-repeat: no-repeat;
    background-position: top left;
  }
  
  a {
    background-image: url(https://chocolateboard.chips.jp/_resource/spthx/logo--white.svg);
  }
}

.header.isSticky {
  position: fixed;
  background: white;
  padding-top: 13px;
  padding-bottom: 10px;
  box-shadow: 0 1px 3px 0 rgba(black, .2);

  .header__id {
    a {
      background-image: url(https://chocolateboard.chips.jp/_resource/spthx/logo--navy.svg);
    }
  }

  .navigation {

    a {
      color: $c-navy;

      &:visited {
        color: $c-navy;
      }
    }
  }
}

.navigation {
  @include font-size(14);
  @include clearfix;
  @extend %text-serif;
  @extend %text-en;
  
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  
  li {
    width: 100px;
    margin-left: 10px;
    float: left;
    list-style: none;
  }

  a {
    display: block;
    text-align: center;
    text-decoration: none;
    position: relative;
    color: $c-background;
  
    &::after {
      @include transition-property(transform);
      @include transition-duration(.3s);
      
      display: block;
      content: '';
      position: absolute;
      bottom: -10px;
      left: 0;
      width: 100%;
      height: 2px;
      transform: scaleX(0);
      background-color: $c-border;
    }
    
    .current {
      &::after {
        background-color: $c-orange;
      }
    }
    
    &:hover {
      &::after {
        transform: scaleX(1);
      }
    }
    
    &:visited {
      color: $c-background;
    }
  }
}

.main {
  min-width: 1000px;
}

.section {
  background-color: $c-background;
  background-size: cover;
  background-position: center center;

  // MEMO: サンプルのセクションをわかりやすくするため色を変える
  &#about {
    background: url(https://unsplash.it/800/600/?random);
    color: $c-background;
    
    .section__content {
      background-color: rgba($c-navy, .85);
    }
  }
  &#service {
    background: url(https://unsplash.it/800/600/?random);
    
    .section__content {
      background-color: rgba($c-background, .80);
    }
  }
  &#team {
    background: white;
  }
  &#contact {
    background: url(https://unsplash.it/800/600/?random);
    color: $c-background;
    
    .section__content {
      background-color: rgba($c-navy, .85);
    }
  }
}

.section__content {
  @extend %wrapper;
  padding-top: 100px;
  padding-bottom: 100px;
  min-height: 500px; 
}

.section__title {
  @include font-size(20);
  @extend %text-serif;
  @extend %text-en;
  
  margin-bottom: 30px;
  text-transform: uppercase;
  text-align: center;
  
  &::after {
    @include generate-dot(10px);
    margin-top: 30px;
  }
}

.section__subTitle {
  @include font-size(30);
  text-align: center;
}

.section__body {
  // MEMO: サンプルなのでセンターにしておく
  text-align: center;
}

.section--hero {
  @extend %wrapper;
  padding-top: 40vh;
  min-height: 100vh;
  min-width: 1000px;
  background: rgba($c-navy, .8);
  position: relative;
  
  &:hover {
    &::before {
      background-position: center -20vh;
      opacity: .5;
    }
    &::after {
      background-position: center 20vh;
      opacity: .5;
    }
  }
  
  &::before,
  &::after {
    @include transition-property(background-position, opacity);
    @include transition-duration(.5s);
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 52vh;
    min-width: 1000px;
    background-repeat: repeat-x;
    background-size: 52vh 52vh;
    z-index: -1;
  }
  &::before {
    top: 0;
    left: 0;
    background-position: center top;
    background-image: url(https://chocolateboard.chips.jp/_resource/spthx/triangle--lt.svg);
  }
  &::after {
    bottom: 0;
    left: 0;
    background-position: center bottom;
    background-image: url(https://chocolateboard.chips.jp/_resource/spthx/triangle--rb.svg);
  }
}

.section--hero__message {
  @include font-size(72);
  @extend %text-serif;
  
  margin: 0;
  color: $c-brown;
  text-align: center;
  line-height: 1;
  
  &::before {
    @include generate-dot(20px);
  }
}

.footer {
  @extend %wrapper;
  padding-top: 30px;
  padding-bottom: 30px;
  text-align: center;
  background: $c-navy;
  color: $c-background;
  
  small {
    @include font-size(12);
    @extend %text-serif;
    @extend %text-en;
  }
}

.text--center {
  text-align: center;
}

.button--navy {
  @include generate-button(navy);
  @extend %text-serif;
  @extend %text-en;
  color: white;

  &:visited {
    color: white;
  }
}

.button--white{
  @include generate-button(white);
  @extend %text-serif;
  @extend %text-en;
}

              
            
!

JS

              
                (function($) {

  'use strict';

  var STICKY_CLASS     = 'isSticky';
  var $header          = $('header[role="banner"]');
  var isSticky         = false;
  
  var windowScrollTop  = 0;
  var aboutOffsetTop   = $('#about').offset().top;
  
  $(document).on({
    'ready': function(){
      
      // Lazyload
      $('img.Lazy').lazyload({
        threshold : 200,
        effect: 'fadeIn',
        effectspeed: 300
      });
      
      // SmoothScroll
      // MEMO: サンプルです
      // 使っているプラグイン https://github.com/urakey/jQuery-plugins/tree/master/jquery.smoothScroll
      $('a[href^="#"]').smoothScroll({
        play: 50,
        duration: 500,
        easing: 'easeOutQuad',
        withHash: false
      });
    }
  });
  
  $(window).on({
    'scroll': function(){
      windowScrollTop = $(window).scrollTop();
      
      if (aboutOffsetTop < windowScrollTop) {
        $header.addClass(STICKY_CLASS);
        isSticky = true;
      } 
      else {
        $header.removeClass(STICKY_CLASS);
        isSticky = false;
      }
      
    }
  });
  
  /**
   * Easing: easeOutQuad
   */
  $.extend( jQuery.easing,{
    easeOutQuad: function (x, t, b, c, d) {
      return -c *(t/=d)*(t-2) + b;
    }
  });
  
})(jQuery);
              
            
!
999px

Console