Upgrade to Pro — share decks privately, control downloads, hide ads and more …

動きのデザインとフロントエンドの連携

 動きのデザインとフロントエンドの連携

2017年3月9日に新潟で行われたイベント、新潟グラム2018 Vol.1で行なったセッション「動きのデザインとフロントエンドの連携」の講演資料です。

https://www.to-r.net/niigm-2018-1/

Kazuma Nishihata

March 11, 2018
Tweet

More Decks by Kazuma Nishihata

Other Decks in Programming

Transcript

  1. $(".js-smoothScroll").click( function(){ var target = 0 if( this.hash && this.hash

    !== "#top"){ target = $(this.hash).offset().top - 100; } $("html, body").animate({ scrollTop: target },300); return false; }); <a href="#foo" class="js-smoothScroll">ϦϯΫ</a>
  2. $(".js-smoothScroll").click( function(){ var target = 0 if( this.hash && this.hash

    !== "#top"){ target = $(this.hash).offset().top - 100; } $("html, body").animate({ scrollTop: target },300); return false; }); <a href="#foo" class="js-smoothScroll">ϦϯΫ</a>
  3. $(".js-smoothScroll").click( function(){ var target = 0 if( this.hash && this.hash

    !== "#top"){ target = $(this.hash).offset().top - 100; } $("html, body").animate({ scrollTop: target },300); return false; }); <a href="#foo" class="js-smoothScroll">ϦϯΫ</a>
  4. $(".js-smoothScroll").click( function(){ var target = 0 if( this.hash && this.hash

    !== "#top"){ target = $(this.hash).offset().top - 100; } $("html, body").animate({ scrollTop: target },300); return false; }); <a href="#foo" class="js-smoothScroll">ϦϯΫ</a>
  5. $(".js-smoothScroll").click( function(){ var target = 0 if( this.hash && this.hash

    !== "#top"){ target = $(this.hash).offset().top - 100; } $("html, body").animate({ scrollTop: target },300); return false; }); <a href="#foo" class="js-smoothScroll">ϦϯΫ</a>
  6. $(".js-smoothScroll").click( function(){ var target = 0 if( this.hash && this.hash

    !== "#top"){ target = $(this.hash).offset().top - 100; } $("html, body").animate({ scrollTop: target },300); return false; }); <a href="#foo" class="js-smoothScroll">ϦϯΫ</a>
  7. (PPHMF8FC'VOEBNFOUBMT ease-out ͱ ease-in ͸ 200ms - 500ms bounce ͱ

    elastic ease ͸ɺ800ms - 1200ms https://developers.google.com/web/fundamentals/design-and-ux/animations/?hl=ja
  8. $(".js-smoothScroll").click( function(){ var target = 0 if( this.hash && this.hash

    !== "#top"){ target = $(this.hash).offset().top - 100; } $("html, body").animate({ scrollTop: target },300); return false; }); <a href="#foo" class="js-smoothScroll">ϦϯΫ</a>
  9. ؆қΠϯλϥΫγϣϯ ࠓ෩ *& a{ transition: all .8s ease-in-out; &:hover{ filter:

    brightness(150%); @media all and (-ms-high-contrast:none){ opacity: .5; } } }
  10. 4BTTͷ.JYJO @mixin mq($level: pc) { @if $level == pc {

    @media (min-width: 768px){ @content; } } @else if $level == small { @media (max-width: 374px){ @content; } } @else if $level == ie { @media all and (-ms-high-contrast:none){ @content; } } @else { @media (max-width: 767px){ @content; } } }