Erik nfc animation v4 #131
Open
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.
Fix Intermittent Stuttering in NFC Payment Animation
Overview
Fixes intermittent animation stuttering and frame drops during the NFC payment animation, specifically during the transition from the morphing phase to the blob phase.
Problem
The animation exhibited inconsistent stuttering behavior—occasionally hanging or hitching mid-transition, then snapping rapidly to completion instead of easing smoothly. This created a "janky" experience that felt like dropped frames or interrupted timing functions.
Root Cause
The issue was caused by a property conflict between CSS transitions and keyframe animations both trying to control the
transformproperty:transform: rotate(45deg)via CSS transitionblobMorphkeyframe animation was also animatingtransform: rotate()from0degto270degWhen the class switched from
morphingtoblob, the browser had to resolve competingtransformvalues:rotate(45deg)→rotate(0deg)rotate(0deg)on the first frameThis race condition caused unpredictable animation behavior, with the browser sometimes prioritizing the transition and sometimes the keyframe, resulting in the intermittent stuttering.
Solution
Removed
transformanimation from theblobMorphkeyframe animation, keeping only theborder-radiusmorphing effect. The CSS transition now smoothly handles the rotation from45degto0degwithout interference from the keyframe animation.Changes:
@keyframes blobMorphto only animateborder-radius(removed alltransform: rotate()declarations)Testing
Tested on:
https://github.com/user-attachments/assets/fb57b93e-2574-40fe-a610-536b66ca131d
https://github.com/user-attachments/assets/86290954-d865-42c4-8cda-456771d646d0
The animation now runs (fairly) smoothly without stuttering or frame drops across all phases. The blob morphing effect is preserved while ensuring consistent, fluid transitions.
Technical Details
The fix maintains the visual design while resolving the underlying performance issue. The blob morph animation continues to provide the organic, fluid shape transformation through border-radius keyframes, while rotation is handled by the more predictable CSS transition system.