Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- NEW: ScrollTrigger recognizes a new "containerAnimation" configuration property for when the trigger element is being "scrolled" into view by a linear Tween of its container, like when vertical scrolling causes elements to move **horizontally** into view. You could think of it like a nested ScrollTrigger. - NEW: ScrollTrigger recognizes a new "preventOverlaps" configuration property that forces all trailing ScrollTrigger animations to their end state when the ScrollTrigger is about to affect its own animation (like in a toggleAction) - NEW: ScrollTrigger recognizes a new "fastScrollEnd" configuration property that will automatically force the associated animation to completion if the scroll velocity exceeds 2500px/second (or whatever you define) when it LEAVES the active area (so onLeave or onLeaveBack). This helps avoid overlapping animations when the user scrolls quickly. - NEW: ScrollTrigger.isInViewport() method that lets you determine if a particular element is in the viewport. You can even define a certain proportion, like if at least 20% of it is in the viewport like ScrollTrigger.isInViewport(element, 0.2); - NEW: ScrollTrigger.positionInViewport() method that lets you get a normalized value representing an element's position in the viewport. For example, if the center of myElement is 80% down from the top of the viewport, ScrollTrigger.positionInViewport(myElement, "center") would return 0.8. - NEW: ScrollTrigger instances have new .previous() and .next() methods that return the ScrollTrigger that's immediately before or after (in the refresh order) which makes it simple to build function-based start/end values that are dependent on the previous one, like start: self => self.previous() ? self.previous().end : "top top" - NEW: ScrollTrigger snapping is now directional by default (except snap: "labels" because there's already a snap: "labelsDirectional" option) because that is what's most intuitive in the vast majority of situations. To prevent the directional part, you can set directional: false in the snap object, like snap: {snapTo: 1 / 5, directional: false} - NEW: ScrollTrigger.snapDirectional() is a utility method that you can give a snapping increment **OR** an Array of numbers and it will return a function that you can use to do directional snapping. For example, let snap = ScrollTrigger.snapDirectional(5) returns a function that'll snap in increments of 5 in the direction provided where 1 is positive and -1 is negative, so snap(11, 1) would return 15 whereas snap(11, -1) would return 10. - NEW: if you return a GSAP animation (Tween/Timeline) from an onEnter/onLeave/onEnterBack/onLeaveBack/onToggle callback, it will be set as the callbackAnimation property, effectively maintaining a reference to the most recent one which will cause it to be affected by preventOverlaps and fastScrollEnd behaviors. - NEW: ScrollTrigger.clearScrollMemory() erases any recorded scroll positions (this is almost never needed, but just in case...) - NEW: ScrollTrigger recognizes a new "pinSpacer" property that allows you to specify an element that should be used as the spacer instead of the default behavior where ScrollTrigger creates a DIV element internally. The main reason this is useful is if you're loading an iframe into the pinned element because on resize, the browser would refresh that content due to the fact that ScrollTrigger must remove/add the spacer element as a part of its ScrollTrigger.refresh() calculations. - NEW: TextPlugin lets you set preserveSpaces: true in order to maintain extra spaces, swapping in to make them show up in HTML. See https://greensock.com/forums/topic/29060-textplugin-and-format-preservation/ - IMPROVED: in some browsers, a pinType of "transform" could appear to jump/vibrate while scrolling. It's impossible to completely eliminate all of that due to the fact that most modern browsers handle scrolling on a separate thread, thus repainting isn't synchronized but 3.8.0 forces updates more frequently while scrolling to minimize that jitter. See https://greensock.com/forums/topic/29205-scrolltrigger-wobbly-pinning/ - IMPROVED: if you misspell selector text in a ScrollTrigger (like trigger: "#oopps"), you'll see a console.warn() message for easier troubleshooting. See #472 - IMPROVED: TypeScript definition files cover gsap-trial package and "snap" property. See https://greensock.com/forums/topic/28966-how-to-snap-in-gsapto/ - IMPROVED: if a ScrollTrigger's start value is numeric, it will be treated as absolute and won't be pushed further down when you pin the same element multiple times. See https://greensock.com/forums/topic/28845-scrolltrigger-long-scroller-with-multiple-animation-triggers/ - IMPROVED: if you animate a CSS value to a value with a % unit and then reverse all the way back to the beginning, it won't revert to the equivalent px value (which is what the browser reported as the computed value). So % is maintained. - IMPROVED: if ScrollTrigger.refresh() is called in an environment where the document/window/body doesn't exist yet, it won't throw an error. See #415 - IMPROVED: PixiPlugin warns if you haven't registered the PIXI object. - FIXED: if you refresh() a ScrollTrigger inside of a callback after the page has already been scrolled, it may remember that scroll position longer than it should in some rare scenarios. - FIXED: if you use a "random(...)" value in the "from" part of a .fromTo() animation on a CSS-related value, it wasn't applied properly. See https://greensock.com/forums/topic/28817-random-not-working-in-fromto/ - FIXED: if the <path/> you use for a motionPath contains data that has no commas or spaces between values like 126.87-32.48-310.91-58-499 instead of 126.87,-32.48,-310.91,-58,-499, it may not be aligned correctly. See https://greensock.com/forums/topic/28827-what-am-i-doing-wrong-motionpathplugin/ and https://greensock.com/forums/topic/29031-my-motion-path-needs-offsets-but-why/ - FIXED: if you create a getProperty() getter function and then try passing in a unit, it would always return a number instead of including that unit. - FIXED: if you set overwrite: "auto" and then before the tween's first render, you alter the progress (like tween.progress(1)), it may not properly overwite conflicting tweens in certain circumstances. - FIXED: when you .kill() a ScrollTrigger that has a numeric scrub value (or the associated animation), it didn't kill() the scrub tween, thus it wasn't made available for garbage collection. See https://greensock.com/forums/topic/29002-memory-leak-in-scrolltrigger-scrub/? - FIXED: in very rare circumstances, an addPause() callback may fire more than once. - FIXED: worked around Firefox bug that could throw an error if matrix values are needed from an SVG that has no width or height - FIXED: regression in MotionPathPlugin 3.7.1 could cause the final value in a MotionPath animation to be incorrect. See https://greensock.com/forums/topic/29097-motion-path-on-complete-sets-position-to-x0-and-y-0/ - FIXED: GSDevTools didn't recognize if you set the time() of the selected animation to a non-zero value. See https://greensock.com/forums/topic/29113-force-gsdevtools-to-start-at-a-given-timeline-time/ - FIXED: if you .kill() a GSDevTools instance and then attempt to create a new one, the keyboard events may not be listened to correctly. See https://greensock.com/forums/topic/29129-killed-gsdevtools-forgets-to-clean-its-event-listeners/ - FIXED: regression in 3.7.0 caused keyframe animations not to inherit a default duration (or other defaults). See https://greensock.com/forums/topic/29180-keyframes-does-not-work-in-version-371/ - FIXED: if you use gsap.utils.snap() with a number greater than 1 but also has a decimal, it would always eliminate the decimal. - FIXED: if you have an inline border-top-* style on the <body></body>, ScrollTrigger may eliminate it upon instantiation. It would only happen if it's more specific than "border-top", like "border-top-width for example. - FIXED: Flip plugin may not properly factor in the page's scroll into the positioning properly under certain circumstances when the element is position: fixed. See https://greensock.com/forums/topic/29343-scrolltrigger-flip-to-fixed-position/ and https://greensock.com/forums/topic/29368-flip-plugin-error-state-position/ - FIXED: regression in 3.7.1 could cause MotionPathPlugin not to properly align a root <svg></svg> element on a path if it has a viewBox attribute with non-zero x/y values. - FIXED: if you set a liveSnap on a Draggable AND bounds, the bounds may not be respected (only the liveSnap). - FIXED: if you place a callback on a timeline with a ScrollTrigger that is set to scrub: true and then scroll down on a page past where that callback is and then refresh the browser, the callback may not be triggered. See https://greensock.com/forums/topic/29456-scrolltrigger-seemingly-inconsistently-updates-timeline-calls/ - FIXED: in Draggable, if you use an Array for snap on multiple values like snap: { x: [0], y: [0] }, it would skip all but the first one (in terms of snapping). See https://greensock.com/forums/topic/29466-draggable-snap-only-affecting-x-value/ - FIXED: in Draggable, if you tap (click) on certain mobile devices and the browser refreshed at a slow enough speed, it was possible that the onClick would fire twice. See https://greensock.com/forums/topic/29530-pointerup-fired-for-draggables-onclick-in-mobile-view - FIXED: if you change the timeScale() of an animation AFTER adding it to a timeline that has smoothChildTiming: false, it may not render at the correct time when the parent is played in reverse
- Loading branch information