GSAP Flashcards
What are the three primary methods of the GSAP object for creating tweens?
gsap.to(), gsap.from(), and gsap.fromTo(). These methods animate properties over time.
What does a tween do in GSAP?
A tween animates a property of an object over time, specifying targets, properties, and optional special properties like duration.
How is the x or y property used in GSAP animations?
It is a shorthand for the CSS translateX or translateY property, used to move elements along the horizontal axis.
What are staggered animations in GSAP?
They animate multiple objects with delayed start times using the stagger property.
What is a GSAP timeline?
A container for multiple tweens, enabling sequencing, overlap, nested timelines, and repeat delays.
What is the basic syntax for a gsap.to() tween?
gsap.to(".fred", { x: 400 });
This animates the element with the class “fred” to an x position of 400.
For best performance, which CSS properties should you animate with GSAP?
- x
- y
- rotation
- rotationX
- rotationY
- skewX and skewY
- scaleX, scaleY, or scale
What does the delay property do in GSAP?
The delay property specifies how much time should transpire before the animation begins.
What does the repeat property do in GSAP?
The repeat property defines how many times the animation should repeat.
What happens if you set repeat: -1 in GSAP?
The animation will repeat indefinitely.
How can you play an animation back and forth in GSAP?
With yoyo set to true:
yoyo: true,
How can you delay, when an animation repeats in GSAP?
The repeatDelay property specifies how much time should transpire between each repeat of the animation.
What does the start property in ScrollTrigger define? (GSAP)
The start property defines when the animation begins relative to the scroll position. Example: “start”: “top 75%”.
What does “start”: “top top” mean in ScrollTrigger? (GSAP)
It means the top of the trigger element matches the top of the viewport (default behavior).
What does the end property in ScrollTrigger do? (GSAP)
The end property defines when the animation ends relative to the scroll position.