I finished the Spin the wheel.
The logic itself wasnt too bad, but handeling with multipleclicks i didnt get that at first. If you clicked the “Turn” button while the wheel was already spinning, the animations would stack, the timer would go crazy, and the wheel would just glitch out.
I had to completely clean up the animation loop. (with ai troubleshooting) Now, every single time you hit that button, it instantly cancels the previous requestAnimationFrame and starts new again.
Once the wheel was done, I built two more tools. A Local Time clock and a World Time dashboard. While building them, I learned much… I used to write way too much code formatting dates and strings manually. Then I found out JavaScript has a built-in code for this:
document.getElementById(‘live-uhr’).textContent = now.toLocaleTimeString();
I dont even know how I didnt know about this..
Though, I do now…
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.