LottieFiles / lottie-interactivity

A small javascript library to enable interactivity with Lottie animations
https://lottiefiles.com/interactivity
MIT License
430 stars 55 forks source link

Enforce player to stop at first/last action's frame during scroll with action.type = "seek" #119

Closed alexeypanov closed 1 month ago

alexeypanov commented 4 months ago

Description

Currently, during fast scrolling, the player may not render the very last or first frame of the provided action range.

Example:

action: {
  visibility: [0.2, 0.8],
  type: "seek",
  frames: [0, 100]
}

When scrolling down, if at some point the container visibility is 0.72 and on the next scroll event it becomes 0.81, the current behavior stops the player at the frame corresponding to 0.72. For certain animations, this is crucial: if the container has passed its bottom visibility point, it should be stopped on the very last frame of the range.

This fix addresses this issue.

Type of change

Checklist

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: 47995b61a7ba91220be0b164b8f091ff96e20e1a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------------------------------- | ----- | | @lottiefiles/lottie-interactivity | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 2 months ago

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.