Repository navigation
fix(pet): animate HTML layers, not SVG groups, so old iPads do not freeze - #1128
Merged
Merged
Conversation
Every pet animation (bounce, sway, wobble, hop, evolve, the laid egg) ran as a CSS transform on an SVG <g> with transform-box: fill-box, and the sleepy mood put a CSS filter on that group. Old iOS Safari repaints an animated SVG group on the main thread every frame, so the kiosk froze once a pet hatched, just as the clipped egg did before #1115. The scene is now stacked full-size SVG layers (back, pet, front, laid egg); the pet and egg layers sit in HTML elements that carry the animation and the filter, which Safari moves on the GPU. It looks the same. Fixes #1126
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1126
The kiosk froze on older iPads once a pet had hatched. #1115 fixed the same freeze for the unhatched egg, but every other pet animation (bounce, sway, wobble, hop, evolve, the laid egg) still ran as a CSS transform on an SVG
<g>, and the sleepy mood put a CSS filter on that group. Old iOS Safari repaints an animated SVG group on the main thread every frame.Fix
Tested
transform-boxor SVG animation/filter in the card stylesnpm run lintclean,npm test1175/1175