Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow animation startTime to be set manually #2755

Merged
merged 15 commits into from
Aug 14, 2024
Merged

Conversation

mattgperry
Copy link
Collaborator

@mattgperry mattgperry commented Aug 9, 2024

This PR allows the startTime of an animation to be set manually via options.

A subsequent PR will use this to better sync animations to optimised appear animations.

@mattgperry mattgperry changed the base branch from main to fix/keyframe-resolve-external-motion-value August 9, 2024 14:35
@mattgperry mattgperry requested a review from adamseckel August 9, 2024 14:55
@mattgperry mattgperry force-pushed the fix/keyframe-resolve-external-motion-value branch from 29eb5bd to bbd4436 Compare August 13, 2024 11:43
Comment on lines +276 to +278
// Coerce to number as TypeScript incorrectly types this
// as CSSNumberish
return animation.startTime as number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just a typescript problem or would a simple if (!isNumber(animation.startTime)) return null be more future proof?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Web Animations L2 spec does show times as CSSNumberish but it isn't ready yet so could still be changed - I also struggle believing they will make this backwards incompatible

@mattgperry mattgperry force-pushed the fix/keyframe-resolve-external-motion-value branch from 22b1317 to ac31a7f Compare August 14, 2024 12:54
Base automatically changed from fix/keyframe-resolve-external-motion-value to main August 14, 2024 12:54
@mattgperry mattgperry merged commit f5274e8 into main Aug 14, 2024
1 check passed
@mattgperry mattgperry deleted the feature/supersync branch August 14, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants