Next.js Discord

Discord Forum

Need Help with Wheel Rotation Logic to Align Winner's Cell at the Top

Unanswered
European pilchard posted this in #help-forum
Open in Discord
Original message was deleted.

78 Replies

Rose-breasted Grosbeak
They say a picture is worth a thousand words and a gif is worth a hundred pictures

Either of those would be helpful
Rose-breasted Grosbeak
It's a text file..
@Rose-breasted Grosbeak It's a text file..
European pilchard
i can only upload it like that
Rose-breasted Grosbeak
The wheel should rotate for a certain amount of time. After the rotation, it should stop in such a way that the winner's cell is positioned at the top of the wheel. (roll and then stop smoothly at it)

Everything else is not important for the animation
totally lost
trying it for 2 days now, i feel very dumb
Rose-breasted Grosbeak
Well.. start by drawing a picture because I don't fully understand your explanation
Rough drawing
European pilchard
but my calculation is dumb
it maps over the entries
Rose-breasted Grosbeak
There's no wheel, I don't know which wheel or cells you're talking about
European pilchard
it then spins the wheel where the cells are placed on
Rose-breasted Grosbeak
Show an image
Yes that's it
Now where are the cells
@Rose-breasted Grosbeak Now where are the cells
European pilchard
second
Rose-breasted Grosbeak
Dude I cannot run this code, I need an image
Okay, so it's more like spinning, not rolling. They're different.

You want that notch or marker at the top to stay in place, or does that move with the wheel?
so let's say
the time is up, the io server emited an jackpot update
the wheel will spin for sometime
then just stop and show the winner
but it stops at the wrong cell
Rose-breasted Grosbeak
Got it
European pilchard
the winner cell should be at the top so the arrow
shows it
Rose-breasted Grosbeak
So it's just the matter of getting the angles right.
European pilchard
yep
@Rose-breasted Grosbeak So it's just the matter of getting the angles right.
European pilchard
will you help me with that?
Rose-breasted Grosbeak
yeah wait
@Rose-breasted Grosbeak yeah wait
European pilchard
thanks.
Rose-breasted Grosbeak
a codepen would have been much more convenient, but I setup a rough example.

https://codepen.io/phoneticallySAARTHaK/pen/MYWeKpZ
it's easy with transition. css animations requires a bit more careful handling, web animation API would be slightly more convenient.
it's a rough example, so don't just copy paste
European pilchard
my dev has exited me, i'm not a developer myself so i cant finish his work
Rose-breasted Grosbeak
what
European pilchard
i'm not sure if i'm aloweed to but i can pay you 20$ for finishing it
allowed*
am i
?
not sure
@European pilchard my dev has exited me, i'm not a developer myself so i cant finish his work
Rose-breasted Grosbeak
you should have told me that earlier, that's very important to know!
what is this for? a freelance project?
@Rose-breasted Grosbeak what is this for? a freelance project?
European pilchard
it's a gambling site
i have coinflip already from my old dev who quit
i then hired someone to make me a jackpot
came 5 days late
kinda works but the animation doesn't
Rose-breasted Grosbeak
I see...
European pilchard
bad ui, not using the figma i gave him
what a horror movie
Rose-breasted Grosbeak
I mean sure, is there a live example?
European pilchard
here
see, it stopped on the wrong winner-
Rose-breasted Grosbeak
uhm where?
@Rose-breasted Grosbeak uhm where?
European pilchard
uploading, bad wifi
there
Rose-breasted Grosbeak
Is there a deployed version?
@Rose-breasted Grosbeak Is there a deployed version?
European pilchard
so sorry
so fucking sorry
my wifi crashed
not right now
i can host one
if you want
i can try
@European pilchard i can try
Rose-breasted Grosbeak
lol it's fine
@Rose-breasted Grosbeak lol it's fine
European pilchard
still here?
i got one up
second
Rose-breasted Grosbeak
well this is beyond the scope of this forum. I can help you with things, but if you need full assistance, this thread probably not the place
?
or what?
Rose-breasted Grosbeak
sure, shoot
European pilchard
ty