Can someone help me with custom code?
I have this code as a GSAP animation but the animation starts when the page loads, so I need to add something that the animation only starts when the element scrolls into view. Thanks
<script src="https://unpkg.com/split-type"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>
<script>
let typeSplit = new SplitType('[animate]', {
types: 'lines, words, chars',
tagName: 'span'
})
gsap.from('[animate] .word', {
opacity: 0.3,
duration: 1.05,
ease: 'power1.out',
stagger: 0.2,
})
</script>