Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: greensock/GSAP
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.4.2
Choose a base ref
...
head repository: greensock/GSAP
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.6.0
Choose a head ref
  • 3 commits
  • 73 files changed
  • 1 contributor

Commits on Aug 13, 2020

  1. 3.5.0

    - NEW: ScrollTrigger.clearMatchMedia() clears out matchMedia() breakpoints that were previously set via ScrollTrigger.matchMedia(). It doesn't kill the ScrollTriggers or animations themselves - it just no longer triggers anything at that break point.
    
    - NEW: gsap.ticker.deltaRatio() method gives a ratio of the change since the last tick based on a target fps (defaults to 60fps). For example, if the ticker is running at EXACTLY 60fps, that means each tick would be roughly 16.67 milliseconds apart, thus the default .deltaRatio() would be 1 (though that rarely happens perfectly). If you call gsap.ticker.deltaRatio(120) meaning you want the ratio based on 120fps, it would return 2 in this scenario. If 33ms elapsed since the previous tick, gsap.ticker.deltaRatio(60) would return roughly 2 because the delta is about TWICE what a normal 60fps rate would be. This makes it easy to do things like gsap.ticker.add(() => obj.rotation += 1 * gsap.ticker.deltaRatio()) and have it animate at the same rate no matter what the refresh rate of the browser/ticker is.
    
    - NEW: you can set pinType: "fixed" in order to force ScrollTrigger to use position: fixed while pinning an element (which it normally does only if the scroller is the body/documentElement).
    
    - NEW: added support for animating Typed Arrays via EndArrayPlugin (which is in the GSAP core). See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
    
    - IMPROVED: when setting a scrollTrigger on a gsap.timeline(), it had to wait for 1 tick before refreshing (because timelines are empty initially and only have a duration after being populated) but now you can manually call refresh() after populating the timeline so that it doesn't need to wait for that tick. This can help in some edge cases like the one here https://greensock.com/forums/topic/24973-issues-with-reinitializing-scrolltrigger/
    
    - IMPROVED: better performance for creating a timeline with hundreds/thousands of tweens, particularly when most don't extend the overall duration.
    
    - IMPROVED: you can alter the duration of a tween inside of an onRepeat and as long as its parent timeline's smoothChildTiming property is set to true, it'll smoothly update. See https://greensock.com/forums/topic/24721-struggling-with-random-duration/?tab=comments#comment-120427
    
    - IMPROVED: complex string-based eases that include parameters can now parse spaces without breaking, and even one set of nested parenthesis like "expoScale(25, 1, back.out(0.5))". See https://greensock.com/forums/topic/25008-delay-before-text-zooming-in
    
    - IMPROVED: ScrollTrigger's pinSpacing is disabled by default the pinned element's parent has display: flex, but now you can force pinSpacing with pinSpacing: true in that case.
    
    - FIXED: defining a value like "random([100, 20, -100])" for a tween, where there's an Array-based value in the string, didn't work properly. This was only the case for the string-based version - you could still use gsap.utils.random(), but now the string-based version works. See https://greensock.com/forums/topic/24901-using-gsaps-new-random-feature/
    
    - FIXED: if you try animating to a CSS property that's undefined, like gsap.to(... {x: undefined}), it will be ignored now. See https://greensock.com/forums/topic/24905-undefined-in-params-breaks-animation-regression-between-311-and-320/
    
    - FIXED: ScrollToPlugin factored in any offsetY or offsetX AFTER the max scroll position rather than before it, thus the viewport wasn't large enough to accommodate the initial scrollTo (without the offset), it would calculate the maximum and THEN subtract the offset, leading to an odd result. See #402
    
    - FIXED: if a ScrollTrigger has pinReparent: true, in certain cases it could alter the text color while pinned. See https://greensock.com/forums/topic/24908-scrolltrigger-pinreparent-styles/
    
    - FIXED: a "fix" in 3.4.2 for working around collapsing margins was to automatically set overflow: hidden on the pinned element if there was no overflow (no scrolling), but in some rare cases that can have unintended consequences. Like in https://codepen.io/GreenSock/pen/1e42c7a73bfa409d2cf1e184e7a4248d the content becomes hidden while scrolling because of that "fix", so we rolled it back in 3.4.3 in favor of having people fix collapsing margins via their CSS setup instead. Setting overflow to hidden or auto is just one potential solution. A border-top: 1px solid transparent is another. But frankly collapsing margins don't seem to be a very common issue anyway.
    
    - FIXED: when a Draggable was applied to elements with position: fixed, their positioning could be rendered incorrectly if you altered the scroll while dragging. See https://greensock.com/forums/topic/24996-what-changed-from-version-32-to-make-this-not-work/
    
    - FIXED: regression in 3.4.0 could cause a fromTo() tween not to render the starting state correctly if reversed quickly. See https://greensock.com/forums/topic/25014-scrolltrigger-scroll-issue-toggle-actions/
    
    - FIXED: worked around an issue with the Web Components polyfill that caused Draggable not to work in IE11. See https://greensock.com/forums/topic/25000-draggable-stops-working-in-ie11-with-webcomponentsjs/
    
    - FIXED: when a ScrollTrigger has once: true, its toggleClass should only toggle once (adding), so refreshing a page that's already scrolled down should result in the elements ABOVE that spot having the class toggled on, but it was toggling them off since those ScrollTriggers were technically past their "end". See https://greensock.com/forums/topic/25023-scrolltrigger-oncetrue-toggleclass-elements-above-are-not-triggered/
    
    - FIXED: doing a motionPath animation on a generic object could result in errors. See #370
    
    - FIXED: a very rare edge case could cause a repeating animation to fire an onRepeat and/or do a repeatRefresh on the very last render (end).
    
    - FIXED: regression in 3.2.0 caused tweens that had reversed: true in their vars object not to render correctly.
    
    - FIXED: if a from() or fromTo() tween was inserted into the very beginning of a timeline that was reversed, the initial state may not render correctly. See https://greensock.com/forums/topic/25067-toggle-animation/
    
    - FIXED: if you set up ScrollTriggers in one matchMedia() function that used a different orientation (vertical/horizontal) on the same scroller than in another (in other words, horizontal: true was set on one but not the other), the scroll position may not be updated properly on the subsequent call. See https://greensock.com/forums/topic/25071-scrolltrigger-horizontal-vs-vertical/
    
    - FIXED: worked around a browser issue in Safari that could cause snapping in ScrollTrigger to be jerky in some cases, and/or it could get stuck (not land at the correct snapping spot).
    
    - FIXED: Physics2DPlugin and PhysicsPropsPlugin could render incorrect values if you used a "friction" value **and** a very long duration and reversed the animation after it was quite far along.
    
    - FIXED: Physics2DPlugin and PhysicsPropsPlugin could appear to visually pulse when using very low timeScale values.
    
    - FIXED: in a very rare circumstance, ScrollTrigger could throw an error. See https://greensock.com/forums/topic/25106-locomotivescroll-and-scrolltrigger-error-when-onleaveback-and-locoscrollscrollto/
    
    - FIXED: a few TypeScript definitions, like #406
    
    - FIXED: if you set once: true on a ScrollTrigger and then refreshed a page after having already scrolled past the end of that ScrollTrigger, its associated animation may not play. See https://greensock.com/forums/topic/24436-scrolltrigger-how-to-start-animations-when-user-scrolls-from-bottom-to-top/
    jackdoyle committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    719be8d View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2020

  1. 3.5.1

    - FIXED: regression in 3.5.0 caused an error to be thrown in IE10 (related to new TypedArrays support). See https://greensock.com/forums/topic/23156-what-browsers-are-supported-by-gsap-3/
    
    - FIXED: some minor TypeScript definition file improvements
    
    - FIXED: if you pin something with ScrollTrigger on a page that initially has NO scrollbar and the contents fill the width, for example, it would end up showing a horizontal scrollbar because the width is set without the scrollbar and then one gets added due to the pinSpacing. So now ScrollTrigger will sense this condition and add overflow-y: scroll to the inline style. See https://greensock.com/forums/topic/25182-scrolltrigger-width-of-page-increase-where-markers-are-set-to-false/
    
    - FIXED: if you set start: 0 on a ScrollTrigger and defined a trigger (which doesn't make much sense since numbers are interpreted as absolute thus there's no point in defining a trigger), it could ignore the start and use the default of "0 100%".
    
    - FIXED: in some rare cases if you have a repeating timeline and jump to a certain spot AFTER it has already played once, it could render the child animations in the wrong order. See https://greensock.com/forums/topic/25211-unexpected-behaviour-when-moving-group/
    
    - FIXED: if you have a ScrollTrigger set to pinReparent: true, occasionally it might not render the pinned element in the correct spot after a resize. See https://greensock.com/forums/topic/25150-scrolltrigger-and-mobile-navbar/
    
    - FIXED: animating CSS-related properties to a string with padded zeroes at the end (like x: "20.400") causes those zeroes to be interpreted as units. See https://greensock.com/forums/topic/25226-problem-with-set-position-x-with-svg/
    
    - FIXED: if you have a zero-duration tween in a timeline, then move that timeline's playhead to a place BEFORE that zero-duration tween and then backwards, it might initialize when it shouldn't, potentially leading to the starting values being incorrect.
    
    - FIXED: if you pass in a CustomEase that has part of the line extending beyond the final position on the x-axis (EXTREMELY rare), it could return an incorrect final value.
    
    - FIXED: if you set a percentage-based max-width or max-height on a ScrollTrigger's pinned element, it may not be applied properly (it becomes a max-width/height of the pin-spacer element).
    
    - FIXED: in a ScrollTrigger with a matchMedia() that has a snap applied, if you resize to a different break point and then go back again, the snapping may not work anymore.
    
    - FIXED: if you call gsap.timeline().tweenTo() multiple times such that you create multiple tweens that are running simultaneously, you could create a situation where the overlap causes mis-timed rendering if an earlier-created one finishes later. The overwrite is set to "auto" now to avoid that (very rare) scenario. See https://greensock.com/forums/topic/25292-on-click-tweento-label-cancel-current-tween/?tab=comments#comment-122340
    jackdoyle committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    147a6b6 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2021

  1. 3.6.0

    - NEW: Flip Plugin smoothly animates between DOM layout changes. See https://greensock.com/flip
    
    - NEW: DrawSVGPlugin can now accommodate values outside of the 0-100% range, meaning you can loop/wrap strokes easily. We even shaved off some kb in the process.
    
    - NEW: you can set a ScrollTrigger's snap value to "labelsDirectional" and instead of snapping to the closest label, it will snap to the NEXT or PREVIOUS timeline label based on the velocity/direction of the timeline's playhead. This means users don't have to scroll beyond halfway between sections, for example - if they scroll even a little bit and release, it will go to the next/previous label in that direction.
    
    - NEW: hex colors with alpha are recognized, like #fd5e53ff. See https://greensock.com/forums/topic/26703-text-shadow-property-not-animated/
    
    - IMPROVED: added the ability for ScrollToPlugin to accommodate a function-based value, like scrollTo: () => ...
    
    - IMPROVED: when animating CSS-related values in a .fromTo() animation, GSAP will attempt to pull the starting values directly from the "from" vars object instead of using the computed values that the browser reports so that you can do things like gsap.fromTo(el, {top: "calc(10vh / 2)"}, {top: "calc(50vh / 2)"}). Notice that the formatting needs to match for complex strings like that. See the original request at https://greensock.com/forums/topic/25568-problems-with-calc-values/
    
    - IMPROVED: worked around a Firefox bug that incorrectly reports getBoundingClientRect() when the element's scale (transform) is exactly 0 - it could interfere with the align feature in MotionPathPlugin.
    
    - IMPROVED: CSS variables now attempt to interpolate between units like if --radius: 8vh is animated to 1em, for example.
    
    - IMPROVED: if you set an xPercent or yPercent on an element and then clearProps, the next time transforms are parsed, the percentage-based translation will be prioritized over px-based translation because that's typically the desired behavior.
    
    - IMPROVED: gsap.utils.random() was slightly less likely to choose a value at the very minimum or maximum, but now it's equal across all values. See https://greensock.com/forums/topic/26524-does-gsaputilsrandom-include-or-exclude-its-minmax/
    
    - IMPROVED: Draggable's onClick callback now gets triggered by code-triggered events on the target element, like element.click(). See https://greensock.com/forums/topic/26513-draggable-html-click-event-not-triggering-onclick-handler
    
    - IMPROVED: ScrollTrigger copies the z-index to the pin-spacer element (for pinned elements). See https://greensock.com/forums/topic/26570-scrolltrigger-pinning-and-z-index-question/
    
    - IMPROVED: if you don't define a "trigger" or a "start" on a ScrollTrigger, it would default to using <body> as the target and start: "top top" which in some rare cases might cause odd start/end values (like if you translate things higher and stretch beyond the top of the <body>), so now it defaults to an absolute start of 0. See https://greensock.com/forums/topic/26626-customscrollbar-scrolltrigger-draggable/
    
    - FIXED: minor TypeScript improvements, like https://greensock.com/forums/topic/25346-morphsvg-shape-error-angular-typings/ and #421 and #422
    
    - FIXED: if a paused child animation of a completed timeline resumes, and that parent timeline has smoothChildTiming: true, it wasn't getting re-activated. See https://greensock.com/forums/topic/25349-no-transition-instant-snap-issue/
    
    - FIXED: if a CSS variable had a space in front of it where the CSS was declared, like --var: 20px, that would interfere with unit conversion in gsap.getProperty(element, "--var", "em"), for example.
    
    - FIXED: in GSDevTools, if you resume a timeline via code that had also been paused via code (not through the GSDevTools interface), it wouldn't be reflected as such by the UI and it could cause it to loop.
    
    - FIXED: in browserless environments (or SSR that may make calls before the DOM is available), a call to ScrollTrigger.refresh() could throw an error in 3.5.1. See #415
    
    - FIXED: if immediateRender was set to true on a timeline.tweenTo()/tweenFromTo(), it could throw an error. See #414
    
    - FIXED: if you try to do a scrollTo animation to an element that doesn't exist, it would throw errors instead of defaulting to 0.
    
    - FIXED: regression in Draggable 3.5.0 caused fixed-position elements not to factor scroll position into their x/y drags (they could jump if you scroll down and then drag a fixed-position element). Only if there was no margin or padding on the <body>. See https://greensock.com/forums/topic/23088-draggable-fixed-elements-disappear-when-dragging-after-scroll/?tab=comments#comment-123425
    
    - FIXED: animating a complex string value with extremely small numbers that had scientific notation like -4.1245e-15 didn't work properly. See https://greensock.com/forums/topic/25485-tween-float-values-in-svg-path/
    
    - FIXED: if you set pinType: "transform" and markers: true but you do NOT specify a scroller on a ScrollTrigger, it could throw an error. See https://greensock.com/forums/topic/25606-bug-report-scrolltrigger-pintype-and-markers/
    
    - FIXED: if you tried to animate zIndex without setting autoRound: true, it didn't work properly in some browsers because they ignore any values that contain decimals.
    
    - FIXED: in very rare cases, an infinitely-repeating animation with a small duration that's set to a progress of 1 could render incorrectly due to a rounding issue.
    
    - FIXED: if you create two tweens that BOTH affect the same property, and one has a ScrollTrigger that hasn't fired yet but overwrite is set to "auto", it could lock in the initial value incorrectly (before the other tween completes).
    
    - FIXED: if the target of a Draggable has its transforms cleared/uncached and that Draggable has bounds applied, it could cause the target to be incorrectly positioned onPress.
    
    - FIXED: if you SplitText an element with type: "lines" and it doesn't have a previousElement in the DOM, it could throw an error.
    
    - FIXED: if you invalidate() a timeline whose playhead is at a non-zero position, it could initialize its child tweens in the wrong order leading to their starting values being incorrect in certain situations.
    
    - FIXED: "xPercent" and "yPercent" are now correlated (measurement-wise) in MotionPathPlugin and the unit is automatically pulled from Array-based values passed in, like [{left:"20%"}, {left:"50%"}]. See https://greensock.com/forums/topic/25747-migrating-a-gsap-2-bezier-to-gsap-3-motionpath/
    
    - FIXED: if the last point past in an Array to MotionPathPlugin was a duplicate of the previous one, it would plot the curved path oddly (wiggling). See https://greensock.com/forums/topic/25775-motion-path-issue/
    
    - FIXED: if you define a %-based translation in x/y/translateX/translateY (which isn't recommended since xPercent/yPercent is the proper way to do that), and then attempt to animate to a px-based value, it could convert between units incorrectly. See https://greensock.com/forums/topic/25801-gsapdefaults-with-modifiers/
    
    - FIXED: if you use ScrollTrigger.saveStyles() before creating a non-scrubbing ScrollTrigger with an animation associated with it, and then scroll to a place where that animation is at a non-zero position, a refresh() (resize) could cause the CSS styles to get reset without getting updated with that animation's changes. See https://greensock.com/forums/topic/25812-scrolltrigger-weird-behavior-when-resizing/
    
    - FIXED: if you gsap.globalTimeline.clear(), it could cause an initial jump when starting to play subsequent animations.
    
    - FIXED: if you accidentally set a ScrollTrigger's "start" to a position ABOVE the top of the page (invalid) and it has pinning enabled, it could offset the pinned element that amount from the top/left of the page.
    
    - FIXED: worked around a Safari bug that could cause snapping in a ScrollTrigger to seem jerky and take a long time if the page was zoomed. Safari reports the scroll position incorrectly as 1 pixel off, so if scrollTop is set to 125, for example, and Safari would report it as 124. See https://greensock.com/forums/topic/25635-scrolltrigger-snap-issue/
    
    - FIXED: if you used complex selector text for a MorphSVGPlugin path multiple times, it could think the path was malformed. See https://greensock.com/forums/topic/25852-morphsvg-malformed-path-problem/
    
    - FIXED: if you load GSDevTools and also have a ScrollTrigger with a numeric scrub value and attempt to scroll sooner than 2 seconds after page load, the scrubbing wouldn't work initially.
    
    - FIXED: zIndex animations that start or end with "auto" didn't round the value during the animation (and browsers refuse to render non-whole numbers for zIndex).
    
    - FIXED: if you define a motionPath with a "start" and "end" that contain a value that's **almost** a whole iteration apart like start: 2.8 / 5 (0.5599999999999999), end: 2.8 / 5 + 1 (1.56), it would get clipped and act like it has a length of 0. See https://greensock.com/forums/topic/25938-animate-text-on-an-svg-path/?tab=comments#comment-125937
    
    - FIXED: if you use ScrollTrigger.saveStyles() on elements that are also controlled by a non-scrubbing ScrollTrigger from() animation created in a ScrollTrigger.matchMedia(), resizing the window could cause the inline styles not to be rendered correctly at the from() position. See https://greensock.com/forums/topic/25944-problem-with-scrolltriggersavestyles-and-scrolltriggermatchmedia/
    
    - FIXED: if you kill() a tween and then tried to play() it again, it would work (unless you called kill() twice). See https://greensock.com/forums/topic/25963-killing-the-tween-issue/
    
    - FIXED: if you had a .set() call right at the very beginning of a timeline, rewinding to that spot after the playhead had moved forward would cause the set() to revert to its very starting values. See https://greensock.com/forums/topic/26049-issue-with-starting-positions/
    
    - FIXED: if you created a ScrollTrigger with a refreshPriority inside a gsap.timeline() and called ScrollTrigger.refresh(), the priority may not be set properly unless ScrollTrigger.refresh() is called after one tick. See https://greensock.com/forums/topic/26126-2-animations-on-same-page-second-one-loading-first-causing-issues
    
    - FIXED: if a motionPath tween used negative start/end values such that they'd wrap (in the negative direction), it wouldn't work. See https://greensock.com/forums/topic/26197-bug-motionpathplugin-unsets-element-position-when-looping-in-negative-direction/
    
    - FIXED: if a motionPath tween used a start and end value that were almost exactly 1 apart but used lengthy decimal values (like beyond 5 decimal places), it may act like the path has a length of zero. See https://greensock.com/forums/topic/26338-where-is-the-bug/
    
    - FIXED: ScrollTrigger showed a console.warn() in Safari regarding scrollBehavior not being a valid property because Safari doesn't support it. That warning is removed now. See https://greensock.com/forums/topic/25199-sliding-window/?tab=comments#comment-127143
    
    - FIXED: worked around some Android/MS issues that affected Draggable's allowNativeTouchScrolling. See https://greensock.com/forums/topic/24166-cross-browser-issues-with-draggable-and-allownativetouchscrolling/
    
    - FIXED: if you add extra padding to a CSS value with a unit, like "3.1000rem", it could get interpreted incorrectly. See https://greensock.com/forums/topic/26352-possible-bug-with-rem-values-like-3100rem/
    
    - FIXED: if you set pinSpacing: false and pinned the SAME element multiple times, on subsequent refresh() calls (like on window resize), a cached value was used which could cause the element to move further and further from where it's supposed to be on each refresh(). See https://greensock.com/forums/topic/26411-multiple-pinned-scrolltriggers-on-the-same-element-wrong-offset-on-resize/
    
    - FIXED: if you go full-screen on an element that's in an iframe, it could force a refresh() which would reload that inframe content, effectively making it impossible to go full-screen. See https://greensock.com/forums/topic/26281-full-screen-video-issue/
    
    - FIXED: a Chrome/Brave (Webkit) update caused ScrollTriggers with pinReparent: true to be positioned incorrectly in some cases because inset CSS values contaminate top/left positioning.
    
    - FIXED: if you re-create a ScrollTrigger.scrollerProxy() on the same element multiple times, it would cache the first one and use the getter/setter functions for that (always). See https://greensock.com/forums/topic/26468-scrolltriggerscrollerproxy-stopped-after-route-change/
    
    - FIXED: disallowed adding the following keys to gsap.defaults() and gsap.config(): __proto__, constructor, and prototype
    
    - FIXED: in some rare cases with negative numbers, gsap.utils.snap() would return an incorrect value. See https://greensock.com/forums/topic/26551-bug-in-snap-utility/
    
    - FIXED: if you set dragClickables: false on a Draggable, event.preventDefault() could be called [incorrectly] when clicking on a clickable element like an <a> or <button> immediately after dragging the ancestor element, meaning the link wouldn't be followed (typically just on mobile devices). See https://greensock.com/forums/topic/26547-gsap-draggable-plugin-issues-with-dragclickables-in-touchscreen/
    
    - FIXED: if you set up a ScrollTrigger with a snap value, on a Windows desktop device it may not kill the snapping immediately when the user attempts to scroll with the mousewheel. See https://greensock.com/forums/topic/26600-scrolltrigger-intermittent-scroll-locking-during-snapping/
    
    - FIXED: if you used SplitText to split the same element multiple times without "words", it could incorrectly lose spaces in some rare cases.
    
    - FIXED: if you fed duplicate values in at the very start of a motionPath Array, it could hang. For example, if you do a .fromTo() and set the initial values AND put those same values into the start of the "path" Array, that'd trigger the issue. See https://greensock.com/forums/topic/26663-browser-crash-while-using-the-motion-path-plugin/
    
    - FIXED: TypeScript definitions updated for gsap.timeline so that if you gsap.registerEffect({... extendTimeline: true}) it'll allow any property to be added to timelines.
    
    - FIXED: if you kill() a ScrollTrigger with a pin, and then re-create it and the pinned element has different margins, the old ones stuck around instead.
    jackdoyle committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    e066b1f View commit details
    Browse the repository at this point in the history
Loading