Skip to content
Permalink
Browse files

Pin intro title and swipe it out of screen on scroll

  • Loading branch information
magadanskiuchen committed Oct 20, 2019
1 parent aa1842c commit 2b31ef2743e6b4b019b5a6e5f5f340927807d5eb
Showing with 11 additions and 0 deletions.
  1. +11 −0 js/main.js
@@ -0,0 +1,11 @@
const vh = window.screen.availHeight / 100;

const controller = new ScrollMagic.Controller();

const introTitlePin = new ScrollMagic.Scene({ triggerElement: '.intro__title', triggerHook: 0 })
.setPin('.intro__title')
.addTo(controller);

const titleSwipe = new ScrollMagic.Scene({ triggerElement: '.intro__title', triggerHook: 0, duration: 50 * vh })
.setTween(new TweenLite.fromTo('.intro__title', 1, { x: 0 }, { x: '100%' }))
.addTo(controller);

0 comments on commit 2b31ef2

Please sign in to comment.
You can’t perform that action at this time.