neurosecure/js/scroll.js

19 lines
494 B
JavaScript

import { gsap } from "gsap";
var controller = new ScrollMagic.Controller();
var wipeAnimation = new TimelineMax()
.fromTo(".about-1", 1, { xPercent: 100 })
.from(".about-2", 1, { xPercent: -100 })
.from(".about-3", 1, { yPercent: 100 })
.from(".about-4", 1, { yPercent: -100 });
new ScrollMagic.Scene({
triggerElement: ".about-section",
triggerHook: "onLeave",
duration: "300%",
})
.setPin(".about-section")
.setTween(wipeAnimation)
.addTo(controller);