There is a websocket server, and a page site, with processing websocket connections via js. Now any action is implemented in the following way: The answer comes from the server webscoket to the clients, and they have a certain animation (one for all). If the client reloads the page, he will immediately receive the final result of the animation.

How to make it so that when you restart the animation remained at a certain step by the user?

Suppose animation is the choice of a particular user from a set of users; here comes the jumps on users, and eventually one user will be selected. It is necessary that when the page is reloaded, the animation remains at a certain step, and the final selected user is not displayed.

How can this be implemented? Write each step of the animation in websocket and send it to all users every time?

  • one
    I would recommend using JS with saving the start time of the animation, see the first example with paravozikom. - MrFylypenko

1 answer 1

Write steps to local storage

  • Each step recorded in the browser is allowed in cookies, and then just check if the steps are not performed by the user, then do this animation? Are there realtime implementation options? - azimut pm
  • What is realtime? One browser performed the animation in 10 seconds, the second in 15. What is realtime? - Anton Shchyrov
  • I agree. Thanks for the answer. - azimut 2:29 pm