I am trying to replicate the codepen linked here to a project I'm working on. I keep getting Invalid property ScrollTrigger in my console logs. I've reviewed other forums of the same problem yet I don't know what I'm doing wrong here. Any help is appreciated, thanks
I have these in my layout file to import gsap:
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.1/ScrollTrigger.min.js"></script>
This is my JS file:
/* eslint-disable no-unused-vars */
import gsap from 'gsap';
import ScrollTrigger from 'gsap/ScrollTrigger';
export default () => {
gsap.registerPlugin(ScrollTrigger);
gsap.to('.pContent', {
yPercent: -100,
ease: 'none',
markers: true,
scrollTrigger: {
trigger: '.pSection',
// start: 'top bottom', // the default values
// end: 'bottom top',
scrub: true
}
});
gsap.to('.pImage', {
yPercent: 50,
ease: 'none',
markers: true,
scrollTrigger: {
trigger: '.pSection',
// start: 'top bottom', // the default values
// end: 'bottom top',
scrub: true
}
});
};