修复抽取多人时撒花卡顿问题#74
Open
huangyiyang89 wants to merge 3 commits into
Open
Conversation
将.prize样式类的添加从逐个卡片的循环中移至所有卡片动画完成后的onComplete回调中统一添加, 避免每个卡片反转都独立触发一次CSS过渡特效造成多次样式重算和重绘。 Co-authored-by: huangyiyang89 <12613485+huangyiyang89@users.noreply.github.com>
…-bug fix: batch .prize class addition to prevent per-card effect triggering lag
There was a problem hiding this comment.
Pull request overview
This pull request optimizes the lottery card selection animation to reduce UI lag when drawing multiple winners by applying the "prize" visual effect only once after all card animations complete.
Changes:
- Removed per-card
"prize"class application during the card animation loop. - Added a single post-animation step that applies the
"prize"class to all selected cards after animations finish.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request optimizes the animation effect handling in the lottery card selection logic. Instead of adding the "prize" effect to each card individually during their animation, the effect is now applied collectively after all animations complete, reducing performance issues and improving user experience.
Animation effect optimization:
"prize"class from inside the card animation loop to a single operation after all card animations finish, preventing multiple triggers and potential UI lag. (product/src/lottery/index.js, [1] [2]