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
[TASK] Foundation for interpreting story animations schema #1789
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1789 +/- ##
============================================
+ Coverage 64.44% 64.66% +0.22%
Complexity 230 230
============================================
Files 576 582 +6
Lines 9334 9422 +88
============================================
+ Hits 6015 6093 +78
- Misses 3319 3329 +10
|
Size Change: 0 B Total Size: 869 kB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work! Only a few nits/ideas for you to consider. Once you've considered them and applied any changes you deem necessary, I'll be happy to re-review and approve! 🎉
assets/src/dashboard/components/storyAnimation/stories/index.js
Outdated
Show resolved
Hide resolved
4792c0b
to
766aa5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work!! 🎉
Summary
StoryAnimation.Provider
playWAAPIAnimations()
method to control WAAPI animationsonWAAPIFinish
prop that will fire everytime all hoisted animations complete (can use to increment page number)StoryAnimation.WAAPIWrapper
Animation Parts
which ties thekeyframe
&timings
to markup given some args. right now only did this forANIMATION_TYPES.BOUNCE
but should be simple to port over old animation configs to this new pattern.example use:
Relevant Technical Choices
Web Animations API - Grouping
Basically had to add some notion of grouping on top of the web animations api. Accomplished this
by just hoisting all
Animation
objects up into the provider. We can then create any group operations we'd like on the hoisted animations. rn onlyplay
&onfinish
supported.Animation Parts
Animation schema is basically looks like:
{ type: 'ANIM_TYPE', ...args }
which we transform intoANIM_TYPE(args) => ReactWrapperComponent
. This should be a pretty extensible in the future for applying to amp-animations or any other animation package. Possibly maleable enough to add aANIMATION_TYPE.SEQUENCE
or anything else in the future because we just pass relevantargs
to a function that creates a react component.To-do
<StoryAnimation.AMPWrapper />
which follows the animation parts patternAMP(type, args)
animation part generator (should be able to leverage @mariano-formidable amp-animation animator work here)How to test
Unit
Run unit tests & make sure they pass.
QA
Open up storybook and go to
Dashboard > Components > StoryAnimation > default
this should show a square that has nestedBOUNCE
animations applied to it and alternates between red & green color each time all the animations finish