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

[feat] [while spin] Show the nams in plain text #6

Open
AsimNet opened this issue May 18, 2020 · 5 comments
Open

[feat] [while spin] Show the nams in plain text #6

AsimNet opened this issue May 18, 2020 · 5 comments

Comments

@AsimNet
Copy link

AsimNet commented May 18, 2020

Hello 👋
Thanks for the great work!
Is it possible to shuffle the names above the wheel in plain text?
Because when we add +200 name, you won't be able to read the names from the wheel.
https://youtu.be/yL5clbrvmyY?t=480
Thanks

@momander
Copy link
Owner

momander commented May 18, 2020 via email

@AsimNet
Copy link
Author

AsimNet commented May 18, 2020 via email

@momander
Copy link
Owner

momander commented May 18, 2020 via email

@johnberry09
Copy link

The Wheel has a method getNameAtPointer().

Naive approach would be to call a function at an interval and update DOM innerText, depending upon the interval, the value will not be in exact sync with entry at the pointer. Also updating DOM innerText too frequently will have performance implications.

A slightly better performance approach would be to raise events as the value at pointer changes, however, this will still have issues at the high speed of wheel rotating. Unless the values are not updated at high speed and only updated at certain low speed.

The correct way to solve this would be to use the same animation approach used to spin the wheel. That way both the name at the pointer and the name value will be always in sync, as the browser paints them.

@momander
Copy link
Owner

Excellent analysis, johnberry09! Thank you.

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

No branches or pull requests

3 participants