-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add useScaleCanvas: Web Animations API for zoom in/out animation #66917
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
af08ecc
Midway commit. Scaling out is broken
jeryj c83c99f
Fix zoom in animation
jeryj ec58902
Fix scaling by preserving CSS properites
jeryj 6582cce
Prevent reflow from removing and re adding scrollbar in animation
jeryj ce9497e
Only rerun zoom out use effects if zoom out has changed.
jeryj 26d9e3a
Allow all CSS vars to update when scale changes
jeryj 3947ab0
Midway commit. Math is wrong for addressing top/bottom exceptions
jeryj cb47e82
Remove usePrevious usage
ajlende bc8cca6
Add prefers-reduced-motion to setTimeout delay
ajlende 578c923
WIP Working zoom without frame size
ajlende d2c16a6
Account for changes to client height when determining edge threshold
jeryj 0faf418
Zoom to center unless it will reveal top or bottom
jeryj ab8038e
Account for a top threshold when zooming in and out
jeryj ba32f99
Clean up math and add comments
ajlende 0b640ee
Add event listener instead of timeout
ajlende 6a3f7a0
Fix reduced motion
ajlende 55df6fe
Remove timeout ref
ajlende 7ba67b2
Refactor callback as separate effect
ajlende 2dc137f
Try to add back useEffect cleanups
ajlende 3eabcf5
Initialize prevClientHeight in the useEffect
ajlende 8b8c206
use useReducedMotion
jeryj 23bd453
Add test for zoom in/out location
jeryj 8cbe2be
Hack to fix reduced motion
ajlende 4c9543e
Clean up the frameSizeValue and scaleValue calculations
ajlende 4e87729
Replace TODO comments with HACK comments
ajlende 17f50d5
Add cleanup for raf
ajlende b049f4b
Simplify CSS diff for 6.7 review
ajlende 61a0de9
Add one more HACK comment
ajlende ac52f2d
Do not allow scrollTopNext to be smaller than 0
jeryj 6b23a30
Fix zoom-out.spec.js
ajlende fd74dc4
Move 6.7 iframe scaling work to trunk
jeryj bfaf7e4
Move calculations to useScaleCanvas hook
jeryj cc28155
Rename scaleValue to scale
jeryj d407ee6
Rename frameSizeValue to frameSize
jeryj c8f2cc7
Remove iframeWindowInnerHeight
jeryj 7903702
Remove unused window resize ref
jeryj 72f5785
Refactor CSS
jeryj 53d8f6f
Move animation to state
jeryj a25f7da
Fix scaling the canvas when sidebars open/close
jeryj 5fcd9c1
Recalculate scale before exiting scaled canvas to prevent snapping ef…
jeryj 1c5d7d5
CSS linting
jeryj 96d62ab
Move code into useScaleCanvas that isn't necessary in iframe index
jeryj ec37f26
Move resize listeners into useScaledCanvas
jeryj 28cff48
Combine into one useEffect
jeryj 28ded6a
Add useEffect cleanup
jeryj 1dbdc82
Fix accidental setting prevScaleRef to scale instead of scaleValue
jeryj cf8ffde
Switch to animations api
jeryj f338821
Reduce rerenders by removing isAnimatingZoomOut state and relying jus…
jeryj 5c93399
Refactor to set scale and frame size on transition end
jeryj ff03e1e
Add reverse animation if zoom state is toggled quickly
jeryj 65bd82e
Refactor step 1 of reverse animation with transitionTo and transition…
jeryj f236641
Finish refactor of transitionTo/From refs
jeryj 83ee4c5
Refactor: computeScrollTopNext
jeryj 32b24e5
Refactor: getAnimationKeyframes
jeryj 1407f8f
Add missing dependency
jeryj d5402bc
Refactor: create startZoomOutAnimation and rename scrollTopNext to tr…
jeryj fc6b4ee
Remove unneeded variables
jeryj 2325135
Move CSS back to original location, as it no longer needs to be moved
jeryj b41d282
Add comments
jeryj 0ff92b5
Fix eslint error
ajlende 92e0e52
Move scrollHeight to animateFrom state
ajlende fb16c4f
Update JSDoc
ajlende 4076a7b
Rename ref variables to use "Ref" suffix
ajlende 798549e
Comment style guide
ajlende File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.