What problem does it solve?
This Skill allows you to create sophisticated scroll-based animations and parallax effects, improving user engagement and the visual appeal of web pages.
Core Features & Use Cases
- Scroll Triggered Animations: Animate elements based on the scroll position of the page.
- Pinning: Keep elements in place while scrolling.
- Scrubbing: Adjust animation timing during scroll.
- Parallax: Create depth effects by moving elements at different speeds during scrolling.
- Use Case: Use this Skill to create a dynamic and engaging homepage with elements that animate or move based on the user's scroll behavior.
Quick Start
To create a simple scrolling animation, add the following script to your HTML file:
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/ScrollTrigger.min.js"></script>
<script>
gsap.registerPlugin(ScrollTrigger);
gsap.to('.element', {
scrollTrigger: {
trigger: '.element',
start: 'top center',
end: 'bottom center',
scrub: true
}
});
</script>