Skip to content
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

I found that on IOS, when I hit the bet button, it was very slow.Is there a solution? #12

Open
denzhe22 opened this issue Jun 29, 2024 · 4 comments
Labels
perf Performance

Comments

@denzhe22
Copy link

denzhe22 commented Jun 29, 2024

When I hit this button quickly, the FPS on IOS was 10, ro less than 10

@AnsonH
Copy link
Owner

AnsonH commented Jun 30, 2024

Hi @denzhe22, sorry for the slow performance issue 🙇

To help debugging easier, would it be possible to provide the following info? Thanks

  • iPhone model are you using
  • iOS version
  • A video recording of the website running on iOS

@AnsonH AnsonH added the perf Performance label Jun 30, 2024
@denzhe22
Copy link
Author

denzhe22 commented Jul 1, 2024

Hi @denzhe22, sorry for the slow performance issue 🙇

To help debugging easier, would it be possible to provide the following info? Thanks

  • iPhone model are you using
  • iOS version
  • A video recording of the website running on iOS

I tried to add sound, and when I quickly clicked [Drop Ball], I found that the frame rate dropped to about 10, and the page was enlarged, and without the sound playback, the frame rate dropped from 60 to 30, and the page was not enlarged. But actually 30 frames will also affect the user experience, because the ball will drop much slower.
Here is the code I added to play the sound

`
let audioEle: any;
function playSound() {
let audioUrl = 'a.mp3';
const audioEle = new Audio(audioUrl);
audioEle.play();
}

function handleBetClick() {
playSound();
$plinkoEngine?.dropBall();
}

noSound.mp4
hasSound.mp4

`

@AnsonH
Copy link
Owner

AnsonH commented Jul 1, 2024

Thanks for the demo 🙇

when I quickly clicked [Drop Ball], I found that the frame rate dropped to about 10, and the page was enlarged

Yes, I encountered this issue previously. The solution is to add touch-action: manipulation CSS to the "Drop Ball" button (see this Stack Overflow post)

In Tailwind CSS, it's the touch-manipulation class

@denzhe22
Copy link
Author

denzhe22 commented Jul 1, 2024

Thanks for the demo 🙇

when I quickly clicked [Drop Ball], I found that the frame rate dropped to about 10, and the page was enlarged

Yes, I encountered this issue previously. The solution is to add touch-action: manipulation CSS to the "Drop Ball" button (see this Stack Overflow post)

In Tailwind CSS, it's the touch-manipulation class

Thank you very much for your reply, but I saw that your latest content on gitHub added touch-manipulation, which still did not work, and I found that moving this button to the outermost layer (a level of Balance) would become very smooth. This is a magical result, and I am very confused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf Performance
Projects
None yet
Development

No branches or pull requests

2 participants